@redocly/framework 1.0.0-next.5 → 1.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler/build/output-metadata.js +1 -1
- package/dist/bundler/build/run.js +1 -1
- package/dist/bundler/build/theme-global-style-compiler.js +1 -0
- package/dist/bundler/build/theme-global-stylesheets.js +1 -0
- package/dist/bundler/build/vite-config.js +2 -2
- package/dist/bundler/dev/materialization-sweeper.js +1 -1
- package/dist/bundler/dev/run.js +1 -1
- package/dist/bundler/dev/runtime-app.js +1 -1
- package/dist/bundler/node-bundle.js +1 -0
- package/dist/bundler/runtime-files.js +1 -1
- package/dist/bundler/user-markdoc-schema.js +1 -1
- package/dist/bundler/vite-config.base.js +12 -12
- package/dist/cli/commands/ingest.js +1 -1
- package/dist/cli/commands/translate.js +1 -1
- package/dist/cli/validate-react-pages.js +1 -1
- package/dist/client/ApiAccess.js +3 -0
- package/dist/client/NavigationProgress.js +1 -1
- package/dist/client/ProductsProvider.js +1 -1
- package/dist/client/RouteErrorBoundary.js +1 -1
- package/dist/client/ThemeGlobalStyle.js +1 -0
- package/dist/client/UnversionedVersionButton.js +1 -1
- package/dist/client/app.js +3 -3
- package/dist/client/client-entry.js +1 -1
- package/dist/client/dev-problems/ProblemsBar.js +6 -6
- package/dist/client/dev-problems/ProblemsModal.js +15 -15
- package/dist/client/l10n/use-l10n-config.js +1 -1
- package/dist/client/l10n/use-l10n-href.js +1 -1
- package/dist/client/l10n/use-translate.js +1 -1
- package/dist/client/products.js +1 -1
- package/dist/client/review/ReviewBar.js +53 -53
- package/dist/client/sidebar/PoweredByRedocly.js +2 -2
- package/dist/client/ssr.js +1 -1
- package/dist/client/telemetry/report-preload-failure.js +1 -0
- package/dist/client/templates/dev-login.js +4 -4
- package/dist/client/templates/unauthorized.js +5 -5
- package/dist/client/theme-global-css.js +1 -0
- package/dist/client/use-banner.js +1 -1
- package/dist/client/use-search.js +1 -1
- package/dist/content-layer/allowed-packages.js +1 -1
- package/dist/content-layer/config-schema.d.ts +5 -1
- package/dist/content-layer/config-schema.js +1 -1
- package/dist/content-layer/config.d.ts +6 -2
- package/dist/content-layer/config.js +1 -1
- package/dist/content-layer/database/adapters/node-sqlite-client.js +1 -1
- package/dist/content-layer/database/connection.js +1 -1
- package/dist/content-layer/database/entity-store.d.ts +9 -1
- package/dist/content-layer/database/entity-store.js +1 -1
- package/dist/content-layer/database/origins.d.ts +2 -4
- package/dist/content-layer/database/origins.js +1 -1
- package/dist/content-layer/ingest/extract-all-phase.js +1 -1
- package/dist/content-layer/ingest/finalize-phase.js +1 -1
- package/dist/content-layer/ingest/hook-inputs.js +1 -1
- package/dist/content-layer/ingest/l10n-warnings.js +1 -1
- package/dist/content-layer/ingest/rbac-teams.js +1 -1
- package/dist/content-layer/ingest/run.js +1 -1
- package/dist/content-layer/ingest/scan.d.ts +1 -1
- package/dist/content-layer/ingest/scan.js +1 -1
- package/dist/content-layer/ingest/search-sync.js +1 -1
- package/dist/content-layer/ingest/slugger/resolve-final-slugs.js +1 -1
- package/dist/content-layer/ingest/sync.js +1 -1
- package/dist/content-layer/loaders/context.js +1 -1
- package/dist/content-layer/markdown/client/OpenapiTagComponents.js +2 -2
- package/dist/content-layer/markdown/client/dynamic-components.js +1 -1
- package/dist/content-layer/markdown/client/markdoc-components.js +2 -2
- package/dist/content-layer/markdown/constants/tag-sets.js +1 -1
- package/dist/content-layer/markdown/nodes/fence.js +1 -1
- package/dist/content-layer/markdown/nodes/table.js +1 -1
- package/dist/content-layer/markdown/resolve/audience-tag.d.ts +1 -1
- package/dist/content-layer/markdown/resolve/audience-tag.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/operation-samples.d.ts +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/operation-samples.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/partial.js +1 -1
- package/dist/content-layer/markdown/search/to-markdown.js +2 -2
- package/dist/content-layer/markdown/search/to-sections.js +1 -1
- package/dist/content-layer/markdown/server/render.js +1 -1
- package/dist/content-layer/markdown/service.js +1 -1
- package/dist/content-layer/markdown/tags/html.d.ts +4 -1
- package/dist/content-layer/markdown/tags/html.js +1 -1
- package/dist/content-layer/markdown/types/service.d.ts +2 -0
- package/dist/content-layer/materialization/entity.js +1 -1
- package/dist/content-layer/materialization/materializer.js +1 -0
- package/dist/content-layer/materialization/static-files.js +1 -1
- package/dist/content-layer/plan-gates.d.ts +3 -2
- package/dist/content-layer/plan-gates.js +1 -1
- package/dist/content-layer/plugins/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/client/template.js +4 -4
- package/dist/content-layer/plugins/internal/api-docs/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/build-definition.d.ts +2 -2
- package/dist/content-layer/plugins/internal/api-docs/server/build-definition.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/build-sidebar.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-docs.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/options.d.ts +4 -2
- package/dist/content-layer/plugins/internal/api-docs/server/options.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/search-documents.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/spec-download.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/server/access.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/server/dispatch.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/banner.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/index.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/products.d.ts +2 -0
- package/dist/content-layer/plugins/internal/app-data/products.js +1 -1
- package/dist/content-layer/plugins/internal/index.js +1 -1
- package/dist/content-layer/plugins/internal/l10n/index.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/client/template.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/index.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/server/shared.d.ts +1 -1
- package/dist/content-layer/plugins/internal/mcp/content-tools.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/index.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/agent-card.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/audit.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/auth.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/config-gate.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/custom-tools.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/__tests__/secret-store-fixture.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/form-page.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/elicitation.js +7 -7
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/fetch-bridge.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/index.js +3 -3
- package/dist/content-layer/plugins/internal/mcp/server/gateway/secret-store.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/tools.js +3 -3
- package/dist/content-layer/plugins/internal/mcp/server/handler.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/mcp-server.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/authorize.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/discovery.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/server-card.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/skills-resources.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/graphql-catalog.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-catalog.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-document.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-refs.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/pages-navigation.js +1 -1
- package/dist/content-layer/plugins/internal/mock/server/handler.js +1 -1
- package/dist/content-layer/plugins/internal/react-page/index.js +1 -1
- package/dist/content-layer/plugins/internal/scorecard-classic/client/Grid.js +11 -11
- package/dist/content-layer/plugins/internal/scorecard-classic/client/ScorecardViews.js +1 -1
- package/dist/content-layer/plugins/internal/scorecard-classic/client/ScorecardWidgets.js +7 -7
- package/dist/content-layer/plugins/internal/scorecard-classic/client/template.js +2 -2
- package/dist/content-layer/plugins/internal/sidebar/bundle.d.ts +1 -1
- package/dist/content-layer/plugins/internal/sidebar/bundle.js +1 -1
- package/dist/content-layer/plugins/internal/sidebar/index.d.ts +1 -1
- package/dist/content-layer/plugins/internal/sidebar/index.js +1 -1
- package/dist/content-layer/plugins/internal/skills/index.js +1 -1
- package/dist/content-layer/plugins/internal/skills/server/routes.js +1 -1
- package/dist/content-layer/plugins/project/load.js +2 -2
- package/dist/content-layer/plugins/registry.js +1 -1
- package/dist/content-layer/plugins/request-context.d.ts +5 -0
- package/dist/content-layer/plugins/types/api-entity.d.ts +2 -6
- package/dist/content-layer/plugins/types/api-entity.js +1 -1
- package/dist/content-layer/plugins/types/plugin.d.ts +8 -0
- package/dist/content-layer/plugins/types/search.d.ts +1 -1
- package/dist/content-layer/plugins/utils/route-index.d.ts +1 -1
- package/dist/content-layer/plugins/utils/route-index.js +1 -1
- package/dist/content-layer/plugins/utils/version-path.js +1 -1
- package/dist/content-layer/revisions/config.js +1 -1
- package/dist/content-layer/server/context.js +1 -1
- package/dist/content-layer/server/materialize.js +1 -1
- package/dist/content-layer/static/audience.js +1 -1
- package/dist/content-layer/static/registry.js +1 -1
- package/dist/content-layer/templates/template-set.js +1 -1
- package/dist/content-layer/versions/redirect.d.ts +11 -6
- package/dist/content-layer/versions/redirect.js +1 -1
- package/dist/plugin-api.d.ts +3 -0
- package/dist/plugin-api.js +1 -1
- package/dist/server/__tests__/rbac-fixture.js +1 -1
- package/dist/server/app.js +2 -2
- package/dist/server/ask-ai/feature-gate.js +1 -1
- package/dist/server/ask-ai/route.js +1 -1
- package/dist/server/auth/gate.js +1 -1
- package/dist/server/auth/middleware.js +1 -1
- package/dist/server/auth/request.js +1 -1
- package/dist/server/auth/routes.js +1 -1
- package/dist/server/auth/runtime.js +1 -1
- package/dist/server/content-assets/access.js +1 -1
- package/dist/server/content.js +12 -12
- package/dist/server/feedback/route.js +1 -1
- package/dist/server/lambda-entry.js +1 -1
- package/dist/server/metrics/request-metrics.js +1 -1
- package/dist/server/node-entry.js +1 -1
- package/dist/server/plugin-context.js +1 -1
- package/dist/server/plugin-routes.js +1 -1
- package/dist/server/rbac/content-asset-access.js +1 -1
- package/dist/server/replay-oauth2/route.js +1 -1
- package/dist/server/review/route.js +1 -1
- package/dist/server/runtime-config.js +1 -1
- package/dist/server/search/route.js +1 -1
- package/dist/server/static-files/serve.js +1 -1
- package/dist/server/subprocess/runner.js +1 -1
- package/dist/server/telemetry/route.js +1 -1
- package/dist/server/template-ids.js +1 -1
- package/dist/shared/constants/api-spec-kinds.d.ts +6 -0
- package/dist/shared/constants/api-spec-kinds.js +1 -0
- package/dist/shared/constants/l10n/langs/ar.js +1 -1
- package/dist/shared/constants/l10n/langs/de.js +1 -1
- package/dist/shared/constants/l10n/langs/en.js +1 -1
- package/dist/shared/constants/l10n/langs/es.js +1 -1
- package/dist/shared/constants/l10n/langs/fr.js +1 -1
- package/dist/shared/constants/l10n/langs/hi.js +1 -1
- package/dist/shared/constants/l10n/langs/it.js +1 -1
- package/dist/shared/constants/l10n/langs/ja.js +1 -1
- package/dist/shared/constants/l10n/langs/ko.js +1 -1
- package/dist/shared/constants/l10n/langs/pl.js +1 -1
- package/dist/shared/constants/l10n/langs/pt-br.js +1 -1
- package/dist/shared/constants/l10n/langs/pt.js +1 -1
- package/dist/shared/constants/l10n/langs/ru.js +1 -1
- package/dist/shared/constants/l10n/langs/uk.js +1 -1
- package/dist/shared/constants/l10n/langs/zh.js +1 -1
- package/dist/{server → shared}/constants/system-routes.d.ts +1 -1
- package/dist/shared/constants/system-routes.js +1 -0
- package/dist/shared/plan-gates.d.ts +6 -1
- package/dist/shared/plan-gates.js +1 -1
- package/dist/shared/products.js +1 -1
- package/dist/{server → shared}/project-env.d.ts +1 -1
- package/dist/{server → shared}/rbac/api-docs.d.ts +1 -1
- package/dist/{server → shared}/rbac/engine.d.ts +1 -1
- package/dist/shared/rbac/engine.js +0 -0
- package/dist/shared/rbac/filter.js +1 -0
- package/dist/{server → shared}/rbac/l10n-rules.d.ts +1 -1
- package/dist/shared/rbac/l10n-rules.js +1 -0
- package/dist/shared/rbac/route-scope.js +1 -0
- package/dist/{server → shared}/rbac/team-templates.d.ts +6 -2
- package/dist/shared/rbac/team-templates.js +1 -0
- package/dist/{server → shared}/rbac/teams.d.ts +1 -1
- package/dist/shared/rbac/types.js +1 -0
- package/dist/shared/types/config.d.ts +2 -0
- package/dist/shared/utils/l10n.js +1 -1
- package/package.json +8 -8
- package/dist/content-layer/server/config.js +0 -1
- package/dist/server/constants/system-routes.js +0 -1
- package/dist/server/rbac/engine.js +0 -0
- package/dist/server/rbac/filter.js +0 -1
- package/dist/server/rbac/l10n-rules.js +0 -1
- package/dist/server/rbac/route-scope.js +0 -1
- package/dist/server/rbac/team-templates.js +0 -1
- package/dist/server/rbac/types.js +0 -1
- /package/dist/{server → shared}/project-env.js +0 -0
- /package/dist/{server → shared}/rbac/api-docs.js +0 -0
- /package/dist/{server → shared}/rbac/entity-scope.js +0 -0
- /package/dist/{server → shared}/rbac/filter.d.ts +0 -0
- /package/dist/{server → shared}/rbac/route-scope.d.ts +0 -0
- /package/dist/{server → shared}/rbac/teams.js +0 -0
- /package/dist/{server → shared}/rbac/types.d.ts +0 -0
- /package/dist/{content-layer/markdown → shared}/utils/packed-ast.d.ts +0 -0
- /package/dist/{content-layer/markdown → shared}/utils/packed-ast.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONTENT_ASSETS_URL_PREFIX as e}from"./content-assets.js";import{BUILD_ASSETS_URL_PREFIX as t}from"./runtime-layout.js";import{AI_ASSISTANT_ESCALATIONS_ROUTE_PATH as n,AI_ASSISTANT_FEEDBACK_ROUTE_PATH as r,ASK_AI_ROUTE_PATH as i,SEMANTIC_SEARCH_ROUTE_PATH as a}from"./ask-ai.js";import{FEEDBACK_ROUTE_PATH as o}from"./feedback.js";import{CORS_PROXY_ROUTE_PATH as s}from"./cors-proxy.js";import{REPLAY_OAUTH2_ROUTE_PATH as c}from"./replay.js";import{SEARCH_FACETS_ROUTE_PATH as l,SEARCH_ROUTE_PATH as u}from"./search.js";import{OTEL_TRACES_ROUTE_PATH as d}from"./telemetry.js";import{REVIEW_ROUTE_PATH as f}from"./review.js";const p=`/_realm`,m=`/page-data`,h=`/entity-data`,g=`/server-fn`,_=Object.freeze([p,`/_auth`,t,`/blob-data`,e,s,m,h,g]),v={Health:`/_health`,Favicon:`/favicon.ico`,Info:`/_info`,LlmsTxt:`/llms.txt`,LlmsFullTxt:`/llms-full.txt`,Search:u,SearchFacets:l,AskAi:i,AiAssistantEscalations:n,AiAssistantFeedback:r,SemanticSearch:a,Feedback:o,OtelTraces:d,CorsProxy:s,Review:f,Login:`/login`,Logout:`/logout`,PostLogout:`/post-logout`,AuthIdpLogin:`/_auth/idp-login`,AuthOidcCallback:`/_auth/oidc`,AuthRedoclyTokenLogin:`/_auth/redocly-token-login`,AuthDevAuthorize:`/_auth/authorize`,ReplayOAuth2Callback:c},y=Object.freeze(Object.values(v));export{t as BUILD_ASSETS_URL_PREFIX,_ as ENGINE_ROUTE_PREFIXES,p as RESERVED_NAMESPACE_PREFIX,h as RUNTIME_ENTITY_DATA_PATH_PREFIX,m as RUNTIME_PAGE_PATH_PREFIX,g as RUNTIME_SERVER_FN_PATH_PREFIX,y as SYSTEM_ROUTES,v as SystemRoute};
|
|
@@ -6,10 +6,15 @@ export type PlanFeature = 'rbac' | 'sso' | 'analytics' | 'advancedSearch' | 'aiS
|
|
|
6
6
|
* Realm Plus holds as the Realm package, `customPackages`, which legacy orders never carry, and
|
|
7
7
|
* `customMarkdocTags` and `customMcpTools`, which tokens signed before them do not carry.
|
|
8
8
|
*/
|
|
9
|
-
export type ProductFeature = 'products' | 'catalogClassic' | 'l10n' | 'apiFunctions' | 'mockServer' | 'seo' | 'redirects' | 'breadcrumbs' | 'banner' | 'codeWalkthrough' | 'customPlugins' | 'markdown' | 'openapi' | 'asyncapi' | 'graphql' | 'reactPages' | 'soap' | 'customPackages' | 'customMarkdocTags' | 'customMcpTools';
|
|
9
|
+
export type ProductFeature = 'products' | 'catalogClassic' | 'l10n' | 'apiFunctions' | 'mockServer' | 'seo' | 'redirects' | 'breadcrumbs' | 'banner' | 'codeWalkthrough' | 'customPlugins' | 'markdown' | 'openapi' | 'asyncapi' | 'graphql' | 'reactPages' | 'soap' | 'devOnboarding' | 'customPackages' | 'customMarkdocTags' | 'customMcpTools';
|
|
10
10
|
/** The plan's decision per feature, on the loaded config when `PLAN_GATES` is set. */
|
|
11
11
|
export type PlanGates = Record<PlanFeature | ProductFeature, boolean>;
|
|
12
12
|
/** Whether the project's plan includes `feature`; always true for a config loaded without a token. */
|
|
13
13
|
/** Whether the project removes the Redocly attribution: the plan's decision; removed without a token. */
|
|
14
14
|
export declare function isAttributionRemoved(config: Pick<RealmConfig, 'planGates'>): boolean;
|
|
15
15
|
export declare function isPlanFeatureGranted(config: Pick<RealmConfig, 'planGates'>, feature: PlanFeature | ProductFeature): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the `PLAN_GATES` token grants `claim`, such as a plugin's feature: true without a
|
|
18
|
+
* token, false when the token lacks the claim, its value is falsy, or it is not a token.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlanClaimGranted(config: Pick<RealmConfig, 'planClaims'>, claim: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return!e.planGates||e.planGates.removeAttribution}function t(e,t){return e.planGates?.[t]!==!1}export{e as isAttributionRemoved,t as isPlanFeatureGranted};
|
|
1
|
+
function e(e){return!e.planGates||e.planGates.removeAttribution}function t(e,t){return e.planGates?.[t]!==!1}function n(e,t){return e.planClaims===void 0||!!e.planClaims[t]}export{e as isAttributionRemoved,n as isPlanClaimGranted,t as isPlanFeatureGranted};
|
package/dist/shared/products.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getSafeClassName as e}from"@redocly/theme/core/utils";import{getProductClassName as t}from"@redocly/theme/components/Product/utils";function n(e,t){let n=t.endsWith(`/`)?t:`${t}/`;return e.find(e=>n.startsWith(e.slug))}function r(n){return e(t(n))}export{n as findProductForSlug,r as productClassName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProcessEnv } from '
|
|
1
|
+
import type { ProcessEnv } from './public-env.js';
|
|
2
2
|
/**
|
|
3
3
|
* Host values a project never reads: engine secrets, hosting platform values, Lambda runtime
|
|
4
4
|
* values and credentials, and shell or runtime variables. Classic Realm hides the same kind
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RbacConfigData, type RbacRole, type RbacScope } from './types';
|
|
2
|
-
import type { RealmConfig } from '
|
|
2
|
+
import type { RealmConfig } from '../types/config.js';
|
|
3
3
|
/** Strict shape check: a plain object whose values are all valid roles. */
|
|
4
4
|
export declare function isRbacScope(value: unknown): value is RbacScope;
|
|
5
5
|
/**
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NAV_ITEM_RBAC as e}from"./types.js";import{canView as t,isRbacScope as n,resolveRole as r}from"./engine.js";import{findRouteEntry as i,resolveRouteScope as a}from"./route-scope.js";import{isPackedMarkdocAst as o,unpackMarkdocAst as s}from"../utils/packed-ast.js";import{REDOCLY_TEAMS_RBAC as c}from"@redocly/config";const l=Symbol(`rbac-remove`);function u(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function d(e,i){if(e===void 0)return!0;let a=n(e)?e:{};return t(r(a,i))}function f(t,r){return t===void 0?{}:n(t)?{[e]:t}:(r?.(),{[e]:{}})}const p=/* @__PURE__ */ new WeakMap;function m(e){let{matcher:t,routeIndex:n}=e,r=()=>{},o=p.get(t);o===void 0&&(o=/* @__PURE__ */ new WeakMap,p.set(t,o));let s=e=>(o.has(e)||o.set(e,a(t,e,r)),{kind:`route`,scope:o.get(e)});return{resolve(t){let r=i(n,t);if(r)return s(r);let a=e.aliasToPhysical?.(t);if(a!=null){let e=i(n,a);if(e)return s(e)}return{kind:`no-route`}}}}const h=/* @__PURE__ */ new WeakMap;function g(e){if(typeof e!=`object`||!e)return!1;let t=h.get(e);return t===void 0&&(t=_(e),h.set(e,t)),t}function _(e){return Array.isArray(e)?e.some(_):u(e)?Object.prototype.hasOwnProperty.call(e,c)||Object.prototype.hasOwnProperty.call(e,`redocly::nav-item-rbac`)?!0:Object.values(e).some(_):!1}function v(e,t){let n=y(e,t,!1);return n===l?null:n}function y(e,t,n){if(o(e))return y(s(e),t,n);if(Array.isArray(e)){let n=[];for(let r of e){let e=y(r,t,!0);e!==l&&n.push(e)}return n}if(!u(e))return e;if(!d(e[`redocly::nav-item-rbac`],t))return l;let r=d(e[c],t);if(!r&&(e.tab===!0||e.tabId!==void 0))return l;let i=x(e,t),a=i.some(({filtered:e})=>e.length>0);if(!r&&!a)return l;let f=S(e,t,r);for(let{key:e,filtered:t}of i)f[e]=t;let p=i.some(({raw:e})=>e.length>0)&&!a;return n&&p&&C(f)?l:f}const b=[`items`,`menu`];function x(e,t){return b.flatMap(n=>{let r=e[n];return Array.isArray(r)?[{key:n,raw:r,filtered:y(r,t,!1)}]:[]})}function S(e,t,n){let r={};for(let[i,a]of Object.entries(e)){if(i===c||i===`redocly::nav-item-rbac`||b.some(e=>e===i)&&Array.isArray(a)||!n&&i===`link`)continue;if(!n&&i===`content`){r.content=null;continue}let e=y(a,t,!1);e!==l&&(r[i]=e)}return r}function C(e){return(e.link===void 0||e.link===``)&&!(`content`in e)}function w(e,t){let n=T(e,t);if(n===l)return null;if(u(n)&&u(n.paths))for(let[e,t]of Object.entries(n.paths))u(t)&&Object.keys(t).length===0&&delete n.paths[e];return n}function T(e,t){if(Array.isArray(e)){let n=[];for(let r of e){let e=T(r,t);e!==l&&n.push(e)}return n}if(!u(e))return e;if(Object.prototype.hasOwnProperty.call(e,c)&&!d(e[c],t))return l;let n={};for(let[r,i]of Object.entries(e)){if(r===c)continue;let e=T(i,t);e!==l&&(n[r]=e)}return n}export{m as createRbacLinkScopes,w as filterRbacAnnotatedDocument,v as filterRbacAnnotatedValue,g as hasRbacAnnotation,f as toNavItemRbacAnnotation};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LocaleContext } from '
|
|
1
|
+
import { type LocaleContext } from '../utils/l10n.js';
|
|
2
2
|
/**
|
|
3
3
|
* Expands a raw `access.rbac` object: `content` gains the per-locale variants and
|
|
4
4
|
* `l10nRules` records how each localized key ranks. Returns the input when no rule
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L10N_DIR as e}from"../constants/l10n/defaults.js";import{stripLeadingSlash as t}from"../utils/strip-leading-slash.js";import{RBAC_L10N_RULES_KEY as n}from"./types.js";import{escapeGlobLiteral as r}from"./engine.js";import{isObject as i}from"../utils/is-object.js";import{slugifySegment as a}from"../utils/routes/slugify-segment.js";import{resolveLocaleContext as o}from"../utils/l10n.js";function s(n,i){let o=i.locales;if(!i.enabled)return{content:n,l10nRules:{}};let s=o.map(e=>a(e)),c=o.map(t=>`${e}/${r(t)}`),l={...n},u={},d=new Set(Object.keys(n).map(t)),f=(e,t,n)=>{d.has(e)||(d.add(e),l[e]=t,u[e]={canonical:n,generated:!0})};for(let[e,r]of Object.entries(n)){let n=t(e),i=s.findIndex(e=>n.startsWith(`${e}/`));if(i===-1)continue;let a=n.slice(s[i].length+1);u[n]={canonical:a,generated:!1},f(`${c[i]}/${a}`,r,a)}for(let[e,r]of Object.entries(n)){let n=t(e);if(!n.startsWith(`@l10n/`)&&!s.some(e=>n===e||n.startsWith(`${e}/`)))for(let e=0;e<o.length;e+=1)f(`${c[e]}/${n}`,r,n),f(`${s[e]}/${n}`,r,n)}return{content:l,l10nRules:u}}function c(e,t){let r=n in e,a=e.content,o=i(a)?s(a,t):{content:a,l10nRules:{}},c=Object.keys(o.l10nRules).length>0;if(!c&&!r)return e;let{[n]:l,...u}=e;return c?{...u,content:o.content,[n]:o.l10nRules}:u}function l(e,t){let n=o(e.l10n,t),r=e.access;if(!i(r))return e;let a=r.rbac;if(!i(a))return e;let s=c(a,n);return s===a?e:{...e,access:{...r,rbac:s}}}export{l as expandConfigRbacForL10n,c as expandRbacForL10n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isRbacScope as e,matchContentScope as t}from"./engine.js";import{computePathPrefixes as n}from"../utils/routes/compute-path-prefixes.js";import{normalizeRoutePath as r}from"../utils/routes/normalize-route-path.js";function i(e,t){let i=r(t),a=e.bySlug.get(i);if(a)return a;let o=n(i),s;for(let t of e.wildcards)o.includes(t.slug)&&(s===void 0||t.slug.length>s.slug.length)&&(s=t);return s}function a(n,r,i){return r.hasRbacKey?e(r.rbacValue)?r.rbacValue:(i(`rbac: route "${r.slug}" has an invalid frontmatter "rbac" value — denying access`),{}):t(n,{filePath:r.sourcePath,slug:r.slug})}export{i as findRouteEntry,a as resolveRouteScope};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import type { ProblemDraft } from '../../content-layer/problems/types.js';
|
|
2
1
|
import type { PlatformFs } from '../../platform/types/fs.js';
|
|
3
2
|
/** Content-relative directory prefix -> the names of its subdirectories. */
|
|
4
3
|
export type TeamDirs = Readonly<Record<string, readonly string[]>>;
|
|
5
|
-
|
|
4
|
+
/** A config problem the expansion reports; it is a valid content-layer `ProblemDraft`. */
|
|
5
|
+
export type TeamTemplateProblem = {
|
|
6
|
+
code: string;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
type Report = (problem: TeamTemplateProblem) => void;
|
|
6
10
|
/**
|
|
7
11
|
* Expands `{folder}` in `access.rbac`: a `content` key with a `{folder}` segment is written once
|
|
8
12
|
* per directory at that position, and `{folder}` in a team name takes the directory name as
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{compareStrings as e}from"../utils/compare-strings.js";import{stripLeadingSlash as t}from"../utils/strip-leading-slash.js";import{escapeGlobLiteral as n,hasGlobMetachar as r}from"./engine.js";import{isObject as i}from"../utils/is-object.js";import{listSubdirectories as a}from"../utils/list-subdirectories.js";const o=`{folder}`,s=[`teamNamePatterns`,`teamFolders`,`teamFoldersBaseRoles`];function c(t,n,r){let a=Object.keys(i(t.content)?t.content:{}).map(e=>f(e)).filter(e=>e.kind===`team`),o=s.some(e=>e in t);if(a.length===0&&!o&&!h(t))return t;let c=[...new Set(a.flatMap(e=>n[e.prefix]??[]))].sort(e),l={};for(let[e,a]of Object.entries(t))s.includes(e)?r({code:`configuration/ignored`,message:`access.rbac.${e} is ignored: Realm Plus derives team rules from directories. Write the rule with a {folder} segment, for example "apis/{folder}/**" with the team name "P-{folder}-WRITE".`}):l[e]=e===`content`&&i(a)?p(a,n,c,r):e===`features`&&i(a)?Object.fromEntries(Object.entries(a).map(([e,t])=>[e,m(t,c,`access.rbac.features.${e}`,r)])):e===`platform`?m(a,c,`access.rbac.platform`,r):a;return l}function l(e){if(!i(e.content))return[];let t=Object.keys(e.content).map(e=>f(e)).flatMap(e=>e.kind===`team`?[e.prefix]:[]);return[...new Set(t)]}async function u(e,t,n){let r={};for(let i of n)r[i]=(await a(i===``?e:`${e}/${i}`,t)).filter(e=>!e.startsWith(`.`)&&!e.startsWith(`@`));return r}function d(e,t,n){let r=e.access;if(!i(r))return e;let a=r.rbac;if(!i(a))return e;let o=c(a,t,n);return o===a?e:{...e,access:{...r,rbac:o}}}function f(e){let n=t(e).split(`/`),i=n.flatMap((e,t)=>e.includes(o)?[t]:[]);if(i.length===0)return{kind:`plain`};if(i.length>1)return{kind:`invalid`,reason:`only one path segment can be {folder}`};let[a]=i;if(n[a]!==o)return{kind:`invalid`,reason:`{folder} must be a whole path segment`};let s=n.slice(0,a);return s.some(e=>e===``||e.startsWith(`.`)||r(e))?{kind:`invalid`,reason:`the path before {folder} must be a plain directory path`}:{kind:`team`,prefix:s.join(`/`)}}function p(e,r,i,a){let s=new Set(Object.keys(e).filter(e=>f(e).kind===`plain`).map(t)),c={};for(let[l,u]of Object.entries(e)){let e=f(l),d=`access.rbac.content["${l}"]`;if(e.kind===`invalid`){a({code:`configuration/invalid`,message:`${d} is ignored: ${e.reason}, for example "apis/{folder}/**".`});continue}if(e.kind===`plain`){c[l]=m(u,i,d,a);continue}let p=r[e.prefix]??[];if(p.length===0){a({code:`configuration/ignored`,message:`${d} matched no directory under ${e.prefix===``?`the content root`:`"${e.prefix}/"`}, so it adds no rule.`});continue}for(let e of p){let r=l.replace(o,()=>n(e));s.has(t(r))||(c[r]=m(u,[e],d,a))}}return c}function m(e,t,n,r){if(!i(e))return e;let a={};for(let[i,s]of Object.entries(e))if(!i.includes(o))a[i]=s;else if(t.length===0)r({code:`configuration/invalid`,message:`${n}["${i}"] is ignored: {folder} has no values: no access.rbac.content key with a {folder} segment matched a directory.`});else for(let e of t)a[i.replaceAll(o,()=>e)]=s;return a}function h(e){return i(e)?Object.entries(e).some(([e,t])=>e.includes(o)||h(t)):!1}export{d as expandConfigRbacTeamTemplates,c as expandRbacTeamTemplates,u as listTeamDirs,l as teamTemplatePrefixes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[`none`,`read`,`triage`,`write`,`maintain`,`admin`],t=`l10nRules`,n=`redocly::nav-item-rbac`,r=`authenticated`,i=`anonymous`;export{n as NAV_ITEM_RBAC,t as RBAC_L10N_RULES_KEY,e as RBAC_ROLES,i as RBAC_TEAM_ANONYMOUS,r as RBAC_TEAM_AUTHENTICATED};
|
|
@@ -47,6 +47,8 @@ export type RealmConfig = Omit<RedoclyConfig, 'apis' | 'redirects' | 'scripts' |
|
|
|
47
47
|
publicEnv?: PublicEnv;
|
|
48
48
|
/** The plan's decision per feature, written when `PLAN_GATES` is set and absent otherwise. */
|
|
49
49
|
planGates?: PlanGates;
|
|
50
|
+
/** The claims of the `PLAN_GATES` token, empty when it is not a token; absent without one. */
|
|
51
|
+
planClaims?: Record<string, unknown>;
|
|
50
52
|
/** The npm packages the plan allows, written only when the plan turns `customPackages` off. */
|
|
51
53
|
allowedPackages?: string[];
|
|
52
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{compareStrings as e}from"./compare-strings.js";import{DEFAULT_LOCALE_PLACEHOLDER as t,L10N_DIR as n}from"../constants/l10n/defaults.js";import{isObject as r}from"./is-object.js";import{listSubdirectories as i}from"./list-subdirectories.js";import{normalizeRouteSlug as a}from"./routes/normalize-route-slug.js";import{slugifySegment as o}from"./routes/slugify-segment.js";function s(e){return typeof e==`string`&&e!==``}function c(e){let n=r(e)?e:void 0,i=s(n?.defaultLocale)?n.defaultLocale:t;if(!Array.isArray(n?.locales))return{defaultLocale:i,locales:void 0};let a=[];for(let e of n.locales)r(e)&&s(e.code)&&a.push({code:e.code,name:s(e.name)?e.name:e.code,showMissingTranslationNotice:e.showMissingTranslationNotice===!0||void 0});return{defaultLocale:i,locales:a}}const l=`${n}/`;function u(e){return e.split(`/`).filter(e=>e!==``)}function d(e){if(!e.startsWith(l))return;let t=l.length,n=e.indexOf(`/`,t);if(n!==-1&&n!==t&&n!==e.length-1)return e.slice(t,n)}function f(e){let t=d(e);return t===void 0?void 0:e.slice(l.length+t.length+1)}function p(e,t){return t===``?e:a(`/${o(t)}${e}`)}function m(e,t){let n=`/${o(t)}`;return e===n?`/`:e.startsWith(`${n}/`)?e.slice(n.length):void 0}function h(t){let n=/* @__PURE__ */ new Set;for(let e of t){let t=d(e);t!==void 0&&n.add(t)}return[...n].sort(e)}async function g(e,t){return i(`${e}/${n}`,t)}var _=class{enabled;defaultLocale;locales;codes;slugSegmentToCode;constructor(e,t){this.enabled=t.length>0,this.defaultLocale=e,this.locales=t,this.codes=new Set(t),this.slugSegmentToCode=new Map(t.map(e=>[o(e),e]))}isLocale(e){return this.codes.has(e)}isL10nPath(e){return e.startsWith(l)}splitLocaleFromPath(e){if(!this.enabled)return{locale:``,canonicalPath:e};let t=u(e);return t[0]!==`@l10n`||t.length<2?{locale:this.defaultLocale,canonicalPath:e}:{locale:t[1],canonicalPath:t.slice(2).join(`/`)}}toL10nPath(e,t){return!this.enabled||t===this.defaultLocale?e:e===``?`${n}/${t}`:`${n}/${t}/${e}`}toL10nSlug(e,t){return!this.enabled||t===this.defaultLocale?e:p(e,t)}splitLocaleFromSlug(e){if(!this.enabled)return{locale:``,canonicalSlug:e};let t=a(e),n=t.split(`/`).filter(e=>e!==``),r=n.length>0?this.slugSegmentToCode.get(n[0]):void 0;return r===void 0||r===this.defaultLocale?{locale:this.defaultLocale,canonicalSlug:t}:{locale:r,canonicalSlug:a(`/${n.slice(1).join(`/`)}`)}}};function v(t,n){let{defaultLocale:r}=c(t);return new _(r,[...new Set(n)].filter(e=>e!==r).sort(e))}export{t as DEFAULT_LOCALE_PLACEHOLDER,n as L10N_DIR,_ as LocaleContext,h as collectL10nDirLocales,f as delocalizeL10nPath,m as delocalizeRouteSlug,s as isLocaleCode,d as l10nDirOf,g as listL10nDirs,c as normalizeL10nConfig,v as resolveLocaleContext,p as toLocaleSlug};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/framework",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.6",
|
|
4
4
|
"description": "A modern hybrid CMS and API documentation platform",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"@hono/node-server": "^2.0.5",
|
|
28
28
|
"@jitl/quickjs-singlefile-mjs-release-sync": "0.32.0",
|
|
29
29
|
"@modelcontextprotocol/server": "2.3.1",
|
|
30
|
-
"@redocly/api-docs": "0.6.0-next.
|
|
31
|
-
"@redocly/config": "0.
|
|
30
|
+
"@redocly/api-docs": "0.6.0-next.5",
|
|
31
|
+
"@redocly/config": "0.74.0",
|
|
32
32
|
"@redocly/markdoc": "0.7.0-beta.2",
|
|
33
|
-
"@redocly/mock-server": "0.15.0-next.
|
|
34
|
-
"@redocly/openapi-core": "2.
|
|
35
|
-
"@redocly/realm-asyncapi-sdk": "0.
|
|
36
|
-
"@redocly/realm-db-client": "0.
|
|
37
|
-
"@redocly/theme": "0.73.0-next.
|
|
33
|
+
"@redocly/mock-server": "0.15.0-next.1",
|
|
34
|
+
"@redocly/openapi-core": "2.77.0",
|
|
35
|
+
"@redocly/realm-asyncapi-sdk": "0.18.0-next.0",
|
|
36
|
+
"@redocly/realm-db-client": "0.3.0",
|
|
37
|
+
"@redocly/theme": "0.73.0-next.2",
|
|
38
38
|
"@tanstack/highlight": "0.0.10",
|
|
39
39
|
"@vitejs/plugin-react": "6.2.1",
|
|
40
40
|
"chokidar": "npm:@redocly/chokidar@3.6.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{loadContentLayerConfig as e}from"../config.js";export{e as loadContentLayerConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CONTENT_ASSETS_URL_PREFIX as e}from"../../shared/constants/content-assets.js";import{AI_ASSISTANT_ESCALATIONS_ROUTE_PATH as t,AI_ASSISTANT_FEEDBACK_ROUTE_PATH as n,ASK_AI_ROUTE_PATH as r,SEMANTIC_SEARCH_ROUTE_PATH as i}from"../../shared/constants/ask-ai.js";import{FEEDBACK_ROUTE_PATH as a}from"../../shared/constants/feedback.js";import{CORS_PROXY_ROUTE_PATH as o}from"../../shared/constants/cors-proxy.js";import{REPLAY_OAUTH2_ROUTE_PATH as s}from"../../shared/constants/replay.js";import{SEARCH_FACETS_ROUTE_PATH as c,SEARCH_ROUTE_PATH as l}from"../../shared/constants/search.js";import{OTEL_TRACES_ROUTE_PATH as u}from"../../shared/constants/telemetry.js";import{BUILD_ASSETS_URL_PREFIX as d}from"../../shared/constants/runtime-layout.js";import{REVIEW_ROUTE_PATH as f}from"../../shared/constants/review.js";const p=`/_realm`,m=`/page-data`,h=`/entity-data`,g=`/server-fn`,_=Object.freeze([p,`/_auth`,d,`/blob-data`,e,o,m,h,g]),v={Health:`/_health`,Favicon:`/favicon.ico`,Info:`/_info`,LlmsTxt:`/llms.txt`,LlmsFullTxt:`/llms-full.txt`,Search:l,SearchFacets:c,AskAi:r,AiAssistantEscalations:t,AiAssistantFeedback:n,SemanticSearch:i,Feedback:a,OtelTraces:u,CorsProxy:o,Review:f,Login:`/login`,Logout:`/logout`,PostLogout:`/post-logout`,AuthIdpLogin:`/_auth/idp-login`,AuthOidcCallback:`/_auth/oidc`,AuthRedoclyTokenLogin:`/_auth/redocly-token-login`,AuthDevAuthorize:`/_auth/authorize`,ReplayOAuth2Callback:s},y=Object.freeze(Object.values(v));export{d as BUILD_ASSETS_URL_PREFIX,_ as ENGINE_ROUTE_PREFIXES,p as RESERVED_NAMESPACE_PREFIX,h as RUNTIME_ENTITY_DATA_PATH_PREFIX,m as RUNTIME_PAGE_PATH_PREFIX,g as RUNTIME_SERVER_FN_PATH_PREFIX,y as SYSTEM_ROUTES,v as SystemRoute};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{NAV_ITEM_RBAC as e}from"./types.js";import{canView as t,isRbacScope as n,resolveRole as r}from"./engine.js";import{findRouteEntry as i,resolveRouteScope as a}from"./route-scope.js";import{isPackedMarkdocAst as o,unpackMarkdocAst as s}from"../../content-layer/markdown/utils/packed-ast.js";import{REDOCLY_TEAMS_RBAC as c}from"@redocly/config";const l=Symbol(`rbac-remove`);function u(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function d(e,i){if(e===void 0)return!0;let a=n(e)?e:{};return t(r(a,i))}function f(t,r){return t===void 0?{}:n(t)?{[e]:t}:(r?.(),{[e]:{}})}const p=/* @__PURE__ */ new WeakMap;function m(e){let{matcher:t,routeIndex:n}=e,r=()=>{},o=p.get(t);o===void 0&&(o=/* @__PURE__ */ new WeakMap,p.set(t,o));let s=e=>(o.has(e)||o.set(e,a(t,e,r)),{kind:`route`,scope:o.get(e)});return{resolve(t){let r=i(n,t);if(r)return s(r);let a=e.aliasToPhysical?.(t);if(a!=null){let e=i(n,a);if(e)return s(e)}return{kind:`no-route`}}}}const h=/* @__PURE__ */ new WeakMap;function g(e){if(typeof e!=`object`||!e)return!1;let t=h.get(e);return t===void 0&&(t=_(e),h.set(e,t)),t}function _(e){return Array.isArray(e)?e.some(_):u(e)?Object.prototype.hasOwnProperty.call(e,c)||Object.prototype.hasOwnProperty.call(e,`redocly::nav-item-rbac`)?!0:Object.values(e).some(_):!1}function v(e,t){let n=y(e,t,!1);return n===l?null:n}function y(e,t,n){if(o(e))return y(s(e),t,n);if(Array.isArray(e)){let n=[];for(let r of e){let e=y(r,t,!0);e!==l&&n.push(e)}return n}if(!u(e))return e;if(!d(e[`redocly::nav-item-rbac`],t))return l;let r=d(e[c],t);if(!r&&(e.tab===!0||e.tabId!==void 0))return l;let i=x(e,t),a=i.some(({filtered:e})=>e.length>0);if(!r&&!a)return l;let f=S(e,t,r);for(let{key:e,filtered:t}of i)f[e]=t;let p=i.some(({raw:e})=>e.length>0)&&!a;return n&&p&&C(f)?l:f}const b=[`items`,`menu`];function x(e,t){return b.flatMap(n=>{let r=e[n];return Array.isArray(r)?[{key:n,raw:r,filtered:y(r,t,!1)}]:[]})}function S(e,t,n){let r={};for(let[i,a]of Object.entries(e)){if(i===c||i===`redocly::nav-item-rbac`||b.some(e=>e===i)&&Array.isArray(a)||!n&&i===`link`)continue;if(!n&&i===`content`){r.content=null;continue}let e=y(a,t,!1);e!==l&&(r[i]=e)}return r}function C(e){return(e.link===void 0||e.link===``)&&!(`content`in e)}function w(e,t){let n=T(e,t);if(n===l)return null;if(u(n)&&u(n.paths))for(let[e,t]of Object.entries(n.paths))u(t)&&Object.keys(t).length===0&&delete n.paths[e];return n}function T(e,t){if(Array.isArray(e)){let n=[];for(let r of e){let e=T(r,t);e!==l&&n.push(e)}return n}if(!u(e))return e;if(Object.prototype.hasOwnProperty.call(e,c)&&!d(e[c],t))return l;let n={};for(let[r,i]of Object.entries(e)){if(r===c)continue;let e=T(i,t);e!==l&&(n[r]=e)}return n}export{m as createRbacLinkScopes,w as filterRbacAnnotatedDocument,v as filterRbacAnnotatedValue,g as hasRbacAnnotation,f as toNavItemRbacAnnotation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L10N_DIR as e}from"../../shared/constants/l10n/defaults.js";import{stripLeadingSlash as t}from"../../shared/utils/strip-leading-slash.js";import{RBAC_L10N_RULES_KEY as n}from"./types.js";import{escapeGlobLiteral as r}from"./engine.js";import{isObject as i}from"../../shared/utils/is-object.js";import{slugifySegment as a}from"../../shared/utils/routes/slugify-segment.js";import{resolveLocaleContext as o}from"../../shared/utils/l10n.js";function s(n,i){let o=i.locales;if(!i.enabled)return{content:n,l10nRules:{}};let s=o.map(e=>a(e)),c=o.map(t=>`${e}/${r(t)}`),l={...n},u={},d=new Set(Object.keys(n).map(t)),f=(e,t,n)=>{d.has(e)||(d.add(e),l[e]=t,u[e]={canonical:n,generated:!0})};for(let[e,r]of Object.entries(n)){let n=t(e),i=s.findIndex(e=>n.startsWith(`${e}/`));if(i===-1)continue;let a=n.slice(s[i].length+1);u[n]={canonical:a,generated:!1},f(`${c[i]}/${a}`,r,a)}for(let[e,r]of Object.entries(n)){let n=t(e);if(!n.startsWith(`@l10n/`)&&!s.some(e=>n===e||n.startsWith(`${e}/`)))for(let e=0;e<o.length;e+=1)f(`${c[e]}/${n}`,r,n),f(`${s[e]}/${n}`,r,n)}return{content:l,l10nRules:u}}function c(e,t){let r=n in e,a=e.content,o=i(a)?s(a,t):{content:a,l10nRules:{}},c=Object.keys(o.l10nRules).length>0;if(!c&&!r)return e;let{[n]:l,...u}=e;return c?{...u,content:o.content,[n]:o.l10nRules}:u}function l(e,t){let n=o(e.l10n,t),r=e.access;if(!i(r))return e;let a=r.rbac;if(!i(a))return e;let s=c(a,n);return s===a?e:{...e,access:{...r,rbac:s}}}export{l as expandConfigRbacForL10n,c as expandRbacForL10n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isRbacScope as e,matchContentScope as t}from"./engine.js";import{computePathPrefixes as n}from"../../shared/utils/routes/compute-path-prefixes.js";import{normalizeRoutePath as r}from"../../shared/utils/routes/normalize-route-path.js";function i(e,t){let i=r(t),a=e.bySlug.get(i);if(a)return a;let o=n(i),s;for(let t of e.wildcards)o.includes(t.slug)&&(s===void 0||t.slug.length>s.slug.length)&&(s=t);return s}function a(n,r,i){return r.hasRbacKey?e(r.rbacValue)?r.rbacValue:(i(`rbac: route "${r.slug}" has an invalid frontmatter "rbac" value — denying access`),{}):t(n,{filePath:r.sourcePath,slug:r.slug})}export{i as findRouteEntry,a as resolveRouteScope};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{stripLeadingSlash as e}from"../../shared/utils/strip-leading-slash.js";import{escapeGlobLiteral as t,hasGlobMetachar as n}from"./engine.js";import{compareStrings as r}from"../../shared/utils/compare-strings.js";import{isObject as i}from"../../shared/utils/is-object.js";import{listSubdirectories as a}from"../../shared/utils/list-subdirectories.js";const o=`{folder}`,s=[`teamNamePatterns`,`teamFolders`,`teamFoldersBaseRoles`];function c(e,t,n){let a=Object.keys(i(e.content)?e.content:{}).map(e=>f(e)).filter(e=>e.kind===`team`),o=s.some(t=>t in e);if(a.length===0&&!o&&!h(e))return e;let c=[...new Set(a.flatMap(e=>t[e.prefix]??[]))].sort(r),l={};for(let[r,a]of Object.entries(e))s.includes(r)?n({code:`configuration/ignored`,message:`access.rbac.${r} is ignored: Realm Plus derives team rules from directories. Write the rule with a {folder} segment, for example "apis/{folder}/**" with the team name "P-{folder}-WRITE".`}):l[r]=r===`content`&&i(a)?p(a,t,c,n):r===`features`&&i(a)?Object.fromEntries(Object.entries(a).map(([e,t])=>[e,m(t,c,`access.rbac.features.${e}`,n)])):r===`platform`?m(a,c,`access.rbac.platform`,n):a;return l}function l(e){if(!i(e.content))return[];let t=Object.keys(e.content).map(e=>f(e)).flatMap(e=>e.kind===`team`?[e.prefix]:[]);return[...new Set(t)]}async function u(e,t,n){let r={};for(let i of n)r[i]=(await a(i===``?e:`${e}/${i}`,t)).filter(e=>!e.startsWith(`.`)&&!e.startsWith(`@`));return r}function d(e,t,n){let r=e.access;if(!i(r))return e;let a=r.rbac;if(!i(a))return e;let o=c(a,t,n);return o===a?e:{...e,access:{...r,rbac:o}}}function f(t){let r=e(t).split(`/`),i=r.flatMap((e,t)=>e.includes(o)?[t]:[]);if(i.length===0)return{kind:`plain`};if(i.length>1)return{kind:`invalid`,reason:`only one path segment can be {folder}`};let[a]=i;if(r[a]!==o)return{kind:`invalid`,reason:`{folder} must be a whole path segment`};let s=r.slice(0,a);return s.some(e=>e===``||e.startsWith(`.`)||n(e))?{kind:`invalid`,reason:`the path before {folder} must be a plain directory path`}:{kind:`team`,prefix:s.join(`/`)}}function p(n,r,i,a){let s=new Set(Object.keys(n).filter(e=>f(e).kind===`plain`).map(e)),c={};for(let[l,u]of Object.entries(n)){let n=f(l),d=`access.rbac.content["${l}"]`;if(n.kind===`invalid`){a({code:`configuration/invalid`,message:`${d} is ignored: ${n.reason}, for example "apis/{folder}/**".`});continue}if(n.kind===`plain`){c[l]=m(u,i,d,a);continue}let p=r[n.prefix]??[];if(p.length===0){a({code:`configuration/ignored`,message:`${d} matched no directory under ${n.prefix===``?`the content root`:`"${n.prefix}/"`}, so it adds no rule.`});continue}for(let n of p){let r=l.replace(o,()=>t(n));s.has(e(r))||(c[r]=m(u,[n],d,a))}}return c}function m(e,t,n,r){if(!i(e))return e;let a={};for(let[i,s]of Object.entries(e))if(!i.includes(o))a[i]=s;else if(t.length===0)r({code:`configuration/invalid`,message:`${n}["${i}"] is ignored: {folder} has no values: no access.rbac.content key with a {folder} segment matched a directory.`});else for(let e of t)a[i.replaceAll(o,()=>e)]=s;return a}function h(e){return i(e)?Object.entries(e).some(([e,t])=>e.includes(o)||h(t)):!1}export{d as expandConfigRbacTeamTemplates,c as expandRbacTeamTemplates,u as listTeamDirs,l as teamTemplatePrefixes};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=[`none`,`read`,`triage`,`write`,`maintain`,`admin`],t=`l10nRules`,n=`redocly::nav-item-rbac`,r=`*`,i=`authenticated`,a=`anonymous`;export{n as NAV_ITEM_RBAC,t as RBAC_L10N_RULES_KEY,e as RBAC_ROLES,a as RBAC_TEAM_ANONYMOUS,i as RBAC_TEAM_AUTHENTICATED,r as RBAC_WILDCARD_TEAM};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|