@redocly/framework 1.0.0-next.1 → 1.0.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler/build/output-metadata.js +1 -1
- package/dist/bundler/build/run.js +1 -1
- package/dist/bundler/build/theme-global-style-compiler.js +1 -0
- package/dist/bundler/build/theme-global-stylesheets.js +1 -0
- package/dist/bundler/build/vite-config.js +2 -2
- package/dist/bundler/dev/dev-content-build.js +1 -0
- package/dist/bundler/dev/dev-problems.js +1 -1
- package/dist/bundler/dev/dev-reporter.js +1 -1
- package/dist/bundler/dev/routes/dev-content-build-route.js +1 -0
- package/dist/bundler/dev/routes/dev-problems-route.js +1 -1
- package/dist/bundler/dev/run.js +1 -1
- package/dist/bundler/dev/runtime-app.js +1 -1
- package/dist/bundler/dev/vite-config.js +1 -1
- package/dist/bundler/node-bundle.js +1 -0
- package/dist/bundler/runtime-files.js +1 -1
- package/dist/bundler/user-markdoc-schema.js +1 -1
- package/dist/bundler/vite-config.base.js +12 -12
- package/dist/cli/api-docs-build-event.js +1 -0
- package/dist/cli/commands/build.js +1 -1
- package/dist/cli/commands/ingest.js +1 -1
- package/dist/cli/commands/translate.js +1 -1
- package/dist/cli/dev-console/{sweep.js → content-build.js} +1 -1
- package/dist/cli/dev-console/index.js +1 -1
- package/dist/cli/dev-console/lines.js +2 -2
- package/dist/cli/dev-console/plain.js +1 -1
- package/dist/cli/dev-console/tui.js +2 -2
- package/dist/cli/output.js +12 -12
- package/dist/cli/validate-react-pages.js +1 -1
- package/dist/client/ApiAccess.js +3 -0
- package/dist/client/NavigationProgress.js +1 -1
- package/dist/client/ProductsProvider.js +1 -1
- package/dist/client/RouteErrorBoundary.js +1 -1
- package/dist/client/RuntimeLink.js +1 -0
- package/dist/client/ThemeGlobalStyle.js +1 -0
- package/dist/client/UnversionedVersionButton.js +1 -1
- package/dist/client/app.js +2 -7
- package/dist/client/client-entry.js +1 -1
- package/dist/client/dev-problems/ProblemsBar.js +75 -15
- package/dist/client/dev-problems/ProblemsModal.js +15 -15
- package/dist/client/dev-problems/build-segment.js +1 -0
- package/dist/client/dev-problems/index.js +1 -1
- package/dist/client/dev-problems/use-dev-problems.js +1 -1
- package/dist/client/experiments/runtime.js +1 -1
- package/dist/client/history-mount.js +1 -0
- package/dist/client/l10n/use-l10n-config.js +1 -1
- package/dist/client/l10n/use-l10n-href.js +1 -1
- package/dist/client/l10n/use-translate.js +1 -1
- package/dist/client/products.js +1 -1
- package/dist/client/review/ReviewBar.js +163 -69
- package/dist/client/review/login-url.js +1 -0
- package/dist/client/revisions-history.js +1 -1
- package/dist/client/sidebar/PoweredByRedocly.js +2 -2
- package/dist/client/ssr.js +1 -1
- package/dist/client/telemetry/report-preload-failure.js +1 -0
- package/dist/client/templates/dev-login.js +4 -4
- package/dist/client/templates/unauthorized.js +5 -5
- package/dist/client/theme-global-css.js +1 -0
- package/dist/client/use-banner.js +1 -1
- package/dist/client/use-bar-position.js +1 -0
- package/dist/client/use-page-versions.js +1 -1
- package/dist/client/use-router-for-local-links.js +1 -1
- package/dist/client/use-search.js +1 -1
- package/dist/client/utils/routes/is-router-path.js +1 -0
- package/dist/client/webmcp/tools/shared.js +1 -1
- package/dist/content-layer/allowed-packages.js +1 -1
- package/dist/content-layer/api-outputs.js +1 -1
- package/dist/content-layer/config-schema.d.ts +12 -3
- package/dist/content-layer/config-schema.js +1 -1
- package/dist/content-layer/config.d.ts +30 -12
- package/dist/content-layer/config.js +1 -1
- package/dist/content-layer/context.d.ts +2 -0
- package/dist/content-layer/context.js +1 -1
- package/dist/content-layer/database/adapters/node-sqlite-client.js +1 -1
- package/dist/content-layer/database/assets.js +1 -1
- package/dist/content-layer/database/blobs.js +1 -1
- package/dist/content-layer/database/connection.js +1 -1
- package/dist/content-layer/database/entity-store.d.ts +24 -3
- package/dist/content-layer/database/entity-store.js +1 -1
- package/dist/content-layer/database/files.js +1 -1
- package/dist/content-layer/database/finalize.js +1 -1
- package/dist/content-layer/database/invalidation.d.ts +6 -0
- package/dist/content-layer/database/invalidation.js +26 -26
- package/dist/content-layer/database/link-refs.js +1 -1
- package/dist/content-layer/database/origins.d.ts +2 -4
- package/dist/content-layer/database/origins.js +1 -1
- package/dist/content-layer/database/problems.d.ts +2 -0
- package/dist/content-layer/database/problems.js +1 -1
- package/dist/content-layer/database/reset.js +1 -1
- package/dist/content-layer/database/route-query-deps.js +1 -1
- package/dist/content-layer/database/schema.d.ts +50 -0
- package/dist/content-layer/database/schema.js +1 -1
- package/dist/content-layer/database/search-vocab.js +2 -2
- package/dist/content-layer/database/site-config.d.ts +23 -0
- package/dist/content-layer/database/site-config.js +1 -1
- package/dist/content-layer/database/static-files.js +1 -1
- package/dist/content-layer/ingest/extract-all-phase.js +1 -1
- package/dist/content-layer/ingest/finalize-phase.js +1 -1
- package/dist/content-layer/ingest/git-last-modified.js +3 -3
- package/dist/content-layer/ingest/hash.js +1 -1
- package/dist/content-layer/ingest/hook-inputs.js +1 -1
- package/dist/content-layer/ingest/l10n-warnings.js +1 -1
- package/dist/content-layer/ingest/markdoc-schema-problem.js +1 -0
- package/dist/content-layer/ingest/rbac-teams.js +1 -1
- package/dist/content-layer/ingest/run.js +1 -1
- package/dist/content-layer/ingest/scan.d.ts +1 -1
- package/dist/content-layer/ingest/scan.js +1 -1
- package/dist/content-layer/ingest/search-sync.js +1 -1
- package/dist/content-layer/ingest/slugger/resolve-final-slugs.js +1 -1
- package/dist/content-layer/ingest/sync.js +1 -1
- package/dist/content-layer/link-checker/delta.js +1 -1
- package/dist/content-layer/link-checker/fingerprint.js +1 -1
- package/dist/content-layer/link-checker/load-view.js +1 -1
- package/dist/content-layer/link-checker/run-build.js +1 -1
- package/dist/content-layer/link-checker/validate.js +1 -1
- package/dist/content-layer/link-checker/view.js +1 -1
- package/dist/content-layer/loaders/context.js +1 -1
- package/dist/content-layer/loaders/define.d.ts +3 -0
- package/dist/content-layer/markdown/client/JsonSchemaTag.js +1 -1
- package/dist/content-layer/markdown/client/OpenapiTagComponents.js +2 -2
- package/dist/content-layer/markdown/client/code-highlight-notation.js +3 -3
- package/dist/content-layer/markdown/client/dynamic-components.js +1 -1
- package/dist/content-layer/markdown/client/markdoc-components.js +2 -2
- package/dist/content-layer/markdown/constants/builtin-tags.js +1 -1
- package/dist/content-layer/markdown/constants/markdown-text-tag-set.js +1 -1
- package/dist/content-layer/markdown/constants/tag-sets.d.ts +20 -5
- package/dist/content-layer/markdown/constants/tag-sets.js +1 -1
- package/dist/content-layer/markdown/nodes/fence.js +1 -1
- package/dist/content-layer/markdown/nodes/heading.js +1 -1
- package/dist/content-layer/markdown/nodes/table.js +1 -1
- package/dist/content-layer/markdown/resolve/ast.js +1 -1
- package/dist/content-layer/markdown/resolve/attribute-resolver-key.d.ts +8 -1
- package/dist/content-layer/markdown/resolve/attribute-resolver-key.js +1 -1
- package/dist/content-layer/markdown/resolve/audience-tag.d.ts +2 -6
- package/dist/content-layer/markdown/resolve/audience-tag.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/code-snippet.js +5 -4
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/code-walkthrough/filesets.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/diagram-file.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/file-reference.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/json-schema.d.ts +2 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/json-schema.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/operation-samples.d.ts +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/operation-samples.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/partial.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/svg-content.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc.d.ts +2 -1
- package/dist/content-layer/markdown/resolve/markdoc.js +1 -1
- package/dist/content-layer/markdown/resolve/raw-partials.d.ts +2 -1
- package/dist/content-layer/markdown/resolve/raw-partials.js +1 -1
- package/dist/content-layer/markdown/resolve/references.d.ts +3 -1
- package/dist/content-layer/markdown/resolve/references.js +1 -1
- package/dist/content-layer/markdown/resolve/render-diagrams.d.ts +8 -1
- package/dist/content-layer/markdown/resolve/render-diagrams.js +1 -1
- package/dist/content-layer/markdown/search/to-markdown.js +2 -2
- package/dist/content-layer/markdown/search/to-sections.d.ts +8 -3
- package/dist/content-layer/markdown/search/to-sections.js +1 -1
- package/dist/content-layer/markdown/search/to-text.d.ts +4 -1
- package/dist/content-layer/markdown/search/to-text.js +5 -5
- package/dist/content-layer/markdown/server/render.d.ts +4 -2
- package/dist/content-layer/markdown/server/render.js +1 -1
- package/dist/content-layer/markdown/service.js +1 -1
- package/dist/content-layer/markdown/tags/html.d.ts +5 -2
- package/dist/content-layer/markdown/tags/html.js +1 -1
- package/dist/content-layer/markdown/tags/markdoc-error.d.ts +8 -0
- package/dist/content-layer/markdown/tags/markdoc-error.js +1 -1
- package/dist/content-layer/markdown/tags/openapi.d.ts +1 -1
- package/dist/content-layer/markdown/tags/openapi.js +1 -1
- package/dist/content-layer/markdown/tags/partial.d.ts +9 -3
- package/dist/content-layer/markdown/tags/partial.js +1 -1
- package/dist/content-layer/markdown/tags/variant.d.ts +6 -0
- package/dist/content-layer/markdown/tags/variant.js +1 -0
- package/dist/content-layer/markdown/types/service.d.ts +6 -0
- package/dist/content-layer/markdown/utils/collect-anchors.js +1 -1
- package/dist/content-layer/markdown/utils/collect-headings.d.ts +3 -1
- package/dist/content-layer/markdown/utils/collect-headings.js +1 -1
- package/dist/content-layer/markdown/utils/first-heading.js +1 -1
- package/dist/content-layer/markdown/utils/heading-slugger.d.ts +8 -0
- package/dist/content-layer/markdown/utils/heading-slugger.js +1 -1
- package/dist/content-layer/markdown/utils/node-source-range.d.ts +3 -3
- package/dist/content-layer/markdown/utils/node-source-range.js +1 -1
- package/dist/content-layer/markdown/utils/parse-cache.js +1 -1
- package/dist/content-layer/markdown/utils/reparse-example-fences.d.ts +4 -1
- package/dist/content-layer/markdown/utils/reparse-example-fences.js +1 -1
- package/dist/content-layer/markdown/utils/substitute-variables.js +1 -1
- package/dist/content-layer/markdown/utils/walk-markdoc-ast.d.ts +2 -2
- package/dist/content-layer/markdown/utils/walk-markdoc-ast.js +1 -1
- package/dist/content-layer/materialization/asset-reconcile.js +1 -1
- package/dist/content-layer/materialization/entity.js +1 -1
- package/dist/content-layer/materialization/materializer.js +1 -0
- package/dist/content-layer/materialization/static-files.js +1 -1
- package/dist/content-layer/plan-gates.d.ts +3 -2
- package/dist/content-layer/plan-gates.js +1 -1
- package/dist/content-layer/plugins/execute.js +1 -1
- package/dist/content-layer/plugins/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/client/event-handlers.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/client/rebase-item-links.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/client/template.js +12 -4
- package/dist/content-layer/plugins/internal/api-docs/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/build-definition.d.ts +28 -13
- package/dist/content-layer/plugins/internal/api-docs/server/build-definition.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/build-sidebar.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/declares-proto-service.d.ts +2 -0
- package/dist/content-layer/plugins/internal/api-docs/server/declares-proto-service.js +3 -0
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-copy.d.ts +14 -0
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-copy.js +23 -0
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-decorator.d.ts +1 -4
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-decorator.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/options.d.ts +4 -2
- package/dist/content-layer/plugins/internal/api-docs/server/options.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/search-documents.d.ts +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/search-documents.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/spec-download.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/server/access.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/server/api-function-telemetry.js +1 -0
- package/dist/content-layer/plugins/internal/api-functions/server/dispatch.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/banner.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/index.d.ts +1 -1
- package/dist/content-layer/plugins/internal/app-data/index.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/products.d.ts +2 -0
- package/dist/content-layer/plugins/internal/app-data/products.js +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/client/catalog-filtering.js +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/index.js +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/resolve-items.d.ts +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/resolve-items.js +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/sidebars.d.ts +1 -1
- package/dist/content-layer/plugins/internal/index.js +1 -1
- package/dist/content-layer/plugins/internal/l10n/index.js +1 -1
- package/dist/content-layer/plugins/internal/l10n/translations-loader.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/client/template.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/index.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/server/shared.d.ts +1 -1
- package/dist/content-layer/plugins/internal/mcp/constants.d.ts +20 -0
- package/dist/content-layer/plugins/internal/mcp/constants.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/content-tools.d.ts +4 -1
- package/dist/content-layer/plugins/internal/mcp/content-tools.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/index.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/agent-card.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/audit.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/auth.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/code-credentials.js +2 -2
- package/dist/content-layer/plugins/internal/mcp/server/codemode/capabilities.js +6 -6
- package/dist/content-layer/plugins/internal/mcp/server/codemode/constants.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/codemode/discover.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/codemode/execute-schema.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/codemode/index.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/codemode/prompts.js +8 -8
- package/dist/content-layer/plugins/internal/mcp/server/config-gate.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/custom-tools.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/allowed-http-methods.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/api-call-operations.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/call-api.js +2 -0
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/form-page.js +10 -10
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/outcome-pages.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/elicitation.js +7 -6
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/allowed-hosts.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/fetch-bridge.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/fetch-errors.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/ssrf-guard.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/upstream-detail.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/index.js +3 -3
- package/dist/content-layer/plugins/internal/mcp/server/gateway/secret-store.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/tool-list.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/gateway/tools.js +4 -4
- package/dist/content-layer/plugins/internal/mcp/server/gateway/upstream-auth-scheme.js +2 -2
- package/dist/content-layer/plugins/internal/mcp/server/handler.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/mcp-server.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/mcp-telemetry.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/authorize.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/discovery.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/rate-limit.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/server-card.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/skills-resources.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/graphql-catalog.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-catalog.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-document.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-refs.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/pages-navigation.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/pages.js +2 -2
- package/dist/content-layer/plugins/internal/mcp/server/tools/schemas.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/workflows/catalog.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/document-resolver.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/operations-subset.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/resolve-workflows.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/run-workflow.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/schemas.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/tools.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/types.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/workflows/workflow-references.js +1 -0
- package/dist/content-layer/plugins/internal/mock/server/handler.js +1 -1
- package/dist/content-layer/plugins/internal/react-page/index.d.ts +3 -2
- package/dist/content-layer/plugins/internal/react-page/index.js +1 -1
- package/dist/content-layer/plugins/internal/scorecard-classic/client/Grid.js +11 -11
- package/dist/content-layer/plugins/internal/scorecard-classic/client/ScorecardViews.js +1 -1
- package/dist/content-layer/plugins/internal/scorecard-classic/client/ScorecardWidgets.js +7 -7
- package/dist/content-layer/plugins/internal/scorecard-classic/client/template.js +2 -2
- package/dist/content-layer/plugins/internal/sidebar/bundle.d.ts +18 -17
- package/dist/content-layer/plugins/internal/sidebar/bundle.js +1 -1
- package/dist/content-layer/plugins/internal/sidebar/index.d.ts +5 -3
- package/dist/content-layer/plugins/internal/sidebar/index.js +2 -2
- package/dist/content-layer/plugins/internal/sidebar/subtree.js +1 -1
- package/dist/content-layer/plugins/internal/skills/index.js +1 -1
- package/dist/content-layer/plugins/internal/skills/server/routes.js +1 -1
- package/dist/content-layer/plugins/internal/versions/index.js +1 -1
- package/dist/content-layer/plugins/project/load.js +2 -2
- package/dist/content-layer/plugins/registry.js +1 -1
- package/dist/content-layer/plugins/request-context.d.ts +5 -0
- package/dist/content-layer/plugins/types/api-entity.d.ts +2 -6
- package/dist/content-layer/plugins/types/api-entity.js +1 -1
- package/dist/content-layer/plugins/types/markdoc.d.ts +2 -0
- package/dist/content-layer/plugins/types/plugin.d.ts +13 -0
- package/dist/content-layer/plugins/types/search.d.ts +14 -3
- package/dist/content-layer/plugins/utils/link-access.d.ts +2 -0
- package/dist/content-layer/plugins/utils/link-access.js +1 -1
- package/dist/content-layer/plugins/utils/route-index.d.ts +1 -1
- package/dist/content-layer/plugins/utils/route-index.js +1 -1
- package/dist/content-layer/plugins/utils/sidebar-label.d.ts +4 -1
- package/dist/content-layer/plugins/utils/sidebar-label.js +1 -1
- package/dist/content-layer/plugins/utils/version-path.js +1 -1
- package/dist/content-layer/plugins/work-time.js +1 -0
- package/dist/content-layer/problems/codes.d.ts +10 -0
- package/dist/content-layer/problems/codes.js +1 -1
- package/dist/content-layer/revisions/config.js +1 -1
- package/dist/content-layer/revisions/delete.js +1 -1
- package/dist/content-layer/search/engine/core/content-parser.js +1 -1
- package/dist/content-layer/search/engine/core/search-engine.js +1 -1
- package/dist/content-layer/search/facet-rows.js +1 -1
- package/dist/content-layer/search/keywords.d.ts +18 -0
- package/dist/content-layer/search/keywords.js +1 -0
- package/dist/content-layer/search/postings/fragment-field.d.ts +2 -0
- package/dist/content-layer/search/postings/fragment-field.js +1 -1
- package/dist/content-layer/search/postings/postings-store.d.ts +14 -0
- package/dist/content-layer/search/postings/postings-store.js +1 -1
- package/dist/content-layer/search/store.d.ts +14 -1
- package/dist/content-layer/server/context.js +1 -1
- package/dist/content-layer/server/database.js +1 -1
- package/dist/content-layer/server/materialize.js +1 -1
- package/dist/content-layer/static/audience.js +1 -1
- package/dist/content-layer/static/registry.js +1 -1
- package/dist/content-layer/templates/template-set.js +1 -1
- package/dist/content-layer/versions/group-info.d.ts +21 -0
- package/dist/content-layer/versions/group-info.js +1 -0
- package/dist/content-layer/versions/redirect.d.ts +24 -17
- package/dist/content-layer/versions/redirect.js +1 -1
- package/dist/content-layer/versions/resolve.d.ts +1 -21
- package/dist/content-layer/versions/resolve.js +1 -1
- package/dist/content-layer/versions/version-groups.d.ts +5 -1
- package/dist/content-layer/versions/version-groups.js +1 -1
- package/dist/plugin-api.d.ts +3 -0
- package/dist/plugin-api.js +1 -1
- package/dist/server/analytics-tags.js +1 -1
- package/dist/server/app.js +3 -3
- package/dist/server/ask-ai/feature-gate.js +1 -1
- package/dist/server/ask-ai/route.js +1 -1
- package/dist/server/auth/access-config.js +1 -1
- package/dist/server/auth/gate.js +1 -1
- package/dist/server/auth/middleware.js +1 -1
- package/dist/server/auth/oidc.js +1 -1
- package/dist/server/auth/request.js +1 -1
- package/dist/server/auth/routes.js +1 -1
- package/dist/server/auth/runtime.js +1 -1
- package/dist/server/content-assets/access.js +1 -1
- package/dist/server/content.js +14 -13
- package/dist/server/feedback/route.js +1 -1
- package/dist/server/html-tags.js +2 -1
- package/dist/server/lambda-entry.js +1 -1
- package/dist/server/llms-txt.js +1 -1
- package/dist/server/manifest-assets.js +2 -2
- package/dist/server/metrics/request-metrics.js +1 -1
- package/dist/server/node-entry.js +1 -1
- package/dist/server/page-handlers.js +1 -1
- package/dist/server/plugin-context.js +1 -1
- package/dist/server/plugin-routes.js +1 -1
- package/dist/server/public-url.js +1 -0
- package/dist/server/rbac/content-asset-access.js +1 -1
- package/dist/server/redirects.js +1 -1
- package/dist/server/replay-oauth2/route.js +1 -1
- package/dist/server/review/route.js +1 -1
- package/dist/server/runtime-config.js +1 -1
- package/dist/server/search/cache.js +1 -0
- package/dist/server/search/route.js +1 -1
- package/dist/server/search/search-telemetry.js +1 -0
- package/dist/server/seo-tags.js +2 -2
- package/dist/server/ssrf/ssrf-blocklist.js +1 -1
- package/dist/server/static-files/serve.js +1 -1
- package/dist/server/subprocess/runner.js +1 -1
- package/dist/server/telemetry/mock-server-events.js +1 -0
- package/dist/server/telemetry/redirect-event.js +1 -0
- package/dist/server/telemetry/route.js +1 -1
- package/dist/server/telemetry/sender.js +1 -1
- package/dist/server/telemetry/server-events.js +1 -1
- package/dist/server/template-ids.js +1 -1
- package/dist/shared/constants/api-spec-kinds.d.ts +7 -0
- package/dist/shared/constants/api-spec-kinds.js +1 -0
- package/dist/shared/constants/content-update.js +1 -1
- package/dist/shared/constants/dependency-pack.js +1 -1
- package/dist/shared/constants/dev-content-build.js +1 -0
- package/dist/shared/constants/dev-problems.js +1 -1
- package/dist/shared/constants/dev-source-sync.js +1 -1
- package/dist/shared/constants/l10n/langs/ar.js +1 -1
- package/dist/shared/constants/l10n/langs/de.js +1 -1
- package/dist/shared/constants/l10n/langs/en.js +1 -1
- package/dist/shared/constants/l10n/langs/es.js +1 -1
- package/dist/shared/constants/l10n/langs/fr.js +1 -1
- package/dist/shared/constants/l10n/langs/hi.js +1 -1
- package/dist/shared/constants/l10n/langs/it.js +1 -1
- package/dist/shared/constants/l10n/langs/ja.js +1 -1
- package/dist/shared/constants/l10n/langs/ko.js +1 -1
- package/dist/shared/constants/l10n/langs/pl.js +1 -1
- package/dist/shared/constants/l10n/langs/pt-br.js +1 -1
- package/dist/shared/constants/l10n/langs/pt.js +1 -1
- package/dist/shared/constants/l10n/langs/ru.js +1 -1
- package/dist/shared/constants/l10n/langs/uk.js +1 -1
- package/dist/shared/constants/l10n/langs/zh.js +1 -1
- package/dist/shared/constants/manifest-version.d.ts +3 -1
- package/dist/shared/constants/openapi-operation-methods.d.ts +2 -0
- package/dist/shared/constants/openapi-operation-methods.js +1 -0
- package/dist/shared/constants/review.d.ts +5 -0
- package/dist/shared/constants/review.js +1 -1
- package/dist/{server → shared}/constants/system-routes.d.ts +1 -1
- package/dist/shared/constants/system-routes.js +1 -0
- package/dist/shared/constants/versions.d.ts +2 -0
- package/dist/shared/constants/versions.js +1 -1
- package/dist/shared/experiments.js +1 -1
- package/dist/shared/load-dot-env.js +1 -1
- package/dist/shared/plan-gates.d.ts +9 -3
- package/dist/shared/plan-gates.js +1 -1
- package/dist/shared/products.js +1 -1
- package/dist/shared/project-env.d.ts +12 -0
- package/dist/shared/project-env.js +1 -0
- package/dist/shared/public-env.d.ts +9 -0
- package/dist/shared/public-env.js +1 -1
- package/dist/{server → shared}/rbac/api-docs.d.ts +3 -2
- package/dist/shared/rbac/api-docs.js +1 -0
- package/dist/{server → shared}/rbac/engine.d.ts +13 -10
- package/dist/shared/rbac/engine.js +0 -0
- package/dist/{server → shared}/rbac/filter.d.ts +2 -0
- package/dist/shared/rbac/filter.js +1 -0
- package/dist/{server → shared}/rbac/l10n-rules.d.ts +1 -1
- package/dist/shared/rbac/l10n-rules.js +1 -0
- package/dist/{server → shared}/rbac/route-scope.d.ts +1 -1
- package/dist/shared/rbac/route-scope.js +1 -0
- package/dist/{server → shared}/rbac/team-templates.d.ts +6 -2
- package/dist/shared/rbac/team-templates.js +1 -0
- package/dist/{server → shared}/rbac/teams.d.ts +1 -1
- package/dist/shared/rbac/types.js +1 -0
- package/dist/shared/search/facets.d.ts +5 -0
- package/dist/shared/search/facets.js +1 -1
- package/dist/shared/types/auth.d.ts +1 -0
- package/dist/shared/types/config.d.ts +5 -0
- package/dist/shared/types/search.d.ts +8 -2
- package/dist/shared/types/sidebar.d.ts +1 -0
- package/dist/shared/utils/l10n.js +1 -1
- package/dist/shared/utils/redirect-match.js +1 -0
- package/dist/shared/utils/routes/markdown-copy-url.js +1 -0
- package/drizzle/20261103061150_site_config_effective_hash/migration.sql +1 -0
- package/drizzle/20261105151816_search_http_path_tokens/migration.sql +1 -0
- package/drizzle/20261111152552_page_markdown_rbac_scope/migration.sql +1 -0
- package/package.json +37 -13
- package/dist/bundler/dev/__tests__/reset-content-update-state.js +0 -1
- package/dist/bundler/dev/materialization-sweeper.js +0 -1
- package/dist/client/dev-problems/sweep-segment.js +0 -1
- package/dist/client/review/use-bar-position.js +0 -1
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-docs.d.ts +0 -5
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-docs.js +0 -26
- package/dist/content-layer/plugins/internal/mcp/server/gateway/__tests__/fake-kv.js +0 -1
- package/dist/content-layer/server/config.js +0 -1
- package/dist/server/__tests__/rbac-fixture.js +0 -1
- package/dist/server/__tests__/test-session.js +0 -1
- package/dist/server/constants/system-routes.js +0 -1
- package/dist/server/rbac/api-docs.js +0 -1
- package/dist/server/rbac/engine.js +0 -0
- package/dist/server/rbac/filter.js +0 -1
- package/dist/server/rbac/l10n-rules.js +0 -1
- package/dist/server/rbac/route-scope.js +0 -1
- package/dist/server/rbac/team-templates.js +0 -1
- package/dist/server/rbac/types.js +0 -1
- package/dist/shared/utils/routes/markdown-path.js +0 -1
- /package/dist/{server → shared}/rbac/entity-scope.js +0 -0
- /package/dist/{server → shared}/rbac/teams.js +0 -0
- /package/dist/{server → shared}/rbac/types.d.ts +0 -0
- /package/dist/{content-layer/markdown → shared}/utils/packed-ast.d.ts +0 -0
- /package/dist/{content-layer/markdown → shared}/utils/packed-ast.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{withPathPrefix as e,withPathPrefixForSrcSet as t}from"../../../shared/path-prefix.js";import{isRouterPath as n}from"../../../client/utils/routes/is-router-path.js";import{resolveRelativeHref as r}from"../../../client/utils/routes/resolve-relative-href.js";import*as i from"react";import a from"styled-components";import{Link as o,useLocation as s}from"react-router";import{dynamic as c}from"@redocly/theme/core/utils";import{jsx as l}from"react/jsx-runtime";import{CodeSnippetProvider as u,PageActionsContext as ee}from"@redocly/theme/core/contexts";import{Accordion as te}from"@redocly/theme/markdoc/components/Accordion/Accordion";import{AccordionGroup as d}from"@redocly/theme/markdoc/components/Accordion/AccordionGroup";import{Admonition as f}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{Card as p}from"@redocly/theme/markdoc/components/Cards/Card";import{Cards as m}from"@redocly/theme/markdoc/components/Cards/Cards";import{CodeBlock as h}from"@redocly/theme/markdoc/components/CodeBlock/CodeBlock";import{CodeGroup as g}from"@redocly/theme/markdoc/components/CodeGroup/CodeGroup";import{CodeStep as _}from"@redocly/theme/markdoc/components/CodeWalkthrough/CodeStep";import{CodeToggle as v}from"@redocly/theme/markdoc/components/CodeWalkthrough/CodeToggle";import{CodeWalkthrough as y}from"@redocly/theme/markdoc/components/CodeWalkthrough/CodeWalkthrough";import{ConnectMCP as ne}from"@redocly/theme/markdoc/components/ConnectMCP/ConnectMCP";import{Diagram as re}from"@redocly/theme/markdoc/components/Diagram/Diagram";import{Experiment as ie}from"@redocly/theme/components/Experiment/Experiment";import{Variant as b}from"@redocly/theme/components/Experiment/Variant";import{Heading as x}from"@redocly/theme/markdoc/components/Heading/Heading";import{Input as S}from"@redocly/theme/markdoc/components/CodeWalkthrough/Input";import{Icon as C}from"@redocly/theme/markdoc/components/Icon/Icon";import{Image as w}from"@redocly/theme/markdoc/components/Image/Image";import{InlineSvg as T}from"@redocly/theme/markdoc/components/InlineSvg/InlineSvg";import{LoginButton as E}from"@redocly/theme/markdoc/components/LoginButton/LoginButton";import{MarkdocExample as D}from"@redocly/theme/markdoc/components/MarkdocExample/MarkdocExample";import{NumberedItem as O}from"@redocly/theme/markdoc/components/NumberedList/NumberedItem";import{NumberedList as k}from"@redocly/theme/markdoc/components/NumberedList/NumberedList";import{Prompt as A}from"@redocly/theme/markdoc/components/Prompt/Prompt";import{Tabs as j}from"@redocly/theme/markdoc/components/Tabs/Tabs";import{TabItemFragment as M}from"@redocly/theme/markdoc/components/Tabs/TabItemFragment";import{Markdown as N}from"@redocly/theme/components/Markdown/Markdown";import{SearchAiCitation as P}from"@redocly/theme/components/Search/SearchAiCitation";import F from"@redocly/markdoc/dist/react.js";import{useL10nHref as I}from"virtual:realm-runtime";import{userMarkdocComponents as L}from"virtual:realm-markdoc-components";const R=t=>typeof t==`string`?e(t):void 0,ae=e=>typeof e==`string`?t(e):void 0,z=e=>/^(https?:|\/\/)/.test(e);function B(e){let t=I(),{pathname:i}=s();if(!e||z(e)||e.startsWith(`mailto:`))return{kind:`external`,href:e};let a=r(e,i);return n(a)?{kind:`page`,href:t(a)}:{kind:`file`,href:a}}function V({href:t,children:n,...r}){let i=B(t);if(i.kind===`external`){let e=t&&z(t)?`_blank`:void 0;return/* @__PURE__ */ l(`a`,{href:t,target:e,...r,rel:typeof r.rel==`string`?r.rel:`noreferrer`,children:n})}return i.kind===`file`?/* @__PURE__ */ l(`a`,{href:e(i.href),...r,children:n}):/* @__PURE__ */ l(o,{to:i.href,...r,children:n})}function H(e){return function({href:t,...n}){return/* @__PURE__ */ l(e,{...n,href:B(t).href})}}const{MarkdownLink:U,...W}=L;function G({src:e,srcSet:t,...n}){return/* @__PURE__ */ l(w,{...n,src:R(e),srcSet:ae(t)})}let K=Promise.resolve();function q(){return K}function J(e,t){return new Promise(n=>{t&&(e.addEventListener(`load`,()=>n()),e.addEventListener(`error`,()=>n())),document.body.appendChild(e),t||n()})}function Y({src:e,children:t,...n}){return i.useEffect(()=>{let r=typeof e==`string`?e:void 0;if(r&&document.querySelector(`script[src="${CSS.escape(r)}"]`))return;let a=document.createElement(`script`);r?a.src=r:t!=null&&(a.textContent=i.Children.toArray(t).join(``));for(let[e,t]of Object.entries(n))(typeof t==`string`||typeof t==`boolean`)&&a.setAttribute(e,String(t));r&&n.async?J(a,!0):K=K.then(()=>J(a,!!r))},[e]),null}function X({image:e,icon:t,...n}){return/* @__PURE__ */ l(p,{...n,image:R(e),icon:R(t)})}const oe=a.span.attrs({role:`alert`,"data-component-name":`MarkdocInlineError`})`
|
|
2
2
|
display: inline;
|
|
3
3
|
padding: 0 var(--spacing-xs);
|
|
4
4
|
border: var(--admonition-danger-border);
|
|
@@ -6,4 +6,4 @@ import"../../../shared/constants/content-assets.js";import{withPathPrefix as e,w
|
|
|
6
6
|
background-color: var(--admonition-danger-bg-color);
|
|
7
7
|
color: var(--admonition-danger-text-color);
|
|
8
8
|
font-size: var(--font-size-sm);
|
|
9
|
-
`,
|
|
9
|
+
`,Z={Accordion:te,AccordionGroup:d,Admonition:f,AiCitation:P,Card:X,Cards:m,CodeBlock:h,CodeGroup:g,CodeStep:_,CodeToggle:v,CodeWalkthrough:y,ConnectMCP:ne,Diagram:re,Experiment:ie,ExperimentVariant:b,Heading:x,HtmlScript:Y,Icon:C,Image:G,InlineSvg:T,Input:S,JsonExample:c(()=>import(`./OpenapiTagComponents.js`).then(e=>e.JsonExample)),JsonSchema:c(()=>import(`./JsonSchemaTag.js`).then(e=>e.JsonSchemaTag)),LoginButton:E,MarkdocExample:D,MarkdocInlineError:oe,NumberedItem:O,NumberedList:k,OpenApiCodeSample:c(()=>import(`./OpenApiEmbedTags.js`).then(e=>e.OpenApiCodeSample)),OpenApiExample:c(()=>import(`./OpenApiEmbedTags.js`).then(e=>e.OpenApiExample)),OpenApiResponseSample:c(()=>import(`./OpenApiEmbedTags.js`).then(e=>e.OpenApiResponseSample)),Prompt:A,ReplayOpenApi:c(()=>import(`./ReplayOpenApiTag.js`).then(e=>e.ReplayOpenApiTag)),Tabs:j,TabItemFragment:M,Link:V,...W,MarkdownLink:U===void 0?V:H(U)},Q=F;function $(e,t=Z){return/* @__PURE__ */ l(u,{children:Q(e,i,{components:t})})}function se({ast:e,components:t=Z,withPageActions:n}){let r=i.useMemo(()=>$(e,t),[e,t]);return/* @__PURE__ */ l(ee.Provider,{value:n??null,children:/* @__PURE__ */ l(N,{children:r})})}function ce({ast:e,components:t}){return i.useMemo(()=>/* @__PURE__ */ l(u,{children:le(e).map((e,n)=>/* @__PURE__ */ l(N,{as:`div`,children:typeof e==`string`?/* @__PURE__ */ l(`p`,{children:e}):Q(e,i,{components:t})},n))}),[e,t])}function le(e){return(Array.isArray(e)?e:[e]).flatMap(e=>e===null||e===``?[]:ue(e)?e.children:[e])}function ue(e){let t=e;return typeof e==`object`&&t?.$$mdtype===`Tag`&&t.name===`article`}export{Y as HtmlScript,ce as MarkdocBlocks,X as MarkdocCard,G as MarkdocImage,V as MarkdocLink,se as MarkdocRenderer,Z as markdocComponents,$ as renderMarkdocAst,q as waitForMarkdownScripts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsonExampleTag as e,jsonSchemaTag as t,openapiCodeSampleTag as n,openapiExampleTag as r,openapiResponseSampleTag as i,replayOpenapiTag as a}from"../tags/openapi.js";import{codeSnippetTag as o}from"../tags/code-snippet.js";import{diagramTag as s}from"../tags/diagram.js";import{html as c}from"../tags/html.js";import{MARKDOC_ERROR_TAG as l,markdocError as u}from"../tags/markdoc-error.js";import{partial as d}from"../tags/partial.js";import{
|
|
1
|
+
import{jsonExampleTag as e,jsonSchemaTag as t,openapiCodeSampleTag as n,openapiExampleTag as r,openapiResponseSampleTag as i,replayOpenapiTag as a}from"../tags/openapi.js";import{codeSnippetTag as o}from"../tags/code-snippet.js";import{diagramTag as s}from"../tags/diagram.js";import{html as c}from"../tags/html.js";import{MARKDOC_ERROR_TAG as l,markdocError as u}from"../tags/markdoc-error.js";import{partial as d}from"../tags/partial.js";import{variant as f}from"../tags/variant.js";import{fence as p}from"../nodes/fence.js";import{heading as m}from"../nodes/heading.js";import{item as h}from"../nodes/gfm-list-item.js";import{table as g,td as _,th as v}from"../nodes/table.js";import{text as y}from"../nodes/text.js";import b from"@redocly/markdoc";import{accordion as x}from"@redocly/theme/markdoc/tags/accordion";import{accordionGroup as S}from"@redocly/theme/markdoc/tags/accordion-group";import{admonition as C}from"@redocly/theme/markdoc/tags/admonition";import{card as w}from"@redocly/theme/markdoc/tags/card";import{cards as T}from"@redocly/theme/markdoc/tags/cards";import{codeGroup as E}from"@redocly/theme/markdoc/tags/code-group";import{codeStep as D}from"@redocly/theme/markdoc/tags/code-step";import{toggle as O}from"@redocly/theme/markdoc/tags/code-toggle";import{codeWalkthrough as k}from"@redocly/theme/markdoc/tags/code-walkthrough";import{connectMcp as A}from"@redocly/theme/markdoc/tags/connect-mcp";import{debug as j}from"@redocly/theme/markdoc/tags/debug";import{experiment as M}from"@redocly/theme/markdoc/tags/experiment";import{icon as N}from"@redocly/theme/markdoc/tags/icon";import{img as P}from"@redocly/theme/markdoc/tags/img";import{inlineSvg as F}from"@redocly/theme/markdoc/tags/inline-svg";import{input as I}from"@redocly/theme/markdoc/tags/input";import{loginButton as L}from"@redocly/theme/markdoc/tags/login-button";import{markdocExample as R}from"@redocly/theme/markdoc/tags/markdoc-example";import{numberedItem as z}from"@redocly/theme/markdoc/tags/numbered-item";import{numberedList as B}from"@redocly/theme/markdoc/tags/numbered-list";import{prompt as V}from"@redocly/theme/markdoc/tags/prompt";import{tab as H}from"@redocly/theme/markdoc/tags/tab";import{tabs as U}from"@redocly/theme/markdoc/tags/tabs";import{VARIANT_TAG as W}from"@redocly/theme/markdoc/tags/variant";import{visibility as G}from"@redocly/theme/markdoc/tags/visibility";const K=[k.tagName,D.tagName,O.tagName,I.tagName],q={[x.tagName]:x.schema,[S.tagName]:S.schema,[C.tagName]:C.schema,[w.tagName]:w.schema,[T.tagName]:T.schema,[E.tagName]:E.schema,"code-snippet":o,[D.tagName]:D.schema,[k.tagName]:k.schema,[A.tagName]:A.schema,[j.tagName]:j.schema,diagram:s,[M.tagName]:M.schema,html:c,[N.tagName]:N.schema,[P.tagName]:P.schema,[F.tagName]:F.schema,[I.tagName]:I.schema,"json-example":e,"json-schema":t,[L.tagName]:L.schema,[l]:u,[R.tagName]:R.schema,[z.tagName]:z.schema,[B.tagName]:B.schema,"openapi-code-sample":n,"openapi-example":r,"openapi-response-sample":i,partial:d,[V.tagName]:V.schema,"replay-openapi":a,[H.tagName]:H.schema,[U.tagName]:U.schema,[O.tagName]:O.schema,[W]:f,[G.tagName]:G.schema},J=(e,t)=>({...e,children:[...e.children??[],...t]}),Y={link:J({...b.nodes.link,render:`MarkdownLink`},[`softbreak`,`image`]),strong:J(b.nodes.strong,[`softbreak`,`em`,`strong`]),em:J(b.nodes.em,[`softbreak`,`em`,`strong`]),s:J(b.nodes.s,[`softbreak`]),image:{...b.nodes.image,render:`Image`},fence:p,heading:m,item:h,table:g,td:_,th:v,text:y};export{K as CODE_WALKTHROUGH_TAG_NAMES,Y as builtInMarkdocNodes,q as builtInMarkdocTags};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{builtInMarkdocFunctions as e}from"./builtin-functions.js";import{builtInMarkdocNodes as t,builtInMarkdocTags as n}from"./builtin-tags.js";import{isSchemaLike as r}from"./tag-sets.js";import{getAttributeBuildTimeResolver as i}from"../resolve/attribute-resolver-key.js";import a from"@redocly/markdoc";const o=/* @__PURE__ */ new Set([`codeSnippetFile`,`svgContent`,`tagRawContent`,`codeWalkthroughFilesets`,`partialFile`,`jsonSchemaRef`,`sampleFromJsonSchema`,`jsonExampleRef`,`openapiCodeSamples`,`openapiCodeSamplePanel`,`openapiReplay`,`openapiResponseSamples`,`openapiResponsePanel`,`openapiExample`]),s=/* @__PURE__ */ new Set([`diagram`]);function c(e){return Object.values(e.attributes??{}).some(e=>i(e)!==null)}function l(e,t){return s.has(e)||Object.values(t.attributes??{}).some(e=>{let t=i(e);return t!==null&&o.has(t)})}function u(e){return{transform:()=>new a.Tag(`Admonition`,{type:`danger`},[`The "${e}" tag is not available in inline markdown.`])}}function d(i){let o={};for(let[e,t]of Object.entries(n))o[e]=l(e,t)?u(e):t;let s={...t};for(let[e,t]of[[`tags`,o],[`nodes`,s]])for(let[n,a]of Object.entries(i?.[e]??{}))r(a)&&!c(a)&&(t[n]=a);return o[`ai-citation`]={render:`AiCitation`,selfClosing:!0,attributes:{number:{type:Number,required:!0},url:{type:String,required:!0}}},s.document={...a.nodes.document,render:`div`},{tags:o,nodes:s,functions:{...i?.functions,...e}}}export{d as buildMarkdownTextTagSet};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ConfigFunction, Schema } from '@redocly/markdoc';
|
|
2
|
+
import type { RealmConfig } from '../../../shared/types/config';
|
|
2
3
|
export type MarkdocTagSet = {
|
|
3
4
|
tags: Record<string, Schema>;
|
|
4
5
|
nodes: Record<string, Schema>;
|
|
@@ -28,21 +29,35 @@ export declare function registerUserMarkdocSchema(schema: UserMarkdocSchema | un
|
|
|
28
29
|
* dependency on the files and are not validated until it loads: without it, each of its
|
|
29
30
|
* tags would be reported as undefined.
|
|
30
31
|
*/
|
|
31
|
-
export declare function registerUserMarkdocSchemaFailure(files: readonly string[]): void;
|
|
32
|
+
export declare function registerUserMarkdocSchemaFailure(files: readonly string[], message: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Why the project schema is not in use; `undefined` when it loaded or there is none. The CLI
|
|
35
|
+
* load and the dev server's import both set it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function userMarkdocSchemaFailure(): string | undefined;
|
|
38
|
+
export declare function setUserMarkdocSchemaFailure(message: string | undefined): void;
|
|
32
39
|
/** The files the CLI loaded the project schema from; `undefined` when it did not load one. */
|
|
33
40
|
export declare function userMarkdocSchemaFiles(): readonly string[] | undefined;
|
|
34
|
-
/**
|
|
41
|
+
/** The tags only the registered project schema defines; empty without one. */
|
|
42
|
+
export declare function customMarkdocTagNames(): string[];
|
|
43
|
+
/**
|
|
44
|
+
* Whether the CLI validates pages: it registered the project schema, or found none. A schema
|
|
45
|
+
* that failed is not registered, so each of its tags would be undefined.
|
|
46
|
+
*/
|
|
35
47
|
export declare function isMarkdocValidationEnabled(): boolean;
|
|
36
48
|
/** The digest of the registered project schema; `undefined` without one. */
|
|
37
49
|
export declare function userMarkdocSchemaDigest(): string | undefined;
|
|
38
50
|
export declare const BUILTIN_MARKDOC_TAG_SET = "builtin";
|
|
39
51
|
export declare const API_DOCS_MARKDOC_TAG_SET = "api-docs";
|
|
40
52
|
export declare const isSchemaLike: (value: unknown) => value is Schema;
|
|
41
|
-
/**
|
|
42
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Resolve a named tag set (extensions merge over the builtin set); no name → builtin. For a
|
|
55
|
+
* `config` whose plan lacks custom Markdoc tags, a project tag does not replace a builtin one.
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolveMarkdocTagSet(name: string | undefined, config: Pick<RealmConfig, 'planGates'>): Promise<MarkdocTagSet>;
|
|
43
58
|
/**
|
|
44
59
|
* The set a Markdown page is validated against: the builtin set it renders with, over the
|
|
45
60
|
* API docs set, whose tags a page may also use. The result is the same object until the
|
|
46
61
|
* project schema changes.
|
|
47
62
|
*/
|
|
48
|
-
export declare function resolveMarkdownPageValidationSet(): Promise<MarkdocTagSet>;
|
|
63
|
+
export declare function resolveMarkdownPageValidationSet(config: Pick<RealmConfig, 'planGates'>): Promise<MarkdocTagSet>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isPlanFeatureGranted as e}from"../../../shared/plan-gates.js";import{builtInMarkdocFunctions as t}from"./builtin-functions.js";import{builtInMarkdocNodes as n,builtInMarkdocTags as r}from"./builtin-tags.js";const i=`@theme/markdoc/schema.ts`;let a,o,s;function c(e,t,n){globalThis.__REALM_MARKDOC_USER_SCHEMA__=e,a=t,o=n,s=void 0}function l(e,t){c(void 0,void 0,e),s=t}function u(){return s}function d(e){s=e}function f(){return o}function p(){return Object.keys(globalThis.__REALM_MARKDOC_USER_SCHEMA__?.tags??{}).filter(e=>!(e in r))}function m(){return o!==void 0&&s===void 0}function h(){return a}const g=`builtin`,_=`api-docs`,v={[_]:async()=>{let{apiDocsMarkdocNodes:e,apiDocsMarkdocTags:t}=await import(`@redocly/api-docs/markdoc`);return{tags:t,nodes:e}}},y=/* @__PURE__ */ new Map;let b;const x=/* @__PURE__ */ new Set,S=e=>!!e&&typeof e==`object`;function C(e,n,r){let i={tags:{...e.tags},nodes:{...e.nodes},functions:{...t,...e.functions}};for(let t of[`tags`,`nodes`,`functions`])for(let[a,o]of Object.entries(n[t]??{}))if(S(o)&&!(t===`tags`&&!r&&a in e.tags)){if(t===`functions`&&a in i.functions){x.has(a)||(x.add(a),console.warn(`[markdoc] The user schema defines the "${a}" function, but the engine already defines it. The engine function is used.`));continue}i[t][a]=o}return i}async function w(i,a){let o=globalThis.__REALM_MARKDOC_USER_SCHEMA__;o!==b&&(b=o,y.clear(),x.clear());let s=i??`builtin`,c=e(a,`customMarkdocTags`),l=T(s,c),u=y.get(l);if(u)return u;let d={tags:r,nodes:n,functions:t};if(o&&(d=C(d,o,c)),s!==`builtin`){let e=await v[s]?.();if(!e)throw Error(`Unknown markdoc tag set "${s}".`);d={tags:{...d.tags,...e.tags},nodes:{...d.nodes,...e.nodes},functions:{...d.functions,...e.functions}}}return y.set(l,d),d}const T=(e,t)=>t?e:`${e}:builtin-tags-kept`;async function E(t){let n=await w(void 0,t),r=await w(_,t),i=T(`page-validation`,e(t,`customMarkdocTags`)),a=y.get(i);if(a)return a;let o={...r,tags:{...r.tags,...n.tags},nodes:{...r.nodes,...n.nodes}};return y.set(i,o),o}export{_ as API_DOCS_MARKDOC_TAG_SET,g as BUILTIN_MARKDOC_TAG_SET,i as USER_MARKDOC_SCHEMA_FILE,p as customMarkdocTagNames,m as isMarkdocValidationEnabled,S as isSchemaLike,c as registerUserMarkdocSchema,l as registerUserMarkdocSchemaFailure,w as resolveMarkdocTagSet,E as resolveMarkdownPageValidationSet,d as setUserMarkdocSchemaFailure,h as userMarkdocSchemaDigest,u as userMarkdocSchemaFailure,f as userMarkdocSchemaFiles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@redocly/markdoc";import{EXAMPLE_CONTENT_ATTRIBUTE as t}from"@redocly/theme/core/constants";const n=/* @__PURE__ */ new Set([`mermaid`,`excalidraw`,`plantuml`]),r={...e.nodes.fence,attributes:{...e.nodes.fence.attributes,label:{type:String,render:`data-label`},title:{type:String,render:`data-title`},highlight:{type:String,render:`data-highlight`},align:{type:String,matches:[`left`,`center`,`right`]},width:{type:String},[t]:{type:Object,render:!1}},transform(t,r){let i=t.transformAttributes(r),a=t.transformChildren(r),o=i[`data-language`],s=i[`data-title`];if(t.attributes.process===!1&&(a=[t.attributes.content]),typeof a[0]!=`string`)return new e.Tag(t.tag,i,a);if(typeof o==`string`&&n.has(o)){let{diagramHtml:n,diagramHtmlDark:r,diagramError:s}=t.attributes;if(typeof n==`string`||typeof s==`string`)return new e.Tag(`Diagram`,{...i,diagramType:o,diagramSource:a[0],diagramHtml:n,diagramHtmlDark:r,diagramError:s},[])}let c=a.map(t=>typeof t==`string`||typeof t==`number`||typeof t==`boolean`?t.toString():e.Tag.isTag(t)?String(t.attributes?.rawtag??``):``).join(``);return new e.Tag(`CodeBlock`,{...i,header:{title:s,controls:{copy:{}}},source:c,lang:o},[])}};export{n as DIAGRAM_LANGUAGES,r as fence};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{headingSlugger as e}from"../utils/heading-slugger.js";import{getInnerText as t}from"../utils/get-inner-text.js";import n from"@redocly/markdoc";const r={children:[`inline`],attributes:{id:{type:String},level:{type:Number,required:!0,default:1}},transform(r,i){let a=r.transformAttributes(i),o=r.transformChildren(i),s=typeof a.id==`string`?e.explicit(a.id):e.slug(t(o));return new n.Tag(`Heading`,{...a,id:s,level:r.attributes.level},o)}};export{r as heading};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@redocly/markdoc";import{MARKDOWN_CLASS_NAME as t}from"@redocly/theme/core/constants";const n={transform(n,r){let{class:i,...a}=n.transformAttributes(r),s=n.transformChildren(r);return o(s),new e.Tag(`div`,{className:`md-table-wrapper`},[new e.Tag(`table`,{...a,className:[t,i].filter(Boolean).join(` `)},s)])}},r={type:String,matches:[`top`,`middle`,`bottom`],render:`vAlign`},i={...e.nodes.td,attributes:{...e.nodes.td.attributes,valign:r}},a={...e.nodes.th,attributes:{...e.nodes.th.attributes,valign:r}};function o([t]){if(e.Tag.isTag(t)&&t.name===`thead`){for(let n of t.children)if(e.Tag.isTag(n))for(let t of n.children)e.Tag.isTag(t)&&t.name===`th`&&(t.attributes[`data-label`]=s(t.children))}}function s(t){return t.map(t=>typeof t==`string`||typeof t==`number`?String(t):e.Tag.isTag(t)?s(t.children):``).join(``).trim()}export{n as table,i as td,a as th};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isObject as e}from"../../../shared/utils/is-object.js";import{markdocNodeRange as t}from"../utils/node-source-range.js";import{PARTIAL_L10N_ATTRIBUTE as n}from"../tags/partial.js";import{builtInMarkdocTags as r}from"../constants/builtin-tags.js";import{walkMarkdocAst as i}from"../utils/walk-markdoc-ast.js";import{getExampleContent as a,walkWithExampleContent as o}from"../utils/reparse-example-fences.js";import{parseMarkdownDocument as s}from"../utils/parse-cache.js";import{substituteStaticVariables as c}from"../utils/substitute-variables.js";import{collectMarkdocTagNames as l,isPromptTag as u,resolveMarkdocBuildTimeAttributes as d}from"./markdoc.js";import{inlineRawPartials as f}from"./raw-partials.js";import{renderMarkdocDiagrams as p}from"./render-diagrams.js";import m from"@redocly/markdoc";const h=/* @__PURE__ */ new Set([`parse-error`,`missing-opening`,`missing-closing`,`fence-tag-error`,`no-inline-annotations`]);async function g(e,t,n){let i=await f(e,t,n.resolverContext),a=s(i.source),o=n.validation?x(a,t,v(n.validation)):[],{entityDeps:u,assetUsages:h,linkRefs:g,problems:_}=await d(a,{tags:n.tags??r,sourceFilePath:t,resolverContext:n.resolverContext,source:i.source});n.variables&&c(a,n.variables);let y=await p(a,t,n.resolverContext.logger),b=w(a,t),S=n.transform?.(a)??[];return C(a),{ast:m.compact(a),entityDeps:[...i.entityDeps,...u],assetUsages:h,linkRefs:g,tagList:l(a),problems:[...i.problems,..._,...b,...o,...S,...y]}}const _=/* @__PURE__ */ new WeakMap;function v(e){let t=_.get(e);return t===void 0&&(t=m.prepareConfig({...e,tags:y(e.tags),nodes:y(e.nodes)}),_.set(e,t)),t}function y(e){if(e!==void 0)return Object.fromEntries(Object.entries(e).map(([e,t])=>{let{validate:n}=t;return n===void 0?[e,t]:[e,{...t,validate(e,t){try{return n.call(this,e,t)}catch(t){return[{id:`validate-failed`,level:`error`,message:`The validate() of '${e.tag??e.type}' failed: ${b(t)}`}]}}}]}))}const b=e=>e instanceof Error?e.message:String(e);function x(e,t,n){let r=[e],i=/* @__PURE__ */ new Set,s=[];for(let t of o(e,u)){for(let e of t.errors??[])i.add(e);let e=a(t);e&&r.push(e),u(t)&&s.push({node:t,children:t.children})}for(let e of s)e.node.children=[];try{return r.flatMap(e=>m.validate(e,n)).filter(e=>!i.has(e.error)).map(e=>S(e,t))}catch(e){return[{code:`markdoc/validation-error`,message:`Markdoc validation failed: ${b(e)}`,location:{filePath:t,range:{start:{line:1},end:{line:1}}}}]}finally{for(let e of s)e.node.children=e.children}}function S(e,n){let{level:r,message:i}=e.error,a={code:`markdoc/validation-error`,message:i,location:{filePath:n,range:t(e)??{start:{line:1},end:{line:1}}}};return r!==`error`&&r!==`critical`&&(a.severity=`warning`),a}function C(t){for(let r of i(t)){let t=r.tag===`partial`?r.attributes[n]:void 0;e(t)&&(r.attributes[n]=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,m.compact(t)])))}}function w(e,n){let r=[];for(let i of o(e))for(let e of i.errors){let a=h.has(e.id)?`markdoc/parse-error`:`markdoc/validation-error`;r.push({code:a,message:e.message,location:{filePath:n,range:t(i)??{start:{line:1},end:{line:1}}}})}return r}export{g as resolveMarkdownAst};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { MarkdocResolverName, MarkdocTagSchema } from '@redocly/theme/markdoc/tags/types';
|
|
2
|
+
/** Every resolver Realm Plus implements: the theme's contract plus the Realm Plus tags' own. */
|
|
3
|
+
export type RealmPlusResolverName = MarkdocResolverName | 'nativeMdLink' | 'htmlAttrs' | 'partialFile' | 'jsonSchemaRef' | 'sampleFromJsonSchema' | 'jsonExampleRef' | 'openapiCodeSamples' | 'openapiCodeSamplePanel' | 'openapiReplay' | 'openapiResponseSamples' | 'openapiResponsePanel' | 'openapiExample' | 'rawContent' | 'parsedYaml';
|
|
4
|
+
export type RealmPlusTagSchema = MarkdocTagSchema<RealmPlusResolverName>;
|
|
5
|
+
/**
|
|
6
|
+
* The resolver name an attribute schema declares in `resolver`, or through the
|
|
7
|
+
* attribute type's static `resolver` (the deprecated theme marker classes).
|
|
8
|
+
*/
|
|
2
9
|
export declare function getAttributeBuildTimeResolver(attribute: unknown): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){
|
|
1
|
+
function e(e){return r(e)?n(e)??t(e.type):null}function t(e){if(Array.isArray(e))for(let n of e){let e=t(n);if(e)return e}return!r(e)&&typeof e!=`function`?null:n(e)}function n(e){let{resolver:t}=e;return typeof t==`string`&&t.trim()!==``?t:null}function r(e){return typeof e==`object`&&!!e}export{e as getAttributeBuildTimeResolver};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AssetAudienceDescriptor } from '../../../
|
|
1
|
+
import { type AssetAudienceDescriptor } from '../../../shared/rbac/engine.js';
|
|
2
2
|
export type AudienceTagResolver = (path: string) => Promise<string | null>;
|
|
3
3
|
/**
|
|
4
4
|
* Builds a per-invocation resolver from a raw `access.rbac` config value —
|
|
@@ -16,12 +16,8 @@ export type AudienceTagResolver = (path: string) => Promise<string | null>;
|
|
|
16
16
|
* Absent config (`parseRbacConfigData` returns `null`) -> every path
|
|
17
17
|
* resolves to `null` (no tag), preserving today's fully-public behavior for
|
|
18
18
|
* every project that hasn't configured RBAC.
|
|
19
|
-
*
|
|
20
|
-
* `warn`, when given, is called once per path that matches no rule at all —
|
|
21
|
-
* an unsatisfiable-by-anyone audience, almost always a missing catch-all
|
|
22
|
-
* `'**'` rule rather than an intentional lockout.
|
|
23
19
|
*/
|
|
24
|
-
export declare function createAudienceTagResolver(rawRbacConfig: unknown
|
|
20
|
+
export declare function createAudienceTagResolver(rawRbacConfig: unknown): AudienceTagResolver;
|
|
25
21
|
/**
|
|
26
22
|
* The `{tag -> descriptor}` table for a raw `access.rbac` config value and a
|
|
27
23
|
* concrete asset-path set — `compileAssetAudiences` behind the same raw-config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compileAssetAudiences as e,compileRbacMatcher as t,deriveAssetTag as n,parseRbacConfigData as r,resolveAssetTagInputs as i}from"../../../
|
|
1
|
+
import{compileAssetAudiences as e,compileRbacMatcher as t,deriveAssetTag as n,parseRbacConfigData as r,resolveAssetTagInputs as i}from"../../../shared/rbac/engine.js";function a(e){let a=r(e);if(!a)return async()=>null;let o=t(a);return async e=>{let t=i(o,e);return t===null?null:n(t)}}async function o(n,i){let a=r(n);return a?e(t(a),i):null}export{o as compileAssetAudienceTable,a as createAudienceTagResolver};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocErrorResult as e}from"../../tags/markdoc-error.js";import{resolveResolverTarget as t}from"./context-paths.js";async function n(n){let{node:i,attributeName:a}=n,o=i.attributes[a];if(typeof o!=`string`||o===``||n.io===void 0)return null;let s=t(n,o);if(s===null)return null;let c=[{kind:`file`,path:s.contentPath}];if(!await n.io.exists(s.absolutePath)){let t=`Code snippet file ${s.contentPath} does not exist`;return e(i,t,n.sourceFilePath,c)}let l=await n.io.readFile(s.absolutePath);try{i.attributes.rawContent=r(l,{from:i.attributes.from,to:i.attributes.to,after:i.attributes.after,before:i.attributes.before,prefix:typeof i.attributes.prefix==`string`?i.attributes.prefix:``,contentPath:s.contentPath})}catch(t){let r=t instanceof Error?t.message:String(t);return e(i,r,n.sourceFilePath,c)}return i.children=[],{entityDeps:c}}function r(e,t){let n=t.from??t.after,r=t.to??t.before,i=t.after!=null,a=t.before!=null,o=(typeof n==`number`?Math.max(n||0,1):1)+ +!!i,s=(typeof r==`number`?r:1/0)-+!!a,c=e;if(typeof n==`string`){let e=c.indexOf(n);if(e===-1)throw Error(`Cannot find start text "${n}" in snippet file ${t.contentPath}`);for(;c[e]!==`
|
|
2
2
|
`&&e>0;)e--;Number.isFinite(s)&&e>0&&(s-=c.slice(0,e).split(`
|
|
3
|
-
`).length),c=e===0?c:c.slice(e+1)}if(typeof r==`string`){let e=c.indexOf(r);if(e===-1)throw Error(`Cannot find end text "${r}" in snippet file ${t.contentPath}`);c[e-1]===`
|
|
4
|
-
`&&e
|
|
3
|
+
`).length),c=e===0?c:c.slice(e+1)}if(typeof r==`string`){let e=c.indexOf(r);if(e===-1)throw Error(`Cannot find end text "${r}" in snippet file ${t.contentPath}`);if(a)c[e-1]===`
|
|
4
|
+
`&&e--;else{let t=c.indexOf(`
|
|
5
|
+
`,e);e=t===-1?c.length:t}c=c.slice(0,e)}let l=c.split(`
|
|
5
6
|
`);if(a)for(;l[l.length-1]===``;)l.pop();return t.prefix+l.slice(o-1,s).join(`
|
|
6
|
-
`)}export{
|
|
7
|
+
`)}export{r as extractSnippetRegion,n as resolveCodeSnippetFileAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocErrorResult as e}from"../../../tags/markdoc-error.js";import{resolveResolverTarget as t}from"../context-paths.js";import{mapFileExtensionToLanguage as n}from"./map-file-extension-to-language.js";import{parseFileChunks as r}from"./file-chunk-parser.js";import{join as i,posix as a}from"node:path";import o from"picomatch";async function s(s){let{node:c,attributeName:l}=s,u=s.io,d=c.attributes[l];if(!Array.isArray(d)||u===void 0)return c.attributes.resolvedFilesets=[],null;let f=u,p=[];async function m(e){let c=t(s,e);if(c===null)return s.logger?.warn(`code-walkthrough: cannot resolve "${e}" from ${s.sourceFilePath}`),[];let l=o.scan(c.contentPath).isGlob?await f.glob?.(c.contentPath)??[]:[c.contentPath];return(await Promise.all(l.map(async e=>{p.push({kind:`file`,path:e});let t=i(s.contentDir,e);if(!await f.exists(t))return s.logger?.warn(`code-walkthrough: file ${e} does not exist`),null;let o=await f.readFile(t),{root:c,metadata:l}=r(o,e);return{path:e,content:c,metadata:l,basename:a.basename(e),language:n(a.extname(e))}}))).filter(e=>e!==null)}let h;try{h=await Promise.all(d.map(async e=>{let t=Array.isArray(e.files)?e.files:[],n=Array.isArray(e.downloadAssociatedFiles)?e.downloadAssociatedFiles:[],[r,i]=await Promise.all([Promise.all(t.map(m)),Promise.all(n.map(m))]);return{when:e.when,unless:e.unless,files:r.flat(),downloadAssociatedFiles:i.flat()}}))}catch(t){let n=t instanceof Error?t.message:String(t);return e(c,n,s.sourceFilePath,p)}return c.attributes.resolvedFilesets=h,{entityDeps:p}}export{s as resolveCodeWalkthroughFilesetsAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocErrorResult as e}from"../../tags/markdoc-error.js";import{resolveResolverTarget as t}from"./context-paths.js";async function n(n){let{node:r,attributeName:i}=n,a=r.attributes[i];if(typeof a!=`string`||a===``||n.io===void 0)return null;let o=t(n,a);if(o===null)return null;if(!await n.io.exists(o.absolutePath)){let t=`Diagram file ${o.contentPath} does not exist`;return e(r,t,n.sourceFilePath,[{kind:`file`,path:o.contentPath}])}return r.attributes.rawContent=await n.io.readFile(o.absolutePath),r.children=[],{entityDeps:[{kind:`file`,path:o.contentPath}]}}export{n as resolveDiagramFileAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocErrorResult as e}from"../../tags/markdoc-error.js";import{L10N_DIR as t}from"../../../../shared/constants/l10n/defaults.js";import{delocalizeL10nPath as n,l10nDirOf as r}from"../../../../shared/utils/l10n.js";import{resolveResolverTarget as i}from"./context-paths.js";import a from"js-yaml";function o(e){return l(e,`RawContent`,e=>e)}function s(e){return l(e,`Resolved`,e=>a.load(e))}function c(e){let{node:n,attributeName:a,sourceFilePath:o}=e,s=n.attributes[a];if(typeof s!=`string`||s===``)return null;let c=r(o),l=c!==void 0&&s.startsWith(`/`)&&r(s.slice(1))===void 0?`/${t}/${c}${s}`:s,u=i(e,l)?.contentPath;return u!==void 0&&(n.attributes[a]=u),null}async function l(t,r,a){let o=t.node.attributes[t.attributeName];if(typeof o!=`string`||o===``||t.io===void 0)return null;let s=i(t,o);if(s===null)return null;let c=[{kind:`file`,path:s.contentPath}],l=s;if(!await t.io.exists(s.absolutePath)){let r=n(t.sourceFilePath);if(l=r===void 0?null:i({...t,sourceFilePath:r},o),l!==null&&c.push({kind:`file`,path:l.contentPath}),l===null||!await t.io.exists(l.absolutePath)){let n=`File ${s.contentPath} does not exist`;return e(t.node,n,t.sourceFilePath,c)}}let u=await t.io.readFile(l.absolutePath),d;try{d=a(u)}catch(n){let r=n instanceof Error?n.message:String(n),i=`File ${l.contentPath} is not valid: ${r}`;return e(t.node,i,t.sourceFilePath,c)}return t.node.attributes[`${t.attributeName}${r}`]=d,{entityDeps:c}}export{s as resolveParsedYamlAttribute,o as resolveRawContentAttribute,c as resolveRelativePathAttribute};
|
|
@@ -4,5 +4,6 @@ export declare function resolveJsonSchemaRefAttribute(ctx: MarkdocAttributeResol
|
|
|
4
4
|
/** `{% json-example schema={...} %}`: generate a sample value from the resolved schema. */
|
|
5
5
|
export declare function resolveSampleFromJsonSchemaAttribute(ctx: MarkdocAttributeResolverContext): Promise<MarkdocAttributeResolverResult | null>;
|
|
6
6
|
/** `{% json-example value={...} %}`: a literal value passes through; a `{ $ref: "file#/pointer" }`
|
|
7
|
-
* loads the pointed value (a tracked file dep). Failures land in `valueResolvedErrors
|
|
7
|
+
* loads the pointed value (a tracked file dep). Failures land in `valueResolvedErrors` and
|
|
8
|
+
* a problem on the tag's line. */
|
|
8
9
|
export declare function resolveJsonExampleRefAttribute(ctx: MarkdocAttributeResolverContext): Promise<MarkdocAttributeResolverResult | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as e}from"../../../../shared/utils/is-object.js";import{
|
|
1
|
+
import{isObject as e}from"../../../../shared/utils/is-object.js";import{markdocNodeProblem as t}from"../../utils/node-source-range.js";import{toContainedContentPath as n}from"../../../ingest/scan.js";import{resolveResolverTarget as r}from"./context-paths.js";import{join as i}from"node:path";async function a(e,t,n){let{bundle:r,createConfig:a,Source:o}=await import(`@redocly/openapi-core`),{createBundleConfig:l,resolvePendingMarkdown:u}=await import(`../../../plugins/internal/api-docs/server/build-definition.js`),d=n?{markdown:e.markdown,loader:{...e,inJsonSchemaDescription:!0},sink:n}:void 0,f=JSON.parse(JSON.stringify({openapi:`3.1.0`,components:{schemas:{__root:t}}})),p=i(e.contentDir,e.sourceFilePath),m=await r({config:await l(a,{bundle:{config:{},configDir:``,plugins:[]},specRelativePath:e.sourceFilePath,rootDir:e.contentDir,resolution:d}),doc:{source:new o(p,``),parsed:f}}),h=m.bundle.parsed,g;if(d){let n=structuredClone(h),{sink:r}=d;await u(d,r.pending,e.contentDir,e.sourceFilePath),r.pending.some(e=>typeof e.read()==`object`)&&(g=n),r.problems=s(e,r.problems,t)}let _=h.components?.schemas,v=_?.__root?.$ref,y=typeof v==`string`?v.split(`/`).at(-1):void 0,b=y?_?.[y]:_?.__root;return{oas:h,asWritten:g,schema:b,errors:(m.problems??[]).slice(0,1).map(e=>e.message),fileDeps:c(m.fileDependencies,e.contentDir,p)}}function o(){return{entityDeps:[],assetUsages:[],linkRefs:[],problems:[],pending:[]}}function s(n,r,i){let a=r.find(e=>e.code.startsWith(`markdoc/`));if(a===void 0)return r;let o=e(i)?i.$ref:void 0,s=typeof o==`string`?`the schema ${o}`:`the schema`;return[...r.filter(e=>!e.code.startsWith(`markdoc/`)),{...t(n.node,`A description in ${s} is not valid Markdoc, so it renders as text: ${a.message}`,n.sourceFilePath,a.code),severity:`warning`}]}function c(e,t,r){if(e===void 0)return[];let i=/* @__PURE__ */ new Set;for(let a of e){let e=n(t,a);a!==r&&e!==null&&i.add(e)}return[...i].sort()}function l(e,t=[]){return e.length>0||t.length>0?{entityDeps:e.map(e=>({kind:`file`,path:e})),problems:t}:null}function u(e,n){let{node:r,attributeName:i}=e;return r.attributes[`${i}ResolvedErrors`]=n,e.logger?.warn(`${r.tag} in ${e.sourceFilePath}: ${n[0]}`),t(r,n[0],e.sourceFilePath)}async function d(t){let{node:n,attributeName:r}=t,i=n.attributes[r];if(!e(i))return null;let s=o(),{oas:c,asWritten:l,errors:d,fileDeps:f}=await a(t,i,t.inJsonSchemaDescription?void 0:s);n.attributes[`${r}Resolved`]=c,l!==void 0&&(n.attributes[`${r}AsWritten`]=l);let p=d.length>0?[u(t,d)]:[];return{entityDeps:[...f.map(e=>({kind:`file`,path:e})),...s.entityDeps],assetUsages:s.assetUsages,linkRefs:s.linkRefs,problems:[...p,...s.problems]}}async function f(t){let{node:n,attributeName:r}=t,i=n.attributes[r];if(!e(i)||n.attributes.value!==void 0)return null;let{oas:o,schema:s,errors:c,fileDeps:d}=await a(t,i);if(c.length>0)return l(d,[u(t,c)]);let f=n.attributes.mode,p=await import(`openapi-sampler`);try{n.attributes[`${r}Resolved`]=p.sample(s,{...f===`read`?{skipWriteOnly:!0}:void 0,...f===`write`?{skipReadOnly:!0}:void 0},o)}catch(e){return l(d,[u(t,[`Failed to generate a sample from the schema: ${e?.message??e}`])])}return l(d)}async function p(t){let{node:n,attributeName:i}=t,a=n.attributes[i],o=e=>({problems:[u(t,[e])]});if(a!==void 0&&n.attributes.schema!==void 0)return o(`The "schema" and "value" attributes are mutually exclusive, use only one.`);if(a===void 0)return n.attributes.schema===void 0?o(`The tag requires a "schema" or "value" attribute.`):null;let s=e(a)?a.$ref:void 0;if(typeof s!=`string`)return n.attributes[`${i}Resolved`]=a,null;let[c,l]=s.split(`#`),d=c?r(t,c):null;if(d===null||t.io===void 0)return o(`Invalid $ref "${s}": the path must stay inside the content directory.`);if(!await t.io.exists(d.absolutePath))return o(`Invalid $ref: no such file ${d.contentPath}`);let f=await t.io.readFile(d.absolutePath),p=[{kind:`file`,path:d.contentPath}],h;try{h=(await import(`js-yaml`)).load(f)}catch(e){return{entityDeps:p,...o(`File ${d.contentPath} must be valid JSON or YAML: ${e.message}`)}}let g=l?m(h,l):h;return l&&g===void 0?{entityDeps:p,...o(`Invalid $ref: ${d.contentPath} has no value at #${l}`)}:(n.attributes[`${i}Resolved`]=g,{entityDeps:p})}function m(t,n){let r=t;for(let t of n.split(`/`).slice(+!!n.startsWith(`/`))){let n=t.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`);if(Array.isArray(r))r=r[Number(n)];else if(e(r))r=r[n];else return}return r}export{p as resolveJsonExampleRefAttribute,d as resolveJsonSchemaRefAttribute,f as resolveSampleFromJsonSchemaAttribute};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApiStore, CodeSamplePanelItem, CodeSampleSource, OpenAPIDefinition, ResponseCodeItem, findExampleEncoding } from '@redocly/api-docs';
|
|
2
2
|
import { REDOCLY_TEAMS_RBAC } from '@redocly/config';
|
|
3
3
|
import type { MarkdocAttributeResolverContext, MarkdocAttributeResolverResult } from '../../../plugins/types/markdoc.js';
|
|
4
|
-
import type { RbacScope } from '../../../../
|
|
4
|
+
import type { RbacScope } from '../../../../shared/rbac/types.js';
|
|
5
5
|
export type ResolvedSampleBlock = {
|
|
6
6
|
lang: string;
|
|
7
7
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isObject as e}from"../../../../shared/utils/is-object.js";import{markdocNodeProblem as t}from"../../utils/node-source-range.js";import{compileRouteAccessMatcher as n,matchContentScope as r}from"../../../../shared/rbac/engine.js";import{SPEC_KIND_OPENAPI as i}from"../../../../shared/constants/api-spec-kinds.js";import{createLruCache as a}from"../../../../shared/utils/lru-cache.js";import{parseMarkdownCached as o}from"../../utils/parse-cache.js";import{resolveResolverTarget as s}from"./context-paths.js";import{createApiEntityKey as c}from"../../../plugins/utils/api-entity-key.js";import{withMockServerOption as l}from"../../../plugins/internal/api-docs/server/options.js";import{annotateApiDocsRbac as u}from"../../../../shared/rbac/api-docs.js";import{REDOCLY_TEAMS_RBAC as d}from"@redocly/config";const f={curl:`shell`,JavaScript:`javascript`,"Node.js":`javascript`,Python:`python`,Java:`java`,"Java8+Apache":`java`,"C#":`csharp`,"C#+Newtonsoft":`csharp`,PHP:`php`,Go:`go`,Ruby:`ruby`,R:`r`},p=/* @__PURE__ */ new WeakMap;async function m(e){let t=p.get(e.node);t===void 0&&(t=h(e),p.set(e.node,t));let n=await t;return{definition:n.definition,problems:n.problems.splice(0)}}async function h(e){let t=e.node.attributes.descriptionFile;if(typeof t!=`string`||t===``||e.entities===void 0)return{definition:null,problems:[]};let n=s(e,t);if(n===null)return g(e,`descriptionFile "${t}" must stay inside the content directory`);let r=c(n.contentPath),i=await e.entities.get(r);return i===null||i.type!==`api`?g(e,`no API description found at ${n.contentPath}`):i.metadata?.specType===`openapi`?{definition:{contentPath:n.contentPath,document:await e.entities.load(r),metadata:i.metadata??{},dataHash:i.status===`ready`?i.dataHash??null:null},problems:[]}:g(e,`${n.contentPath} is not an OpenAPI description`)}function g(e,n){return e.logger?.warn(`${e.node.tag} in ${e.sourceFilePath}: ${n}`),e.node.attributes.descriptionFileInvalid=!0,{definition:null,problems:[t(e.node,n,e.sourceFilePath)]}}const _=(e,t)=>e.node.attributes[t]??void 0;function v(t){let n=e(t.options)?t.options:{};return e(n.mockServer)?{...n,mockServer:{...n.mockServer,position:`off`}}:n}function y(t,n){let r=_(t,`language`),i=_(t,`options`);return{...n,...i,codeSamples:{...e(n.codeSamples)?n.codeSamples:{},...i?.codeSamples,...r&&{languages:[{lang:r}]}}}}async function b(e){let{definition:t,problems:n}=await m(e);if(t===null)return{problems:n};let{buildCodeSamples:r,getRequestBodySamples:i,normalizeOptions:a,resolveOperationSampleContext:s}=await import(`@redocly/api-docs/server`),c=a({specType:`openapi`,...y(e,v(t.metadata)),markdownParser:o}),l=s(t.document,c,{operationId:_(e,`operationId`),pointer:_(e,`pointer`)});if(!l)return null;let u={exampleKey:_(e,`exampleKey`),mimeType:_(e,`mimeType`),parameters:_(e,`parameters`),requestBody:_(e,`requestBody`),environments:_(e,`environments`),environment:_(e,`environment`)},d=r(l,u).map(e=>({lang:f[e.lang]??e.lang.toLowerCase(),title:e.label??e.lang,source:e.source})),p=c.codeSamples?.languages??[],h=p.findIndex(({lang:e})=>e===`Payload`);if(h!==-1){let e=i(l,{exampleKey:u.exampleKey,mimeType:u.mimeType,titlePrefix:p[h].label});d.splice(h,0,...e)}return d.length>0&&(e.node.attributes[e.attributeName]=d),null}async function x(e){let{definition:t,problems:n}=await m(e);if(t===null)return{problems:n};let{getResponseSamples:r,normalizeOptions:i,resolveOperationSampleContext:a}=await import(`@redocly/api-docs/server`),s=a(t.document,i({specType:`openapi`,...v(t.metadata),markdownParser:o}),{operationId:_(e,`operationId`),pointer:_(e,`pointer`)});if(!s)return null;let c=r(s,{exampleKey:_(e,`exampleKey`)});return c.length>0&&(e.node.attributes[e.attributeName]=c),null}const S=a({budget:4});function C(e,t,n){let r=async()=>{let{buildItems:r}=await import(`@redocly/api-docs/server`),a=u(t.document,i,{warn:t=>e.logger?.warn(t)}),{items:s,store:c}=await r({type:i,document:a,options:{...n,specType:i,markdownParser:o},basePath:`/`,markdownParser:o});return{items:s,store:c}};if(t.dataHash===null)return r();let a=JSON.stringify([t.contentPath,t.dataHash,n]),s=S.get(a);return s===void 0&&(s=r(),S.set(a,s)),s}function w(e){return e.startsWith(`#`)?e.slice(1):e}function T(e,t){let n=_(t,`pointer`),r=_(t,`operationId`);if(n!==void 0||r!==void 0)for(let i of e){let e=i.content?.meta;if(n!==void 0&&e?.pointer!==void 0&&w(e.pointer)===w(n)||r!==void 0&&e?.sourceId===r)return i;let a=T(i.items??[],t);if(a!==void 0)return a}}function E(e){return e[d]}function D(e,t,n){for(let r of e){if(r.nodeType!==`container`)continue;let e=E(r)??n;for(let n of r.panels??[]){let r=`children`in n?n.children.find(t):void 0;if(r!==void 0){let t=E(n)??e;return{entry:r,scope:t===void 0?{}:{[d]:t}}}}let i=D(r.children,t,e);if(i!==void 0)return i}}async function O(e,t){return N(e,t,e.markdown.pageRouteSlug(t))}async function k(e){let{definition:t,problems:n}=await m(e);if(t===null)return{problems:n};let r=v(t.metadata),{items:i,store:a}=await C(e,t,r),o=T(i,e),s=o?.content?D(o.content.children,e=>e.kind===`code-sample`,E(o)):void 0;if(s===void 0)return null;let c=s.entry,{appendUndeclaredConfigureParameters:l}=await import(`@redocly/api-docs/server`),u=_(e,`parameters`),d={apiStore:a,options:y(e,r),panel:{...c,source:l(c.source,{...u?.path&&{path:u.path},...u?.query&&{query:u.query},...u?.header&&{headers:u.header},...u?.cookie&&{cookie:u.cookie}}),...s.scope},...await O(e,t.contentPath)};return e.node.attributes[e.attributeName]=d,null}async function A(e){let{definition:t,problems:n}=await m(e);if(t===null)return{problems:n};let r=v(t.metadata),{items:i,store:a}=await C(e,t,r),o=T(i,e),s=o?.content?D(o.content.children,e=>e.kind===`response`&&!!e.responseCodes?.length,E(o)):void 0;if(s?.entry.responseCodes===void 0)return null;let c={apiStore:a,options:r,panel:{responseCodes:s.entry.responseCodes,...s.entry.schemaId!==void 0&&{schemaId:s.entry.schemaId},...s.scope},...await O(e,t.contentPath)};return e.node.attributes[e.attributeName]=c,null}async function j(e){let t=_(e,`pointer`);if(t===void 0)return null;let{definition:n,problems:r}=await m(e);if(n===null)return{problems:r};let i=v(n.metadata),{items:a,store:o}=await C(e,n,i),s=w(t).replace(/^\//,``),c=Object.fromEntries([s,s.replace(/\/value$/,``)].filter(e=>o.exampleStore[e]!==void 0).map(e=>[e,o.exampleStore[e]]));if(Object.keys(c).length===0)return null;let l=(await import(`@redocly/api-docs/server`)).findExampleEncoding(a,t),u={apiStore:{schemaStore:{},exampleStore:c,securitySchemeStore:{}},options:{...i,..._(e,`options`)},...l!==void 0&&{encoding:l},...await O(e,n.contentPath)};return e.node.attributes[e.attributeName]=u,null}function M(e,t,n,r,i){if(!e.requestBody||!t&&!n)return e;let a={...e.requestBody};if(t&&(a=a[t]?{[t]:a[t]}:{}),n)for(let[e,t]of Object.entries(a)){let o=t.exampleIds?.filter(e=>r[e]?.key!==void 0);if(!o?.length)continue;let s=i(o,n,e=>r[e]);a[e]={...t,exampleIds:s?[s]:[]}}return{...e,requestBody:a}}function N(e,t,i){let a=n(e.config);if(a===null)return{};let o=r(a,{filePath:t,slug:i??null});return{[d]:o}}async function P(t){let{definition:n,problems:r}=await m(t);if(n===null)return{problems:r};let{findExampleIdByKey:a,JsonPointer:s,normalizeOptions:c,resolveOperationSampleContext:d}=await import(`@redocly/api-docs/server`),f=n.metadata,p=e(f.options)?f.options:{},h=t.markdown.pageRouteSlug(n.contentPath),g=l(p,t.config,h),v=_(t,`options`),y={...g,...v??{}},b=c({specType:`openapi`,...y,markdownParser:o}),x=u(n.document,i,{warn:e=>t.logger?.warn(e)}),S=d(x,b,{operationId:_(t,`operationId`),pointer:_(t,`pointer`)});if(!S)return null;let C=M(S.source,_(t,`mimeType`),_(t,`exampleKey`),S.storeCtx.exampleStore,a),w={apiStore:{schemaStore:S.storeCtx.schemaStore,exampleStore:S.storeCtx.exampleStore,securitySchemeStore:S.storeCtx.securitySchemeStore,specVersion:x.openapi},definition:x,operationId:S.operation.operationId??``,operationSource:C,options:y,pointer:s.compile([`paths`,S.pathName,S.method.toLowerCase()]),...N(t,n.contentPath,h)};return t.node.attributes[t.attributeName]=w,null}export{k as resolveOpenapiCodeSamplePanelAttribute,b as resolveOpenapiCodeSamplesAttribute,j as resolveOpenapiExampleAttribute,P as resolveOpenapiReplayAttribute,A as resolveOpenapiResponsePanelAttribute,x as resolveOpenapiResponseSamplesAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{replaceWithMarkdocError as
|
|
1
|
+
import{markdocErrorResult as e,replaceWithMarkdocError as t}from"../../tags/markdoc-error.js";import{PARTIAL_L10N_ATTRIBUTE as n}from"../../tags/partial.js";import{L10N_DIR as r}from"../../../../shared/constants/l10n/defaults.js";import{delocalizeL10nPath as i,l10nDirOf as a}from"../../../../shared/utils/l10n.js";import{shiftRange as o}from"../../../../shared/utils/shift-range.js";import{inlinedLinkRefs as s}from"../../../link-checker/node-ref.js";import{resolveResolverTarget as c}from"./context-paths.js";import{getPartialsFolders as l,isPartialPath as u}from"../../utils/partials.js";import{FRONTMATTER_BLOCK_RE as d,computeFrontmatterLineOffset as f}from"../../utils/frontmatter-offset.js";import{substituteStaticVariables as p}from"../../utils/substitute-variables.js";import{resolveMarkdocBuildTimeAttributes as m}from"../markdoc.js";import{join as h}from"node:path";async function g(o){let{node:s,attributeName:d}=o,f=s.attributes[d];if(typeof f!=`string`||f===``||o.io===void 0)return null;let p=c(o,f);if(p===null)return null;if(!u(p.contentPath,o.config)){let t=`Partial ${p.contentPath} must live in a partials folder (markdown.partialsFolders: ${l(o.config).join(`, `)})`;return e(s,t,o.sourceFilePath)}let m=a(o.sourceFilePath),g=[],v=m!==void 0&&a(p.contentPath)===void 0?`${r}/${m}/${p.contentPath}`:p.contentPath;if(!await o.io.exists(h(o.contentDir,v))){g.push({kind:`file`,path:v});let t=i(v);if(t!==void 0&&g.push({kind:`file`,path:t}),t===void 0||!await o.io.exists(h(o.contentDir,t))){let t=`Partial file ${p.contentPath} does not exist`;return e(s,t,o.sourceFilePath,g)}v=t}let y=o.partialChain??[o.sourceFilePath];if(y.includes(v))return t(s,`Circular partial inclusion: ${[...y,v].join(` -> `)}`),{entityDeps:[{kind:`file`,path:v}]};let b=await o.io.readFile(h(o.contentDir,v)),x=await _(o,v,b,y);s.children=x.ast.children;let S=[{entityDeps:g},x.result];if(m===void 0&&a(p.contentPath)===void 0){let e={},t=a(o.file.path);for(let n of o.markdown.contentLocales){let i=`${r}/${n}/${o.file.path}`;if(t===void 0&&S.push({entityDeps:[{kind:`file`,path:i}]}),t===void 0?o.markdown.hasPageRoute(i):n!==t)continue;let a=`${r}/${n}/${p.contentPath}`,s=h(o.contentDir,a);if(!await o.io.exists(s)){S.push({entityDeps:[{kind:`file`,path:a}]});continue}let c=await _(o,a,await o.io.readFile(s),y);e[n]=c.ast,S.push(c.result)}Object.keys(e).length>0&&(s.attributes[n]=e)}return{entityDeps:S.flatMap(e=>e.entityDeps??[]),assetUsages:S.flatMap(e=>e.assetUsages??[]),linkRefs:S.flatMap(e=>e.linkRefs??[]),problems:S.flatMap(e=>e.problems??[])}}async function _(e,t,n,r){let i=n.replace(d,``),a=structuredClone(e.markdown.parseCached(i)),o=await m(a,{tags:e.tags,sourceFilePath:t,resolverContext:{config:e.config,contentDir:e.contentDir,entities:e.entities,file:e.file,io:e.io,logger:e.logger,markdown:e.markdown,plugin:e.plugin},partialChain:[...r,t],source:i}),c=e.node.attributes.variables;typeof c==`object`&&c&&!Array.isArray(c)&&p(a,c);let l=f(n);return{ast:a,result:{entityDeps:[{kind:`file`,path:t},...o.entityDeps],assetUsages:o.assetUsages,linkRefs:s(o.linkRefs,t,l),problems:o.problems.map(e=>v(e,l))}}}function v(e,t){if(t===0||e.location?.range===void 0)return e;let n={...e.location,range:o(e.location.range,t)};return{...e,location:n}}export{g as resolvePartialFileAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocErrorResult as e}from"../../tags/markdoc-error.js";import{delocalizeL10nPath as t}from"../../../../shared/utils/l10n.js";import{resolveResolverTarget as n}from"./context-paths.js";import{prefixSvgIds as r}from"../../utils/prefix-svg-ids.js";async function i(i,a={}){let{node:o,attributeName:s}=i,c=o.attributes[s];if(typeof c!=`string`||c===``||i.io===void 0)return null;let l=n(i,c);if(l===null)return null;let u=[{kind:`file`,path:l.contentPath}],d=l;if(!await i.io.exists(l.absolutePath)){let r=t(i.sourceFilePath);if(d=r===void 0?null:n({...i,sourceFilePath:r},c),d===null||!await i.io.exists(d.absolutePath)){if(a.optional)return null;let t=`SVG file ${l.contentPath} does not exist`;return e(o,t,i.sourceFilePath,u)}u.push({kind:`file`,path:d.contentPath})}let f=await i.io.readFile(d.absolutePath),p=d.contentPath.replace(/[^a-zA-Z0-9_-]/g,`-`);return o.attributes[`${s}RawContent`]=r(f,p),{entityDeps:u}}export{i as resolveSvgContentAttribute};
|
|
@@ -4,6 +4,7 @@ import type { LinkRefDraft } from '../../link-checker/classify.js';
|
|
|
4
4
|
import type { ProblemDraft } from '../../problems/types.js';
|
|
5
5
|
import type { EntityInvalidationDep } from '../../plugins/types/plugin.js';
|
|
6
6
|
import type { MarkdocAttributeResolver, MarkdocAttributeResolverContext } from '../../plugins/types/markdoc.js';
|
|
7
|
+
import { type RealmPlusResolverName } from './attribute-resolver-key.js';
|
|
7
8
|
export type MarkdocResolverContextBase = Omit<MarkdocAttributeResolverContext, 'attributeName' | 'node' | 'sourceFilePath' | 'readSourceLines'>;
|
|
8
9
|
export type ResolveMarkdocBuildTimeAttributesOptions = {
|
|
9
10
|
resolverContext?: MarkdocResolverContextBase;
|
|
@@ -22,7 +23,7 @@ export type ResolveMarkdocBuildTimeAttributesResult = {
|
|
|
22
23
|
/** Resolver failures, located at the file each tag is written in. */
|
|
23
24
|
problems: ProblemDraft[];
|
|
24
25
|
};
|
|
25
|
-
type MarkdocAttributeResolverMap = Record<
|
|
26
|
+
type MarkdocAttributeResolverMap = Record<RealmPlusResolverName, MarkdocAttributeResolver>;
|
|
26
27
|
/**
|
|
27
28
|
* Walk the parsed Markdoc AST and resolve local references so that the stored
|
|
28
29
|
* tree contains final URLs rather than raw file paths.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{replaceWithMarkdocError as
|
|
1
|
+
import{markdocErrorResult as e,replaceWithMarkdocError as t}from"../tags/markdoc-error.js";import{walkMarkdocAst as n}from"../utils/walk-markdoc-ast.js";import{getExampleContent as r,walkWithExampleContent as i}from"../utils/reparse-example-fences.js";import{isLocalReference as a}from"./references.js";import{resolveLinkAttribute as o}from"./markdoc-resolvers/link.js";import{resolveIconAttribute as s,resolveImageAttribute as c,resolveImageSrcSetAttribute as l}from"./markdoc-resolvers/image.js";import{resolveCodeSnippetFileAttribute as u}from"./markdoc-resolvers/code-snippet.js";import{resolveSvgContentAttribute as d}from"./markdoc-resolvers/svg-content.js";import{resolveTagRawContentAttribute as f}from"./markdoc-resolvers/tag-raw-content.js";import{resolveHtmlAttrsAttribute as p}from"./markdoc-resolvers/html-attrs.js";import{resolveImageGalleryAttribute as m}from"./markdoc-resolvers/image-gallery.js";import{resolveCodeWalkthroughFilesetsAttribute as h}from"./markdoc-resolvers/code-walkthrough/filesets.js";import{resolvePartialFileAttribute as g}from"./markdoc-resolvers/partial.js";import{resolveDiagramFileAttribute as _}from"./markdoc-resolvers/diagram-file.js";import{resolveParsedYamlAttribute as v,resolveRawContentAttribute as y,resolveRelativePathAttribute as b}from"./markdoc-resolvers/file-reference.js";import{resolveJsonExampleRefAttribute as x,resolveJsonSchemaRefAttribute as S,resolveSampleFromJsonSchemaAttribute as C}from"./markdoc-resolvers/json-schema.js";import{resolveOpenapiCodeSamplePanelAttribute as w,resolveOpenapiCodeSamplesAttribute as T,resolveOpenapiExampleAttribute as E,resolveOpenapiReplayAttribute as D,resolveOpenapiResponsePanelAttribute as O,resolveOpenapiResponseSamplesAttribute as k}from"./markdoc-resolvers/operation-samples.js";import{getAttributeBuildTimeResolver as A}from"./attribute-resolver-key.js";import{convertGithubAlertToAdmonition as j}from"@redocly/theme/markdoc/tags/admonition";import{PROMPT_TAG as M}from"@redocly/theme/core/constants";async function N(e,a){let o=a.tags??{},s=F,c={entityDeps:[],assetUsages:[],linkRefs:[],problems:[]},l=a.resolverContext?.markdown?.disabledTags,u=R(a.source),d=[...n(e,{skipChildren:z})],f=d.flatMap(e=>{let t=r(e);return t?[...i(t,z)]:[]});for(let e of[...d,...f])j(e);let p=f.filter(e=>e.type===`tag`);for(let e of[...d,...p])if(e.type===`link`)await L(s.nativeMdLink,e,`href`,a,c,u);else if(e.type===`image`)await L(s.imageSrc,e,`src`,a,c,u);else if(e.type===`tag`){if(typeof e.tag==`string`&&l?.has(e.tag)){t(e,`The "${e.tag}" tag is not available here.`);continue}let n=typeof e.tag==`string`?o[e.tag]:void 0;for(let[t,r]of Object.entries(n?.attributes??{})){let n=A(r);n&&Object.hasOwn(s,n)&&await L(s[n],e,t,a,c,u)}}return c}const P=({attributeName:e,markdown:t,node:n,partialChain:r,sourceFilePath:i})=>o(n,e,i,t,r?.[0]),F={imageSrc({attributeName:e,markdown:t,node:n,sourceFilePath:r}){return c(n,e,r,t)},imageSrcSet({attributeName:e,markdown:t,node:n,sourceFilePath:r}){return l(n,e,r,t)},link:P,nativeMdLink:P,async relativeOrCdnIcon(e){let{attributeName:t,markdown:n,node:r,sourceFilePath:i}=e,a=r.attributes[t];return typeof a==`string`&&B(a)&&await d(e,{optional:!0}),s(r,t,i,n)},codeSnippetFile:u,diagramFile:_,svgContent:d,tagRawContent:f,htmlAttrs:p,imageGallery:m,codeWalkthroughFilesets:h,partialFile:g,jsonSchemaRef:S,sampleFromJsonSchema:C,jsonExampleRef:x,openapiCodeSamples:T,openapiCodeSamplePanel:w,openapiReplay:D,openapiResponseSamples:k,openapiResponsePanel:O,openapiExample:E,rawContent:y,parsedYaml:v,relativePath:b};function I(e){let t=/* @__PURE__ */ new Set;for(let n of i(e))n.type===`tag`&&typeof n.tag==`string`&&t.add(n.tag);return[...t].sort()}async function L(t,n,r,i,a,o){let s;try{s=await t({...i.resolverContext,attributeName:r,node:n,sourceFilePath:i.sourceFilePath,tags:i.tags,partialChain:i.partialChain,readSourceLines:o})}catch(t){let r=t instanceof Error?t.message:String(t);s=e(n,r,i.sourceFilePath)}s&&(s.entityDeps&&a.entityDeps.push(...s.entityDeps),s.assetUsages&&a.assetUsages.push(...s.assetUsages),s.linkRefs&&a.linkRefs.push(...s.linkRefs),s.problems&&a.problems.push(...s.problems))}function R(e){let t;return()=>(t??=e.split(/\r?\n/),t)}function z(e){return e.type===`tag`&&e.tag===M}function B(e){let t=(e.split(`#`,1)[0]??e).split(`?`,1)[0]??e;return/\.svg$/i.test(t)&&a(e)}export{F as builtInMarkdocAttributeResolvers,I as collectMarkdocTagNames,z as isPromptTag,N as resolveMarkdocBuildTimeAttributes};
|
|
@@ -9,7 +9,8 @@ export type InlineRawPartialsResult = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Classic Realm's `{% raw-partial file="…" /%}`: the text of a Markdown file from a partials
|
|
11
11
|
* folder, inlined before parsing, so link reference definitions in it apply to the page. A
|
|
12
|
-
* `/` path is content-root-relative, any other is relative to the including file. A
|
|
12
|
+
* `/` path is content-root-relative, any other is relative to the including file. A missing
|
|
13
|
+
* `@l10n/<locale>/` file falls back to its default-locale twin, as in classic Realm. A file
|
|
13
14
|
* that is missing, not Markdown, outside the partials folders, or already being inlined
|
|
14
15
|
* inlines nothing and reports a problem.
|
|
15
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{delocalizeL10nPath as e}from"../../../shared/utils/l10n.js";import{resolveContentPath as t}from"../../../shared/utils/resolve-content-path.js";import{isPartialPath as n}from"../utils/partials.js";import{join as r}from"node:path";const i=/\{% ?raw-partial file="([^"]+)" ?\/?%\}/g;async function a(s,c,l,u=[c]){let d={source:s,entityDeps:[],problems:[]};if(!s.includes(`raw-partial`)||l.io===void 0)return d;let f=/* @__PURE__ */ new Map;for(let[,p]of s.matchAll(i)){if(p===void 0||f.has(p))continue;let i=t(p,c),s=``;if(i===null||!i.endsWith(`.md`)||!n(i,l.config))d.problems.push(o(c,`Raw partial "${p}" must be a Markdown file in a partials folder.`));else if(u.includes(i))d.problems.push(o(c,`Circular raw partial inclusion: ${[...u,i].join(` -> `)}`));else{d.entityDeps.push({kind:`file`,path:i});let t=e(i),n=i;if(await l.io.exists(r(l.contentDir,i))||(t!==void 0&&d.entityDeps.push({kind:`file`,path:t}),n=t!==void 0&&await l.io.exists(r(l.contentDir,t))?t:null),n!==null){let e=await a(await l.io.readFile(r(l.contentDir,n)),i,l,[...u,i]);s=e.source,d.entityDeps.push(...e.entityDeps),d.problems.push(...e.problems)}else d.problems.push(o(c,`Raw partial file ${i} does not exist.`))}f.set(p,s)}return d.source=s.replace(i,(e,t)=>f.get(t)??``),d}function o(e,t){return{code:`markdoc/validation-error`,severity:`warning`,message:t,location:{filePath:e}}}export{a as inlineRawPartials};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContentStateView } from '../../database/types/content-state.js';
|
|
1
|
+
import type { ContentStateRouteInfo, ContentStateView } from '../../database/types/content-state.js';
|
|
2
2
|
import type { EntityInvalidationDep } from '../../plugins/types/plugin.js';
|
|
3
3
|
import type { AssetUsage } from '../types/asset-usage.js';
|
|
4
4
|
import type { AudienceTagResolver } from './audience-tag.js';
|
|
@@ -36,6 +36,8 @@ export type ResolveImageSrcSetResult = {
|
|
|
36
36
|
entityDeps: EntityInvalidationDep[];
|
|
37
37
|
assetUsages: AssetUsage[];
|
|
38
38
|
};
|
|
39
|
+
/** The route that serves `slug`: its own, else the nearest wildcard route above it. */
|
|
40
|
+
export declare function findServingRoute(state: ContentStateView, slug: string): ContentStateRouteInfo | undefined;
|
|
39
41
|
export declare function resolveLocalReference(rawHref: string, sourceFilePath: string, state: ContentStateView, resolveAudienceTag?: AudienceTagResolver, contentLocales?: readonly string[], includingPagePath?: string): Promise<ReferenceResolution>;
|
|
40
42
|
export declare function resolveImageReference(rawSrc: string, sourceFilePath: string, state: ContentStateView, resolveAudienceTag?: AudienceTagResolver, contentLocales?: readonly string[]): Promise<ReferenceResolution>;
|
|
41
43
|
export declare function resolveImageSrcSet(rawSrcSet: string, sourceFilePath: string, state: ContentStateView, resolveAudienceTag?: AudienceTagResolver, contentLocales?: readonly string[]): Promise<ResolveImageSrcSetResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buildContentAssetUrl as e}from"../../plugins/internal/assets/url.js";import{L10N_DIR as t}from"../../../shared/constants/l10n/defaults.js";import{delocalizeL10nPath as n,l10nDirOf as r,toLocaleSlug as i}from"../../../shared/utils/l10n.js";import{resolveContentPath as a}from"../../../shared/utils/resolve-content-path.js";import{computePathPrefixes as o}from"../../../shared/utils/routes/compute-path-prefixes.js";import{IMAGE_EXTENSIONS as s}from"../../plugins/internal/assets/extensions.js";import{isRouteSlugTarget as c}from"../../../shared/utils/routes/is-route-slug-target.js";import{safeDecodeURI as l}from"../../../shared/utils/safe-decode-uri.js";import{joinSrcSet as u,parseSrcSet as d}from"../../plugins/internal/assets/srcset.js";import{isIndexPagePath as f,resolveRelativeSlug as p}from"../../../shared/utils/routes/resolve-relative-slug.js";import{posix as m}from"node:path";const h=/[[\]()*_`#!|<>~]|\{
|
|
1
|
+
import{buildContentAssetUrl as e}from"../../plugins/internal/assets/url.js";import{L10N_DIR as t}from"../../../shared/constants/l10n/defaults.js";import{delocalizeL10nPath as n,l10nDirOf as r,toLocaleSlug as i}from"../../../shared/utils/l10n.js";import{resolveContentPath as a}from"../../../shared/utils/resolve-content-path.js";import{computePathPrefixes as o}from"../../../shared/utils/routes/compute-path-prefixes.js";import{IMAGE_EXTENSIONS as s}from"../../plugins/internal/assets/extensions.js";import{isRouteSlugTarget as c}from"../../../shared/utils/routes/is-route-slug-target.js";import{safeDecodeURI as l}from"../../../shared/utils/safe-decode-uri.js";import{joinSrcSet as u,parseSrcSet as d}from"../../plugins/internal/assets/srcset.js";import{isIndexPagePath as f,resolveRelativeSlug as p}from"../../../shared/utils/routes/resolve-relative-slug.js";import{posix as m}from"node:path";const h=/[[\]()*_`#!|<>~]|\{%|\n[ \t\r]*\n|^\s{0,3}([-+*]\s|\d+\.\s|>|-{3,}|={2,})/m;function g(e){return h.test(e)}function _(e){return e.startsWith(`#`)||e.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(e)?!1:!e.startsWith(`/`)||!c(y(e).path)}function v(e){let t=e.indexOf(`?`);return t===-1?[e,``]:[e.slice(0,t),e.slice(t)]}function y(e){let t=e.indexOf(`#`);return t===-1?{path:e,hash:``}:{path:e.slice(0,t),hash:e.slice(t)}}async function b(e,t){let r=await t(e);if(r)return r;let i=n(e);if(i!==void 0){let n=await t(i);if(n){let t=e.slice(0,e.length-i.length),r=n.entityDeps.filter(e=>e.kind===`file`).map(e=>({kind:`file`,path:`${t}${e.path}`}));return{...n,entityDeps:[...r,...n.entityDeps]}}}return{result:{kind:`passthrough`},entityDeps:[],assetUsages:[]}}async function x(e,t){let i=n(e),a=r(e);if(i===void 0||a===void 0)return null;let o=await t(i,a);return o===null?null:{...o,entityDeps:[{kind:`file`,path:e},...o.entityDeps]}}async function S(n,r,i,a,o){let[s]=n.assetUsages;if(!s||!a?.length||n.result.kind!==`assetRef`||r.startsWith(`@l10n/`))return n;let c=e(s.path,s.hash,s.tag),l=[];for(let e of a){let n=`${t}/${e}/${s.path}`,r=i.filesByPath.get(n);if(!r)continue;let a=await o?.(n)??null;l.push({path:n,hash:r.hash,kind:s.kind,tag:a,l10n:{locale:e,canonicalUrl:c}})}return l.length===0?n:{...n,assetUsages:[s,...l]}}function C(e,t){let n=e.routeBySlug.get(t);return n===void 0?o(t).reverse().map(t=>e.routeBySlug.get(t)).find(e=>e?.wildcardPrefix===!0):n}async function w(t,n,r,o,c,u){if(!_(t))return{result:{kind:`passthrough`},entityDeps:[],assetUsages:[]};let{path:d,hash:h}=y(t),g=async(t,n)=>{let a=r.primaryRouteByFilePath.get(t);if(a!==void 0)return{result:{kind:`pageUrl`,url:`${n===void 0?a:i(a,n)}${h}`},entityDeps:[{kind:`file`,path:t}],assetUsages:[]};let c=r.filesByPath.get(t);if(c){let n=m.extname(t).toLowerCase(),r=s.has(n)?`image`:`file`,i=await o?.(t)??null;return{result:{kind:`assetRef`,url:`${e(t,c.hash,i)}${h}`,path:t,hash:c.hash},entityDeps:[{kind:`file`,path:t}],assetUsages:[{path:t,hash:c.hash,kind:r,tag:i}]}}return null};return S(await b(n,async e=>{let t=a(l(d),e);if(t===null)return null;let n=await g(t)??await x(t,g);if(n!==null)return n;let[i=``,o=``]=v(d);if(!d.startsWith(`/`)&&m.extname(i)===``){let t=u??e,n=r.primaryRouteByFilePath.get(t),a=n===void 0?m.extname(t).toLowerCase()===`.md`?void 0:p(i,`/${t}`,!1):p(i,n,f(t)),s=a===void 0?void 0:C(r,a);if(a!==void 0&&s!==void 0)return{result:{kind:`pageUrl`,url:`${a}${o}${h}`},entityDeps:s.originFilePath===null?[]:[{kind:`file`,path:s.originFilePath}],assetUsages:[]}}return null}),n,r,c,o)}async function T(t,n,r,i,o){if(!_(t))return{result:{kind:`passthrough`},entityDeps:[],assetUsages:[]};let{path:s}=y(t),c=async t=>{let n=r.filesByPath.get(t);if(!n)return null;let a=await i?.(t)??null;return{result:{kind:`assetRef`,url:e(t,n.hash,a),path:t,hash:n.hash},entityDeps:[{kind:`file`,path:t}],assetUsages:[{path:t,hash:n.hash,kind:`image`,tag:a}]}};return S(await b(n,async e=>{let t=a(l(s),e);return t===null?null:await c(t)??await x(t,c)}),n,r,o,i)}async function E(e,t,n,r,i){let a=[],o=[],s=d(e);if(!s||s.length===0)return{value:e,entityDeps:a,assetUsages:o};let c=await Promise.all(s.map(async e=>{let s=await T(e.src,t,n,r,i);return s.result.kind===`assetRef`&&(a.push(...s.entityDeps),o.push(...s.assetUsages),e.src=s.result.url),e}));return{value:u(c),entityDeps:a,assetUsages:o}}export{C as findServingRoute,_ as isLocalReference,g as looksLikeMarkdown,T as resolveImageReference,E as resolveImageSrcSet,w as resolveLocalReference,y as splitHash};
|