@redocly/realm 0.138.0-next.1 → 0.138.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 +182 -0
- package/dist/bin.js +0 -0
- package/dist/cli/build/analytics/collect-analytics.js +1 -1
- package/dist/cli/build/analytics/collectors/get-sidebars-usage.d.ts +12 -0
- package/dist/cli/build/analytics/collectors/get-sidebars-usage.js +1 -0
- package/dist/cli/build/index.js +1 -1
- package/dist/cli/develop.js +1 -1
- package/dist/cli/eject/resolveEjectParams.js +1 -1
- package/dist/cli/generate/string-utils.js +1 -1
- package/dist/cli/stats/collectors/extension-sampling.js +1 -1
- package/dist/cli/translations/collect-config-translations.js +1 -1
- package/dist/client/App.js +1 -1
- package/dist/client/TestProvider.d.ts +3 -1
- package/dist/client/TestProvider.js +1 -1
- package/dist/client/app/Link.js +1 -1
- package/dist/client/app/ReviewComments/ReviewComments.js +2 -2
- package/dist/client/app/Sidebar/Sidebar.js +1 -1
- package/dist/client/app/Sidebar/useSidebarItems.js +1 -1
- package/dist/client/app/hooks/codeHighlight/treeview-transformer.js +1 -1
- package/dist/client/app/hooks/codeHighlight/useCodeHighlight.js +1 -1
- package/dist/client/app/hooks/index.d.ts +1 -0
- package/dist/client/app/hooks/index.js +1 -1
- package/dist/client/app/hooks/markdown/useMarkdownText.js +1 -1
- package/dist/client/app/hooks/useConsent.d.ts +11 -0
- package/dist/client/app/hooks/useConsent.js +1 -0
- package/dist/client/app/l10n/L10nContext.d.ts +10 -0
- package/dist/client/app/l10n/L10nContext.js +1 -0
- package/dist/client/app/l10n/hooks/useL10n.js +1 -1
- package/dist/client/app/l10n/hooks/useTranslate.js +1 -1
- package/dist/client/app/l10n/hooks/useTranslationKeys.d.ts +2 -0
- package/dist/client/app/l10n/hooks/useTranslationKeys.js +1 -1
- package/dist/client/app/l10n/ssrL10n.d.ts +4 -0
- package/dist/client/app/l10n/ssrL10n.js +1 -0
- 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/hooks/use-store.d.ts +2 -3
- package/dist/client/app/pages/DevLogin/DevLoginForm.js +1 -1
- package/dist/client/app/pages/Invite/Invite.js +1 -1
- package/dist/client/app/search/index.d.ts +1 -1
- package/dist/client/app/search/index.js +1 -1
- package/dist/client/app/search/useSearch.d.ts +3 -0
- package/dist/client/app/search/useSearch.js +1 -1
- package/dist/client/app/webmcp/index.d.ts +2 -0
- package/dist/client/app/webmcp/index.js +1 -0
- package/dist/client/app/webmcp/tools/api-tools.d.ts +8 -0
- package/dist/client/app/webmcp/tools/api-tools.js +1 -0
- package/dist/client/app/webmcp/tools/shared.d.ts +13 -0
- package/dist/client/app/webmcp/tools/shared.js +1 -0
- package/dist/client/app/webmcp/tools/site-tools.d.ts +5 -0
- package/dist/client/app/webmcp/tools/site-tools.js +3 -0
- package/dist/client/app/webmcp/types.d.ts +36 -0
- package/dist/client/app/webmcp/types.js +0 -0
- package/dist/client/app/webmcp/useWebMcpTools.d.ts +9 -0
- package/dist/client/app/webmcp/useWebMcpTools.js +1 -0
- package/dist/client/providers/page-data/hooks.d.ts +2 -0
- package/dist/client/providers/page-data/hooks.js +1 -1
- package/dist/client/providers/theme/ThemeDataProvider.js +1 -1
- package/dist/client/runtime/loader.js +1 -1
- package/dist/client/server-entry.d.ts +2 -1
- package/dist/client/server-entry.js +1 -1
- package/dist/client/templates/api-docs/helpers.js +1 -1
- package/dist/client/templates/api-docs/template.js +7 -3
- package/dist/client/utils/catalog/parse-filter-query.js +1 -1
- package/dist/client/{app/Sidebar/helpers → utils}/filter-out-versioned-items.d.ts +12 -2
- package/dist/client/utils/filter-out-versioned-items.js +1 -0
- package/dist/client/utils/navigation-tabs.d.ts +14 -0
- package/dist/client/utils/navigation-tabs.js +1 -0
- package/dist/compiled/svgo/svgo-node.js +39 -39
- package/dist/constants/common.d.ts +1 -0
- package/dist/constants/common.js +1 -1
- 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/markdoc/nodes/table.d.ts +2 -0
- package/dist/markdoc/nodes/table.js +1 -1
- package/dist/server/config/env-config.d.ts +0 -6
- package/dist/server/config/env-schema.d.ts +0 -15
- package/dist/server/config/env-schemas/feature-flags.d.ts +0 -12
- package/dist/server/config/env-schemas/feature-flags.js +1 -1
- package/dist/server/constants/common.d.ts +3 -1
- package/dist/server/constants/common.js +1 -1
- package/dist/server/constants/entitlements.js +1 -1
- package/dist/server/constants/plugins/consent.d.ts +3 -0
- package/dist/server/constants/plugins/consent.js +1 -0
- package/dist/server/constants/plugins/search.js +1 -1
- package/dist/server/esbuild/esbuild-logger.js +3 -3
- package/dist/server/plugins/analytics/adobe/index.js +1 -1
- package/dist/server/plugins/analytics/amplitude/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/amplitude/index.js +1 -1
- package/dist/server/plugins/analytics/fullstory/index.js +1 -1
- package/dist/server/plugins/analytics/ga/index.js +1 -1
- package/dist/server/plugins/analytics/gtm/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/gtm/index.js +1 -1
- package/dist/server/plugins/analytics/heap/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/rudderstack/index.js +1 -1
- package/dist/server/plugins/analytics/segment/index.js +1 -1
- package/dist/server/plugins/api-docs/index.js +1 -1
- package/dist/server/plugins/api-docs/utils/apply-nav-item-to-root.d.ts +9 -0
- package/dist/server/plugins/api-docs/utils/apply-nav-item-to-root.js +1 -0
- package/dist/server/plugins/api-docs/utils/decorators.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/common/revision-repository.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/common/revision-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/common/version-repository.d.ts +5 -1
- package/dist/server/plugins/catalog-entities/database/repositories/common/version-repository.js +7 -1
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/utils/ajv-validator.js +1 -1
- package/dist/server/plugins/catalog-entities/utils/extract-parts-from-components-ref.js +1 -1
- package/dist/server/plugins/catalog-entities/utils/is-valid-tag-name.js +1 -1
- package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.js +1 -1
- package/dist/server/plugins/config-parser/format-custom-tags.d.ts +1 -0
- package/dist/server/plugins/config-parser/format-custom-tags.js +1 -1
- package/dist/server/plugins/config-parser/index.js +1 -1
- package/dist/server/plugins/config-parser/loaders/redocly-config-loader.js +1 -1
- package/dist/server/plugins/config-parser/loaders/versions-config-loader.js +1 -1
- package/dist/server/plugins/config-parser/safe-parse.js +1 -1
- package/dist/server/plugins/consent/build-consent-script.d.ts +6 -0
- package/dist/server/plugins/consent/build-consent-script.js +230 -0
- package/dist/server/plugins/consent/gate-ssr-components.d.ts +5 -0
- package/dist/server/plugins/consent/gate-ssr-components.js +1 -0
- package/dist/server/plugins/consent/index.d.ts +3 -0
- package/dist/server/plugins/consent/index.js +1 -0
- package/dist/server/plugins/consent/is-consent-enabled.d.ts +8 -0
- package/dist/server/plugins/consent/is-consent-enabled.js +1 -0
- package/dist/server/plugins/consent/zone-modes.d.ts +8 -0
- package/dist/server/plugins/consent/zone-modes.js +1 -0
- package/dist/server/plugins/default-theme/extract-team-names.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/App.js +5 -5
- package/dist/server/plugins/dev-onboarding/template/components/ApiKeyOverview.js +3 -3
- package/dist/server/plugins/get-reserved-routes.d.ts +4 -2
- package/dist/server/plugins/get-reserved-routes.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/markdoc/markdoc-options.d.ts +2 -0
- package/dist/server/plugins/markdown/search/get-ai-search-documents.js +9 -9
- package/dist/server/plugins/markdown/search/nodes/tag-node.d.ts +1 -1
- package/dist/server/plugins/markdown/search/nodes/tag-node.js +1 -1
- package/dist/server/plugins/markdown/search/to-markdown.js +1 -1
- package/dist/server/plugins/markdown/utils/sanitize-malformed-md-content.js +1 -1
- package/dist/server/plugins/mcp/audit/audit-log.js +1 -1
- package/dist/server/plugins/mcp/audit/secret-patterns.js +1 -1
- package/dist/server/plugins/mcp/auth/assistant-anonymous-token.d.ts +9 -0
- package/dist/server/plugins/mcp/auth/assistant-anonymous-token.js +1 -0
- package/dist/server/plugins/mcp/auth/auth-handlers.d.ts +5 -3
- package/dist/server/plugins/mcp/auth/auth-handlers.js +1 -1
- package/dist/server/plugins/mcp/codemode/build-tool-list.d.ts +6 -1
- package/dist/server/plugins/mcp/codemode/build-tool-list.js +2 -2
- package/dist/server/plugins/mcp/codemode/build-tool-type-declarations.js +4 -4
- package/dist/server/plugins/mcp/codemode/capabilities/fetch/index.js +3 -3
- package/dist/server/plugins/mcp/codemode/capabilities/types.d.ts +0 -1
- package/dist/server/plugins/mcp/codemode/capabilities/utils.d.ts +1 -2
- package/dist/server/plugins/mcp/codemode/capabilities/utils.js +4 -4
- package/dist/server/plugins/mcp/codemode/code-execution-audit.d.ts +3 -2
- package/dist/server/plugins/mcp/codemode/code-execution-audit.js +1 -1
- package/dist/server/plugins/mcp/codemode/code-execution-telemetry.d.ts +3 -4
- package/dist/server/plugins/mcp/codemode/code-execution-telemetry.js +1 -1
- package/dist/server/plugins/mcp/codemode/prompts.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/describe-tools.js +2 -2
- package/dist/server/plugins/mcp/codemode/tools/execute-schema.d.ts +0 -2
- 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.js +2 -2
- package/dist/server/plugins/mcp/custom-tools/scan-custom-tools.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/core/create-anonymous-session.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/core/whoami.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/constants.d.ts +2 -0
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/constants.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/endpoint-suggestions.d.ts +6 -0
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/endpoint-suggestions.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoint-info.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-security-schemes.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.d.ts +2 -0
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.d.ts +6 -2
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/utils/resolve-refs.d.ts +20 -14
- package/dist/server/plugins/mcp/docs-mcp/utils/resolve-refs.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/credential-validation.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/elicitation.d.ts +16 -10
- package/dist/server/plugins/mcp/gateway-mcp/elicitation.js +5 -5
- package/dist/server/plugins/mcp/gateway-mcp/fetch/allowed-hosts.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/url-placeholders.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/rate-limit/ip-key.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.d.ts +0 -6
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.js +2 -2
- package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
- package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.js +1 -1
- package/dist/server/plugins/mcp/handlers/mcp-credentials-page.js +35 -35
- package/dist/server/plugins/mcp/index.js +1 -1
- package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
- package/dist/server/plugins/mcp/servers/mcp-server.js +2 -4
- package/dist/server/plugins/mcp/types.d.ts +5 -11
- package/dist/server/plugins/mcp/utils/disabled-tools.d.ts +3 -0
- package/dist/server/plugins/mcp/utils/disabled-tools.js +1 -0
- package/dist/server/plugins/mcp/utils/json-schema-validator.d.ts +2 -2
- package/dist/server/plugins/mcp/utils/json-schema-validator.js +1 -1
- package/dist/server/plugins/mcp/utils/mcp-client.js +1 -1
- package/dist/server/plugins/mcp/utils/public-endpoint.d.ts +9 -0
- package/dist/server/plugins/mcp/utils/public-endpoint.js +1 -0
- package/dist/server/plugins/mcp/utils/telemetry-attributes.d.ts +2 -1
- package/dist/server/plugins/mcp/utils/telemetry-attributes.js +1 -1
- package/dist/server/plugins/mcp/utils/tool-registration.d.ts +2 -1
- package/dist/server/plugins/mcp/utils/tool-registration.js +1 -1
- package/dist/server/plugins/mcp/utils/xmcp-utils.d.ts +0 -7
- package/dist/server/plugins/mcp/utils/xmcp-utils.js +1 -1
- package/dist/server/plugins/mcp/workers/execute-mcp-tool.js +1 -1
- package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.d.ts +5 -7
- package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.js +1 -1
- package/dist/server/plugins/nav-utils.js +1 -1
- package/dist/server/plugins/scorecard-classic/index.js +1 -1
- package/dist/server/plugins/scorecard-classic/template/Grid/GridHeader.js +21 -8
- package/dist/server/plugins/scorecard-classic/template/ScorecardDashboard.js +3 -3
- package/dist/server/plugins/scorecard-classic/template/index.styles.d.ts +1 -0
- package/dist/server/plugins/scorecard-classic/template/index.styles.js +15 -5
- package/dist/server/plugins/scorecard-classic/template/useData.js +1 -1
- package/dist/server/plugins/scorecard-classic/template/views.js +1 -1
- package/dist/server/plugins/search/engines/flexsearch/index.js +2 -1
- package/dist/server/plugins/search/engines/flexsearch/search-index.d.ts +2 -2
- package/dist/server/plugins/search/engines/flexsearch/search-index.js +1 -1
- package/dist/server/plugins/search/llmstxt/index.js +1 -1
- package/dist/server/plugins/sidebars/index.js +7 -3
- package/dist/server/plugins/sidebars/tabs.d.ts +19 -0
- package/dist/server/plugins/sidebars/tabs.js +1 -0
- package/dist/server/plugins/sso/index.js +1 -1
- package/dist/server/ssr/render.js +1 -1
- package/dist/server/store.d.ts +2 -0
- package/dist/server/store.js +1 -1
- package/dist/server/tools/notifiers/helpers/privacy/mask-subject.js +1 -1
- package/dist/server/tools/notifiers/helpers/privacy/remove-pii.js +1 -1
- package/dist/server/types/plugins/search.d.ts +7 -5
- package/dist/server/utils/catalog-classic/get-catalog-shared-data-id.d.ts +3 -0
- package/dist/server/utils/catalog-classic/get-catalog-shared-data-id.js +1 -0
- package/dist/server/utils/envs/interpolate-env-variables.js +1 -1
- package/dist/server/utils/rbac-expand.js +1 -1
- package/dist/server/utils/rbac.js +1 -1
- package/dist/server/utils/redact-url.d.ts +6 -0
- package/dist/server/utils/redact-url.js +1 -0
- package/dist/server/utils/report-all-errors.js +1 -1
- package/dist/server/utils/sandbox-context.js +1 -1
- package/dist/server/utils/search/highlight-text-for-search.d.ts +1 -0
- package/dist/server/utils/search/highlight-text-for-search.js +1 -1
- package/dist/server/utils/search/text-match.d.ts +6 -0
- package/dist/server/utils/search/text-match.js +1 -0
- package/dist/server/utils/static-data.js +1 -1
- package/dist/server/utils/write-problems-report.d.ts +3 -0
- package/dist/server/utils/write-problems-report.js +1 -0
- package/dist/server/web-server/auth.d.ts +16 -2
- package/dist/server/web-server/auth.js +4 -4
- package/dist/server/web-server/jwt/jwt.js +1 -1
- package/dist/server/web-server/jwt/token-types.d.ts +11 -0
- package/dist/server/web-server/jwt/token-types.js +1 -0
- package/dist/server/web-server/jwt/types.d.ts +4 -4
- package/dist/server/web-server/jwt/types.js +1 -1
- package/dist/server/web-server/middleware/ensureSearchData.js +1 -1
- package/dist/server/web-server/middleware/responseHeadersMiddleware.js +1 -1
- package/dist/server/web-server/middleware/telemetry-middleware.js +1 -1
- package/dist/server/web-server/routes/ask-ai.js +1 -1
- package/dist/server/web-server/routes/auth.d.ts +1 -1
- package/dist/server/web-server/routes/auth.js +1 -1
- package/dist/server/web-server/routes/cors-proxy.js +2 -2
- package/dist/server/web-server/routes/dynamic-route.js +1 -1
- package/dist/server/web-server/routes/index.js +1 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-server-card.js +1 -1
- package/dist/server/web-server/routes/semantic-search.d.ts +1 -1
- package/dist/server/web-server/routes/semantic-search.js +1 -1
- package/dist/server/web-server/routes/static-content.js +1 -1
- package/dist/server/workers/worker-pool.js +1 -1
- package/dist/types/entitlements.d.ts +1 -0
- package/dist/utils/path/parse-path-versions.js +1 -1
- package/dist/utils/string/to-kebab-case.js +1 -1
- package/package.json +9 -9
- package/dist/client/app/Sidebar/helpers/filter-out-versioned-items.js +0 -1
- package/dist/server/plugins/mcp/auth/token-audience-telemetry.d.ts +0 -7
- package/dist/server/plugins/mcp/auth/token-audience-telemetry.js +0 -1
- package/dist/server/plugins/mcp/auth/token-audience.d.ts +0 -6
- package/dist/server/plugins/mcp/auth/token-audience.js +0 -1
- /package/dist/server/{plugins/mcp/gateway-mcp/fetch → web-server/utils}/ssrf-blocklist.d.ts +0 -0
- /package/dist/server/{plugins/mcp/gateway-mcp/fetch → web-server/utils}/ssrf-blocklist.js +0 -0
- /package/dist/server/{plugins/mcp/gateway-mcp/fetch → web-server/utils}/ssrf-safe-lookup.d.ts +0 -0
- /package/dist/server/{plugins/mcp/gateway-mcp/fetch → web-server/utils}/ssrf-safe-lookup.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"i18next";import{useSyncExternalStore as
|
|
1
|
+
import e from"i18next";import{useContext as t,useSyncExternalStore as o}from"react";import{L10nContext as r}from"../L10nContext";const u=n=>(e.on("languageChanged",n),()=>e.off("languageChanged",n)),a=()=>e.language,L=()=>{const n=t(r),g=o(u,a,a);return n?{changeLanguage:n.changeLanguage,lang:n.lang}:{changeLanguage:e.changeLanguage,lang:g}};export{L as useL10n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"i18next";import{useContext as n,useMemo as a}from"react";import{createTranslate as s}from"../../../../utils/l10n/create-translate.js";import{L10nContext as m}from"../L10nContext";import{useL10n as l}from"./useL10n";const x=()=>{const o=n(m),{lang:t}=l(),r=a(()=>s(e.t),[t]);return{translate:o?.translate??r}};export{x as useTranslate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import a from"i18next";import{useL10n as
|
|
1
|
+
import a from"i18next";import{useContext as y}from"react";import{L10nContext as g}from"../L10nContext";import{useL10n as h}from"./useL10n";let c,f=[],l=!1;function m(){if(l)return;l=!0;const t=()=>{c=void 0,f=[]};a.on("added",t),a.on("removed",t),a.on("languageChanged",t)}function p(t,e){if(!t.isInitialized)return[];const s=new Set,o=new Set,r=n=>{if(!(!n||o.has(n))){o.add(n);for(const i of u(t.getResourceBundle(n,"translation")))s.add(i)}};r(e),r(t.language);for(const n of t.languages??[])r(n);const d=t.options?.resources??{};for(const n of Object.keys(d))if(!o.has(n)){o.add(n);for(const i of u(d[n]?.translation))s.add(i)}return[...s]}const j=()=>{const t=y(g),{lang:e}=h();return t?t.getKeys():(m(),K(e))};function K(t){return c!==t&&(f=p(a,t),c=t),f}function u(t,e=""){if(!t||typeof t!="object"||Array.isArray(t))return e?[e]:[];const s=[];for(const o of Object.keys(t)){const r=e?`${e}.${o}`:o;s.push(...u(t[o],r))}return s}export{p as collectTranslationKeys,j as useTranslationKeys};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i from"i18next";import{DEFAULT_LOCALE_PLACEHOLDER as o}from"../../../constants/common.js";import{buildI18nConfig as s}from"../../../utils/l10n/build-i18n-config.js";import{createTranslate as c}from"../../../utils/l10n/create-translate.js";import{collectTranslationKeys as f}from"./hooks/useTranslationKeys";async function d(a,t){const e=i.createInstance(),r=a?.defaultLocale||o;await e.init(await s(a,r));let n;return{lang:t,translate:c(e.getFixedT(t)),changeLanguage:async()=>e.getFixedT(t),getKeys:()=>(n||(n=f(e,t)),n)}}export{d as createSsrL10nContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{MarkdownAdapterProvider as s,RedocExample as c,StoreProvider as d,markdocParser as l}from"@redocly/api-docs";import{ErrorMessage as E,OpenApiComponentWrap as f}from"../styled.elements";import{useStore as u}from"../../hooks/use-store";import{usePortalMarkdownAdapter as k}from"./use-markdown-adapter";function v(o){const{descriptionFile:t,pointer:p,options:a,mimeType:n}=o,{store:r,error:i}=u(t),m=k();return r?e.createElement(f,{"data-testid":"openapi-example"},e.createElement(d,{options:{
|
|
1
|
+
import*as e from"react";import{MarkdownAdapterProvider as s,RedocExample as c,StoreProvider as d,markdocParser as l}from"@redocly/api-docs";import{ErrorMessage as E,OpenApiComponentWrap as f}from"../styled.elements";import{useStore as u}from"../../hooks/use-store";import{usePortalMarkdownAdapter as k}from"./use-markdown-adapter";function v(o){const{descriptionFile:t,pointer:p,options:a,mimeType:n}=o,{store:r,error:i}=u(t),m=k();return r?e.createElement(f,{"data-testid":"openapi-example"},e.createElement(d,{options:{...r.options,...a,markdownParser:l},apiStore:r.store},e.createElement(s,{value:m},e.createElement(c,{pointer:p,mimeType:n||"application/json"})))):e.createElement(E,null,i)}export{v as OpenApiExample};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{MarkdownAdapterProvider as
|
|
1
|
+
import*as e from"react";import{MarkdownAdapterProvider as c,RedocResponseSamples as f,StoreProvider as u,markdocParser as E}from"@redocly/api-docs";import{ErrorMessage as t,OpenApiComponentWrap as S}from"../styled.elements";import{useStore as P}from"../../hooks/use-store";import{findResponseSamples as h}from"../../utils/find-openapi-response-samples.js";import{usePortalMarkdownAdapter as k}from"./use-markdown-adapter";function w(n){const{descriptionFile:s,operationId:p,pointer:a,exampleKey:i}=n,{store:o,error:m}=P(s),d=k(),l=e.useMemo(()=>({...o?.options,specType:"openapi",markdownParser:E}),[o?.options]);if(!o)return e.createElement(t,null,m);const r=o.items?.length?h(o.items,{pointer:a,sourceId:p}):void 0;return r?.responseCodes.length?e.createElement(S,{"data-testid":"openapi-response-sample"},e.createElement(u,{options:l,apiStore:o.store},e.createElement(c,{value:d},e.createElement(f,{responseCodes:r.responseCodes,exampleKey:i,schemaId:r.schemaId})))):e.createElement(t,null,"Cannot find response samples for the given operation")}export{w as OpenApiResponseSample};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"react";import{useLocation as g}from"react-router";import{EmbeddedReplay as k,StoreProvider as I,buildReplayPredefinedEnvValues as P,mergeEnvData as b,useOpenApiDefinition as h,withReplayPrefetch as R,markdocParser as w}from"@redocly/api-docs";import{Admonition as V}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{ErrorMessage as C,OpenApiComponentWrap as D}from"../styled.elements.js";import{useStore as v}from"../../hooks/use-store.js";import{getMockServerDocsConfig as
|
|
1
|
+
import o from"react";import{useLocation as g}from"react-router";import{EmbeddedReplay as k,StoreProvider as I,buildReplayPredefinedEnvValues as P,mergeEnvData as b,useOpenApiDefinition as h,withReplayPrefetch as R,markdocParser as w}from"@redocly/api-docs";import{Admonition as V}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{ErrorMessage as C,OpenApiComponentWrap as D}from"../styled.elements.js";import{useStore as v}from"../../hooks/use-store.js";import{getMockServerDocsConfig as y}from"../../../../templates/api-docs/mock-server-config.js";import{buildReplayOperationSourceMap as $}from"../../utils/build-replay-operation-source-map.js";import{findApiItem as x}from"../../utils/find-api-item.js";const F=R(function({descriptionFile:p,operationId:r,pointer:n,exampleKey:a,mimeType:e,requestBody:u,parameters:c,environment:s,environments:i,hideOtherSecuritySchemes:d}){const f=g(),{store:t,baseSlug:S}=v(p),m=h(),E=o.useMemo(()=>{if(!m)return{};const M=y(t?.options?.mockServer,S??""),A=P(m,M);return b(A,i??{})},[m,t?.options?.mockServer,S,i]),O=o.useMemo(()=>t?.items?$(t.items,{pointer:n,sourceId:r},{mimeType:e,exampleKey:a},t.store?.exampleStore??{}):new Map,[t?.items,t?.store?.exampleStore,n,r,e,a]);return!m||!t?null:o.createElement(k,{key:`${f.pathname}-${p}-${r||n}`,activeOperationId:r,fullOpenApi:m,pointer:n,operationSourceMap:O,hideOtherSecuritySchemes:d,predefinedEnvValues:E,allowedEnvironments:s?[s]:void 0,requestValues:{body:u,...c},activeMimeName:e})}),J=l=>{const{descriptionFile:p,operationId:r,pointer:n,options:a}=l,{store:e,error:u,baseSlug:c}=v(p),s=o.useMemo(()=>({...e?.options,...a}),[a,e?.options]),i=o.useMemo(()=>e?.items?.length?x(e.items,{pointer:n,sourceId:r}):void 0,[e?.items,n,r]);if(!e)return o.createElement(C,null,u);if(!i?.content?.meta?.pointer)return o.createElement(V,{type:"danger"},"Cannot find OpenAPI operation by operationId or pointer in ",p);const d=i.content.meta.pointer,f=i.content.meta.sourceId??"";return o.createElement(D,{"data-testid":"replay-openapi"},o.createElement(I,{apiStore:e.store,options:{specType:"openapi",...s,mockServer:y(s.mockServer,c??""),basePath:c,markdownParser:w,replayFeatures:e.options.replayFeatures}},o.createElement(F,{...l,pointer:d,operationId:f})))};export{J as ReplayOpenApi};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ApiItem, ApiStore } from '@redocly/api-docs';
|
|
2
|
-
import type { RedocConfig } from '@redocly/config';
|
|
1
|
+
import type { ApiItem, ApiStore, RawApiDocsOptions } from '@redocly/api-docs';
|
|
3
2
|
export type ApiDefinitionEmbedSharedData = {
|
|
4
3
|
items: ApiItem[];
|
|
5
4
|
store: ApiStore;
|
|
6
|
-
options:
|
|
5
|
+
options: RawApiDocsOptions;
|
|
7
6
|
baseSlug: string;
|
|
8
7
|
};
|
|
9
8
|
export declare function useStore(sharedDataKey?: string): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import a,{useState as T}from"react";import C from"styled-components";import{Button as o}from"@redocly/theme/components/Button/Button";import{isEmailValid as x}from"../../pages/DevLogin/utils";import{DEFAULT_AUTHENTICATED_TEAM as n}from"../../../../constants/common";import{TeamsSelector as g}from"./styled";function F({teams:s,formState:{values:t,errors:l},setFormState:m,onSubmit:d}){const[u,p]=T([]),f=()=>m({values:t,errors:void 0}),c=()=>{t?.email&&x(t.email)?(d(),l&&f()):m({values:t,errors:{...l,email:"Please enter a correct email"}})},h=({target:e})=>{m({errors:l,values:{...t,[e.name]:e.value}})},E=({target:e})=>{const i=[...t?.teams||[],e.name];e.checked?m({errors:l,values:{...t,teams:i}}):m({errors:l,values:{...t,teams:t.teams?.filter(k=>k!==e.name)}})},b=e=>{e.preventDefault(),c()},y=()=>{const e=prompt("Enter custom team name");e&&p(i=>[...i,e])};return a.createElement("form",{id:"main_form",onSubmit:b},a.createElement("div",{className:"email-screen"},a.createElement("span",{className:"label","data-cy":"email-input-label"},"Email address"),a.createElement("input",{type:"email",id:"email",name:"email",autoFocus:!0,value:t?.email||"",onChange:h,"data-cy":"email-input",className:l?.email?"error":""}),l?.email&&a.createElement("span",{id:"email-screen-email-error",className:"email-error-block","data-cy":"incorrect-email-error"},l.email),a.createElement(a.Fragment,null,a.createElement("span",{className:"label","data-cy":"email-input-label"},"Select teams"),a.createElement(g,null,s.concat(u).map(e=>a.createElement(r,{key:e},a.createElement("input",{type:"checkbox",name:e,id:e,checked:t?.teams?.includes(e)||!1,onChange:E}),a.createElement("label",{htmlFor:e},e))),a.createElement(r,{key:n},a.createElement("input",{type:"checkbox",name:n,id:n,disabled:!0,checked:!0}),a.createElement("label",{htmlFor:n,title:"This team is enabled for all authenticated users by default"},n)),a.createElement(o,{type:"button",size:"small",fullWidth:!0,onClick:y},"+ Add custom team"))),a.createElement(o,{fullWidth:!0,size:"large",variant:"primary",onClick:c,"data-cy":"log-in-button"},"Login")))}const r=C.div`
|
|
1
|
+
import a,{useState as T}from"react";import C from"styled-components";import{Button as o}from"@redocly/theme/components/Button/Button";import{isEmailValid as x}from"../../pages/DevLogin/utils";import{DEFAULT_AUTHENTICATED_TEAM as n}from"../../../../constants/common";import{TeamsSelector as g}from"./styled";function F({teams:s,formState:{values:t,errors:l},setFormState:m,onSubmit:d}){const[u,p]=T([]),f=()=>m({values:t,errors:void 0}),c=()=>{t?.email&&x(t.email)?(d(),l&&f()):m({values:t,errors:{...l,email:"Please enter a correct email"}})},h=({target:e})=>{m({errors:l,values:{...t,[e.name]:e.value}})},E=({target:e})=>{const i=[...t?.teams||[],e.name];e.checked?m({errors:l,values:{...t,teams:i}}):m({errors:l,values:{...t,teams:t.teams?.filter(k=>k!==e.name)}})},b=e=>{e.preventDefault(),c()},y=()=>{const e=prompt("Enter custom team name");e&&p(i=>[...i,e])};return a.createElement("form",{id:"main_form",onSubmit:b},a.createElement("div",{className:"email-screen"},a.createElement("span",{className:"label",id:"email-label","data-cy":"email-input-label"},"Email address"),a.createElement("input",{type:"email",id:"email","aria-labelledby":"email-label",name:"email",autoFocus:!0,value:t?.email||"",onChange:h,"data-cy":"email-input",className:l?.email?"error":""}),l?.email&&a.createElement("span",{id:"email-screen-email-error",className:"email-error-block","data-cy":"incorrect-email-error"},l.email),a.createElement(a.Fragment,null,a.createElement("span",{className:"label","data-cy":"email-input-label"},"Select teams"),a.createElement(g,null,s.concat(u).map(e=>a.createElement(r,{key:e},a.createElement("input",{type:"checkbox",name:e,id:e,checked:t?.teams?.includes(e)||!1,onChange:E}),a.createElement("label",{htmlFor:e},e))),a.createElement(r,{key:n},a.createElement("input",{type:"checkbox",name:n,id:n,disabled:!0,checked:!0}),a.createElement("label",{htmlFor:n,title:"This team is enabled for all authenticated users by default"},n)),a.createElement(o,{type:"button",size:"small",fullWidth:!0,onClick:y},"+ Add custom team"))),a.createElement(o,{fullWidth:!0,size:"large",variant:"primary",onClick:c,"data-cy":"log-in-button"},"Login")))}const r=C.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as m}from"react";import
|
|
1
|
+
import e,{useState as m}from"react";import d from"styled-components";import{Button as s}from"@redocly/theme/components/Button/Button";import{H3 as p}from"@redocly/theme/components/Typography/H3";import{ServerRoutes as u}from"../../../../constants/api";import{withPathPrefix as f}from"@redocly/theme/core/utils";function g(){const t=new URLSearchParams(window.location.search);return{code:t.get("code")||"",org:t.get("org")||"",invitedBy:t.get("invitedBy")||""}}function P(){const{code:t,org:a,invitedBy:i}=g(),[o,l]=m(t),c=async r=>{if(r.preventDefault(),!o)return;const n=new URL(f(u.IDP_LOGIN),window.location.href);n.searchParams.set("inviteCode",o),n.searchParams.set("redirectTo","/"),window.location.href=n.toString()};return e.createElement(v,null,e.createElement(p,null,"Join ",a||"Redocly"),e.createElement("form",{onSubmit:c},e.createElement("div",{className:"form-content"},!t&&e.createElement(e.Fragment,null,e.createElement("span",{className:"label",id:"invite-code-label"},"Enter your invite code"),e.createElement("input",{type:"text","aria-labelledby":"invite-code-label",value:o,onChange:r=>l(r.target.value),placeholder:"Invite code",autoFocus:!0})),i&&e.createElement("div",{className:"invite-info"},e.createElement("strong",null,i)," has invited you to join"),e.createElement(s,{fullWidth:!0,size:"large",variant:"primary",type:"submit",disabled:!o},"Accept invite"))))}const v=d.div`
|
|
2
2
|
font-family: var(--font-family-base);
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSearch as o}from"./useSearch";import{useFacetQuery as
|
|
1
|
+
import{useSearch as o,useSearchFeatures as u}from"./useSearch";import{useFacetQuery as s}from"./useFacets";import{useAiSearch as c}from"./useAiSearch";export{c as useAiSearch,s as useFacetQuery,o as useSearch,u as useSearchFeatures};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { SearchItemData, SearchFilterItem, SearchFacet } from '@redocly/theme/core/types';
|
|
2
|
+
export declare function useSearchFeatures(): {
|
|
3
|
+
askAi: boolean | undefined;
|
|
4
|
+
};
|
|
2
5
|
export declare function useSearch(product?: string, disableAutoSearch?: boolean): {
|
|
3
6
|
query: string;
|
|
4
7
|
setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as D,useEffect as k,useMemo as L,useState as S,useRef as A}from"react";import{SEARCH_DEBOUNCE_TIME_MS as U}from"@redocly/theme/core/constants";import{getBaseDataAttributes as B,withPathPrefix as v}from"@redocly/theme/core/utils";import{ServerRoutes as H}from"../../../constants/api";import{SEARCH_GROUP_FACET_FIELD as T,SEARCH_PRODUCT_FIELD as J,SEARCH_VERSION_FIELD as K}from"../../../constants/common";import{debounce as $}from"../../../utils/time/debounce.js";import{useSearchSession as z}from"@redocly/theme/core/contexts";import{useGlobalData as j,useI18nConfig as x}from"../hooks";import{usePageVersions as W}from"../../providers/page-data/hooks";import{useFacets as X}from"./useFacets";import{telemetry as Y}from"../telemetry/index.js";const Z=(n,u,r,i,R,s,F,l,o,d)=>{const{searchSessionId:C}=z(),{currentLocale:E}=x(),f=A(""),p=A(null),h=A(async(e,a)=>{try{F(null);const t=await fetch(v(H.SEARCH),a);if(!t.ok)throw new Error(t.statusText||`Search failed (${t.status})`);if(y(e)){const c=await t.json();i(c.facets),r(c.documents),R(c.groupCounts??{}),p.current=null,e.trim().length>1&&Y.sendSearchQueryMessage([{...B("searchQuery","search"),query:e,resultCount:Object.keys(c.documents).length.toString(),searchSessionId:C,...o&&{product:o}}]),s(!1)}}catch(t){if(!y(e))return;p.current={query:e,requestParams:a},r({}),s(!1),F(t instanceof Error?t.message:"An unknown error occurred")}}),y=e=>f.current===e,m=L(()=>$(async(e,a,t,c)=>{if(!e.trim().length&&!a.length){r({}),i({}),R({}),s(!1),F(null),p.current=null;return}const g={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:e,filter:G(a,c,l),locale:t})};await h.current(e,g)},U),[l?.version,l?.folderId,o]);return k(()=>{d||(s(!0),m(n,u,E,o),f.current=n)},[d,u,E,o,n,m,s]),{retrySearch:D(async()=>{const e=p.current;e&&(s(!0),f.current=e.query,await h.current(e.query,e.requestParams))},[s])}},V=(n,u,r,i,R,s,F,l,o,d)=>{const{currentLocale:C}=x();k(()=>{E(r,n,u,C,i,R,o,d)},[i,o,d?.version,d?.folderId]);const E=D(async(f,p,h,y,m,b,e,a)=>{if(m){const{groupKey:t}=m;l(!0);const g={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:p,filter:(()=>{const I=b.find(O=>O.field===T);let _=h;return I&&(h.find(q=>q.field===I.field)||(_=[...h,{field:I.field,values:[t]}])),G(_,e,a)})(),loadMore:m,locale:y})},w=await(await fetch(v(H.SEARCH),g)).json(),M=f[t]||[],N=w.documents[t]??[],Q={...f,[t]:[...M,...N]};s(Q),w.groupCounts&&F(I=>({...I,...w.groupCounts})),l(!1)}},[]);return{}};function fe(){const{searchFeatures:n}=j();return{askAi:n?.ai?.enabled}}function me(n,u){const{searchFeatures:r}=j(),[i,R]=S(""),[s,F]=S([]),[l,o]=S({}),[d,C]=S({}),[E,f]=S({}),[p,h]=S(),[y,m]=S(!1),[b,e]=S(null),{facets:a}=X(d),{versions:t=[]}=W()||{},c=t.find(P=>P?.active),{retrySearch:g}=Z(i,s,o,C,f,m,e,c,n,u);return V(i,s,l,p,a,o,f,m,n,c),{query:i,setQuery:R,filter:s,setFilter:F,items:l,isSearchLoading:y,searchError:b,facets:a,groupCounts:E,groupField:T,setLoadMore:h,retrySearch:g,advancedSearch:r?.advanced?.enabled,askAi:r?.ai?.enabled}}function G(n,u,r){return[...n,...u?[{field:J,values:[u]}]:[],...r?[{field:K,values:[...r.default?["default"]:[r.folderId,r.version]]}]:[]]}export{me as useSearch,fe as useSearchFeatures};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useWebMcpTools as p}from"./useWebMcpTools.js";export{p as useWebMcpTools};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentTool } from '@redocly/api-docs';
|
|
2
|
+
import type { ApiDocsPageData, ToolContext } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The API reference tools come from api-docs. Realm supplies the two host-specific pieces: its
|
|
5
|
+
* path prefix, and operation detail read from the page's Markdown mirror.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildApiTools(context: ToolContext, apiDocs: ApiDocsPageData): AgentTool[];
|
|
8
|
+
//# sourceMappingURL=api-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildApiDocsAgentTools as e}from"@redocly/api-docs";import{fetchText as i,markdownPathForRoute as l}from"./shared.js";function u(o,r){return e({items:r.items,store:r.store,resolveDocUrl:o.withPrefix,getOperationDetail:t=>i(o.routeUrl(l(t.url)))})}export{u as buildApiTools};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
2
|
+
/**
|
|
3
|
+
* Markdown mirror of a prefixed route, mirroring `getLlmsTxtMdPathBySlug` on the server. The site
|
|
4
|
+
* root resolves to `index.html.md`; every other route gains a `.md` suffix. The query and the
|
|
5
|
+
* fragment are dropped, so the suffix always lands on the pathname and can never select another route.
|
|
6
|
+
*/
|
|
7
|
+
export declare function markdownPathForRoute(pathname: string): string;
|
|
8
|
+
/** Returns the normalized path only when it stays on this site, so a tool can never navigate off-origin. */
|
|
9
|
+
export declare function toSitePath(target: string): string | undefined;
|
|
10
|
+
export declare function fetchText(url: string): Promise<string | undefined>;
|
|
11
|
+
export declare function clampLimit(value: unknown, fallback: number, max: number): number;
|
|
12
|
+
export declare function joinField(value: string | string[] | undefined): string;
|
|
13
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withPathPrefix as s,withoutPathPrefix as c}from"@redocly/theme/core/utils";function a(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function f(t){const[r=t]=t.split("#"),[n=r]=r.split("?"),e=c(n),i=e.length>1?e.replace(/\/$/,""):"/";return s(`${i}${i==="/"?"index.html.md":".md"}`)}const o="https://site.invalid";function p(t){const r=t.trim();if(!r.startsWith("/"))return;const n=URL.parse(r,o);if(n?.origin===o)return`${n.pathname}${n.search}${n.hash}`}async function h(t){const r=await fetch(t,{headers:{accept:"text/plain"}});if(r.ok)return await r.text()}function d(t,r,n){const e=typeof t=="number"?t:Number(t);return!Number.isFinite(e)||e<=0?r:Math.min(Math.floor(e),n)}function m(t){return Array.isArray(t)?t.join(" "):t??""}export{d as clampLimit,h as fetchText,a as isRecord,m as joinField,f as markdownPathForRoute,p as toSitePath};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AgentTool } from '@redocly/api-docs';
|
|
2
|
+
import type { ToolContext } from '../types.js';
|
|
3
|
+
/** Tools registered on every page of the site. */
|
|
4
|
+
export declare function buildSiteTools(context: ToolContext): AgentTool[];
|
|
5
|
+
//# sourceMappingURL=site-tools.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{agentErrorResult as o,agentJsonResult as h,agentTextResult as d,collectOperations as v}from"@redocly/api-docs";import{ServerRoutes as b}from"../../../../constants/api.js";import{AGENT_SKILLS_BASE as S}from"../../../../constants/common.js";import{clampLimit as P,fetchText as g,isRecord as m,joinField as f,markdownPathForRoute as T,toSitePath as y}from"./shared.js";const A=`${S}/index.json`,_="mcp",O="webmcp-browser-agent",R="/llms.txt",w=10,E=50,H=3;function G(e){return[...e.feedbackHidden?[]:[$(e)],{name:"get_current_page",title:"Get current page",description:"Report which documentation page the user is looking at right now, including the product and version in scope and whether it is an API reference page. Call this first so an answer matches what is on screen.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0},execute:async()=>j(e)},{name:"search_docs",title:"Search documentation",description:"Search this documentation site and return matching pages with their titles and URLs. Use it to find the page that answers a question before reading it.",inputSchema:{type:"object",properties:{query:{type:"string",description:"What to search for"},limit:{type:"integer",description:`Maximum number of results, ${w} by default`}},required:["query"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async t=>C(e,t)},{name:"read_page",title:"Read a page",description:"Return the full Markdown source of a documentation page. Omit the url to read the page the user is currently on.",inputSchema:{type:"object",properties:{url:{type:"string",description:"Site-relative page path, for example /guides/quickstart"}},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async t=>L(e,t)},{name:"get_site_overview",title:"Get site overview",description:"Return the outline of this documentation site: its sections and the pages inside them, limited to what the current user may see. Use it to orient before searching.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async()=>q(e)},{name:"read_skill",title:"Read an agent skill",description:"List the agent skills this site publishes, or read one by name. A skill explains how to carry out a task against the documented product.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Skill name; omit to list every skill"}},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async t=>U(e,t)},{name:"navigate_page",title:"Open a page",description:"Move the browser tab to another page of this documentation site, so the user sees what an answer is based on. Accepts site-relative paths only.",inputSchema:{type:"object",properties:{url:{type:"string",description:"Site-relative page path, optionally with a #section anchor"}},required:["url"],additionalProperties:!1},annotations:{readOnlyHint:!1},execute:async t=>M(e,t)}]}async function j(e){const t=e.versions.find(n=>n.active);return h({url:e.pathname,title:e.pageTitle??document.title,locale:e.locale,product:e.product,version:t?.label??t?.version,isApiReference:!!e.apiDocs,...e.apiDocs?{apiBasePath:e.withPrefix(e.apiDocs.baseSlug),apiSpecType:e.apiDocs.store.specType,operationCount:v(e.apiDocs.items).length}:{}})}async function C(e,t){const n=typeof t.query=="string"?t.query.trim():"";if(!n)return o("Provide a query to search for.");const i=P(t.limit,w,E),a=await fetch(e.sitePathUrl(b.SEARCH),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:n,locale:e.locale})});if(!a.ok)return o(`Search failed with status ${a.status}.`);const r=await a.json(),s=m(r)&&m(r.documents)?r.documents:{},u=Object.entries(s).flatMap(([l,p])=>(Array.isArray(p)?p:[]).map(c=>({group:l,item:c}))).slice(0,i).map(({group:l,item:p})=>{const c=p.document;return{title:f(c?.title),url:c?.url&&e.withPrefix(c.url),section:l,...c?.httpMethod?{method:c.httpMethod.toUpperCase(),path:f(c.httpPath)}:{},...c?.deprecated?{deprecated:!0}:{},snippet:f(c?.text).slice(0,300)}});return u.length?h({query:n,resultCount:u.length,results:u}):d(`No documentation pages matched "${n}".`)}async function L(e,t){const n=typeof t.url=="string"&&t.url.trim()?t.url.trim():e.pathname,i=y(n);if(!i)return o('Provide a site-relative path that starts with "/".');const a=await g(e.routeUrl(T(i)));return a?d(a):o(`${i} has no Markdown version. Either the path is wrong, or the page is built from code rather than Markdown. Use search_docs to find a documentation page.`)}async function q(e){const t=k(e.sidebarItems,e.withPrefix,0);if(t.length)return h({product:e.product,pages:t});const n=await g(e.sitePathUrl(R));return n?d(n):o("This site publishes no navigation tree.")}function k(e,t,n){if(n>=H)return[];const i=[];for(const a of e){if(!m(a))continue;const r=typeof a.label=="string"?a.label:"",s=typeof a.link=="string"?a.link:void 0;if(!r&&!s)continue;const u=Array.isArray(a.items)?k(a.items,t,n+1):[];i.push({title:r,...s?{url:t(s)}:{},...u.length?{pages:u}:{}})}return i}async function U(e,t){const n=await fetch(e.sitePathUrl(A),{headers:{accept:"application/json"}});if(!n.ok)return o("This site does not publish agent skills.");const i=await n.json(),a=m(i)&&Array.isArray(i.skills)?i.skills:[],r=typeof t.name=="string"?t.name.trim():"";if(!r)return h({skills:a.map(l=>({name:l.name,description:l.description}))});const s=a.find(l=>l.name.toLowerCase()===r.toLowerCase());if(!s){const l=a.map(p=>p.name).join(", ");return o(`No skill named "${r}". Available skills: ${l||"none"}.`)}const u=await g(e.routeUrl(s.url));return u?d(u):o(`The "${s.name}" skill could not be read.`)}function $(e){return{name:"leave_feedback",title:"Leave feedback on a page",description:"Report that a documentation page is wrong, outdated, confusing or incomplete. Use it only when the user agrees, and summarize the problem in their words. Reports reach the team that owns the page.",inputSchema:{type:"object",properties:{summary:{type:"string",description:"One sentence naming the problem"},details:{type:"string",description:"What is wrong and what the page should say"},url:{type:"string",description:"Site-relative path of the page; the current page by default"}},required:["summary"],additionalProperties:!1},annotations:{readOnlyHint:!1,consequentialHint:!0},execute:async t=>D(e,t)}}async function D(e,t){const n=typeof t.summary=="string"?t.summary.trim():"";if(!n)return o("Describe the problem in one sentence.");const i=typeof t.details=="string"?t.details.trim():"",a=typeof t.url=="string"&&t.url.trim()?t.url.trim():e.pathname,r=y(a);if(!r)return o('Provide a site-relative path that starts with "/".');const s=await fetch(e.sitePathUrl(b.FEEDBACK),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({component:"comment",path:e.routeUrl(r),comment:i?`${n}
|
|
2
|
+
|
|
3
|
+
${i}`:n,agent:O,origin:_})});return s.ok?d(`Thanks. The feedback about ${r} reached the documentation team.`):o(s.status===403||s.status===404?`Feedback cannot be left for ${r}.`:`Feedback could not be sent, status ${s.status}.`)}async function M(e,t){const n=typeof t.url=="string"?y(t.url):void 0;return n?(await e.navigate(n),d(`Opened ${n}.`)):o('Provide a site-relative path that starts with "/". This tool cannot leave the documentation site.')}export{G as buildSiteTools};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ApiItem, ApiStore } from '@redocly/api-docs';
|
|
2
|
+
/** The api-docs payload the portal publishes as shared page data on API reference pages. */
|
|
3
|
+
export type ApiDocsPageData = {
|
|
4
|
+
items: ApiItem[];
|
|
5
|
+
store: ApiStore;
|
|
6
|
+
baseSlug: string;
|
|
7
|
+
};
|
|
8
|
+
export type PageVersion = {
|
|
9
|
+
label?: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Everything the tool builders need from the running page. */
|
|
14
|
+
export type ToolContext = {
|
|
15
|
+
/** Current route pathname, path prefix included. */
|
|
16
|
+
pathname: string;
|
|
17
|
+
pageTitle?: string;
|
|
18
|
+
locale: string;
|
|
19
|
+
product?: string;
|
|
20
|
+
versions: PageVersion[];
|
|
21
|
+
/** The site's navigation tree, already filtered by what this reader may see. */
|
|
22
|
+
sidebarItems: unknown[];
|
|
23
|
+
/** Client-side navigation that resolves once the new page has loaded. */
|
|
24
|
+
navigate: (to: string) => Promise<void>;
|
|
25
|
+
/** Absolute URL for a route that already carries the path prefix. */
|
|
26
|
+
routeUrl: (route: string) => string;
|
|
27
|
+
/** Absolute URL for a root-relative path that still needs the path prefix. */
|
|
28
|
+
sitePathUrl: (path: string) => string;
|
|
29
|
+
/** Applies the site's path prefix to a link that the page data stores un-prefixed. */
|
|
30
|
+
withPrefix: (path: string) => string;
|
|
31
|
+
/** `feedback.hide` is set, so the site publishes no feedback tool. */
|
|
32
|
+
feedbackHidden: boolean;
|
|
33
|
+
/** Present only on API reference pages. */
|
|
34
|
+
apiDocs?: ApiDocsPageData;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publishes this site's tools to browser AI agents through WebMCP.
|
|
3
|
+
*
|
|
4
|
+
* Site-wide tools register once and read the live page context on every call. API reference tools
|
|
5
|
+
* register only while the reader is on an API page and unregister on the way out, which fires
|
|
6
|
+
* `toolchange` so the agent re-reads the tool list.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useWebMcpTools(): void;
|
|
9
|
+
//# sourceMappingURL=useWebMcpTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as u,useRef as S}from"react";import{useLocation as h,useNavigate as A}from"react-router";import{withPathPrefix as g}from"@redocly/theme/core/utils";import{useThemeConfig as R}from"@redocly/theme/core/hooks";import{usePageProps as v,usePageSharedData as C,usePageVersions as L,useSidebarItemsData as x}from"../../providers/page-data/hooks";import{useCurrentProduct as D}from"../hooks/products/useCurrentProduct";import{useL10nConfig as U}from"../hooks/useL10nConfig";import{loadAndNavigate as E}from"../utils/loadAndNavigate";import{telemetry as m}from"../telemetry/index.js";import{registerAgentTools as p}from"@redocly/api-docs";import{buildApiTools as O}from"./tools/api-tools.js";import{buildSiteTools as y}from"./tools/site-tools.js";function z(){const r=h(),o=A(),{currentLocale:n}=U(),{versions:b}=L(),T=x(),i=D(),P=v(),s=C("apiDocsStore"),w=s?.baseSlug,a=R().feedback?.hide===!0,c={pathname:r.pathname,pageTitle:P.seo?.title,locale:n,product:i?.name??i?.slug,versions:b,sidebarItems:T,apiDocs:s,feedbackHidden:a,navigate:e=>E({navigate:o,to:e}),withPrefix:g,routeUrl:e=>new URL(e,window.location.origin).toString(),sitePathUrl:e=>new URL(g(e),window.location.origin).toString()},t=S(c);Object.assign(t.current,c),u(()=>{const e=new AbortController;return p(y(t.current),e.signal,d("site")),()=>e.abort()},[a]),u(()=>{const e=t.current.apiDocs;if(!e)return;const l=new AbortController;return p(O(t.current,e),l.signal,d("apiReference")),()=>l.abort()},[w])}const f={id:"agentTools",object:"feature",uri:"urn:redocly:realm:ui:feature:agentTools"};function d(r){return{registered:o=>m.sendAgentToolsRegisteredMessage([{...f,toolCount:o,scope:r}]),called:(o,n)=>m.sendAgentToolCalledMessage([{...f,toolName:o,outcome:n}])}}export{z as useWebMcpTools};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PageProps, ResolvedNavItem, CatalogEntityConfig } from '@redocly/config';
|
|
2
2
|
import type { SidebarConnectedEntity } from '@redocly/theme/core/types';
|
|
3
|
+
import type { ResolvedNavigationTabs } from '../../utils/navigation-tabs';
|
|
3
4
|
export * from './use-page-shared-data';
|
|
4
5
|
export declare function usePageData(): import("../../../types").ResolvedPageData | null;
|
|
5
6
|
export declare function usePageProps<T extends object>(): PageProps & T;
|
|
@@ -18,6 +19,7 @@ export declare function usePageVersions(): {
|
|
|
18
19
|
link: string;
|
|
19
20
|
}[];
|
|
20
21
|
};
|
|
22
|
+
export declare function useNavigationTabs(): ResolvedNavigationTabs | undefined;
|
|
21
23
|
export declare function useSidebarItemsData(): ResolvedNavItem[];
|
|
22
24
|
export declare function useSidebarConnectedCatalogEntity(): SidebarConnectedEntity | undefined;
|
|
23
25
|
export declare function useSidebarConnectedCatalogConfig(): CatalogEntityConfig | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i,{useContext as a}from"react";import{useLocation as
|
|
1
|
+
import i,{useContext as a}from"react";import{useLocation as c}from"react-router";import{removeLeadingSlash as p,removeTrailingSlash as g}from"@redocly/theme/core/utils";import{findDeepFirst as d}from"../../../utils/tree/find-deep-first.js";import{flattenTabItems as v,resolveNavigationTabs as S,navigationTabSidebarItems as y}from"../../utils/navigation-tabs";import{getSiblingPages as C}from"../../utils";import{PageDataContext as s}from"./PageDataContext.js";import{Loader as k}from"../../runtime/loader";import{useRawSidebarItems as x}from"../../app/Sidebar/useSidebarItems";import{usePageSharedData as m}from"./use-page-shared-data";export*from"./use-page-shared-data";function b(){return a(s)}function _(){return a(s)?.props||{}}const E=[];function I(){const t=D(),{versions:e=E}=a(s)||{};return{versions:i.useMemo(()=>e.map(n=>{const u=!!d(t,o=>o.version===n.version&&typeof o.link=="string"&&p(g(o.link))===p(g(n.link))),l=d(t,o=>o.version===n.version&&!!o.link);return{...n,link:(u?n.link:l?.link)||n.link}}),[e,t])}}function h(){const t=f(),{pathname:e}=c(),r=P();return i.useMemo(()=>t?.tabs?.length?S({tabs:t.tabs,pathname:e,activeVersion:r}):void 0,[t,e,r])}function j(){const t=f(),e=h();return i.useMemo(()=>e?y(e):t?.items??[],[t,e])}function q(){const t=m("sidebar")?.catalogEntity,e=b()?.props.entity;return t?{key:t.key,version:t.version}:e?.key?{key:e.key,version:e.version}:void 0}function z(){const t=m("sidebar")?.catalogEntity;return b()?.props?.catalogConfig||t?.catalogConfig}function B(){const t=c(),{versions:e=[]}=I()||{},r=e.find(u=>u?.active),n=x(r);return i.useMemo(()=>{if(n)return C(n,t.pathname)},[t.pathname,n])}function G(){const t=c();return k.loadSync(t.pathname)}function D(){const t=f();return i.useMemo(()=>t?.tabs?.length?v(t.tabs):t?.items??[],[t])}function f(){return m("sidebar")}function P(){const{versions:t=[]}=a(s)||{};return t.find(e=>e.active)}export{h as useNavigationTabs,b as usePageData,G as usePageDataLoader,_ as usePageProps,I as usePageVersions,z as useSidebarConnectedCatalogConfig,q as useSidebarConnectedCatalogEntity,j as useSidebarItemsData,B as useSidebarSiblingsData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{ThemeDataContext as m,SearchSessionProvider as d}from"@redocly/theme/core/contexts";import{useBreadcrumbs as g,useBanner as p,
|
|
1
|
+
import e from"react";import{ThemeDataContext as m,SearchSessionProvider as d}from"@redocly/theme/core/contexts";import{useBreadcrumbs as g,useBanner as p,useConsent as b,useCatalogClassic as f,useCurrentProduct as C,useGlobalData as o,useI18n as h,useI18nConfig as S,useL10n as P,useL10nConfig as T,usePageData as r,usePageSharedData as D,usePageVersions as M,usePreloadHistory as v,useProducts as F,useUserMenu as k,useSubmitFeedback as y,useTranslate as E,useTranslationKeys as L,useSidebarSiblingsData as R,useNavigationTabs as O,usePageProps as w,useUserTeams as x,useMarkdownText as A,useMarkdocRenderer as I,useCodeHighlight as N,useLoadAndNavigate as j,useCatalog as B,useCatalogSort as H,useCatalogSearch as U,useFetchCatalogEntities as _,useFetchCatalogEntitiesRelations as G,useFetchCatalogEntityRevisions as K,useTelemetry as n,useMcpData as Q}from"../../app/hooks";import{Link as V}from"../../app/Link";import{useFacetQuery as W,useSearch as q,useSearchFeatures as z,useAiSearch as J}from"../../app/search";import{useSidebarItems as X}from"../../app/Sidebar/useSidebarItems";import{deepMerge as Y}from"../../../utils/object/deep-merge";import{allowlistObject as Z}from"../../../utils/object/allowlist-object";const $=["title","description","seo","sidebar","excludeFromSearch","template","redirects","rbac","metadata","slug","codeSnippet","breadcrumbs","markdown","seo","navbar","footer","colorMode","feedback","navigation"],ee={useBreadcrumbs:g,useBanner:p,useConsent:b,useCatalog:B,useCatalogSort:H,useCatalogSearch:U,useFetchCatalogEntities:_,useFetchCatalogEntitiesRelations:G,useFetchCatalogEntityRevisions:K,useCatalogClassic:f,useCurrentProduct:C,useGlobalData:o,useSearch:q,useSearchFeatures:z,useAiSearch:J,useFacetQuery:W,useI18n:h,useI18nConfig:S,useL10n:P,useL10nConfig:T,usePageData:r,usePageSharedData:D,usePageVersions:M,usePreloadHistory:v,useProducts:F,useUserMenu:k,useSidebarItems:X,useNavigationTabs:O,useSidebarSiblingsData:R,useSubmitFeedback:y,useTranslate:E,useTranslationKeys:L,useUserTeams:x,usePageProps:w,useMarkdownText:A,useMarkdocRenderer:I,useCodeHighlight:N,useLoadAndNavigate:j,useTelemetry:n,useOtelTelemetry:n,useMcpData:Q},te={LinkComponent:V};function le({children:u}){const{props:t}=r()||{},a=o(),s=e.useMemo(()=>a||{},[a]),i=e.useMemo(()=>{const l=Z(t?.frontmatter||{},$);return Y(s,l)},[s,t?.frontmatter]),c={hooks:ee,components:te,config:i};return e.createElement(d,null,e.createElement(m.Provider,{value:c},u))}export{le as ThemeDataProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as g from"react";import{withPathPrefix as x}from"@redocly/theme/core/utils";import{appendSearchParams as z}from"../utils";import{mapObject as I}from"../../utils/object/map-object.js";import{mapObjectAsync as $}from"../../utils/object/map-object-async.js";import{isFunction as A}from"../../utils/guards/is-function.js";import{isBrowser as G}from"../../utils/env/is-browser.js";import{GLOBAL_DATA_URL as N}from"../../constants/common.js";import{getClientPageDataUrl as V}from"../../utils/url/get-client-page-data-url.js";import{getSharedDataFetchUrl as B}from"../../utils/url/get-shared-data-fetch-url.js";import{normalizeRouteSlug as d}from"../../utils/path/normalize-route-slug.js";import{templates as b}from"./generated/templates.js";import{AsyncCache as S}from"./cache.js";import{fetch as y}from"./fetch.js";import{updateTranslations as F}from"../app/l10n";import{PageMissingDefaultExportError as v}from"./errors/page-missing-default-export-error.js";const i=new S,c=new S;let D=null,m,K;const u=new Set;async function W(){const o=await(await y(x(N))).json();return m=o,o}async function C(o){const t=B(o,process.env.NODE_ENV==="development");return await(await y(t)).json()}async function q(o){return c.has(o)||c.set(o,C(o)),c.get(o)}function dt(){const[,o]=g.useReducer(t=>t+1,0);g.useEffect(()=>{process.env.NODE_ENV!=="production"&&(window.__redoclyRefresh=o)},[o])}function _(o,t){const e=t?new URLSearchParams(t).get("revision"):null,a=t?new URLSearchParams(t).get("version"):null;return e||a?`${o}?${e?`revision=${encodeURIComponent(e)}`:""}${a?`&version=${encodeURIComponent(a)}`:""}`.trim():o}class p{static markdocComponents={};static async updateTemplate(t,e,a){const n=d(t);b[a]=()=>e;const r=d(window.location.pathname);n===r&&(await this.load(t,!0),window.__redoclyRefresh())}static async update(t){const e=d(t),a=d(window.location.pathname);if(e!==a){i.delete(e);return}await this.load(t,!0),window.__redoclyRefresh()}static async updateSharedData(t){await c.set(t,C(t)),window.__redoclyRefresh()}static addGlobalDataListener(t){u.add(t)}static removeGlobalDataListener(t){u.delete(t)}static updateGlobalData(t){u.forEach(e=>e(t)),m=t,F(m.l10n)}static async tryLoad(t,e,a){try{return await this.load(t,e,a)}catch{return null}}static async loadDynamicMarkdocComponents(t){const e=this.markdocComponents?.[t];e&&A(e)&&Object.assign(this.markdocComponents,await e())}static async load(t,e,a){const n=d(t),r=_(n,a);if(!m&&!D&&(D=W()),!e&&i.has(r)){const f=await i.get(r);if(f)return f}const[s]=await Promise.all([i.set(r,l(a)),D]);return s;async function l(f){const E=V(n),T=z(E,f),k=await y(T),{templateId:P,sharedDataIds:w,props:R,userData:L,versions:M,redirectTo:O,isPublic:U}=await k.json(),[j]=await Promise.all([(async()=>p.loadTemplate(P))(),Promise.all((R.dynamicMarkdocComponents||[]).map(h=>p.loadDynamicMarkdocComponents(h))),w?$(w,h=>q(h)):Promise.resolve({})]);return{templateId:P,slug:n,sharedDataIds:w,redirectTo:O,props:R,Template:j,userData:L,versions:M,isPublic:U}}}static loadSync(t){const e=d(t),a=_(e,typeof window<"u"?window.location.search:void 0),n=i.tryGetSync(a);if(!n)return;const r=I(n.sharedDataIds,s=>c.getSync(s,"Data dependency not cached ahead of time: "+s));return{...n,sharedData:r}}static async prepare(t,e,a,n){const r=t.templateId;if(await Promise.all((t.props.dynamicMarkdocComponents||[]).map(l=>this.loadDynamicMarkdocComponents(l))),e)for(const l of Object.keys(e))c.setSync(l,e[l]);const s=await p.loadTemplate(r);s&&i.setSync(t.slug,{templateId:r,slug:t.slug,props:t.props,sharedDataIds:t.sharedDataIds||{},Template:s,userData:t.userInfo,versions:t.versions,isPublic:t.isPublic}),m=a,K=n}static async loadTemplate(t){try{const e=await b[t]();if(t.endsWith("page.tsx")&&!e.default)throw new v(t);const a=e.default;return H(a)?a:a?.default}catch(e){if(!(process.env.NODE_ENV==="development")||!G())throw e;return e instanceof v?()=>(window.location.reload(),null):(window.location.reload(),null)}}static clear(){u.clear(),c.clear(),i.clear()}}(typeof window<"u"?window:global).__LOADER=p;function H(o){return typeof o=="function"||typeof o=="object"&&o!==null&&"$$typeof"in o}export{p as Loader,q as getSharedData,m as globalData,K as initLocale,dt as useRefresh};
|
|
@@ -2,5 +2,6 @@ export { App, routes } from './App.js';
|
|
|
2
2
|
export { ErrorDetails } from './app/Error/ErrorDetails.js';
|
|
3
3
|
export { Loader } from './runtime/loader.js';
|
|
4
4
|
export { ServerStyleSheet, StyleSheetManager } from 'styled-components';
|
|
5
|
-
export
|
|
5
|
+
export { L10nContext } from './app/l10n/L10nContext.js';
|
|
6
|
+
export { createSsrL10nContext } from './app/l10n/ssrL10n.js';
|
|
6
7
|
//# sourceMappingURL=server-entry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{App as o,routes as t}from"./App.js";import{ErrorDetails as x}from"./app/Error/ErrorDetails.js";import{Loader as m}from"./runtime/loader.js";import{ServerStyleSheet as a,StyleSheetManager as n}from"styled-components";import{L10nContext as s}from"./app/l10n/L10nContext.js";import{createSsrL10nContext as h}from"./app/l10n/ssrL10n.js";export{o as App,x as ErrorDetails,s as L10nContext,m as Loader,a as ServerStyleSheet,n as StyleSheetManager,h as createSsrL10nContext,t as routes};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useMemo as u,useRef as m}from"react";import{components as c}from"@redocly-markdoc/components";import{schema as s}from"@redocly-markdoc/schema";import{withPathPrefix as i}from"@redocly/theme/core/utils";import{tags as p,components as f}from"@redocly/theme/markdoc/default";import*as l from"../../app/markdoc/custom-components/index.js";import{parsePartials as d}from"../../../markdoc/helpers/parse-partials.js";import*as g from"../../../markdoc/nodes/index.js";import w from"../../../markdoc/tags/index.js";import{normalizeCustomTags as h}from"../../../markdoc/helpers/normalize-custom-tags.js";import{deepEqual as y}from"../../../utils/object/deep-equal.js";function b(t){return t.map(r=>{const o={...r};return typeof o.link=="string"&&(o.link=i(o.link)),typeof o.routeSlug=="string"&&(o.routeSlug=i(o.routeSlug)),Array.isArray(o.items)&&(o.items=b(o.items)),o})}function a(t){const r=m(t);return y(r.current,t)||(r.current=t),r.current}function E(t,r){const o=a(t),n=a(r);return u(()=>{const e=globalThis.__LOADER?.markdocComponents??{};return{...n,...o,tags:{...n?.tags??{},...w,...p,...h(s?.tags??{})},nodes:{...n?.nodes??{},...g,...s?.nodes??{}},functions:{...s?.functions??{}},components:{...n?.components??{},...l,...f,...c,...e},partials:d(o?.partials)}},[o,n])}function M(t){if(typeof window>"u")return null;if(typeof t=="function")return t;if(typeof t!="string")return null;try{const r=t.trim();if(!r.match(/^(\([^)]*\)\s*=>\s
|
|
1
|
+
import{useMemo as u,useRef as m}from"react";import{components as c}from"@redocly-markdoc/components";import{schema as s}from"@redocly-markdoc/schema";import{withPathPrefix as i}from"@redocly/theme/core/utils";import{tags as p,components as f}from"@redocly/theme/markdoc/default";import*as l from"../../app/markdoc/custom-components/index.js";import{parsePartials as d}from"../../../markdoc/helpers/parse-partials.js";import*as g from"../../../markdoc/nodes/index.js";import w from"../../../markdoc/tags/index.js";import{normalizeCustomTags as h}from"../../../markdoc/helpers/normalize-custom-tags.js";import{deepEqual as y}from"../../../utils/object/deep-equal.js";function b(t){return t.map(r=>{const o={...r};return typeof o.link=="string"&&(o.link=i(o.link)),typeof o.routeSlug=="string"&&(o.routeSlug=i(o.routeSlug)),Array.isArray(o.items)&&(o.items=b(o.items)),o})}function a(t){const r=m(t);return y(r.current,t)||(r.current=t),r.current}function E(t,r){const o=a(t),n=a(r);return u(()=>{const e=globalThis.__LOADER?.markdocComponents??{};return{...n,...o,tags:{...n?.tags??{},...w,...p,...h(s?.tags??{})},nodes:{...n?.nodes??{},...g,...s?.nodes??{}},functions:{...s?.functions??{}},components:{...n?.components??{},...l,...f,...c,...e},partials:d(o?.partials)}},[o,n])}function M(t){if(typeof window>"u")return null;if(typeof t=="function")return t;if(typeof t!="string")return null;try{const r=t.trim();if(!r.match(/^(\([^)]*\)\s*=>\s*\S.*|[a-zA-Z_$][\w$]*\s*=>\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(e=>r.includes(e)))throw new Error("Function contains prohibited keywords");return new Function("event",`
|
|
2
2
|
'use strict';
|
|
3
3
|
const userFn = ${r};
|
|
4
4
|
return userFn(event);
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import*as e from"react";import{useMemo as i}from"react";import A from"styled-components";import{RedoclyApiDocs as
|
|
1
|
+
import*as e from"react";import{useMemo as i}from"react";import A from"styled-components";import{RedoclyApiDocs as _,createMarkdocAdapter as T}from"@redocly/api-docs";import{LayoutVariant as x}from"@redocly/theme/components/SidebarActions/SidebarActions";import{ThreePanelLayout as B}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as U}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{Breadcrumbs as D}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{withPathPrefix as s}from"@redocly/theme/core/utils";import{usePageSharedData as I,useUserClaims as $}from"../../app/hooks";import{ServerRoutes as p}from"../../../constants/api.js";import{isBrowser as M}from"../../../utils/env/is-browser.js";import{CLIENT_TELEMETRY_ENABLED as N}from"../../constants/common.js";import{PACKAGE_NAME as H}from"../../../config/product-gates";import{applyPathPrefixToApiItems as Y,safeParseFunction as V,useCollectMarkdocOptions as W}from"./helpers";function z({pageProps:{markdown:c,apiOptions:f,metadata:v}}){const u=I("apiDocsStore"),{items:l,options:o,store:w,baseSlug:r}=u,a=M(),g=$(),n=W(c,o.markdocOptions),d=i(()=>s(r),[r]),y=i(()=>d===r?l:Y(l),[l,r,d]),C=i(()=>T(n),[n]),k=i(()=>{const S=a?`${window.location.origin}${s(p.REPLAY_OAUTH2_CALLBACK)}`:void 0;let m=o.corsProxyUrl;if(m===void 0){const t=s(`${p.CORS_PROXY}/`);m=a?new URL(t,window.location.origin).toString():t}const E=o.events,h=E?Object.entries(E).reduce((t,[b,O])=>{const P=V(O);return P&&(t[b]=P),t},{}):void 0;return{...o,markdocOptions:n,oAuth2RedirectURI:S,corsProxyUrl:m,userClaims:g,...h&&{events:h},unstable_hooks:{...o.unstable_hooks,MiddlePanelHeader:()=>e.createElement(D,null)}}},[o,n,a,g]);if(!u)return e.createElement("div",null,"Something went wrong");const L=a?{collectorUrl:new URL(s(p.OTEL_TRACES),window.location.origin).toString(),disabled:!N,serviceVersion:`${H}@${process.env.REDOCLY_PORTAL_VERSION}`}:void 0;return e.createElement(K,null,e.createElement(R,{layout:f?.layout},e.createElement(U,{metadata:v})),e.createElement(_,{items:y,store:w,basePath:d,options:k,markdownAdapter:C,layout:f?.layout,telemetryConfig:L}))}const R=A(B)`
|
|
2
2
|
&& {
|
|
3
|
-
padding-right: ${({layout:c})=>c===
|
|
3
|
+
padding-right: ${({layout:c})=>c===x.THREE_PANEL?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
|
|
4
4
|
}
|
|
5
5
|
`,K=A.main`
|
|
6
6
|
div[id],
|
|
7
7
|
a[id],
|
|
8
8
|
a[data-section-id],
|
|
9
9
|
div[data-section-id] {
|
|
10
|
-
scroll-margin-top:
|
|
10
|
+
scroll-margin-top: var(--navbar-offset);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[id]:not([data-section-id]):has([data-deep-link-anchor]) {
|
|
14
|
+
scroll-margin-top: calc(var(--navbar-offset) + var(--deep-link-scroll-gap, var(--spacing-xl)));
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
--sidebar-width: 0px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function m(c,s=[]){const n=Array.from({length:s.length},()=>new Set),r=decodeURIComponent(c);if(!r)return n;const o=r.split(
|
|
1
|
+
function m(c,s=[]){const n=Array.from({length:s.length},()=>new Set),r=decodeURIComponent(c);if(!r)return n;const o=r.split(/(?<!\s)\s+(?:AND|OR)\s+|\(|\)/).reduce((t,e)=>{const l=e.trim();return l.length>0&&t.push(l),t},[]);for(const t of o){const e=Math.max(t.indexOf(":"),t.indexOf("~"));if(e===-1)continue;const l=t.slice(0,e);let a=t.slice(e+1);const i=s.findIndex(f=>f.property===l);if(i===-1)continue;if(s[i].type==="date-range"&&a.includes("..")){const[f,u]=a.split("..");n[i]={from:f,to:u}}else{const f=d(a.toLowerCase()),u=n[i]instanceof Set?n[i]:new Set;f.forEach(p=>u.add(p))}}return n}function d(c){const s=[];let n="",r=!1,o="";for(let t=0;t<c.length;t++){const e=c[t];!r&&(e==='"'||e==="'")?(r=!0,o=e):r&&e===o?(r=!1,o=""):!r&&e===","?(s.push(n.trim()),n=""):n+=e}return n.trim()&&s.push(n.trim()),s.map(t=>t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t)}export{m as parseFilterQuery};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Version } from '@redocly/config';
|
|
2
|
+
type VersionedItem = {
|
|
3
|
+
version?: string;
|
|
4
|
+
isDefault?: boolean;
|
|
5
|
+
versionFolderId?: string;
|
|
6
|
+
link?: string;
|
|
7
|
+
} & {
|
|
8
|
+
[key in (typeof CHILDREN_KEYS)[number]]?: VersionedItem[];
|
|
9
|
+
};
|
|
10
|
+
declare const CHILDREN_KEYS: readonly ['items', 'menu'];
|
|
2
11
|
/**
|
|
3
12
|
* Filters the sidebar items based on the active version.
|
|
4
13
|
*
|
|
@@ -22,5 +31,6 @@ import type { ResolvedNavItem, Version } from '@redocly/config';
|
|
|
22
31
|
* - if the active version name doesn't exist in its own folder, that folder
|
|
23
32
|
* falls back to its default version
|
|
24
33
|
*/
|
|
25
|
-
export declare function filterOutVersionedItems(items:
|
|
34
|
+
export declare function filterOutVersionedItems<T extends VersionedItem>(items: T[], activeVersion?: Version | null, versionNamesByFolderId?: Record<string, Set<string>>): T[];
|
|
35
|
+
export {};
|
|
26
36
|
//# sourceMappingURL=filter-out-versioned-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const l=["items","menu"];function u(r,e,i={}){for(const n of r)n.versionFolderId&&n.version&&(i[n.versionFolderId]=i[n.versionFolderId]??new Set).add(n.version);const s=[];for(const n of r){if(n.version!=null&&!(!e||n.versionFolderId!==e.folderId?n.isDefault:n.versionFolderId&&i[n.versionFolderId]?.has(e.version)?n.version===e.version:n.isDefault))continue;const o=l.find(f=>Array.isArray(n[f]));if(o===void 0){s.push(n);continue}const t=n[o]??[],d=u(t,e,i);d.length===0&&t.length>0&&!n.link||s.push({...n,[o]:d})}return s}export{u as filterOutVersionedItems};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolvedNavItem, ResolvedTab, ResolvedTabMenuEntry, Version } from '@redocly/config';
|
|
2
|
+
export type ResolvedNavigationTabs = {
|
|
3
|
+
tabs: ResolvedTab[];
|
|
4
|
+
activeTab?: ResolvedTab;
|
|
5
|
+
activeMenuEntry?: ResolvedTabMenuEntry;
|
|
6
|
+
};
|
|
7
|
+
export declare function resolveNavigationTabs({ tabs, pathname, activeVersion, }: {
|
|
8
|
+
tabs: ResolvedTab[];
|
|
9
|
+
pathname: string;
|
|
10
|
+
activeVersion?: Version | null;
|
|
11
|
+
}): ResolvedNavigationTabs;
|
|
12
|
+
export declare function navigationTabSidebarItems(navigationTabs: ResolvedNavigationTabs): ResolvedNavItem[];
|
|
13
|
+
export declare function flattenTabItems(tabs: ResolvedTab[]): ResolvedNavItem[];
|
|
14
|
+
//# sourceMappingURL=navigation-tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withPathPrefix as a}from"@redocly/theme/core/utils";import{removeTrailingSlash as c}from"../../utils/url/remove-trailing-slash";import{isAbsoluteUrl as l}from"../../utils/url/is-absolute-url";import{filterOutVersionedItems as d}from"./filter-out-versioned-items";function w({tabs:e,pathname:t,activeVersion:n}){const i=d(e,n),r=p(i,t);return{tabs:i,activeTab:r?.tab,activeMenuEntry:r?.menuEntry}}function E(e){if(e.activeTab)return e.activeMenuEntry?.items??e.activeTab.items??[];const t=b(e.tabs);return t?.menuEntry?.items??t?.tab.items??[]}function M(e){return e.flatMap(t=>t.menu?t.menu.flatMap(n=>[n,...n.items]):[{...t,type:"group"},...t.items??[]])}function p(e,t){const n=u(t);return s({tabs:e,pathname:n,routeKey:"routeSlug"})??s({tabs:e,pathname:n,routeKey:"link"})}function b(e){const t=e[0];if(t)return t.menu?{tab:t,menuEntry:t.menu[0]}:{tab:t}}function u(e){return decodeURIComponent(c(e))||"/"}function s({tabs:e,pathname:t,routeKey:n}){const i=r=>f(r.link,t)||m({items:r.items,pathname:t,routeKey:n});for(const r of e)if(r.menu){const o=r.menu.find(i);if(o)return{tab:r,menuEntry:o}}else if(i(r))return{tab:r}}function f(e,t){return!e||l(e)?!1:u(a(e.split("#")[0]))===t}function m({items:e,pathname:t,routeKey:n}){return(e??[]).some(i=>f(i[n],t)||m({items:i.items,pathname:t,routeKey:n}))}export{M as flattenTabItems,E as navigationTabSidebarItems,w as resolveNavigationTabs};
|