@redocly/realm 0.130.0-custom.4 → 0.130.0-custom.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +116 -0
- package/dist/bin.js +1 -1
- package/dist/cli/develop.js +1 -1
- package/dist/cli/eject/resolveTheme.d.ts +1 -1
- package/dist/cli/eject/resolveTheme.js +1 -1
- package/dist/cli/prepare/copy-env-files.js +1 -1
- package/dist/cli/prepare/index.js +1 -1
- package/dist/cli/stats/collectors/openapi.js +1 -1
- package/dist/cli/telemetry/index.js +1 -1
- package/dist/client/App.js +1 -1
- package/dist/client/ErrorBoundary.js +1 -1
- package/dist/client/app/DevModeFloatingBar/index.d.ts +3 -0
- package/dist/client/app/DevModeFloatingBar/index.js +43 -0
- package/dist/client/app/Feedback/useSubmitFeedback.js +1 -1
- package/dist/client/app/Sidebar/useSidebarItems.js +1 -1
- package/dist/client/app/hooks/useAutoScroll.js +1 -1
- package/dist/client/app/hooks/useRouteChangeTracker.js +1 -1
- package/dist/client/app/hooks/utils/pathname-matches-active-section.d.ts +6 -0
- package/dist/client/app/hooks/utils/pathname-matches-active-section.js +1 -0
- package/dist/client/app/markdoc/custom-components/html-script.js +1 -0
- package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.js +1 -0
- package/dist/client/app/markdoc/custom-components/openapi/openapi-response-sample.js +1 -0
- package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.js +1 -0
- package/dist/client/app/markdoc/hooks/use-store.js +1 -0
- package/dist/client/browser-entry.js +5 -5
- package/dist/client/constants/common.d.ts +2 -0
- package/dist/client/constants/common.js +1 -0
- package/dist/client/providers/hooks.js +1 -1
- package/dist/client/runtime/loader.js +1 -1
- package/dist/client/runtime/useSocketMessages.js +1 -1
- package/dist/{server/plugins/asyncapi-docs/template → client/templates/asyncapi-docs}/helpers.d.ts +3 -3
- package/dist/client/templates/asyncapi-docs/helpers.js +1 -0
- package/dist/{server/plugins/asyncapi-docs/template/AsyncApiDocs.d.ts → client/templates/asyncapi-docs/template.d.ts} +1 -1
- package/dist/{server/plugins/asyncapi-docs/template/AsyncApiDocs.js → client/templates/asyncapi-docs/template.js} +1 -1
- package/dist/client/templates/openapi-docs/helpers.js +5 -0
- package/dist/{server/plugins/openapi-docs/template/OpenAPIDocs.d.ts → client/templates/openapi-docs/template.d.ts} +1 -1
- package/dist/{server/plugins/openapi-docs/template/OpenAPIDocs.js → client/templates/openapi-docs/template.js} +1 -1
- package/dist/client/utils/catalog/inject-catalog-items.d.ts +1 -1
- package/dist/client/utils/catalog/inject-catalog-items.js +1 -1
- package/dist/constants/catalog-entities.d.ts +12 -0
- package/dist/constants/catalog-entities.js +1 -0
- package/dist/constants/common.d.ts +2 -2
- package/dist/constants/common.js +1 -1
- package/dist/constants/l10n/langs/ar.js +1 -1
- package/dist/constants/l10n/langs/de.js +1 -1
- package/dist/constants/l10n/langs/en.js +1 -1
- package/dist/constants/l10n/langs/es.js +1 -1
- package/dist/constants/l10n/langs/fr.js +1 -1
- package/dist/constants/l10n/langs/hi.js +1 -1
- package/dist/constants/l10n/langs/it.js +1 -1
- package/dist/constants/l10n/langs/ja.js +1 -1
- package/dist/constants/l10n/langs/ko.js +1 -1
- package/dist/constants/l10n/langs/pl.js +1 -1
- package/dist/constants/l10n/langs/pt-BR.js +1 -1
- package/dist/constants/l10n/langs/pt.js +1 -1
- package/dist/constants/l10n/langs/ru.js +1 -1
- package/dist/constants/l10n/langs/uk.js +1 -1
- package/dist/constants/l10n/langs/zh.js +1 -1
- package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/get-inner-text.d.ts +1 -1
- package/dist/markdoc/helpers/get-inner-text.js +2 -0
- package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/get-variable.d.ts +2 -2
- package/dist/markdoc/helpers/get-variable.js +1 -0
- package/dist/markdoc/nodes/fence/index.js +1 -0
- package/dist/markdoc/nodes/heading.js +1 -0
- package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/index.d.ts +6 -6
- package/dist/markdoc/tags/json-example.d.ts +3 -0
- package/dist/markdoc/tags/json-schema.d.ts +3 -0
- package/dist/markdoc/tags/openapi-code-sample.d.ts +3 -0
- package/dist/markdoc/tags/openapi-example.d.ts +3 -0
- package/dist/markdoc/tags/openapi-response-sample.d.ts +3 -0
- package/dist/markdoc/tags/replay-openapi.d.ts +3 -0
- package/dist/markdoc/types.d.ts +8 -0
- package/dist/markdoc/types.js +0 -0
- package/dist/server/api-routes/import-api-routes-handlers.js +1 -1
- package/dist/server/api-routes/run-api-routes-worker.js +1 -1
- package/dist/server/config/env-config.js +1 -0
- package/dist/{config → server/config}/env-schema.d.ts +6 -3
- package/dist/{config → server/config}/env-schemas/database.d.ts +1 -1
- package/dist/server/config/env-schemas/database.js +1 -0
- package/dist/{config → server/config}/env-schemas/organization-project.d.ts +3 -0
- package/dist/{config → server/config}/env-schemas/organization-project.js +1 -1
- package/dist/server/constants/common.d.ts +3 -0
- package/dist/server/constants/common.js +1 -1
- package/dist/server/constants/feedback.d.ts +6 -0
- package/dist/server/constants/feedback.js +1 -0
- package/dist/server/constants/plugins/catalog-entities.d.ts +0 -11
- package/dist/server/constants/plugins/catalog-entities.js +1 -1
- package/dist/server/entitlements/entitlements-provider.js +1 -1
- package/dist/server/esbuild/esbuild-logger.js +1 -1
- package/dist/server/esbuild/esbuild.js +1 -1
- package/dist/server/esbuild/plugins/assets-resolver.js +1 -1
- package/dist/server/esbuild/plugins/esbuild-compile-resolver.js +1 -1
- package/dist/server/esbuild/plugins/styled-components-ssr.js +1 -1
- package/dist/server/esbuild/plugins/themes-resolver.js +2 -2
- package/dist/server/{config/external-plugins.d.ts → external-plugins/resolve-external-plugins.d.ts} +2 -2
- package/dist/server/{config/external-plugins.js → external-plugins/resolve-external-plugins.js} +1 -1
- package/dist/server/fs/cache.js +1 -1
- package/dist/server/fs/last-modified-tracker.js +1 -1
- package/dist/server/fs/utils/is-loader-cache-enabled.js +1 -1
- package/dist/server/node-bundle-entry.js +1 -1
- package/dist/server/plugins/analytics/adobe/index.js +1 -1
- package/dist/server/plugins/analytics/amplitude/index.js +1 -1
- package/dist/server/plugins/analytics/fullstory/index.js +1 -1
- package/dist/server/plugins/analytics/ga/index.js +1 -1
- package/dist/server/plugins/analytics/gtm/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/gtm/index.js +1 -1
- package/dist/server/plugins/analytics/heap/index.js +1 -1
- package/dist/server/plugins/analytics/rudderstack/index.js +1 -1
- package/dist/server/plugins/analytics/segment/index.js +1 -1
- package/dist/server/plugins/asyncapi-docs/index.js +1 -1
- package/dist/server/plugins/asyncapi-docs/search/get-ai-search-documents.js +27 -27
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-write-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/asyncapi-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/graphql-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.js +1 -1
- package/dist/server/plugins/catalog-entities/plugin.js +1 -1
- package/dist/server/plugins/config-parser/loaders/redocly-config-loader.js +1 -1
- package/dist/server/plugins/config-parser/loaders/utils/read-and-validate-config.js +1 -1
- package/dist/server/plugins/default-theme/index.js +1 -1
- package/dist/server/plugins/entitlements/index.js +1 -1
- package/dist/server/plugins/lifecycle.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/code-walkthrough/filesets-resolver.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-code-snippet-from-file.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-html-href.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-html-source-attribute.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-image-src-set.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-image-src.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-json-example-ref.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-json-schema-ref.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-native-md-link.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-nav-links.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-open-api-ref.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-parsed-yaml.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-raw-content.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-relative-or-cdn-icon.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-relative-path.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-sample-from-json-schema.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-svg-content.js +1 -1
- package/dist/server/plugins/markdown/markdoc/import-user-tags.js +1 -1
- package/dist/server/plugins/markdown/markdoc/markdoc-options.js +1 -1
- package/dist/server/plugins/markdown/markdoc/partials.js +1 -1
- package/dist/server/plugins/markdown/markdoc/plugins/headings.js +1 -1
- package/dist/server/plugins/markdown/markdoc/plugins/render-mermaid.js +1 -1
- package/dist/server/plugins/markdown/markdoc/plugins/utils.js +1 -1
- package/dist/server/plugins/markdown/runtime-transform.js +1 -1
- package/dist/server/plugins/markdown/search/get-ai-search-documents.js +1 -1
- package/dist/server/plugins/markdown/search/get-search-documents.js +2 -2
- package/dist/server/plugins/markdown/search/nodes/section-node.js +1 -1
- package/dist/server/plugins/markdown/search/search-resolver.js +1 -1
- package/dist/server/plugins/markdown/search/to-markdown.js +17 -13
- package/dist/server/plugins/markdown/search/walk-sections.js +1 -1
- package/dist/server/plugins/markdown/utils/stringify-tag-children-objects.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/docs-mcp-tool.d.ts +5 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/docs-mcp-tool.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/index.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/search.d.ts +3 -2
- package/dist/server/plugins/mcp/docs-mcp/tools/search.js +6 -1
- package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
- package/dist/server/plugins/mcp/handlers/handle-mcp-request.js +1 -1
- package/dist/server/plugins/mcp/servers/docs-server.d.ts +9 -2
- package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
- package/dist/server/plugins/mcp/types.d.ts +20 -1
- package/dist/server/plugins/openapi-docs/index.js +1 -1
- package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +20 -20
- package/dist/server/plugins/openapi-docs/search-indexer.js +1 -1
- package/dist/server/plugins/scorecard-classic/compute-scorecard.js +1 -1
- package/dist/server/plugins/scorecard-classic/index.js +1 -1
- package/dist/server/plugins/scorecard-classic/lint.js +1 -1
- package/dist/server/plugins/scorecards/database/scorecards-config-service.js +1 -1
- package/dist/server/plugins/scorecards/plugin.js +1 -1
- package/dist/server/plugins/scorecards/workers/run-scorecards-worker.js +1 -1
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.d.ts +11 -0
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +1 -0
- package/dist/server/plugins/search/documents/search-documents.js +1 -1
- package/dist/server/plugins/search/engines/flexsearch/index.js +1 -1
- package/dist/server/plugins/search/engines/typesense/index.js +1 -1
- package/dist/server/plugins/search/index.js +1 -1
- package/dist/server/plugins/search/llmstxt/index.js +1 -1
- package/dist/server/plugins/search/utils.d.ts +2 -0
- package/dist/server/plugins/search/utils.js +2 -2
- package/dist/server/plugins/sidebars/index.js +1 -1
- package/dist/server/plugins/sso/index.js +1 -1
- package/dist/server/providers/database/base-repository.js +1 -1
- package/dist/server/providers/database/database-connection-factory.js +1 -1
- package/dist/server/providers/database/database-preconnect-service.js +1 -1
- package/dist/server/providers/database/databases/sqld-sqlite/drizzle.config.js +1 -1
- package/dist/server/ssr/render.js +1 -1
- package/dist/server/ssr/server-side-props/get-server-props-from-user-handler.js +1 -1
- package/dist/server/ssr/utils.js +1 -1
- package/dist/server/store.d.ts +3 -1
- package/dist/server/store.js +1 -1
- package/dist/server/telemetry/index.js +1 -1
- package/dist/server/tools/notifiers/formatter.js +1 -1
- package/dist/server/tools/notifiers/helpers/colors.js +1 -1
- package/dist/server/tools/notifiers/logger.js +1 -1
- package/dist/server/tools/notifiers/reporter.js +1 -1
- package/dist/server/tools/notifiers/terminal-manager.js +1 -1
- package/dist/server/types/plugins/common.d.ts +1 -0
- package/dist/server/types/plugins/markdown.d.ts +0 -7
- package/dist/server/utils/ai-agent-detection.d.ts +16 -0
- package/dist/server/utils/ai-agent-detection.js +1 -0
- package/dist/server/utils/envs/load-env-variables.js +1 -1
- package/dist/server/utils/fs.js +1 -1
- package/dist/server/utils/index.d.ts +2 -2
- package/dist/server/utils/index.js +1 -1
- package/dist/server/utils/is-catalog-entities-enabled.js +1 -1
- package/dist/server/utils/is-scorecards-enabled.js +1 -1
- package/dist/server/utils/report-all-errors.js +1 -1
- package/dist/server/version.js +1 -1
- package/dist/server/web-server/auth.d.ts +2 -0
- package/dist/server/web-server/auth.js +4 -4
- package/dist/server/web-server/handle-api-route-request.js +1 -1
- package/dist/server/web-server/http.js +2 -2
- package/dist/server/web-server/middleware/apiKeyMiddleware.js +1 -1
- package/dist/server/web-server/middleware/catalogAuthMiddleware.js +1 -1
- package/dist/server/web-server/middleware/corsMiddleware.js +1 -1
- package/dist/server/web-server/middleware/dynamic-middleware/dynamic-middleware.js +1 -1
- package/dist/server/web-server/middleware/idleTimeoutMiddleware.js +1 -1
- package/dist/server/web-server/middleware/responseHeadersMiddleware.js +1 -1
- package/dist/server/web-server/mime-types.js +1 -1
- package/dist/server/web-server/routes/auth.js +1 -1
- package/dist/server/web-server/routes/cors-proxy.d.ts +5 -0
- package/dist/server/web-server/routes/cors-proxy.js +2 -0
- package/dist/server/web-server/routes/dynamic-route.js +1 -1
- package/dist/server/web-server/routes/error.js +1 -1
- package/dist/server/web-server/routes/feedback.js +1 -1
- package/dist/server/web-server/routes/helpers/get-md-asset-pathname.d.ts +2 -0
- package/dist/server/web-server/routes/helpers/get-md-asset-pathname.js +1 -0
- package/dist/server/web-server/routes/index.js +1 -1
- package/dist/server/web-server/routes/info.js +1 -1
- package/dist/server/web-server/routes/mcp-oauth.js +1 -1
- package/dist/server/web-server/routes/otel/otel.js +1 -1
- package/dist/server/web-server/routes/page-data.js +1 -1
- package/dist/server/web-server/routes/path-prefix-redirect.js +1 -1
- package/dist/server/web-server/routes/resolve-route.js +1 -1
- package/dist/server/web-server/routes/semantic-search.d.ts +4 -0
- package/dist/server/web-server/routes/semantic-search.js +1 -0
- package/dist/server/workers/worker-pool.js +1 -1
- package/dist/{server/utils → utils}/slugger.d.ts +13 -0
- package/package.json +11 -11
- package/dist/client/app/ErrorBubble/index.d.ts +0 -3
- package/dist/client/app/ErrorBubble/index.js +0 -59
- package/dist/client/app/PageCounter/index.d.ts +0 -3
- package/dist/client/app/PageCounter/index.js +0 -64
- package/dist/config/env-config.js +0 -1
- package/dist/config/env-schemas/database.js +0 -1
- package/dist/server/plugins/asyncapi-docs/template/helpers.js +0 -1
- package/dist/server/plugins/markdown/markdoc/custom-components/html-script.js +0 -1
- package/dist/server/plugins/markdown/markdoc/custom-components/openapi/openapi-code-sample.js +0 -1
- package/dist/server/plugins/markdown/markdoc/custom-components/openapi/openapi-response-sample.js +0 -1
- package/dist/server/plugins/markdown/markdoc/custom-components/openapi/replay-openapi.js +0 -1
- package/dist/server/plugins/markdown/markdoc/helpers/get-inner-text.js +0 -2
- package/dist/server/plugins/markdown/markdoc/helpers/get-variable.js +0 -1
- package/dist/server/plugins/markdown/markdoc/hooks/use-store.js +0 -1
- package/dist/server/plugins/markdown/markdoc/nodes/fence/index.js +0 -1
- package/dist/server/plugins/markdown/markdoc/nodes/heading.js +0 -1
- package/dist/server/plugins/markdown/markdoc/tags/json-example.d.ts +0 -3
- package/dist/server/plugins/markdown/markdoc/tags/json-schema.d.ts +0 -3
- package/dist/server/plugins/markdown/markdoc/tags/openapi-code-sample.d.ts +0 -3
- package/dist/server/plugins/markdown/markdoc/tags/openapi-example.d.ts +0 -3
- package/dist/server/plugins/markdown/markdoc/tags/openapi-response-sample.d.ts +0 -3
- package/dist/server/plugins/markdown/markdoc/tags/replay-openapi.d.ts +0 -3
- package/dist/server/plugins/openapi-docs/template/helpers.js +0 -5
- package/dist/server/plugins/search/ai-indexer/prepare-ai-search-documents.d.ts +0 -6
- package/dist/server/plugins/search/ai-indexer/prepare-ai-search-documents.js +0 -1
- /package/dist/client/app/{ErrorBubble → DevModeFloatingBar}/DetailedErrors.d.ts +0 -0
- /package/dist/client/app/{ErrorBubble → DevModeFloatingBar}/DetailedErrors.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/html-script.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/index.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/index.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/explain-step.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/explain-step.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/get-operation-info-by-id.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/get-operation-info-by-id.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/get-operation-info-by-pointer.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/get-operation-info-by-pointer.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/get-operation.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/get-operation.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/index.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/index.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/index.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/index.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/operation-identifier.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/operation-identifier.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/operation-info.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/operation-info.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/operation-parameters.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/get-operation/types/operation-parameters.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/index.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/index.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/json-example.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/json-example.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/json-schema.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/json-schema.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/openapi-code-sample.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/openapi-example.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/openapi-example.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/openapi-response-sample.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/replay-openapi.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/step-by-step-wrapper.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/openapi/step-by-step-wrapper.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/styled.elements.d.ts +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/custom-components/styled.elements.js +0 -0
- /package/dist/{server/plugins/markdown → client/app}/markdoc/hooks/use-store.d.ts +0 -0
- /package/dist/{server/plugins/openapi-docs/template → client/templates/openapi-docs}/helpers.d.ts +0 -0
- /package/dist/{server/plugins/openapi-docs/template → client/templates/openapi-docs}/mock-server-config.d.ts +0 -0
- /package/dist/{server/plugins/openapi-docs/template → client/templates/openapi-docs}/mock-server-config.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/definition-path.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/definition-path.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/index.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/index.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/json-example-ref.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/json-example-ref.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/json-schema-ref.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/json-schema-ref.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/parsed-yaml.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/parsed-yaml.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/raw-content.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/raw-content.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/sample-from-json-schema.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/attributes/sample-from-json-schema.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/extract-rbac-from-condition-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/extract-rbac-from-condition-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/get-node-attribute.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/get-node-attribute.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-code-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-code-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-conditional-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-conditional-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-content-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-content-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-example-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-example-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-fence-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-fence-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-function.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-function.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-list-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-list-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-string-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-string-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-tag.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-tag.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-text-node.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-text-node.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-variable.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/guards/is-variable.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/remove-markdoc-tags.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/remove-markdoc-tags.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/set-node-attribute-value.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/helpers/set-node-attribute-value.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/fence/escape-html.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/fence/escape-html.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/fence/index.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/gfm-list-item.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/gfm-list-item.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/heading.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/index.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/index.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/table.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/table.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/text.d.ts +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/nodes/text.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/index.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/json-example.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/json-schema.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/openapi-code-sample.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/openapi-example.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/openapi-response-sample.js +0 -0
- /package/dist/{server/plugins/markdown/markdoc → markdoc}/tags/replay-openapi.js +0 -0
- /package/dist/{config → server/config}/env-config.d.ts +0 -0
- /package/dist/{config → server/config}/env-schema.js +0 -0
- /package/dist/{config → server/config}/env-schemas/api-urls.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/api-urls.js +0 -0
- /package/dist/{config → server/config}/env-schemas/auth.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/auth.js +0 -0
- /package/dist/{config → server/config}/env-schemas/catalog.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/catalog.js +0 -0
- /package/dist/{config → server/config}/env-schemas/environment-detection.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/environment-detection.js +0 -0
- /package/dist/{config → server/config}/env-schemas/feature-flags.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/feature-flags.js +0 -0
- /package/dist/{config → server/config}/env-schemas/scorecards.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/scorecards.js +0 -0
- /package/dist/{config → server/config}/env-schemas/search.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/search.js +0 -0
- /package/dist/{config → server/config}/env-schemas/server-config.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/server-config.js +0 -0
- /package/dist/{config → server/config}/env-schemas/site.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/site.js +0 -0
- /package/dist/{config → server/config}/env-schemas/ssr.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/ssr.js +0 -0
- /package/dist/{config → server/config}/env-schemas/telemetry.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/telemetry.js +0 -0
- /package/dist/{config → server/config}/env-schemas/test.d.ts +0 -0
- /package/dist/{config → server/config}/env-schemas/test.js +0 -0
- /package/dist/server/{config → external-plugins}/resolve-module.d.ts +0 -0
- /package/dist/server/{config → external-plugins}/resolve-module.js +0 -0
- /package/dist/{server/utils → utils}/conflict-resolvers.d.ts +0 -0
- /package/dist/{server/utils → utils}/conflict-resolvers.js +0 -0
- /package/dist/{server/utils → utils}/slugger.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,121 @@
|
|
|
1
1
|
# @redocly/realm
|
|
2
2
|
|
|
3
|
+
## 0.130.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5b1e533559: Fixed security vulnerability CVE-2026-25128 in fast-xml-parser by upgrading openapi-sampler to version 1.7.0.
|
|
8
|
+
- Updated dependencies [5b1e533559]
|
|
9
|
+
- @redocly/portal-plugin-mock-server@0.15.2
|
|
10
|
+
- @redocly/asyncapi-docs@1.7.2
|
|
11
|
+
- @redocly/openapi-docs@3.18.2
|
|
12
|
+
- @redocly/theme@0.62.1
|
|
13
|
+
- @redocly/graphql-docs@1.7.1
|
|
14
|
+
|
|
15
|
+
## 0.130.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 0beb1adad0: Fixed a bug where AI search events were not tracked for project analytics.
|
|
20
|
+
- Updated dependencies [e7708a15f1]
|
|
21
|
+
- Updated dependencies [e7708a15f1]
|
|
22
|
+
- @redocly/portal-plugin-mock-server@0.15.1
|
|
23
|
+
- @redocly/asyncapi-docs@1.7.1
|
|
24
|
+
- @redocly/openapi-docs@3.18.1
|
|
25
|
+
|
|
26
|
+
## 0.131.0-next.6
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- bfdf798d61: Fixed **View as Markdown** and **Copy for LLM** page actions incorrectly omitting schema properties that share a name with a property at a different nesting level.
|
|
31
|
+
- 17aafeac4a: Fixed an issue in OpenAPI docs where example keys were used instead of summary text in example drop-downs.
|
|
32
|
+
- 3b5a78a01a: Updated `@redocly/openapi-core` to version `2.19.0`.
|
|
33
|
+
- 9b35001fdd: Fixed an issue in OpenAPI docs where nested Markdoc partial tags prevented partial content from rendering.
|
|
34
|
+
- c50df09073: Fixed an issue where scorecard displayed a "Lint completed without rules" message when rules were configured in the `apis` section of `redocly.yaml` rather than at the root level.
|
|
35
|
+
- 2bb21c43ec: Fixed security vulnerability `CVE-2026-26278` in `fast-xml-parser` by upgrading to version `5.3.6`.
|
|
36
|
+
- Updated dependencies [17aafeac4a]
|
|
37
|
+
- Updated dependencies [3b5a78a01a]
|
|
38
|
+
- Updated dependencies [2bb21c43ec]
|
|
39
|
+
- Updated dependencies [2bb21c43ec]
|
|
40
|
+
- @redocly/openapi-docs@3.19.0-next.4
|
|
41
|
+
- @redocly/portal-plugin-mock-server@0.16.0-next.4
|
|
42
|
+
- @redocly/asyncapi-docs@1.8.0-next.4
|
|
43
|
+
|
|
44
|
+
## 0.131.0-next.5
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- 5ef75a3b5d: Fixed an issue where the **Copy for LLM** and **View as Markdown** page actions ignored the respective path prefix for the root page.
|
|
49
|
+
- Updated dependencies [5ef75a3b5d]
|
|
50
|
+
- @redocly/theme@0.63.0-next.3
|
|
51
|
+
- @redocly/asyncapi-docs@1.8.0-next.3
|
|
52
|
+
- @redocly/graphql-docs@1.8.0-next.3
|
|
53
|
+
- @redocly/openapi-docs@3.19.0-next.3
|
|
54
|
+
- @redocly/portal-plugin-mock-server@0.16.0-next.3
|
|
55
|
+
|
|
56
|
+
## 0.131.0-next.4
|
|
57
|
+
|
|
58
|
+
### Minor Changes
|
|
59
|
+
|
|
60
|
+
- d87ca0f750: Replaces the separate right-side development mode controls in Realm docs UI with a single bottom floating status bar to improve user experience.
|
|
61
|
+
- e7cc4036fc: Added support for OpenAPI 3.2 `tags` object.
|
|
62
|
+
- 4aa015b6ea: Added support for OpenAPI 3.2 `querystring` parameters to handle structured query parameters with nested objects and arrays.
|
|
63
|
+
- 10585dd0d0: Added support for the `nodeType` field in the OpenAPI 3.2 XML Object.
|
|
64
|
+
- 703634d21f: Enabled semantic search for Docs MCP.
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- c2b1717b2b: Added stricter validation to feedback forms.
|
|
69
|
+
- 34ef22b17c: Added `code-snippet` Markdoc tag support for `llms.txt`.
|
|
70
|
+
- b8765bab46: Updated `@redocly/openapi-core` to version `2.18.2`.
|
|
71
|
+
- Updated dependencies [c2b1717b2b]
|
|
72
|
+
- Updated dependencies [e7cc4036fc]
|
|
73
|
+
- Updated dependencies [4aa015b6ea]
|
|
74
|
+
- Updated dependencies [10585dd0d0]
|
|
75
|
+
- Updated dependencies [34ef22b17c]
|
|
76
|
+
- Updated dependencies [b8765bab46]
|
|
77
|
+
- @redocly/theme@0.63.0-next.2
|
|
78
|
+
- @redocly/openapi-docs@3.19.0-next.2
|
|
79
|
+
- @redocly/asyncapi-docs@1.8.0-next.2
|
|
80
|
+
- @redocly/graphql-docs@1.8.0-next.2
|
|
81
|
+
- @redocly/portal-plugin-mock-server@0.16.0-next.2
|
|
82
|
+
|
|
83
|
+
## 0.130.2
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- 4dfbc3b570: Fixed an issue where Project Analytics would not display any data for specific versions of Realm.
|
|
88
|
+
- Updated dependencies [4dfbc3b570]
|
|
89
|
+
- @redocly/realm-asyncapi-sdk@0.8.1
|
|
90
|
+
- @redocly/theme@0.62.0
|
|
91
|
+
|
|
92
|
+
## 0.131.0-next.3
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- 807547ecbd: Improved build memory usage during build for large projects.
|
|
97
|
+
|
|
98
|
+
## 0.131.0-next.2
|
|
99
|
+
|
|
100
|
+
### Minor Changes
|
|
101
|
+
|
|
102
|
+
- 8a6153095f: Added an internal `/_api/cors` proxy endpoint in Realm and configured embedded Replay to use it by default.
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- 089558ba51: Updated `@redocly/openapi-core` to version `2.18.0`.
|
|
107
|
+
- 8ff89afeb0: Fixed an issue where Project Analytics would not display any data for specific versions of Realm.
|
|
108
|
+
- adf0e98992: Fixed an issue where the expand dropdown buttons were not covered by other dropdown menus.
|
|
109
|
+
- Updated dependencies [089558ba51]
|
|
110
|
+
- Updated dependencies [8ff89afeb0]
|
|
111
|
+
- Updated dependencies [adf0e98992]
|
|
112
|
+
- @redocly/openapi-docs@3.19.0-next.1
|
|
113
|
+
- @redocly/realm-asyncapi-sdk@0.9.0-next.1
|
|
114
|
+
- @redocly/theme@0.63.0-next.1
|
|
115
|
+
- @redocly/asyncapi-docs@1.8.0-next.1
|
|
116
|
+
- @redocly/portal-plugin-mock-server@0.16.0-next.1
|
|
117
|
+
- @redocly/graphql-docs@1.8.0-next.1
|
|
118
|
+
|
|
3
119
|
## 0.131.0-next.1
|
|
4
120
|
|
|
5
121
|
### Patch Changes
|
package/dist/bin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./server/utils/set-execution-mode.js";import"./cli/utils/node-version-check.js";import o from"mri";import*as r from"node:path";import{tmpdir as A}from"node:os";import*as x from"node:fs";import"./server/node-fetch-polyfill.js";import{cliCommandNames as g}from"./constants/common.js";import{initPlugins as T}from"./server/plugins/lifecycle.js";import{loadEnvVariables as y}from"./server/utils/envs/load-env-variables.js";import{PORTAL_VERSION as k}from"./server/version.js";import{logger as p}from"./server/tools/notifiers/logger.js";import{reporter as t}from"./server/tools/notifiers/reporter.js";import{sha as R}from"./server/utils/crypto/sha.js";import{envConfig as S}from"./config/env-config.js";import{develop as V}from"./cli/develop.js";import{eject as I}from"./cli/eject/index.js";import{beforeCommand as w}from"./server/utils/lifecycle-hooks.js";import{Store as C}from"./server/store.js";import{prepare as L}from"./cli/prepare/index.js";import{fromCurrentDir as _}from"./server/utils/paths.js";import{translationsCliOpts as M}from"./cli/translations/options.js";import{generateTranslations as N}from"./cli/translations/index.js";import{EntitlementsProvider as F}from"./server/entitlements/entitlements-provider.js";import{isValidPlan as U}from"./server/entitlements/is-valid-plan.js";import{stopAllCompilers as $}from"./server/esbuild/esbuild.js";import{copyLibsqlPrebuiltBinary as q}from"./cli/prepare/libsql/copy-prebuilt-binary.js";import{telemetry as d}from"./cli/telemetry/index.js";import{stats as B}from"./cli/stats/index.js";import{statsCliOpts as G}from"./cli/stats/options.js";const n=process.argv[2];let i;const f={alias:{d:"project-dir",p:"port"},default:{"project-dir":S.REDOCLY_CONTENT_DIR||process.cwd(),outdir:"public"}},Y={alias:f.alias,default:{...f.default,plan:"enterprise"}},z={alias:{d:"prepareDir"},default:{prepareDir:"public"}},H={boolean:["force"],alias:{f:"force",d:"project-dir"},default:{"project-dir":process.cwd()}};process.on("uncaughtException",async function(e){e?.code==="ERR_INVALID_STATE"?console.log("Ignore premature close error"):(p.error("Uncaught exception occurred. Stopping compilers."),await $(),p.error("Exiting due to uncaught exception"),await t.panic(e))});try{n||await t.panicOnContentError("Command not specified.");const e=F.instance();switch(["prepare","serve","stats"].includes(n)&&await e.init(),["eject","translate"].includes(n)&&await e.init({developModePlan:"enterprise"}),n){case"develop":case"preview":const a=o(process.argv.slice(3),Y),E=r.resolve(a["project-dir"]),j=r.join(A(),"redocly-public-"+R(E)),l=a.plan.toLowerCase();U(l)||await t.panicOnContentError(`Invalid --plan argument value '${l}'.`),await e.init({developModePlan:l}),i=new C({contentDir:r.resolve(a["project-dir"]),outdir:j,serverOutDir:_(import.meta.url,"./server/esbuild/cache/server")}),await w(g.DEVELOP,a,i),await V(a,i);break;case"prepare":const s=o(process.argv.slice(3),f),u=r.resolve(r.join(s.outdir,"server"));i=new C({contentDir:r.resolve(s["project-dir"]),outdir:r.resolve(s.outdir,"client"),serverOutDir:u}),await w(g.PREPARE,s,i),q(u),await L(s,i);break;case"serve":await y();const b=o(process.argv.slice(3),z),O=r.resolve(b.prepareDir);d.sendServeCliCommandExecutedMessage();const v=r.join(O,"server","index.mjs");x.existsSync(v)||await t.panic("Server not found. Please run `realm prepare` first"),import(v).catch(async c=>{await t.panic("Failed to load server",c)});break;case"eject":e.canAccessFeature("themeEjecting")||await t.panicOnContentError('The "eject" command is not available for this project');const m=o(process.argv.slice(3),H),{lifecycleContext:{getConfig:h,fs:D}}=await T({outdir:"",contentDir:r.resolve(m["project-dir"]),setGlobalConfig:()=>null});D.dispose(),d.sendCliCommandEjectExecutedMessage([{object:"cli_command",arguments:m}]),await I({...m,config:await h()}),p.clearAllTimeouts();break;case"translate":if(e.canAccessFeature("l10n")){const c=o(process.argv.slice(3),M);d.sendCliCommandTranslateExecutedMessage({arguments:c}),await N(c)}else await t.panicOnContentError('The "translate" command is not available for this project');break;case"stats":const P=o(process.argv.slice(3),G);await B(P);break;case"--version":console.log(k);break;default:await t.panicOnContentError(`Unknown command "${n}"`)}}catch(e){p.error("Exiting due to uncaught exception"),await t.panic(e)}
|
|
2
|
+
import"./server/utils/set-execution-mode.js";import"./cli/utils/node-version-check.js";import o from"mri";import*as r from"node:path";import{tmpdir as A}from"node:os";import*as x from"node:fs";import"./server/node-fetch-polyfill.js";import{cliCommandNames as g}from"./constants/common.js";import{initPlugins as T}from"./server/plugins/lifecycle.js";import{loadEnvVariables as y}from"./server/utils/envs/load-env-variables.js";import{PORTAL_VERSION as k}from"./server/version.js";import{logger as p}from"./server/tools/notifiers/logger.js";import{reporter as t}from"./server/tools/notifiers/reporter.js";import{sha as R}from"./server/utils/crypto/sha.js";import{envConfig as S}from"./server/config/env-config.js";import{develop as V}from"./cli/develop.js";import{eject as I}from"./cli/eject/index.js";import{beforeCommand as w}from"./server/utils/lifecycle-hooks.js";import{Store as C}from"./server/store.js";import{prepare as L}from"./cli/prepare/index.js";import{fromCurrentDir as _}from"./server/utils/paths.js";import{translationsCliOpts as M}from"./cli/translations/options.js";import{generateTranslations as N}from"./cli/translations/index.js";import{EntitlementsProvider as F}from"./server/entitlements/entitlements-provider.js";import{isValidPlan as U}from"./server/entitlements/is-valid-plan.js";import{stopAllCompilers as $}from"./server/esbuild/esbuild.js";import{copyLibsqlPrebuiltBinary as q}from"./cli/prepare/libsql/copy-prebuilt-binary.js";import{telemetry as d}from"./cli/telemetry/index.js";import{stats as B}from"./cli/stats/index.js";import{statsCliOpts as G}from"./cli/stats/options.js";const n=process.argv[2];let i;const f={alias:{d:"project-dir",p:"port"},default:{"project-dir":S.REDOCLY_CONTENT_DIR||process.cwd(),outdir:"public"}},Y={alias:f.alias,default:{...f.default,plan:"enterprise"}},z={alias:{d:"prepareDir"},default:{prepareDir:"public"}},H={boolean:["force"],alias:{f:"force",d:"project-dir"},default:{"project-dir":process.cwd()}};process.on("uncaughtException",async function(e){e?.code==="ERR_INVALID_STATE"?console.log("Ignore premature close error"):(p.error("Uncaught exception occurred. Stopping compilers."),await $(),p.error("Exiting due to uncaught exception"),await t.panic(e))});try{n||await t.panicOnContentError("Command not specified.");const e=F.instance();switch(["prepare","serve","stats"].includes(n)&&await e.init(),["eject","translate"].includes(n)&&await e.init({developModePlan:"enterprise"}),n){case"develop":case"preview":const a=o(process.argv.slice(3),Y),E=r.resolve(a["project-dir"]),j=r.join(A(),"redocly-public-"+R(E)),l=a.plan.toLowerCase();U(l)||await t.panicOnContentError(`Invalid --plan argument value '${l}'.`),await e.init({developModePlan:l}),i=new C({contentDir:r.resolve(a["project-dir"]),outdir:j,serverOutDir:_(import.meta.url,"./server/esbuild/cache/server")}),await w(g.DEVELOP,a,i),await V(a,i);break;case"prepare":const s=o(process.argv.slice(3),f),u=r.resolve(r.join(s.outdir,"server"));i=new C({contentDir:r.resolve(s["project-dir"]),outdir:r.resolve(s.outdir,"client"),serverOutDir:u}),await w(g.PREPARE,s,i),q(u),await L(s,i);break;case"serve":await y();const b=o(process.argv.slice(3),z),O=r.resolve(b.prepareDir);d.sendServeCliCommandExecutedMessage();const v=r.join(O,"server","index.mjs");x.existsSync(v)||await t.panic("Server not found. Please run `realm prepare` first"),import(v).catch(async c=>{await t.panic("Failed to load server",c)});break;case"eject":e.canAccessFeature("themeEjecting")||await t.panicOnContentError('The "eject" command is not available for this project');const m=o(process.argv.slice(3),H),{lifecycleContext:{getConfig:h,fs:D}}=await T({outdir:"",contentDir:r.resolve(m["project-dir"]),setGlobalConfig:()=>null});D.dispose(),d.sendCliCommandEjectExecutedMessage([{object:"cli_command",arguments:m}]),await I({...m,config:await h()}),p.clearAllTimeouts();break;case"translate":if(e.canAccessFeature("l10n")){const c=o(process.argv.slice(3),M);d.sendCliCommandTranslateExecutedMessage({arguments:c}),await N(c)}else await t.panicOnContentError('The "translate" command is not available for this project');break;case"stats":const P=o(process.argv.slice(3),G);await B(P);break;case"--version":console.log(k);break;default:await t.panicOnContentError(`Unknown command "${n}"`)}}catch(e){p.error("Exiting due to uncaught exception"),await t.panic(e)}
|
package/dist/cli/develop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{logger as t}from"../server/tools/notifiers/logger.js";import{reporter as u}from"../server/tools/notifiers/reporter.js";import{green as v}from"../server/tools/notifiers/helpers/colors.js";import{envConfig as m}from"../config/env-config.js";import{resolveCache as w}from"../server/esbuild/plugins/themes-resolver.js";import{getBilledPagesCount as p}from"../server/utils/index.js";import{createClientCompiler as C,createServerCompiler as h}from"../server/esbuild/esbuild.js";import{initPlugins as S,runPlugins as f,writeClientEntries as E}from"../server/plugins/lifecycle.js";import{startDevServer as R}from"../server/web-server/dev-server.js";import{validateAllMarkdowns as b}from"../server/plugins/markdown/compiler.js";import{reportAllErrors as g}from"../server/utils/report-all-errors.js";import{copyMigrationsFolder as y}from"../server/providers/database/copy-migrations.js";async function F(i,e){t.info("Starting project preview mode."),E(e),t.startTiming("initial-js"),await L(e),t.infoTime("initial-js","JavaScript compiled");const{pluginInstances:a,lifecycleContext:n}=await S({contentDir:e.contentDir,outdir:e.outdir,serverOutDir:void 0,devLogin:i["dev-login"]!==!1,setGlobalConfig:e.setGlobalConfig});e.lifecycleContext=n,y(e),await f(a,e,n,{failFast:!0});const d=async()=>{const r=performance.now();u.clearErrors(),await f(a,e,n),m.REDOCLY_EXP_DISABLE_MD_VALIDATION!=="true"?await b(e,n):t.info("Skipping markdown validation step"),D().then(async()=>{await g(n);const l=p(e.getAllRoutes()),o=u.summary(` \u{1F440} Last change processed in ${v(Math.round(performance.now()-r)+"ms")}`,l);e.runListeners("errors-updated",void 0,o),e.runListeners("pages-updated",void 0,l),e.runListeners("routes-updated")})};m.REDOCLY_EXP_DISABLE_MD_VALIDATION!=="true"?await b(e,n):t.info("Skipping markdown validation step"),await g(n);const s=p(e.getAllRoutes());u.summary(" \u{1F440} Watching for changes...",s),e.runListeners("pages-updated",void 0,s),n.fs.watch(async()=>{w.clear(),await d()}),t.verbose("Starting development server."),await R(e,n,{port:Number(i.port||4e3)}),u.listenStdin()}async function L(i){let e=!0,a=!0;const n=r=>{r==="client"?e=!0:a=!0,i.runListeners("build-started"),e!=a&&(i.startEsbuildRun(),t.startTiming("rebuild"))},d=async r=>{r==="client"?e=!1:a=!1,!(e||a)&&(i.finishEsbuildRun(),i.buildRevision++,t.infoTime("rebuild","JavaScript re-compiled"),await i.reloadMarkdocOptions(),i.markUserCodeReady(),i.runListeners("build-updated"),i.lifecycleContext&&i.buildRevision>1&&i.lifecycleContext.fs.emitCodeUpdated())},s=[new Promise((r,l)=>{const o={label:"client",buildStart(){t.verbose("Start compiling client code."),t.startTiming(this.label)},buildEnd(){t.verboseTime(this.label,"Client compiled"),r(!0)},rebuildStart:()=>n("client"),rebuildEnd:()=>d("client")};C(i,i.outdir,"development",o).then(c=>c.watch()).catch(l)}),new Promise((r,l)=>{const o={label:"server",buildStart(){t.verbose("Start compiling server code."),t.startTiming(this.label)},buildEnd(){t.verboseTime(this.label,"Server compiled"),r(!0)},rebuildStart:()=>n("server"),rebuildEnd:()=>d("server")};h(i,i.serverOutDir,"development",o).then(c=>c.watch()).catch(l)})];await Promise.all(s),await i.reloadMarkdocOptions()}function D(){return new Promise(i=>{setTimeout(i,0)})}export{F as develop};
|
|
1
|
+
import{logger as t}from"../server/tools/notifiers/logger.js";import{reporter as u}from"../server/tools/notifiers/reporter.js";import{green as v}from"../server/tools/notifiers/helpers/colors.js";import{envConfig as m}from"../server/config/env-config.js";import{resolveCache as w}from"../server/esbuild/plugins/themes-resolver.js";import{getBilledPagesCount as p}from"../server/utils/index.js";import{createClientCompiler as C,createServerCompiler as h}from"../server/esbuild/esbuild.js";import{initPlugins as S,runPlugins as f,writeClientEntries as E}from"../server/plugins/lifecycle.js";import{startDevServer as R}from"../server/web-server/dev-server.js";import{validateAllMarkdowns as b}from"../server/plugins/markdown/compiler.js";import{reportAllErrors as g}from"../server/utils/report-all-errors.js";import{copyMigrationsFolder as y}from"../server/providers/database/copy-migrations.js";async function F(i,e){t.info("Starting project preview mode."),E(e),t.startTiming("initial-js"),await L(e),t.infoTime("initial-js","JavaScript compiled");const{pluginInstances:a,lifecycleContext:n}=await S({contentDir:e.contentDir,outdir:e.outdir,serverOutDir:void 0,devLogin:i["dev-login"]!==!1,setGlobalConfig:e.setGlobalConfig});e.lifecycleContext=n,y(e),await f(a,e,n,{failFast:!0});const d=async()=>{const r=performance.now();u.clearErrors(),await f(a,e,n),m.REDOCLY_EXP_DISABLE_MD_VALIDATION!=="true"?await b(e,n):t.info("Skipping markdown validation step"),D().then(async()=>{await g(n);const l=p(e.getAllRoutes()),o=u.summary(` \u{1F440} Last change processed in ${v(Math.round(performance.now()-r)+"ms")}`,l);e.runListeners("errors-updated",void 0,o),e.runListeners("pages-updated",void 0,l),e.runListeners("routes-updated")})};m.REDOCLY_EXP_DISABLE_MD_VALIDATION!=="true"?await b(e,n):t.info("Skipping markdown validation step"),await g(n);const s=p(e.getAllRoutes());u.summary(" \u{1F440} Watching for changes...",s),e.runListeners("pages-updated",void 0,s),n.fs.watch(async()=>{w.clear(),await d()}),t.verbose("Starting development server."),await R(e,n,{port:Number(i.port||4e3)}),u.listenStdin()}async function L(i){let e=!0,a=!0;const n=r=>{r==="client"?e=!0:a=!0,i.runListeners("build-started"),e!=a&&(i.startEsbuildRun(),t.startTiming("rebuild"))},d=async r=>{r==="client"?e=!1:a=!1,!(e||a)&&(i.finishEsbuildRun(),i.buildRevision++,t.infoTime("rebuild","JavaScript re-compiled"),await i.reloadMarkdocOptions(),i.markUserCodeReady(),i.runListeners("build-updated"),i.lifecycleContext&&i.buildRevision>1&&i.lifecycleContext.fs.emitCodeUpdated())},s=[new Promise((r,l)=>{const o={label:"client",buildStart(){t.verbose("Start compiling client code."),t.startTiming(this.label)},buildEnd(){t.verboseTime(this.label,"Client compiled"),r(!0)},rebuildStart:()=>n("client"),rebuildEnd:()=>d("client")};C(i,i.outdir,"development",o).then(c=>c.watch()).catch(l)}),new Promise((r,l)=>{const o={label:"server",buildStart(){t.verbose("Start compiling server code."),t.startTiming(this.label)},buildEnd(){t.verboseTime(this.label,"Server compiled"),r(!0)},rebuildStart:()=>n("server"),rebuildEnd:()=>d("server")};h(i,i.serverOutDir,"development",o).then(c=>c.watch()).catch(l)})];await Promise.all(s),await i.reloadMarkdocOptions()}function D(){return new Promise(i=>{setTimeout(i,0)})}export{F as develop};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ResolvedPlugin } from '../../server/
|
|
1
|
+
import type { ResolvedPlugin } from '../../server/external-plugins/resolve-external-plugins.js';
|
|
2
2
|
export declare function resolveTheme(contentDir: string, pluginPaths: string[], themeName?: string, componentToEject?: string): Promise<ResolvedPlugin | undefined>;
|
|
3
3
|
//# sourceMappingURL=resolveTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as f from"path";import{bold as i}from"colorette";import{existsSync as m}from"node:fs";import{USER_THEME_ALIAS as u}from"../../constants/common.js";import{reporter as a}from"../../server/tools/notifiers/reporter.js";import{
|
|
1
|
+
import*as f from"path";import{bold as i}from"colorette";import{existsSync as m}from"node:fs";import{USER_THEME_ALIAS as u}from"../../constants/common.js";import{reporter as a}from"../../server/tools/notifiers/reporter.js";import{resolveExternalPlugins as l}from"../../server/external-plugins/resolve-external-plugins.js";const d=[".tsx",".ts",".mjsx",".mjs",".jsx",".js"];async function T(t,s,e,n){const o=(await l(t,s)).find(r=>e?r.name===e:h(r,n));if(!o){const r=e?`The requested theme ${i(e)} does not exist`:n?`The requested component ${i(n)} does not exist in any theme`:void 0;r&&await a.panicOnBuildContentError(r)}return o}function h(t,s){if(t.name===u||!s)return!1;for(const e of d)if(m(f.join(t.pluginDirAbsolutePath,s+e)))return!0;return!1}export{T as resolveTheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"node:path";import{copyFileSync as v,existsSync as s,mkdirSync as u}from"node:fs";import{envConfig as c}from"../../config/env-config.js";import{logger as l}from"../../server/tools/notifiers/logger.js";import{sanitizeBranchName as a}from"../../server/utils/envs/sanitize-branch-name.js";const F=n=>{const i=f();s(n.serverOutDir)||u(n.serverOutDir,{recursive:!0});const e=[];for(const o of i){const r=t.join(n.contentDir,o);if(!s(r))continue;const p=t.join(n.serverOutDir,o);v(r,p),e.push(o)}e.length>0&&l.info(`Env files included in bundle: ${e.map(()=>"%rp").join(", ")}`,...e)},f=()=>{const n=c.redoclyEnv,i=c.PUBLIC_REDOCLY_BRANCH_NAME,e=[".env"];switch(i&&e.push(`.env.branch.${a(i)}`),n){case"production":e.push(".env.production");break;case"preview":e.push(".env.preview");break;default:e.push(".env.development");break}return e};export{F as copyEnvFiles};
|
|
1
|
+
import t from"node:path";import{copyFileSync as v,existsSync as s,mkdirSync as u}from"node:fs";import{envConfig as c}from"../../server/config/env-config.js";import{logger as l}from"../../server/tools/notifiers/logger.js";import{sanitizeBranchName as a}from"../../server/utils/envs/sanitize-branch-name.js";const F=n=>{const i=f();s(n.serverOutDir)||u(n.serverOutDir,{recursive:!0});const e=[];for(const o of i){const r=t.join(n.contentDir,o);if(!s(r))continue;const p=t.join(n.serverOutDir,o);v(r,p),e.push(o)}e.length>0&&l.info(`Env files included in bundle: ${e.map(()=>"%rp").join(", ")}`,...e)},f=()=>{const n=c.redoclyEnv,i=c.PUBLIC_REDOCLY_BRANCH_NAME,e=[".env"];switch(i&&e.push(`.env.branch.${a(i)}`),n){case"production":e.push(".env.production");break;case"preview":e.push(".env.preview");break;default:e.push(".env.development");break}return e};export{F as copyEnvFiles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import T from"node:path";import{unlink as h}from"node:fs/promises";import{writeFileSync as y}from"node:fs";import{envConfig as S}from"../../config/env-config.js";import{PORTAL_VERSION as A}from"../../server/version.js";import{logger as e}from"../../server/tools/notifiers/logger.js";import{reporter as b}from"../../server/tools/notifiers/reporter.js";import{shutdowner as O}from"../../server/tools/shutdowner.js";import{promiseMapLimit as D}from"../../server/utils/async/promise-map-limit.js";import{validateReactPages as E}from"../../server/plugins/pages/validators/validate-react-pages.js";import{ensureDir as v}from"../../server/utils/index.js";import{initPlugins as M,runPlugins as _,writeClientEntries as x}from"../../server/plugins/lifecycle.js";import{createClientCompiler as L,createNodeBundleCompiler as J}from"../../server/esbuild/esbuild.js";import{validateAllMarkdowns as j}from"../../server/plugins/markdown/compiler.js";import{copyEnvFiles as k}from"./copy-env-files.js";import{EsbuildError as l,esbuildLogger as p}from"../../server/esbuild/esbuild-logger.js";import{reportAllErrors as F}from"../../server/utils/report-all-errors.js";import{collectAnalytics as U}from"./analytics/collect-analytics.js";import{copyMigrationsFolder as z}from"../../server/providers/database/copy-migrations.js";import{telemetry as c}from"../telemetry/index.js";import{telemetryTraceStep as m}from"../telemetry/helpers/trace-step.js";async function si(C,i){c.initialize(A),e.info("Starting project build.");const P=e.startTiming();await m("build.start",async R=>{x(i);const d=await L(i,i.outdir,"production"),u=await J(i,i.serverOutDir,"production");let n,f;try{await m("build.client_compilation",async()=>{const s=e.startTiming(),o=await d.rebuild().catch(a=>{throw new l(a)});Array.isArray(o.warnings)&&p(new l({warnings:o.warnings}));const r=e.infoTime(s,"Client JavaScript compiled");r&&c.sendTimingPerformedMessage(r)}),await m("build.server_compilation",async()=>{const s=e.startTiming(),o=await u.rebuild().catch(a=>{throw new l(a)});Array.isArray(o.warnings)&&p(new l({warnings:o.warnings}));const r=e.infoTime(s,"Server JavaScript compiled");r&&c.sendTimingPerformedMessage({message:r.message,timeMs:r.timeMs})}),await i.reloadMarkdocOptions();let t;({pluginInstances:t,lifecycleContext:n}=await M({outdir:i.outdir,serverOutDir:i.serverOutDir,contentDir:i.contentDir,devLogin:C.devLogin,setGlobalConfig:i.setGlobalConfig})),n.fs.dispose(),i.lifecycleContext=n,z(i),await _(t,i,n),f=U(i,n),await m("build.client_server_recompile",async()=>{const s=e.startTiming();e.info("Re-compiling JavaScript with user code"),(await Promise.all([d.rebuild(),u.rebuild()]).catch(a=>{throw new l(a)})).forEach(({warnings:a})=>{Array.isArray(a)&&p(new l({warnings:a}))});const r=e.infoTime(s,"JavaScript re-compiled");r&&c.sendTimingPerformedMessage(r)}),await m("build.pages_validation",async()=>{await E(i,n),await j(i,n)}),await F(n),i.markUserCodeReady()}catch(t){R?.error(t),t instanceof l&&p(t)}finally{f&&await f.catch(()=>{}),await d.dispose(),await u.dispose()}b.printErrors(),e.info("Rendering pages..."),await m("build.prepare_static_data",async t=>{const s=e.startTiming(),o=[...i.getAllRoutes(),...i.getAllApiRoutes()];t?.setAttribute("totalRoutes",o.length.toString()),await D(o,15,a=>i.writeRouteStaticData(a,n));const r=e.successTime(s,"Page static data prepared.");r&&c.sendTimingPerformedMessage(r)}),await m("build.store_serialization",async()=>{const t=e.startTiming();v(i.serverOutDir),y(T.join(i.serverOutDir,"store.json"),JSON.stringify(await i.toJson())),e.successTime(t,"Store serialized and written."),k(i)});const g=S.REDOCLY_PROBLEMS_OUTPUT_FILE;if(g){const t=e.startTiming();y(v(g),JSON.stringify(b.getProblems()),"utf-8"),e.successTime(t,"Broken links written.")}await h(T.join(i.serverOutDir,"index.css"));const w=e.successTime(P,"All done");w&&c.sendTimingPerformedMessage(w)}),await O.exitWithCode(0)}export{si as prepare};
|
|
1
|
+
import T from"node:path";import{unlink as h}from"node:fs/promises";import{writeFileSync as y}from"node:fs";import{envConfig as S}from"../../server/config/env-config.js";import{PORTAL_VERSION as A}from"../../server/version.js";import{logger as e}from"../../server/tools/notifiers/logger.js";import{reporter as b}from"../../server/tools/notifiers/reporter.js";import{shutdowner as O}from"../../server/tools/shutdowner.js";import{promiseMapLimit as D}from"../../server/utils/async/promise-map-limit.js";import{validateReactPages as E}from"../../server/plugins/pages/validators/validate-react-pages.js";import{ensureDir as v}from"../../server/utils/index.js";import{initPlugins as M,runPlugins as _,writeClientEntries as x}from"../../server/plugins/lifecycle.js";import{createClientCompiler as L,createNodeBundleCompiler as J}from"../../server/esbuild/esbuild.js";import{validateAllMarkdowns as j}from"../../server/plugins/markdown/compiler.js";import{copyEnvFiles as k}from"./copy-env-files.js";import{EsbuildError as l,esbuildLogger as p}from"../../server/esbuild/esbuild-logger.js";import{reportAllErrors as F}from"../../server/utils/report-all-errors.js";import{collectAnalytics as U}from"./analytics/collect-analytics.js";import{copyMigrationsFolder as z}from"../../server/providers/database/copy-migrations.js";import{telemetry as c}from"../telemetry/index.js";import{telemetryTraceStep as m}from"../telemetry/helpers/trace-step.js";async function si(C,i){c.initialize(A),e.info("Starting project build.");const P=e.startTiming();await m("build.start",async R=>{x(i);const d=await L(i,i.outdir,"production"),u=await J(i,i.serverOutDir,"production");let n,f;try{await m("build.client_compilation",async()=>{const s=e.startTiming(),o=await d.rebuild().catch(a=>{throw new l(a)});Array.isArray(o.warnings)&&p(new l({warnings:o.warnings}));const r=e.infoTime(s,"Client JavaScript compiled");r&&c.sendTimingPerformedMessage(r)}),await m("build.server_compilation",async()=>{const s=e.startTiming(),o=await u.rebuild().catch(a=>{throw new l(a)});Array.isArray(o.warnings)&&p(new l({warnings:o.warnings}));const r=e.infoTime(s,"Server JavaScript compiled");r&&c.sendTimingPerformedMessage({message:r.message,timeMs:r.timeMs})}),await i.reloadMarkdocOptions();let t;({pluginInstances:t,lifecycleContext:n}=await M({outdir:i.outdir,serverOutDir:i.serverOutDir,contentDir:i.contentDir,devLogin:C.devLogin,setGlobalConfig:i.setGlobalConfig})),n.fs.dispose(),i.lifecycleContext=n,z(i),await _(t,i,n),f=U(i,n),await m("build.client_server_recompile",async()=>{const s=e.startTiming();e.info("Re-compiling JavaScript with user code"),(await Promise.all([d.rebuild(),u.rebuild()]).catch(a=>{throw new l(a)})).forEach(({warnings:a})=>{Array.isArray(a)&&p(new l({warnings:a}))});const r=e.infoTime(s,"JavaScript re-compiled");r&&c.sendTimingPerformedMessage(r)}),await m("build.pages_validation",async()=>{await E(i,n),await j(i,n)}),await F(n),i.markUserCodeReady()}catch(t){R?.error(t),t instanceof l&&p(t)}finally{f&&await f.catch(()=>{}),await d.dispose(),await u.dispose()}b.printErrors(),e.info("Rendering pages..."),await m("build.prepare_static_data",async t=>{const s=e.startTiming(),o=[...i.getAllRoutes(),...i.getAllApiRoutes()];t?.setAttribute("totalRoutes",o.length.toString()),await D(o,15,a=>i.writeRouteStaticData(a,n));const r=e.successTime(s,"Page static data prepared.");r&&c.sendTimingPerformedMessage(r)}),await m("build.store_serialization",async()=>{const t=e.startTiming();v(i.serverOutDir),y(T.join(i.serverOutDir,"store.json"),JSON.stringify(await i.toJson())),e.successTime(t,"Store serialized and written."),k(i)});const g=S.REDOCLY_PROBLEMS_OUTPUT_FILE;if(g){const t=e.startTiming();y(v(g),JSON.stringify(b.getProblems()),"utf-8"),e.successTime(t,"Broken links written.")}await h(T.join(i.serverOutDir,"index.css"));const w=e.successTime(P,"All done");w&&c.sendTimingPerformedMessage(w)}),await O.exitWithCode(0)}export{si as prepare};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{detectSpec as m,getTypes as f,normalizeTypes as d,normalizeVisitors as u,resolveDocument as w,BaseResolver as h,Stats as
|
|
1
|
+
import{detectSpec as m,getTypes as f,normalizeTypes as d,normalizeVisitors as u,resolveDocument as w,BaseResolver as h,Stats as y,walkDocument as S}from"@redocly/openapi-core";import{logger as l}from"../../../server/tools/notifiers/logger.js";import{envConfig as g}from"../../../server/config/env-config.js";import{telemetryTraceStep as D}from"../../telemetry/helpers/trace-step.js";import{telemetry as I}from"../../telemetry/index.js";const t={refs:{metric:"References",total:0,color:"red",items:new Set},externalDocs:{metric:"External Documents",total:0,color:"magenta"},schemas:{metric:"Schemas",total:0,color:"white"},parameters:{metric:"Parameters",total:0,color:"yellow",items:new Set},links:{metric:"Links",total:0,color:"cyan",items:new Set},pathItems:{metric:"Path Items",total:0,color:"green"},webhooks:{metric:"Webhooks",total:0,color:"green"},operations:{metric:"Operations",total:0,color:"yellow"},tags:{metric:"Tags",total:0,color:"white",items:new Set}};async function T(s,a){await D("stats.openapi",async()=>{l.info("OpenAPI collector: start processing documents...");const e=(await s.cache.load(".","load-oas-docs")).data,o=[];for(const r of e)if(!r.isVirtual){const n=await v(r);o.push(n),I.sendStatsOpenapiCollectedMessage([{...n,projectBuildId:g.PROJECT_BUILD_ID||""}])}a||console.table(o),l.info("OpenAPI collector: openapi docments processing completed.")})}async function v(s){const a=s.definition,e=m(a),o=d(f(e)),r=u([{severity:"warn",ruleId:"openapi_stats",visitor:y(t)}],o),n={problems:[],specVersion:e,visitorsData:{}},c={source:{absoluteRef:""},parsed:a},i=o.Root;if(!i)throw new Error("Root type not found in OpenAPI spec types");const p=await w({rootDocument:c,rootType:i,externalRefResolver:new h});return S({rootType:i,normalizedVisitors:r,resolvedRefMap:p,document:c,ctx:n}),{path:s.relativePath,refs:t.refs.total,externalDocs:t.externalDocs.total,schemas:t.schemas.total,parameters:t.parameters.total,links:t.links.total,pathItems:t.pathItems.total,webhooks:t.webhooks.total,operations:t.operations.total,tags:t.tags.total,version:e}}export{T as collectOpenapiDocumentsStatistics};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AsyncApiRealmCLI as c}from"@redocly/realm-asyncapi-sdk";import{TELEMETRY_ENABLED as i}from"../../server/constants/common.js";import{shutdowner as
|
|
1
|
+
import{AsyncApiRealmCLI as c}from"@redocly/realm-asyncapi-sdk";import{ulid as l}from"ulid";import{TELEMETRY_ENABLED as i}from"../../server/constants/common.js";import{shutdowner as s}from"../../server/tools/shutdowner.js";import{envConfig as t}from"../../server/config/env-config.js";import{PACKAGE_NAME as n}from"../../config/product-gates.js";class d extends c.Telemetry{#e=new Map;constructor(){super(),this.updateCloudEventData(()=>({organizationId:t.ORGANIZATION_ID||"",organizationSlug:t.ORGANIZATION_SLUG||"",projectId:t.PROJECT_ID||"",projectSlug:t.PROJECT_SLUG||"",origin:"realmCli",actor:{id:`ann_${l()}`,object:"user",uri:""},source:"cli"}))}initialize(e,r,o){const a=r!==void 0?!(r&&i):!i;this.init({otel:{serviceName:"realm-cli",serviceVersion:`${n}@${e}`,collectorTraceUrl:t.OTEL_TRACES_URL||"https://otel.cloud.redocly.com/v1/traces",isProd:t.isProductionEnv,version:"1.0",tracerName:"cli-telemetry"},disabled:a,verbose:o}),s.registerShutdownCallback(this.#r.bind(this))}addTraceStepCallbacks(e,{error:r,end:o}){this.#e.set(e,{error:r,end:o})}removeTraceStepCallbacks(e){this.#e.delete(e)}async#r(e){for(const[,{error:r,end:o}]of this.#e)e&&r(e),o();this.#e.clear(),await this.forceFlush(),await this.shutdown()}}const m=new d,A=m.tracer;export{m as telemetry,A as telemetryTracer};
|
package/dist/client/App.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"react";import{useEffect as
|
|
1
|
+
import*as o from"react";import{useEffect as l}from"react";import{Outlet as E,useLocation as g,useNavigate as d}from"react-router-dom";import{components as h}from"@redocly-markdoc/components";import P from"@markdoc/markdoc/dist/react";import{withoutPathPrefix as T}from"@redocly/theme/core/utils";import{InternalServerErrorLayout as D}from"@redocly/theme/layouts/InternalServerErrorLayout";import{RootLayout as S}from"@redocly/theme/layouts/RootLayout";import{PageLayout as L}from"@redocly/theme/layouts/PageLayout";import{components as i}from"@redocly/theme/markdoc/default";import{Sidebar as _}from"./app/Sidebar/Sidebar";import{loadAndNavigate as v}from"./app/utils/loadAndNavigate";import{useActions as C}from"./app/Sidebar/useActions";import{useScrollTracker as A}from"./app/hooks/useScrollTracker";import{useAutoScroll as y}from"./app/hooks/useAutoScroll";import{OPENAPI_DOCS_TEMPLATE_ID as O,ASYNC_API_DOCS_TEMPLATE_ID as R,GRAPHQL_TEMPLATE_ID as N}from"../constants/common";import{removeTrailingSlash as I}from"../utils/url/remove-trailing-slash";import{removeLeadingSlash as b}from"../utils/url/remove-leading-slash";import*as k from"./app/markdoc/custom-components/index";import{DefaultStyles as M}from"./styling/default-styles";import{ThemeDataProvider as x}from"./providers/theme/ThemeDataProvider";import{PageDataContext as B}from"./providers/page-data/PageDataContext";import{SeoTags as G}from"./app/seo/SeoTags";import{useRouterForLocalLinks as V,useRunningEnvironmentCheck as F}from"./providers/hooks";import{usePageData as $,usePageDataLoader as w}from"./providers/page-data/hooks";import{ErrorBoundary as H}from"./ErrorBoundary";import{ErrorDetails as c,Loader as Q}from"./server-entry";import"@styles";import{useRouteChangeTracker as U}from"./app/hooks/useRouteChangeTracker";import{isInIframe as Y}from"./utils";import{useL10n as j}from"./app/l10n";import{PostMessageProvider as q}from"./providers/post-message/PostMessageProvider";import{ScriptLoader as z}from"./ScriptLoader";import{clientRoutes as J}from"./runtime/generated/routes.js";import{DevModeFloatingBar as K}from"./app/DevModeFloatingBar";import{usePageTimeTracker as W}from"./app/hooks/usePageTimeTracker";globalThis.__LOADER.markdocComponents={...k,...i};function ke(){const e=w(),[t,n]=o.useState(e),r=g(),m=d();j(),l(()=>{e?n(e):v({navigate:m,to:r.pathname+r.search+r.hash}).then(()=>n(Q.loadSync(r.pathname)))},[r,m]),V();const a=F();return a?(console.log(a),o.createElement(c,{error:{message:a,name:""}})):t?o.createElement(H,null,o.createElement(M,null),o.createElement(B.Provider,{value:e||t},o.createElement(x,null,o.createElement(q,{enabled:process.env.NODE_ENV==="development"||Y()},o.createElement(E,null))))):null}function u(){U(),W(),A(),y();const e=$(),t=C(),{layout:n}=t,r={layout:n},m=process.env.NODE_ENV!=="production",a=globalThis.SSR_OMIT_SUSPENSE,s=e?.props.ast&&e.props.ast.$$mdtype==="Tag"?P(e.props.ast,o,{components:{...globalThis.__LOADER.markdocComponents,...i,...h}}):null,f=I(e?.slug||"");if(l(()=>{document.documentElement.classList.add("ready")},[]),e?.props.pagePropGetterError?.message)return m?o.createElement(c,{error:{...e?.props?.pagePropGetterError}}):o.createElement(D,null);if(!!e?.props?.compilationErrors?.length)return e?.Template?o.createElement(e.Template,{pageProps:e?.props,children:s}):null;const p=()=>o.createElement(S,null,o.createElement(L,{sidebar:o.createElement(_,{layoutControls:t})},o.createElement(G,{seo:e?.props.seo,slug:f}),e?.Template?o.createElement(e.Template,{pageProps:[O,R,N].includes(e.templateId)?{...e.props,apiOptions:r}:e?.props,children:s}):null),process.env.NODE_ENV!=="production"&&o.createElement(K,null),o.createElement(z,null));return a?p():o.createElement(o.Suspense,null,p())}const Me=[...J.map(e=>({Component:u,path:b(T(e).substring(1)+"/*")})),{Component:u,path:"*"}];export{ke as App,u as Page,Me as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as s from"react";import{ErrorDetails as a}from"./app/Error/ErrorDetails";import{telemetry as n}from"./app/telemetry/index.js";class p extends s.Component{constructor(r){super(r),this.state={error:void 0}}componentDidCatch(r,c){const{name:e,message:t}=r,o={name:e,message:t,stack:c.componentStack??void 0};this.setState({error:o}),n.sendClientErrorMessage([{object:"client",message:`${e}: ${t}`,url:location.href}]),n.sendError(o,"ReactErrorBoundary"),process.env.NODE_ENV!=="production"&&console.log(r)}render(){return this.state.error&&process.env.NODE_ENV!=="production"?s.createElement(a,{error:this.state.error}):this.props.children}}export{p as ErrorBoundary};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import e from"react";import u from"styled-components";import{Tooltip as X}from"@redocly/theme/components/Tooltip/Tooltip";import{CheckmarkFilledIcon as H}from"@redocly/theme/icons/CheckmarkFilledIcon/CheckmarkFilledIcon";import{DraggableIcon as O}from"@redocly/theme/icons/DraggableIcon/DraggableIcon";import{ErrorFilledIcon as N}from"@redocly/theme/icons/ErrorFilledIcon/ErrorFilledIcon";import{Button as U}from"@redocly/theme/components/Button/Button";import{DetailedErrors as G}from"./DetailedErrors";import{useSocketMessages as T}from"../../runtime/useSocketMessages";const V="pages-updated",W="errors-updated",P=99,f=24,k="portal.dev-mode-floating-bar-slot",K=280,w="bottom-left",R=["bottom-left","middle","bottom-right"];function Y(t,a){const s=a/2;return{minX:s+f,maxX:t-s-f}}function j(t,a){switch(t){case"bottom-left":return a.minX;case"bottom-right":return a.maxX;case"middle":default:return(a.minX+a.maxX)/2}}function q(t){return typeof t=="string"&&R.includes(t)}function J(){if(typeof window>"u")return w;try{const t=localStorage.getItem(k);return q(t)?t:w}catch{return w}}function de(){const[t,a]=e.useState(0),[s,z]=e.useState([]),[B,E]=e.useState(!1),[l,v]=e.useState(!1),[c,L]=e.useState(J),[p,b]=e.useState(null),S=e.useRef(0),g=e.useRef(null),h=e.useRef(null);T(V,r=>a(r.pages)),T(W,r=>z(r.errors));const y=e.useCallback(()=>h.current?.getBoundingClientRect().width||K,[]),d=e.useCallback(()=>Y(window.innerWidth,y()),[y]),x=e.useCallback(r=>{const o=d();return Math.min(Math.max(o.minX,r),o.maxX)},[d]),D=e.useCallback(r=>{const o=d();return R.map(n=>{const i=j(n,o),$=Math.abs(i-r);return{slot:n,distance:$}}).sort((n,i)=>n.distance-i.distance)[0].slot},[d]);e.useEffect(()=>{if(!(typeof window>"u"))try{localStorage.setItem(k,c)}catch{return}},[c]),e.useEffect(()=>{if(!l)return;const r=n=>{const i=x(n.clientX-S.current);g.current=i,b(i)},o=()=>{v(!1);const n=g.current||0,i=D(n);L(i),b(null),g.current=null};return window.addEventListener("pointermove",r),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o),()=>{window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)}},[x,D,l,c]);const M=r=>{if(r.button!==0)return;const o=h.current?.getBoundingClientRect();if(!o)return;const n=o.left+o.width/2;S.current=r.clientX-n,g.current=n,b(n),v(!0),r.preventDefault()},_=e.useMemo(()=>{if(l&&p!==null)return{left:`${p}px`,right:"auto",transform:"translateX(-50%)"};switch(c){case"middle":return{left:"50%",right:"auto",transform:"translateX(-50%)"};case"bottom-right":return{left:"auto",right:`${f}px`,transform:"none"};case"bottom-left":default:return{left:`${f}px`,right:"auto",transform:"none"}}},[p,l,c]);if(!t&&!s.length)return null;const A=s.length>P?`${P}+`:s.length,m=s.length>0,I=m?"Problems":"No problems",F=c==="bottom-left"?"left":c==="bottom-right"?"right":"center";return e.createElement(e.Fragment,null,e.createElement(Q,{ref:h,$isDragging:l,style:_},e.createElement(X,{tip:"Drag to move",placement:"top",arrowPosition:F,disabled:l},e.createElement(Z,{type:"button","aria-label":"Drag floating bar",onPointerDown:M,$isDragging:l},e.createElement(O,{size:"14px",color:"var(--color-warm-grey-5)"}))),e.createElement(ee,{"aria-label":"Total number of pages in documentation"},e.createElement(C,null,t),e.createElement(te,null,"pages")),e.createElement(X,{tip:I,placement:"top"},e.createElement(re,{type:"button",variant:"secondary",size:"small",icon:m?e.createElement(N,{size:"14px",color:"var(--color-raspberry-6)"}):e.createElement(H,{size:"14px",color:"var(--color-green-6)"}),"aria-label":m?"Show detailed error message":"No errors",onClick:()=>m&&E(!0)},e.createElement(C,null,A)))),B&&e.createElement(G,{onHide:()=>E(!1),problems:s}))}const Q=u.div`
|
|
2
|
+
position: fixed;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 2px;
|
|
6
|
+
background: var(--color-warm-grey-10);
|
|
7
|
+
color: var(--color-warm-grey-1);
|
|
8
|
+
border-radius: var(--border-radius-lg);
|
|
9
|
+
bottom: var(--spacing-lg);
|
|
10
|
+
padding: var(--spacing-xxs);
|
|
11
|
+
box-shadow: var(--bg-raised-shadow);
|
|
12
|
+
z-index: var(--z-index-raised);
|
|
13
|
+
user-select: none;
|
|
14
|
+
cursor: ${({$isDragging:t})=>t?"grabbing":"default"};
|
|
15
|
+
`,Z=u.button`
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
border: 0;
|
|
20
|
+
background: transparent;
|
|
21
|
+
color: inherit;
|
|
22
|
+
height: var(--line-height-base);
|
|
23
|
+
cursor: ${({$isDragging:t})=>t?"grabbing":"grab"};
|
|
24
|
+
`,ee=u.div`
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding-right: var(--spacing-xs);
|
|
28
|
+
gap: var(--spacing-xxs);
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
line-height: var(--line-height-base);
|
|
31
|
+
`,te=u.span`
|
|
32
|
+
font-size: var(--font-size-base);
|
|
33
|
+
`,C=u.span`
|
|
34
|
+
font-size: var(--font-size-base);
|
|
35
|
+
font-weight: var(--font-weight-regular);
|
|
36
|
+
`,re=u(U)`
|
|
37
|
+
--button-bg-color-secondary: var(--color-warm-grey-8);
|
|
38
|
+
--button-bg-color-secondary-hover: var(--color-warm-grey-7);
|
|
39
|
+
--button-bg-color-secondary-pressed: var(--color-warm-grey-6);
|
|
40
|
+
--button-color: var(--color-warm-grey-3);
|
|
41
|
+
--button-color-hover: var(--color-warm-grey-3);
|
|
42
|
+
--button-padding: 1px 6px;
|
|
43
|
+
`;export{de as DevModeFloatingBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as f}from"react";import{withPathPrefix as b,combineUrls as u}from"@redocly/theme/core/utils";import{ServerRoutes as l}from"../../../constants/common";import{usePageData as P}from"../../providers/hooks";import{usePageSharedData as g}from"../../providers/page-data/hooks";function O(){const{basePath:o}=g("openAPIDocsStore")||{},e=P()?.templateId==="openapi_docs";return{submitFeedback:f(async({type:i,values:r,path:n,location:s,lang:c})=>{const m=u(window.location.origin,e?o:"",n),a={};for(const[d,t]of Object.entries(r))a[d]=typeof t=="string"?t.trim():t;const p={location:s?.trim(),lang:c?.trim(),component:i,...a,path:m};await fetch(b(l.FEEDBACK),{method:"POST",body:JSON.stringify(p)})},[o,e])}}export{O as useSubmitFeedback};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as _}from"react-router-dom";import{useEffect as k,useMemo as S,useState as b}from"react";import{useActiveSectionId as D}from"@redocly/theme/core/hooks";import{getMenuItemType as v}from"@redocly/theme/core/utils";import{MenuItemType as C}from"@redocly/theme/core/constants";import{
|
|
1
|
+
import{useLocation as _}from"react-router-dom";import{useEffect as k,useMemo as S,useState as b}from"react";import{useActiveSectionId as D}from"@redocly/theme/core/hooks";import{getMenuItemType as v}from"@redocly/theme/core/utils";import{MenuItemType as C}from"@redocly/theme/core/constants";import{CATALOG_BASE_SLUG as T,CATALOG_SLUGS as h}from"../../../constants/catalog-entities";import{usePageSharedData as y,useSidebarItemsData as G,useSidebarConnectedCatalogConfig as E,useSidebarConnectedCatalogEntity as O}from"../../providers/page-data/hooks";import{mapItemsPropsToState as g}from"./utils";import{injectCatalogItems as K}from"../../utils/catalog/inject-catalog-items";import{filterOutVersionedItems as B}from"./helpers/filter-out-versioned-items";const M="catalog.backToAllLabel",P=`${T}/${h.ALL}`;function U(n){const e=G();return S(()=>B(e,n),[e,n])}function J(n){const e=_(),t=D(e,!0),a=O(),p=E(),s=U(n),c=a?K(s,a.key,p?.slug,e.search):s,[u,I]=b(null),r=S(()=>g(c,e,t),[t,e,c]),l=y("current-catalog-info"),L=S(()=>f(r),[c]),[o,m]=b(L),i=o.length>0?o[o.length-1]:void 0,A=i&&g([...i.item.link?[{...i.item,items:[],menuStyle:void 0,separatorLine:!1}]:[],...i.item.items],e,t);k(()=>{if(!u||u!==t){const d=f(r);m(d),I(t)}},[s,e,t,u]);const w=i?{slug:i.previousLink,event:"sidebar_drilldown_back_button.clicked"}:a?{label:"Back to Catalog",labelTranslationKey:M,slug:P,event:"back_to_catalog_button.clicked"}:l?{label:l.catalog.label,labelTranslationKey:l.catalog.labelTranslationKey,slug:l.catalog.link,event:"back_to_catalog_button.clicked"}:void 0;return{currentItems:A||r,allSidebarItems:r,popDrilldownState:()=>{o.length>0&&m(o.slice(0,o.length-1))},pushDrilldownState:d=>{m([...o,d])},backLink:w,versionLabel:a?.version??null}}function f(n,e=[]){for(const t of n){if(!t.active&&!t.hasActiveSubItem)continue;if(v(t)===C.DrillDown&&e.push({item:t}),t.active)return e;if(t.hasActiveSubItem)return f(t.items,e)}return e}export{U as useRawSidebarItems,J as useSidebarItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as i,useNavigate as
|
|
1
|
+
import{useLocation as i,useNavigate as s}from"react-router-dom";import{useEffect as h,useRef as m}from"react";import{useActiveSectionId as u}from"@redocly/theme/core/hooks";import{isBrowser as f}from"../../../utils/env/is-browser";import{pathnameMatchesActiveSection as p}from"./utils/pathname-matches-active-section.js";let c=!0;function g(){const t=i(),o=s(),e=u(t,!1,!1),a=m(null);h(()=>{if(e&&c){c=!1,a.current=e;return}const n=a.current!==e,r=p(window.location.pathname,e);f()&&e&&!t.hash&&n&&!r&&o({pathname:t.pathname,search:t.search,hash:`#${e}`},{replace:!0}),a.current=e},[e,t.pathname,t.search,t.hash,o])}export{g as useAutoScroll};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as u,useNavigate as d,useNavigationType as l}from"react-router-dom";import{useEffect as v,useState as P}from"react";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{removeTrailingSlash as E}from"../../../utils/url/remove-trailing-slash";import{
|
|
1
|
+
import{useLocation as u,useNavigate as d,useNavigationType as l}from"react-router-dom";import{useEffect as v,useState as P}from"react";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{removeTrailingSlash as E}from"../../../utils/url/remove-trailing-slash";import{onRouteChange as M}from"../../runtime/generated/browser-plugins.js";import{resolveRouteBySlug as y}from"../utils/resolveRouteBySlug.js";import{usePageData as b}from"./usePageData.js";import{usePostMessage as C}from"../../providers/post-message/use-post-message.js";import{isInIframe as T}from"../../utils/utils.js";import{waitForContentScripts as I}from"../../ScriptLoader.js";import{telemetry as N}from"../telemetry/index.js";const U=()=>{const e=u(),n=d(),a=l(),r=b(),[t,i]=P(),m=w(),{sendMessage:h}=C();v(()=>{I().then(()=>{if(e.pathname!==t?.pathname||e.search!==t.search){M({location:e,prevLocation:t},m);const o=`${window.origin}${e.pathname+e.search+e.hash}`,s=t?`${window.origin}${t.pathname+t.search+t.hash}`:void 0;N.sendPageViewedMessage([{object:"page",uri:o,referrer:s||document.referrer||void 0}])}});const c=!!t;i(e);const{pathname:p,hash:g,state:f}=e;if(e?.pathname.endsWith("/")&&e?.pathname!=="/"){const o=E(e.pathname);n({pathname:o,search:e.search,hash:e.hash},{replace:!0})}(process.env.NODE_ENV==="development"||T())&&c&&y(p+g,r?.templateId).then(o=>{const s=a==="POP"?"browser":f?.origin;s&&h({type:"route-updated",origin:s,...o})}).catch(o=>console.log("Resolve route by slug failed with error: ",o.message))},[e,a])};export{U as useRouteChangeTracker};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when pathname (after decode) already identifies the same section as activeSectionId.
|
|
3
|
+
* Used to avoid adding redundant hash when URL path already matches (e.g. encoded %7b/%7d vs logical {}).
|
|
4
|
+
*/
|
|
5
|
+
export declare function pathnameMatchesActiveSection(pathname: string, activeSectionId: string): boolean;
|
|
6
|
+
//# sourceMappingURL=pathname-matches-active-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{normalizeRouteSlug as t}from"../../../../utils/path/normalize-route-slug";function c(e,o){return t(e).toLowerCase().includes(o.toLowerCase())}export{c as pathnameMatchesActiveSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as s from"react";import{loadScriptFromReactAsync as l,loadScriptFromReactSync as i}from"../../../ScriptLoader";function u(n){let r=!1;const{children:c,src:e,async:o,...t}=n;return typeof document<"u"&&(r=!!(e?document.querySelector(`script[src="${e}"]`):null)),s.useEffect(()=>{r||(e?o?l(e,t):i(e,!1,t):c&&i(c.toString(),!0,t))},[e]),null}export{u as HtmlScript};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as o from"react";import{StoreProvider as v,RequestSamples as y,normalizeOptions as E}from"@redocly/openapi-docs";import{ErrorMessage as O,OpenApiComponentWrap as M}from"../styled.elements";import{useStore as b}from"../../hooks/use-store";import{getOperation as C}from"./get-operation/index";import{getMockServerDocsConfig as k}from"../../../../templates/openapi-docs/mock-server-config.js";function P(u){const{descriptionFile:d,operationId:a,pointer:m,exampleKey:s,mimeType:l,language:r,requestBody:f,parameters:g,environment:t,environments:n}=u,{store:e,error:S,baseSlug:c}=b(d),i=o.useMemo(()=>({...e?.options,...(r||null)&&{codeSamples:{languages:[{lang:r??""}]},mockServer:k(e?.options?.mockServer,c||"")}}),[r,e?.options,c]),p=o.useMemo(()=>{if(e)return C(e,{operationId:a,pointer:m},E(i),{exampleKey:s,mimeType:l,environments:n,environment:t})},[s,i,l,a,m,e,n,t]);return e?p?o.createElement(M,{"data-testid":"openapi-code-sample"},o.createElement(v,{options:i,definition:e.definition,withState:{environments:n,environment:t,operation:{pointer:p.pointer,state:{requestValues:{body:f,...g}}}}},o.createElement(y,{operation:p,disableFooter:!0}))):o.createElement("pre",{style:{color:"red"}},"Cannot find OpenAPI operation by operationId or pointer"):o.createElement(O,null,S)}export{P as OpenApiCodeSample};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{StoreProvider as S,ResponseSamples as v,normalizeOptions as g}from"@redocly/openapi-docs";import{ErrorMessage as b,OpenApiComponentWrap as E}from"../styled.elements";import{useStore as R}from"../../hooks/use-store";import{getOperation as C}from"./get-operation/index";import{getMockServerDocsConfig as O}from"../../../../templates/openapi-docs/mock-server-config.js";function x(a){const{descriptionFile:m,operationId:i,pointer:p,exampleKey:t}=a,{store:o,error:c,baseSlug:s}=R(m),[l,f]=e.useState(),r=e.useMemo(()=>({...o?.options,mockServer:O(o?.options?.mockServer,s||"")}),[o?.options,s]),n=e.useMemo(()=>{if(o)return C(o,{operationId:i,pointer:p},g(r),{exampleKey:t})},[t,r,i,p,o]),d=e.useCallback(u=>{f(u)},[]);return o?n?e.createElement(E,{"data-testid":"openapi-response-sample"},e.createElement(S,{options:r,definition:o.definition,withState:{operation:{pointer:n.pointer,state:{activeExampleName:t}}}},e.createElement(v,{operation:n,activeResponseTab:l,onTabChange:d}))):e.createElement("pre",{style:{color:"red"}},"Cannot find OpenAPI operation by operationId or pointer"):e.createElement(b,null,c)}export{x as OpenApiResponseSample};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"react";import{EmbeddedReplay as E,StoreProvider as M}from"@redocly/openapi-docs";import{useLocation as b}from"react-router-dom";import{Admonition as k}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{ErrorMessage as A,OpenApiComponentWrap as I}from"../styled.elements.js";import{useStore as P}from"../../hooks/use-store.js";import{getOperation as x}from"./get-operation/index.js";import{getMockServerDocsConfig as R}from"../../../../templates/openapi-docs/mock-server-config.js";const L=y=>{const{descriptionFile:n,operationId:i,pointer:p,exampleKey:d,mimeType:l,requestBody:a,parameters:S,options:m,environment:t,environments:s,hideOtherSecuritySchemes:O}=y,h=b(),{store:e,error:v,baseSlug:u}=P(n),c=o.useMemo(()=>({...e?.options,...m}),[m,e?.options]),f=o.useMemo(()=>{const{mockServer:C,...g}=c;return g},[c]),r=o.useMemo(()=>{if(e)return x(e,{operationId:i,pointer:p},f,{exampleKey:d,mimeType:l,environments:s,environment:t,requestBody:a})},[d,f,l,i,p,e,s,t,a]);return e?r?o.createElement(I,{"data-testid":"replay-openapi"},o.createElement(M,{key:`${h.pathname}-${n}-${i||p}`,options:{...m,disableRouter:!0,routingBasePath:u,mockServer:R(c.mockServer,u)},definition:e.definition,withState:{environments:s,allowedEnvironments:t?[t]:void 0,operation:{pointer:r.pointer,state:{requestValues:{body:a,...S}}}}},o.createElement(E,{activeOperationId:r.operationId||"",fullOpenApi:e.definition,corsProxyUrl:e.options.corsProxyUrl,pointer:r.pointer,hideOtherSecuritySchemes:O}))):o.createElement(k,{type:"danger"},"Cannot find OpenAPI operation by operationId or pointer in ",n):o.createElement(A,null,v)};export{L as ReplayOpenApi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{usePageSharedData as t}from"../../../providers/page-data/hooks";function n(r){const e=t(r||"");return e?{store:e,error:null,baseSlug:e.baseSlug}:{store:void 0,error:"Incorrect OpenAPI file path"}}export{n as useStore};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{telemetry as
|
|
2
|
-
%c Version: ${
|
|
3
|
-
`,"background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 3px; color: #0044D4","background:transparent"):
|
|
4
|
-
%c Redocly ${
|
|
1
|
+
import{telemetry as s}from"./app/telemetry/index.js";s.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${_}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(r(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!O});import e from"react";import{hydrateRoot as p}from"react-dom/client";import{RouterProvider as m,createBrowserRouter as d}from"react-router-dom";import{HelmetProvider as f}from"@dr.pogodin/react-helmet";import{getLocaleFromPathname as u,withoutPathPrefix as E,withPathPrefix as r}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as R,ServerRoutes as L}from"../constants/common";import{CLIENT_TELEMETRY_ENABLED as O}from"./constants/common.js";import"./polyfills";import{PACKAGE_NAME as _,PRODUCT_NAME as D}from"../config/product-gates";import{App as g,routes as h}from"./App";import{Loader as v,useRefresh as x,globalData as t}from"./runtime/loader";import{initL10n as A}from"./app/l10n/initL10n";import{ServerStyleSheet as z,StyleSheetManager as G}from"styled-components";function P(){return x(),e.createElement(f,{context:{}},e.createElement(g,null))}function N(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
|
|
2
|
+
%c Version: ${process.env.REDOCLY_PORTAL_VERSION} %c
|
|
3
|
+
`,"background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 3px; color: #0044D4","background:transparent"):process.env.REDOCLY_PORTAL_VERSION&&console.log(`
|
|
4
|
+
%c Redocly ${D} %c ${process.env.REDOCLY_PORTAL_VERSION} %c
|
|
5
5
|
|
|
6
6
|
%chttps://redocly.com
|
|
7
|
-
`,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function
|
|
7
|
+
`,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function T(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await v.load(window.location.pathname,void 0,window.location.search),N();const o=t?.l10n,n=o?.locales||[],i=o?.defaultLocale||R,a=u(E(location.pathname),i,n);await A(o,a);const c=d([{Component:P,path:r("/*"),children:h}]);p(document.getElementById("app_root"),e.createElement(m,{future:{v7_startTransition:!1},router:c}))}T();export{z as ServerStyleSheet,G as StyleSheetManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const E=process.env.REDOCLY_TELEMETRY==="on";export{E as CLIENT_TELEMETRY_ENABLED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as c,useState as s}from"react";import{useNavigate as
|
|
1
|
+
import{useEffect as c,useState as s}from"react";import{useNavigate as l}from"react-router-dom";import{isLocalLink as m}from"../../utils/path/is-local-link.js";import{isJsProtocolLink as a}from"../../utils/path/is-js-protocol-link.js";import{isAssetsLink as u}from"../../utils/path/is-assets-link.js";import{isHostnameOnDomain as f}from"../app/utils/isHostnameOnDomain.js";import{loadAndNavigate as d}from"../app/utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as p}from"../utils/utils.js";export*from"./page-data/hooks.js";function E(){const e=l();c(()=>{const t=n=>{const i=n.target;if(i.tagName!=="A"||p(n,i.getAttribute("target")||""))return;const r=i.getAttribute("href");!m(r)||u(r)||a(r)||(n.preventDefault(),d({navigate:e,to:r||""}))};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}},[e])}function b(){const[e,t]=s(null);return c(()=>{if(process.env.NODE_ENV==="development"&&typeof window<"u"&&!o("localhost")&&!o("127.0.0.1")&&!o("")&&!o("redocly-local.com")&&!o("editor.redocly.xyz")&&!o("apps.codespaces.githubusercontent.com")&&!o("blueharvest.cloud")&&!o("bhstage.cloud")&&!o("cloud.redocly.com")&&!o("cloud.eu.redocly.com")&&!o("cba.au.redocly.com"))return t("Development mode is only allowed in localhost")},[typeof window]),e}function o(e){return f(window.location.hostname,e)}export{E as useRouterForLocalLinks,b as useRunningEnvironmentCheck};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as I from"react";import{withPathPrefix as v}from"@redocly/theme/core/utils";import{appendSearchParams as j}from"../utils";import{mapObject as z}from"../../utils/object/map-object.js";import{mapObjectAsync as A}from"../../utils/object/map-object-async.js";import{isFunction as G}from"../../utils/guards/is-function.js";import{isBrowser as N}from"../../utils/env/is-browser.js";import{GLOBAL_DATA_URL as $}from"../../constants/common.js";import{getClientPageDataUrl as V}from"../../utils/url/get-client-page-data-url.js";import{getSharedDataUrl as B}from"../../utils/url/get-shared-data-url.js";import{normalizeRouteSlug as l}from"../../utils/path/normalize-route-slug.js";import{templates as g}from"./generated/templates.js";import{AsyncCache as S}from"./cache.js";import{fetch as y}from"./fetch.js";import{updateTranslations as K}from"../app/l10n";import{PageMissingDefaultExportError as b}from"./errors/page-missing-default-export-error.js";const d=new S,i=new S;let D=null,m,W;const u=new Set;async function q(){const o=await(await y(v($))).json();return m=o,o}async function C(o){const t=v(B(o)),e=process.env.NODE_ENV==="development"?t:encodeURI(t);return await(await y(e)).json()}async function F(o){return i.has(o)||i.set(o,C(o)),i.get(o)}function lt(){const[,o]=I.useReducer(t=>t+1,0);typeof window>"u"||process.env.NODE_ENV!=="production"&&(window.__redoclyRefresh=o)}function _(o,t){const e=t?new URLSearchParams(t).get("revision"):null,a=t?new URLSearchParams(t).get("version"):null;return e||a?`${o}?${e?`revision=${encodeURIComponent(e)}`:""}${a?`&version=${encodeURIComponent(a)}`:""}`.trim():o}class p{static markdocComponents={};static async updateTemplate(t,e,a){const n=l(t);g[a]=()=>e;const r=l(window.location.pathname);n===r&&(await this.load(t,!0),window.__redoclyRefresh())}static async update(t){const e=l(t),a=l(window.location.pathname);if(e!==a){d.delete(e);return}await this.load(t,!0),window.__redoclyRefresh()}static async updateSharedData(t){await i.set(t,C(t)),window.__redoclyRefresh()}static addGlobalDataListener(t){u.add(t)}static removeGlobalDataListener(t){u.delete(t)}static updateGlobalData(t){u.forEach(e=>e(t)),m=t,K(m.l10n)}static async tryLoad(t,e,a){try{return await this.load(t,e,a)}catch{return null}}static async loadDynamicMarkdocComponents(t){const e=this.markdocComponents?.[t];e&&G(e)&&Object.assign(this.markdocComponents,await e())}static async load(t,e,a){const n=l(t),r=_(n,a),s=await d.get(r);if(!m&&!D&&(D=q()),s&&!e)return s;{const[f]=await Promise.all([d.set(r,c(a)),D]);return f}async function c(f){const U=V(n),k=j(U,f),E=await y(k),{templateId:R,sharedDataIds:w,props:P,userData:T,versions:L,redirectTo:M,isPublic:O}=await E.json(),[x]=await Promise.all([(async()=>p.loadTemplate(R))(),Promise.all((P.dynamicMarkdocComponents||[]).map(h=>p.loadDynamicMarkdocComponents(h))),w?A(w,h=>F(h)):Promise.resolve({})]);return{templateId:R,slug:n,sharedDataIds:w,redirectTo:M,props:P,Template:x,userData:T,versions:L,isPublic:O}}}static loadSync(t){const e=l(t),a=_(e,typeof window<"u"?window.location.search:void 0),n=d.tryGetSync(a);if(!n)return;const r=z(n.sharedDataIds,s=>i.getSync(s,"Data dependency not cached ahead of time: "+s));return{...n,sharedData:r}}static async prepare(t,e,a,n){const r=t.templateId;if(await Promise.all((t.props.dynamicMarkdocComponents||[]).map(c=>this.loadDynamicMarkdocComponents(c))),e)for(const c of Object.keys(e))i.setSync(c,e[c]);const s=await p.loadTemplate(r);s&&d.setSync(t.slug,{templateId:r,slug:t.slug,props:t.props,sharedDataIds:t.sharedDataIds||{},Template:s,userData:t.userInfo,versions:t.versions,isPublic:t.isPublic}),m=a,W=n}static async loadTemplate(t){try{const e=await g[t]();if(t.endsWith("page.tsx")&&!e.default)throw new b(t);const a=e.default;return typeof a=="function"?a:a.default}catch(e){if(!(process.env.NODE_ENV==="development")||!N())throw e;return e instanceof b?()=>(window.location.reload(),null):(window.location.reload(),null)}}static clear(){u.clear(),i.clear(),d.clear()}}(typeof window<"u"?window:global).__LOADER=p;export{p as Loader,F as getSharedData,m as globalData,W as initLocale,lt as useRefresh};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{useEffect as o,useRef as c}from"react";import{addSocketMessageListener as f}from"./ws-client";function i(e,r){const t=c(r);t.current=r,o(()=>f(e,s=>t.current(s)),[e])}export{i as useSocketMessages};
|
package/dist/{server/plugins/asyncapi-docs/template → client/templates/asyncapi-docs}/helpers.d.ts
RENAMED
|
@@ -3,9 +3,7 @@ export declare function useCollectMarkdocOptions({ markdown }: PageProps): {
|
|
|
3
3
|
partials: Record<string, import("@markdoc/markdoc").Node | import("@markdoc/markdoc").Node[]> | undefined;
|
|
4
4
|
variables?: Record<string, any>;
|
|
5
5
|
tags: {
|
|
6
|
-
[x: string]: (import("@markdoc/markdoc").Schema
|
|
7
|
-
dynamicComponentLib: string;
|
|
8
|
-
}) | (import("@markdoc/markdoc").Schema<Readonly<Partial<{
|
|
6
|
+
[x: string]: (import("@markdoc/markdoc").Schema<Readonly<Partial<{
|
|
9
7
|
nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial</*elided*/ any>, string>>>;
|
|
10
8
|
tags: Record<string, import("@markdoc/markdoc").Schema>;
|
|
11
9
|
variables: Record<string, any>;
|
|
@@ -20,6 +18,8 @@ export declare function useCollectMarkdocOptions({ markdown }: PageProps): {
|
|
|
20
18
|
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
21
19
|
resolver?: string;
|
|
22
20
|
}>;
|
|
21
|
+
}) | (import("@markdoc/markdoc").Schema & {
|
|
22
|
+
dynamicComponentLib?: string;
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
nodes: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as t}from"react";import{components as s}from"@redocly-markdoc/components";import{tags as m,components as r}from"@redocly/theme/markdoc/default";import*as n from"../../app/markdoc/custom-components/index.js";import*as e from"../../../markdoc/nodes/index.js";import p from"../../../markdoc/tags/index.js";import{parsePartials as a}from"../../templates/openapi-docs/helpers.js";function C({markdown:o}){return t(()=>({tags:{...p,...m},nodes:{...e},components:{...n,...r,...s,...globalThis.__LOADER.markdocComponents},...o,partials:a(o?.partials)}),[o])}export{C as useCollectMarkdocOptions};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import o from"styled-components";import*as a from"react";import{RedoclyAsyncAPIDocs as p}from"@redocly/asyncapi-docs";import{LayoutVariant as d}from"@redocly/theme/components/SidebarActions/SidebarActions";import{ThreePanelLayout as f}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as h}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{withPathPrefix as u}from"@redocly/theme/core/utils";import{usePageSharedData as g}from"
|
|
1
|
+
import o from"styled-components";import*as a from"react";import{RedoclyAsyncAPIDocs as p}from"@redocly/asyncapi-docs";import{LayoutVariant as d}from"@redocly/theme/components/SidebarActions/SidebarActions";import{ThreePanelLayout as f}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as h}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{withPathPrefix as u}from"@redocly/theme/core/utils";import{usePageSharedData as g}from"../../providers/page-data/hooks";import{useCollectMarkdocOptions as y}from"./helpers.js";function v({pageProps:t}){const r=g("AsyncApiDefinition"),{document:e,apiItems:i,protocol:n,downloadUrls:c}=r,l=u(t?.settings?.baseUrlPath),s=y(t),m=t.apiOptions?.layout;return a.createElement(A,null,a.createElement(E,{layout:m},a.createElement(h,{metadata:t.metadata})),a.createElement(p,{pageProps:t,document:e,apiItems:i,routingBasePath:l,protocol:n,downloadUrls:c,markdocOptions:s}))}const A=o.div`
|
|
2
2
|
a[id],
|
|
3
3
|
a[data-section-id],
|
|
4
4
|
div[data-section-id] {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{useMemo as v}from"react";import{components as _}from"@redocly-markdoc/components";import{Ast as S}from"@markdoc/markdoc";import{PageNavigation as y}from"@redocly/theme/components/PageNavigation/PageNavigation";import{tags as w,components as P}from"@redocly/theme/markdoc/default";import{Breadcrumbs as O}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{withPathPrefix as u}from"@redocly/theme/core/utils";import{OPENAPI_DOCS_TEMPLATE_ID as b,ServerRoutes as d}from"../../../constants/common.js";import{isBrowser as C}from"../../../utils/env/is-browser.js";import*as x from"../../../markdoc/nodes/index.js";import E from"../../../markdoc/tags/index.js";import*as A from"../../app/markdoc/custom-components/index.js";import{usePageData as R,useSidebarSiblingsData as T}from"../../providers/page-data/hooks";import{telemetry as U}from"../../app/telemetry/index.js";import{getMockServerDocsConfig as $}from"./mock-server-config.js";function K(e="",t="",o="/"){return e.endsWith(o)&&(e=e.slice(0,-o.length)),t.startsWith(o)&&(t=t.slice(o.length)),!e||!t?e+t:e+o+t}function D(e){if(e)return Object.entries(e).reduce((t,[o,s])=>(t[o]=S.fromJSON(JSON.stringify(s)),t),{})}function X(e,{markdown:t,baseSlug:o,customFields:s}){return v(()=>{const a=C();function m(n,i){return n?.replace(/\/$/,"")===i?.replace(/\/$/,"")}function g(n){return e.definition.servers?.find(i=>m(i.url,n.host))?.description||(n.environment?n.environment+" server":null)||"Computed server"}const c=s?.computedServers||e.definition["x-computed-servers"];if(c){const n=e.definition.servers?.filter(r=>!c.some(l=>m(l.host,r.url))),i=c.map(r=>{const l=g(r);return{...r,url:r.host,"x-isLive":!0,description:l,"x-labels":[r.tenant?{label:"Gateway Name",color:"gold",value:r.tenant}:null,r.environment?{label:"Env",color:"blue",value:r.environment}:null,r.version?{label:"Version",color:"green",value:r.version}:null].filter(Boolean)}});e.definition.servers=[...i||[],...n||[]]}if(e.options.oAuth2RedirectURI=a?`${window.location.origin}${u(d.REPLAY_OAUTH2_CALLBACK)}`:null,e.options.routingBasePath=u(o),e.options.mockServer=$(e.options.mockServer,o),!e.options.corsProxyUrl){const n=u(`${d.CORS_PROXY}/`);e.options.corsProxyUrl=a?new URL(n,window.location.origin).toString():n}e.options.scrollYOffset=a?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--navbar-height"),10):0,e.options.markdocOptions={tags:{...E,...w},nodes:{...x},components:{...A,...P,..._,...globalThis.__LOADER.markdocComponents},...t,partials:D(t?.partials)},e.options.unstable_hooks={...e.options.unstable_hooks,MiddlePanelFooter:()=>{const{templateId:n}=R()||{},{nextPage:i,prevPage:r}=T()||{};return n===b?null:y({nextPage:i,prevPage:r})},MiddlePanelHeader:()=>O({})};const h={codeSamplesLanguageSwitch:"samples_language_switch",codeSamplesCopy:"code_samples_copy",panelToggle:"panel_toggle",targetServerSwitch:"target_server_switch",tryItOpen:"try_it_toggle",tryItSent:"try_it_sent"},f={};for(const[n,i]of Object.entries(h)){const r=I(e.options.events?.[n]);f[n]=L(r,i)}return e.options.events=f,e},[e,t,o,s])}function I(e){if(typeof window>"u")return null;if(typeof e=="function")return e;if(typeof e!="string")return null;try{const t=e.trim();if(!t.match(/^(\([^)]*\)\s*=>\s*.+|[a-zA-Z_$][\w$]*\s*=>\s*.+)$/))throw new Error("Invalid function format. Only arrow functions allowed.");if(["eval","Function","constructor","prototype","__proto__","import","require","process","global","window","document"].some(p=>t.includes(p)))throw new Error("Function contains prohibited keywords");return new Function("event",`
|
|
2
|
+
'use strict';
|
|
3
|
+
const userFn = ${t};
|
|
4
|
+
return userFn(event);
|
|
5
|
+
`)}catch(t){return console.error("Function parsing error:",t),null}}function L(e,t){return o=>{if(e)try{e(o)}catch(s){console.error("User event handler error:",s)}if(t)try{U.sendOpenapiDocsMessage([{object:"openapi_docs",eventType:t,operationHttpVerb:o.operationHttpVerb,operationPath:o.operationPath,lang:"lang"in o?o.lang:void 0,action:o.action,state:"state"in o?o.state:void 0,serverUrl:"serverUrl"in o?o.serverUrl:void 0}])}catch{}}}export{K as joinWithSeparator,L as mergeEvents,D as parsePartials,I as safeParseFunction,X as usePatchedStore};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as a from"react";import i from"styled-components";import{RedoclyOpenAPIDocs as c}from"@redocly/openapi-docs";import{LayoutVariant as s}from"@redocly/config";import{ThreePanelLayout as m}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as p}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{useUserClaims as h}from"
|
|
1
|
+
import*as a from"react";import i from"styled-components";import{RedoclyOpenAPIDocs as c}from"@redocly/openapi-docs";import{LayoutVariant as s}from"@redocly/config";import{ThreePanelLayout as m}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as p}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{useUserClaims as h}from"../../app/hooks";import{usePageSharedData as u}from"../../providers/page-data/hooks";import{usePatchedStore as d}from"./helpers.js";function f({pageProps:t}){const o=h(),e=u("openAPIDocsStore"),n=a.useMemo(()=>({layout:t.apiOptions?.layout,userClaims:o}),[t.apiOptions?.layout,o]),r=d(e,t);if(!e)return"Something went wrong";const l=t.apiOptions?.layout;return a.createElement(g,null,a.createElement(v,{layout:l},a.createElement(p,{metadata:t.metadata})),a.createElement(c,{store:{options:r.options,definition:r.definition,withState:n}}))}const v=i(m)`
|
|
2
2
|
&& {
|
|
3
3
|
padding-right: ${({layout:t})=>t===s.THREE_PANEL?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
|
|
4
4
|
}
|