@redocly/framework 1.0.0-next.12 → 1.0.0-next.14

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.
Files changed (244) hide show
  1. package/README.md +0 -1
  2. package/dist/bundler/build/dependency-pack.js +1 -1
  3. package/dist/bundler/build/output-metadata.js +1 -1
  4. package/dist/bundler/build/run.js +1 -1
  5. package/dist/bundler/build/theme-global-stylesheets.js +1 -1
  6. package/dist/bundler/build/vite-config.js +2 -2
  7. package/dist/bundler/dev/dev-content-build.js +1 -1
  8. package/dist/bundler/dev/routes/dev-problems-route.js +1 -1
  9. package/dist/bundler/dev/routes/source-sync-route.js +1 -1
  10. package/dist/bundler/dev/run.js +1 -1
  11. package/dist/bundler/dev/runtime-app.js +1 -1
  12. package/dist/bundler/dev/vite-chunk-url.js +1 -1
  13. package/dist/bundler/user-markdoc-schema.js +1 -1
  14. package/dist/bundler/vite-config.base.js +5 -5
  15. package/dist/cli/api-docs-build-event.js +1 -1
  16. package/dist/cli/args.js +1 -1
  17. package/dist/cli/commands/build.js +1 -1
  18. package/dist/cli/commands/dev.js +1 -1
  19. package/dist/cli/commands/ingest.js +1 -1
  20. package/dist/cli/commands/translate.js +1 -1
  21. package/dist/cli/problems-output.js +3 -3
  22. package/dist/cli/validate-react-pages.js +1 -1
  23. package/dist/client/UnversionedVersionButton.js +1 -1
  24. package/dist/client/VersionPicker.js +343 -0
  25. package/dist/client/ai-search/use-ai-search.js +1 -1
  26. package/dist/client/analytics-page-view.js +1 -1
  27. package/dist/client/app.js +2 -2
  28. package/dist/client/classic-webview-sync.js +1 -1
  29. package/dist/client/client-entry.js +1 -1
  30. package/dist/client/contexts.js +1 -1
  31. package/dist/client/feedback.js +1 -1
  32. package/dist/client/history-mount.js +6 -5
  33. package/dist/client/l10n/ssr-l10n.js +1 -1
  34. package/dist/client/l10n/use-l10n-config.js +1 -1
  35. package/dist/client/products.js +1 -1
  36. package/dist/client/review/ReviewBar.js +31 -31
  37. package/dist/client/review/login-url.js +1 -1
  38. package/dist/client/review/use-review.js +1 -1
  39. package/dist/client/revisions-history.js +1 -1
  40. package/dist/client/sidebar/SidebarDataProvider.js +1 -1
  41. package/dist/client/sidebar/drilldown.js +1 -1
  42. package/dist/client/ssr.js +1 -1
  43. package/dist/client/telemetry/config.js +1 -1
  44. package/dist/client/theme-logo.js +1 -1
  45. package/dist/client/use-entity-revisions.js +1 -1
  46. package/dist/client/use-page-versions.js +1 -1
  47. package/dist/client/use-search.js +1 -1
  48. package/dist/client/webmcp/tools/shared.js +1 -1
  49. package/dist/client/webmcp/tools/site-tools.js +1 -1
  50. package/dist/client/webmcp/use-webmcp-tools.js +1 -1
  51. package/dist/content-layer/config-schema.js +1 -1
  52. package/dist/content-layer/config.d.ts +8 -0
  53. package/dist/content-layer/config.js +1 -1
  54. package/dist/content-layer/context-state.js +1 -1
  55. package/dist/content-layer/context.d.ts +6 -0
  56. package/dist/content-layer/context.js +1 -1
  57. package/dist/content-layer/database/assets.js +1 -1
  58. package/dist/content-layer/database/blobs.js +1 -1
  59. package/dist/content-layer/database/entities.d.ts +2 -0
  60. package/dist/content-layer/database/entities.js +1 -1
  61. package/dist/content-layer/database/entity-store.js +1 -1
  62. package/dist/content-layer/database/files.js +1 -1
  63. package/dist/content-layer/database/finalize.js +1 -1
  64. package/dist/content-layer/database/invalidation.js +26 -26
  65. package/dist/content-layer/database/link-refs.js +1 -1
  66. package/dist/content-layer/database/origins.d.ts +2 -1
  67. package/dist/content-layer/database/origins.js +1 -1
  68. package/dist/content-layer/database/problems.js +1 -1
  69. package/dist/content-layer/database/reset.js +1 -1
  70. package/dist/content-layer/database/route-query-deps.d.ts +19 -3
  71. package/dist/content-layer/database/route-query-deps.js +1 -1
  72. package/dist/content-layer/database/search-vocab.js +2 -2
  73. package/dist/content-layer/database/static-files.js +1 -1
  74. package/dist/content-layer/ingest/extract-all-phase.js +1 -1
  75. package/dist/content-layer/ingest/finalize-phase.js +1 -1
  76. package/dist/content-layer/ingest/git-last-modified.d.ts +20 -0
  77. package/dist/content-layer/ingest/git-last-modified.js +5 -4
  78. package/dist/content-layer/ingest/hash.js +1 -1
  79. package/dist/content-layer/ingest/hook-inputs.js +1 -1
  80. package/dist/content-layer/ingest/l10n-warnings.js +1 -1
  81. package/dist/content-layer/ingest/markdoc-schema-problem.js +1 -1
  82. package/dist/content-layer/ingest/normalize-artifacts.js +1 -1
  83. package/dist/content-layer/ingest/run.js +1 -1
  84. package/dist/content-layer/ingest/scan.js +1 -1
  85. package/dist/content-layer/ingest/search-sync.js +1 -1
  86. package/dist/content-layer/ingest/sync.js +1 -1
  87. package/dist/content-layer/link-checker/config-links.js +1 -1
  88. package/dist/content-layer/link-checker/delta.js +1 -1
  89. package/dist/content-layer/link-checker/fingerprint.js +1 -1
  90. package/dist/content-layer/link-checker/load-view.js +1 -1
  91. package/dist/content-layer/link-checker/node-ref.js +1 -1
  92. package/dist/content-layer/link-checker/run-build.js +1 -1
  93. package/dist/content-layer/link-checker/validate.js +1 -1
  94. package/dist/content-layer/loaders/context.js +1 -1
  95. package/dist/content-layer/markdown/client/JsonSchemaTag.js +1 -1
  96. package/dist/content-layer/markdown/client/markdown-text.js +1 -1
  97. package/dist/content-layer/markdown/constants/builtin-tags.js +1 -1
  98. package/dist/content-layer/markdown/nodes/fence.js +1 -1
  99. package/dist/content-layer/markdown/nodes/heading.js +1 -1
  100. package/dist/content-layer/markdown/nodes/table.js +1 -1
  101. package/dist/content-layer/markdown/resolve/ast.d.ts +2 -0
  102. package/dist/content-layer/markdown/resolve/ast.js +1 -1
  103. package/dist/content-layer/markdown/resolve/markdoc-resolvers/file-reference.js +1 -1
  104. package/dist/content-layer/markdown/resolve/markdoc-resolvers/operation-samples.js +1 -1
  105. package/dist/content-layer/markdown/resolve/markdoc-resolvers/partial.js +1 -1
  106. package/dist/content-layer/markdown/resolve/markdoc-resolvers/svg-content.js +1 -1
  107. package/dist/content-layer/markdown/resolve/markdoc.js +1 -1
  108. package/dist/content-layer/markdown/resolve/references.js +1 -1
  109. package/dist/content-layer/markdown/search/to-markdown.js +3 -3
  110. package/dist/content-layer/markdown/search/to-sections.js +1 -1
  111. package/dist/content-layer/markdown/search/to-text.js +5 -5
  112. package/dist/content-layer/markdown/server/render.js +1 -1
  113. package/dist/content-layer/markdown/service.js +1 -1
  114. package/dist/content-layer/markdown/tags/variant.js +1 -1
  115. package/dist/content-layer/markdown/utils/collect-anchors.js +1 -1
  116. package/dist/content-layer/markdown/utils/first-heading.js +1 -1
  117. package/dist/content-layer/markdown/utils/parse-cache.d.ts +5 -1
  118. package/dist/content-layer/markdown/utils/parse-cache.js +1 -1
  119. package/dist/content-layer/materialization/asset-reconcile.js +1 -1
  120. package/dist/content-layer/materialization/entity.js +1 -1
  121. package/dist/content-layer/materialization/materializer.js +1 -1
  122. package/dist/content-layer/materialization/static-files.js +1 -1
  123. package/dist/content-layer/plugins/execute.js +1 -1
  124. package/dist/content-layer/plugins/index.js +1 -1
  125. package/dist/content-layer/plugins/internal/api-docs/client/template.js +2 -2
  126. package/dist/content-layer/plugins/internal/api-docs/index.js +1 -1
  127. package/dist/content-layer/plugins/internal/api-docs/server/build-definition.d.ts +4 -1
  128. package/dist/content-layer/plugins/internal/api-docs/server/build-definition.js +1 -1
  129. package/dist/content-layer/plugins/internal/api-docs/server/markdown-copy.js +12 -10
  130. package/dist/content-layer/plugins/internal/api-docs/server/options.d.ts +1 -1
  131. package/dist/content-layer/plugins/internal/api-docs/server/options.js +1 -1
  132. package/dist/content-layer/plugins/internal/api-docs/server/search-documents.js +1 -1
  133. package/dist/content-layer/plugins/internal/api-docs/server/spec-download.js +1 -1
  134. package/dist/content-layer/plugins/internal/api-functions/server/dispatch.js +1 -1
  135. package/dist/content-layer/plugins/internal/app-data/index.js +1 -1
  136. package/dist/content-layer/plugins/internal/app-data/logo.js +1 -1
  137. package/dist/content-layer/plugins/internal/app-data/products.js +1 -1
  138. package/dist/content-layer/plugins/internal/assets/index.js +1 -1
  139. package/dist/content-layer/plugins/internal/catalog-classic/client/use-catalog-classic.js +1 -1
  140. package/dist/content-layer/plugins/internal/catalog-classic/index.js +1 -1
  141. package/dist/content-layer/plugins/internal/catalog-classic/resolve-items.js +1 -1
  142. package/dist/content-layer/plugins/internal/index.js +1 -1
  143. package/dist/content-layer/plugins/internal/l10n/index.js +1 -1
  144. package/dist/content-layer/plugins/internal/l10n/translations-loader.js +1 -1
  145. package/dist/content-layer/plugins/internal/markdoc/client/template.js +1 -1
  146. package/dist/content-layer/plugins/internal/markdoc/index.js +1 -1
  147. package/dist/content-layer/plugins/internal/mcp/app-data.js +1 -1
  148. package/dist/content-layer/plugins/internal/mcp/constants.d.ts +4 -3
  149. package/dist/content-layer/plugins/internal/mcp/constants.js +1 -1
  150. package/dist/content-layer/plugins/internal/mcp/content-tools.js +1 -1
  151. package/dist/content-layer/plugins/internal/mcp/ignored-routes.js +1 -1
  152. package/dist/content-layer/plugins/internal/mcp/index.js +1 -1
  153. package/dist/content-layer/plugins/internal/mcp/server/agent-card.js +1 -1
  154. package/dist/content-layer/plugins/internal/mcp/server/audit.js +1 -1
  155. package/dist/content-layer/plugins/internal/mcp/server/auth.js +1 -1
  156. package/dist/content-layer/plugins/internal/mcp/server/codemode/constants.js +1 -1
  157. package/dist/content-layer/plugins/internal/mcp/server/codemode/execute-schema.js +1 -1
  158. package/dist/content-layer/plugins/internal/mcp/server/codemode/prompts.js +8 -8
  159. package/dist/content-layer/plugins/internal/mcp/server/config-gate.js +1 -1
  160. package/dist/content-layer/plugins/internal/mcp/server/custom-tools.js +1 -1
  161. package/dist/content-layer/plugins/internal/mcp/server/gateway/call-api.js +2 -2
  162. package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-handler.js +1 -1
  163. package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/form-page.js +1 -1
  164. package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/site-branding.js +1 -1
  165. package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials.js +1 -1
  166. package/dist/content-layer/plugins/internal/mcp/server/gateway/elicitation.js +6 -6
  167. package/dist/content-layer/plugins/internal/mcp/server/gateway/index.js +3 -3
  168. package/dist/content-layer/plugins/internal/mcp/server/gateway/subject.js +1 -1
  169. package/dist/content-layer/plugins/internal/mcp/server/gateway/tool-list.js +1 -1
  170. package/dist/content-layer/plugins/internal/mcp/server/gateway/tools.js +4 -4
  171. package/dist/content-layer/plugins/internal/mcp/server/handler.js +1 -1
  172. package/dist/content-layer/plugins/internal/mcp/server/mcp-server.js +1 -1
  173. package/dist/content-layer/plugins/internal/mcp/server/mcp-telemetry.js +1 -1
  174. package/dist/content-layer/plugins/internal/mcp/server/oauth/authorize.js +1 -1
  175. package/dist/content-layer/plugins/internal/mcp/server/oauth/callback.js +1 -1
  176. package/dist/content-layer/plugins/internal/mcp/server/oauth/client-metadata.js +1 -1
  177. package/dist/content-layer/plugins/internal/mcp/server/oauth/discovery.js +1 -1
  178. package/dist/content-layer/plugins/internal/mcp/server/oauth/register.js +1 -1
  179. package/dist/content-layer/plugins/internal/mcp/server/oauth/token.js +1 -1
  180. package/dist/content-layer/plugins/internal/mcp/server/server-card.js +1 -1
  181. package/dist/content-layer/plugins/internal/mcp/server/server-info.js +1 -1
  182. package/dist/content-layer/plugins/internal/mcp/server/skills-resources.js +1 -1
  183. package/dist/content-layer/plugins/internal/mcp/server/tools/pages-navigation.js +1 -1
  184. package/dist/content-layer/plugins/internal/mcp/server/tools/pages.js +2 -2
  185. package/dist/content-layer/plugins/internal/mcp/server/tools/schemas.js +1 -1
  186. package/dist/content-layer/plugins/internal/mcp/server/tools/search.js +2 -2
  187. package/dist/content-layer/plugins/internal/mcp/server/workflows/resolve-workflows.js +1 -1
  188. package/dist/content-layer/plugins/internal/mcp/server/workflows/schemas.js +2 -1
  189. package/dist/content-layer/plugins/internal/mcp/server/workflows/tools.js +1 -1
  190. package/dist/content-layer/plugins/internal/mcp/setup-page.js +1 -1
  191. package/dist/content-layer/plugins/internal/mock/server/handler.js +1 -1
  192. package/dist/content-layer/plugins/internal/react-page/index.js +1 -1
  193. package/dist/content-layer/plugins/internal/scorecard-classic/client/template.js +1 -1
  194. package/dist/content-layer/plugins/internal/scorecard-classic/index.js +1 -1
  195. package/dist/content-layer/plugins/internal/sidebar/bundle.js +1 -1
  196. package/dist/content-layer/plugins/internal/sidebar/index.js +2 -2
  197. package/dist/content-layer/plugins/internal/skills/index.js +1 -1
  198. package/dist/content-layer/plugins/internal/skills/server/routes.js +1 -1
  199. package/dist/content-layer/plugins/io.js +1 -1
  200. package/dist/content-layer/plugins/project/load.js +2 -2
  201. package/dist/content-layer/plugins/source-file.js +1 -1
  202. package/dist/content-layer/plugins/utils/link-access.js +1 -1
  203. package/dist/content-layer/plugins/utils/route-index.js +1 -1
  204. package/dist/content-layer/revisions/delete.js +1 -1
  205. package/dist/content-layer/revisions/read.js +1 -1
  206. package/dist/content-layer/search/engine/core/search-engine.js +1 -1
  207. package/dist/content-layer/search/postings/postings-store.js +1 -1
  208. package/dist/content-layer/server/database.js +1 -1
  209. package/dist/content-layer/static/registry.js +1 -1
  210. package/dist/content-layer/templates/template-set.js +1 -1
  211. package/dist/content-layer/versions/redirect.js +1 -1
  212. package/dist/content-layer/versions/resolve.js +1 -1
  213. package/dist/server/app.js +3 -3
  214. package/dist/server/ask-ai/feature-gate.js +1 -1
  215. package/dist/server/ask-ai/route.js +1 -1
  216. package/dist/server/auth/middleware.js +1 -1
  217. package/dist/server/auth/request.js +1 -1
  218. package/dist/server/auth/routes.js +1 -1
  219. package/dist/server/content.js +12 -12
  220. package/dist/server/cors-proxy/handler.js +1 -1
  221. package/dist/server/feedback/route.js +1 -1
  222. package/dist/server/lambda-entry.js +1 -1
  223. package/dist/server/manifest-assets.js +4 -4
  224. package/dist/server/node-entry.js +1 -1
  225. package/dist/server/page-handlers.js +2 -2
  226. package/dist/server/plugin-context.js +1 -1
  227. package/dist/server/rbac/content-asset-access.js +1 -1
  228. package/dist/server/runtime-config.js +1 -1
  229. package/dist/server/search/route.js +1 -1
  230. package/dist/server/seo-tags.js +2 -2
  231. package/dist/server/sitemap.js +1 -1
  232. package/dist/server/static-files/serve.js +1 -1
  233. package/dist/server/subprocess/child-entry.js +1 -1
  234. package/dist/server/subprocess/host.js +1 -1
  235. package/dist/server/template-ids.js +1 -1
  236. package/dist/shared/constants/system-routes.js +1 -1
  237. package/dist/shared/rbac/engine.js +0 -0
  238. package/dist/shared/rbac/l10n-rules.js +1 -1
  239. package/dist/shared/rbac/route-scope.js +1 -1
  240. package/dist/shared/rbac/team-templates.js +1 -1
  241. package/dist/shared/types/config.d.ts +2 -1
  242. package/dist/shared/utils/l10n.js +1 -1
  243. package/dist/shared/utils/routes/file-path-to-route-slug.js +1 -1
  244. package/package.json +4 -5
@@ -1 +1 @@
1
- import{stripPathPrefix as e}from"../../shared/path-prefix.js";import{isObject as t}from"../../shared/utils/is-object.js";import{canView as n,matchContentScope as r,resolveAudience as i,resolveRbacDenialStatus as a,resolveRole as o}from"../../shared/rbac/engine.js";import{resolveRouteScope as s}from"../../shared/rbac/route-scope.js";import{createRuntimeEntityStore as c,loadRbacRouteIndex as l,loadRbacRuntime as u,loadStaticFileIndex as d}from"../content.js";import{attachmentDisposition as f}from"../../shared/utils/attachment-disposition.js";import{normalizeStaticPath as p}from"../../content-layer/static/normalize-path.js";import{producerContentType as m,toStaticBodyBytes as h}from"../../content-layer/static/producer-value.js";import{CONTENT_ASSET_PRIVATE_CACHE_CONTROL as g,contentAssetDenied as _,contentAssetNotFound as v}from"../content-assets/access.js";import{readLocalFileBody as y,sendFileBody as b}from"../content-assets/file-body.js";import{join as x}from"node:path";const S=`public, max-age=3600`;function C(e,t){let{database:n,logger:r}=t,i=t.staticFilesDir===void 0;e.get(`*`,async(e,a)=>{let o=w(e),s=o===null?void 0:(await d(n)).get(o);if(!s)return a();let c=t.buildRequest(e),l=await T({config:t.getConfig(),database:n,logger:r,row:s,request:c});if(l.deny)return _(e,l.status);let u=await E({...t,row:s,method:e.req.method});if(!u)return r?.debug(`Static file "${s.path}" is registered but its bytes are missing.`),v(e);let p=l.audience===`public`&&!e.get(`realmAccessConfig`)?.requiresLogin;e.set(`realmCacheControlOwned`,!0);let m={"Cache-Control":i?`no-store`:p?S:g,"Content-Type":u.contentType,"Access-Control-Allow-Origin":`*`};return new URL(e.req.url).searchParams.has(`download`)&&(m[`Content-Disposition`]=f(s.path.slice(s.path.lastIndexOf(`/`)+1))),b(e,u,m)})}function w(t){let n=e(new URL(t.req.url).pathname);if(n===null)return null;try{return p(decodeURIComponent(n).slice(1))}catch{return null}}async function T(e){let t=await u(e);if(!t)return{deny:!1,audience:`public`};let c=e.request.teams,d={deny:!0,status:a(c)};if(e.row.kind===`copy`){let a=r(t.matcher,{filePath:e.row.sourcePath,slug:`/${e.row.path}`});return n(o(a,c))?{deny:!1,audience:i(a)===`public`?`public`:`private`}:d}let f=e.row.audience??`public`;if(f===`public`)return{deny:!1,audience:`public`};let p=(await l(e.database)).bySlug.get(f.routeSlug);if(!p)return d;let m=s(t.matcher,p,()=>{});return n(o(m,c))?{deny:!1,audience:`private`}:d}async function E(e){let{row:n}=e;if(n.kind===`producer`){if(!n.entityKey)return null;let r=await c(e).load(n.entityKey);if(!t(r))return null;let i=h(r.body);return{bytes:i,size:i.byteLength,contentType:m(r,n)}}let r=e.staticFilesDir===void 0?e.contentDir!==void 0&&n.sourcePath?x(e.contentDir,n.sourcePath):null:x(e.staticFilesDir,...n.path.split(`/`));if(r===null)return null;let i=await y(r,e.method);return i&&{...i,contentType:n.contentType}}export{S as STATIC_FILE_PUBLIC_CACHE_CONTROL,C as registerStaticFileRoute};
1
+ import{isObject as e}from"../../shared/utils/is-object.js";import{canView as t,matchContentScope as n,resolveAudience as r,resolveRbacDenialStatus as i,resolveRole as a}from"../../shared/rbac/engine.js";import{resolveRouteScope as o}from"../../shared/rbac/route-scope.js";import{stripPathPrefix as s}from"../../shared/path-prefix.js";import{producerContentType as c,toStaticBodyBytes as l}from"../../content-layer/static/producer-value.js";import{createRuntimeEntityStore as u,loadRbacRouteIndex as d,loadRbacRuntime as f,loadStaticFileIndex as p}from"../content.js";import{attachmentDisposition as m}from"../../shared/utils/attachment-disposition.js";import{normalizeStaticPath as h}from"../../content-layer/static/normalize-path.js";import{CONTENT_ASSET_PRIVATE_CACHE_CONTROL as g,contentAssetDenied as _,contentAssetNotFound as v}from"../content-assets/access.js";import{readLocalFileBody as y,sendFileBody as b}from"../content-assets/file-body.js";import{join as x}from"node:path";const S=`public, max-age=3600`;function C(e,t){let{database:n,logger:r}=t,i=t.staticFilesDir===void 0;e.get(`*`,async(e,a)=>{let o=w(e),s=o===null?void 0:(await p(n)).get(o);if(!s)return a();let c=t.buildRequest(e),l=await T({config:t.getConfig(),database:n,logger:r,row:s,request:c});if(l.deny)return _(e,l.status);let u=await E({...t,row:s,method:e.req.method});if(!u)return r?.debug(`Static file "${s.path}" is registered but its bytes are missing.`),v(e);let d=l.audience===`public`&&!e.get(`realmAccessConfig`)?.requiresLogin;e.set(`realmCacheControlOwned`,!0);let f={"Cache-Control":i?`no-store`:d?S:g,"Content-Type":u.contentType,"Access-Control-Allow-Origin":`*`};return new URL(e.req.url).searchParams.has(`download`)&&(f[`Content-Disposition`]=m(s.path.slice(s.path.lastIndexOf(`/`)+1))),b(e,u,f)})}function w(e){let t=s(new URL(e.req.url).pathname);if(t===null)return null;try{return h(decodeURIComponent(t).slice(1))}catch{return null}}async function T(e){let s=await f(e);if(!s)return{deny:!1,audience:`public`};let c=e.request.teams,l={deny:!0,status:i(c)};if(e.row.kind===`copy`){let i=n(s.matcher,{filePath:e.row.sourcePath,slug:`/${e.row.path}`});return t(a(i,c))?{deny:!1,audience:r(i)===`public`?`public`:`private`}:l}let u=e.row.audience??`public`;if(u===`public`)return{deny:!1,audience:`public`};let p=(await d(e.database)).bySlug.get(u.routeSlug);if(!p)return l;let m=o(s.matcher,p,()=>{});return t(a(m,c))?{deny:!1,audience:`private`}:l}async function E(t){let{row:n}=t;if(n.kind===`producer`){if(!n.entityKey)return null;let r=await u(t).load(n.entityKey);if(!e(r))return null;let i=l(r.body);return{bytes:i,size:i.byteLength,contentType:c(r,n)}}let r=t.staticFilesDir===void 0?t.contentDir!==void 0&&n.sourcePath?x(t.contentDir,n.sourcePath):null:x(t.staticFilesDir,...n.path.split(`/`));if(r===null)return null;let i=await y(r,t.method);return i&&{...i,contentType:n.contentType}}export{S as STATIC_FILE_PUBLIC_CACHE_CONTROL,C as registerStaticFileRoute};
@@ -1 +1 @@
1
- import{openContentLayerDatabase as e}from"../../content-layer/database/connection.js";import{createKvStore as t}from"../../content-layer/database/kv.js";import"../../content-layer/server/database.js";import{toPosixPath as n}from"../../shared/utils/to-posix-path.js";import"./protocol.js";import{pathToFileURL as r}from"node:url";import{createWriteStream as i}from"node:fs";import a from"node:process";async function o(){let e=[];for await(let t of a.stdin)e.push(t);return JSON.parse(Buffer.concat(e).toString(`utf8`))}function s(e){return e instanceof Error?e.cause===void 0?e.message:`${e.message}: ${s(e.cause)}`:String(e)}function c(e,t){return{ok:!1,code:e,message:s(t)}}function l(e){return typeof e==`object`&&!!e&&`response`in e&&`id`in e&&typeof e.id==`number`}async function u(){let{ESModulesEvaluator:e,ModuleRunner:t,createNodeImportMeta:r}=await import(`vite/module-runner`),i=/* @__PURE__ */ new Map,o=a.send?.bind(a);if(!o)throw Error(`The vite loader needs an IPC channel`);let s=0;a.on(`message`,e=>{l(e)&&(i.get(e.id)?.resolve(e.response),i.delete(e.id))});let c=new t({transport:{invoke:e=>new Promise((t,n)=>{let r=s++;i.set(r,{reject:n,resolve:t}),o({id:r,payload:e},e=>{e&&(i.get(r)?.reject(e),i.delete(r))})})},hmr:!1,createImportMeta:r},new e);return e=>c.import(`/@fs${n(e)}`)}const d=e=>import(r(e).href);async function f(e,t){t.loader??=e.loader===`vite`?u():Promise.resolve(d);let n=await t.loader,r=(await n(e.modulePath))[e.exportName];if(typeof r!=`function`)throw Error(`Export "${e.exportName}" of ${e.modulePath} is not a function`);return{handler:r,loadModule:n}}async function p(n,r){let i,a;try{({handler:i,loadModule:a}=await f(n,r))}catch(e){return c(`module-load`,e)}let o=Symbol(`none`),{database:s}=n,l=s?async()=>(r.database??=e({databaseUrl:s.databaseUrl,authToken:s.authToken,runMigrations:!1}).catch(e=>{throw r.database=void 0,o=e,e}),t(await r.database)):void 0;try{return{ok:!0,output:await i(n.input,{getKv:l,loadModule:a})}}catch(e){return c(e===o?`database-open`:`handler-throw`,e)}}async function m(e){await e.database?.then(e=>e.close()).catch(()=>{})}function h(e){try{return JSON.stringify(e)}catch(e){return JSON.stringify(c(`handler-throw`,`Handler output is not JSON serializable: ${String(e)}`))}}function g(e){return new Promise((t,n)=>{let r=i(``,{fd:3});r.on(`error`,n),r.end(h(e),()=>t())})}async function*_(){let e=[];for await(let t of a.stdin){let n=t;for(let t=n.indexOf(10);t!==-1;t=n.indexOf(10))e.push(n.subarray(0,t)),yield Buffer.concat(e).toString(`utf8`),e=[],n=n.subarray(t+1);e.push(n)}}function v(e){try{return JSON.parse(e)}catch(e){return c(`bad-message`,e)}}async function y(e){let t=i(``,{fd:3});for await(let n of _()){let r=v(n),i=`modulePath`in r?await p(r,e):r;await new Promise((e,n)=>{t.write(`${h(i)}\n`,t=>t?n(t):e())})}}async function b(){let e={};if(a.argv.includes(`--reuse`))await y(e);else{let t=await p(await o(),e);await m(e),await g(t)}a.exit(0)}b().catch(e=>{a.stderr.write(`subprocess child failed: ${e instanceof Error?e.stack:e}\n`),a.exit(1)});export{};
1
+ import{toPosixPath as e}from"../../shared/utils/to-posix-path.js";import{openContentLayerDatabase as t}from"../../content-layer/database/connection.js";import"./protocol.js";import{createKvStore as n}from"../../content-layer/database/kv.js";import"../../content-layer/server/database.js";import{pathToFileURL as r}from"node:url";import{createWriteStream as i}from"node:fs";import a from"node:process";async function o(){let e=[];for await(let t of a.stdin)e.push(t);return JSON.parse(Buffer.concat(e).toString(`utf8`))}function s(e){return e instanceof Error?e.cause===void 0?e.message:`${e.message}: ${s(e.cause)}`:String(e)}function c(e,t){return{ok:!1,code:e,message:s(t)}}function l(e){return typeof e==`object`&&!!e&&`response`in e&&`id`in e&&typeof e.id==`number`}async function u(){let{ESModulesEvaluator:t,ModuleRunner:n,createNodeImportMeta:r}=await import(`vite/module-runner`),i=/* @__PURE__ */ new Map,o=a.send?.bind(a);if(!o)throw Error(`The vite loader needs an IPC channel`);let s=0;a.on(`message`,e=>{l(e)&&(i.get(e.id)?.resolve(e.response),i.delete(e.id))});let c=new n({transport:{invoke:e=>new Promise((t,n)=>{let r=s++;i.set(r,{reject:n,resolve:t}),o({id:r,payload:e},e=>{e&&(i.get(r)?.reject(e),i.delete(r))})})},hmr:!1,createImportMeta:r},new t);return t=>c.import(`/@fs${e(t)}`)}const d=e=>import(r(e).href);async function f(e,t){t.loader??=e.loader===`vite`?u():Promise.resolve(d);let n=await t.loader,r=(await n(e.modulePath))[e.exportName];if(typeof r!=`function`)throw Error(`Export "${e.exportName}" of ${e.modulePath} is not a function`);return{handler:r,loadModule:n}}async function p(e,r){let i,a;try{({handler:i,loadModule:a}=await f(e,r))}catch(e){return c(`module-load`,e)}let o=Symbol(`none`),{database:s}=e,l=s?async()=>(r.database??=t({databaseUrl:s.databaseUrl,authToken:s.authToken,runMigrations:!1}).catch(e=>{throw r.database=void 0,o=e,e}),n(await r.database)):void 0;try{return{ok:!0,output:await i(e.input,{getKv:l,loadModule:a})}}catch(e){return c(e===o?`database-open`:`handler-throw`,e)}}async function m(e){await e.database?.then(e=>e.close()).catch(()=>{})}function h(e){try{return JSON.stringify(e)}catch(e){return JSON.stringify(c(`handler-throw`,`Handler output is not JSON serializable: ${String(e)}`))}}function g(e){return new Promise((t,n)=>{let r=i(``,{fd:3});r.on(`error`,n),r.end(h(e),()=>t())})}async function*_(){let e=[];for await(let t of a.stdin){let n=t;for(let t=n.indexOf(10);t!==-1;t=n.indexOf(10))e.push(n.subarray(0,t)),yield Buffer.concat(e).toString(`utf8`),e=[],n=n.subarray(t+1);e.push(n)}}function v(e){try{return JSON.parse(e)}catch(e){return c(`bad-message`,e)}}async function y(e){let t=i(``,{fd:3});for await(let n of _()){let r=v(n),i=`modulePath`in r?await p(r,e):r;await new Promise((e,n)=>{t.write(`${h(i)}\n`,t=>t?n(t):e())})}}async function b(){let e={};if(a.argv.includes(`--reuse`))await y(e);else{let t=await p(await o(),e);await m(e),await g(t)}a.exit(0)}b().catch(e=>{a.stderr.write(`subprocess child failed: ${e instanceof Error?e.stack:e}\n`),a.exit(1)});export{};
@@ -1 +1 @@
1
- import{RUNTIME_SSR_DIRNAME as e,RUNTIME_SUBPROCESS_CHILD_FILENAME as t,serverModuleChunkPath as n}from"../../shared/constants/runtime-layout.js";import{isRemoteDatabaseUrl as r}from"../../content-layer/database/utils/is-remote-database-url.js";import{resolveLocalDatabasePath as i}from"../../content-layer/database/connection.js";import"../../content-layer/server/database.js";import{SubprocessError as a,runSubprocess as o,startReusedSubprocess as s,toRealPath as c}from"./runner.js";import{fileURLToPath as l,pathToFileURL as u}from"node:url";import{existsSync as d,lstatSync as f,readdirSync as p}from"node:fs";import{basename as m,dirname as h,isAbsolute as g,join as _,sep as v}from"node:path";function y(e){let{database:t,resolveContentModule:n,...r}=e,i=0,c=[],l=/* @__PURE__ */ new Map,u=async e=>{let n=l.get(e.modulePath);n||(n=[],l.set(e.modulePath,n));let i=n.pop();for(;i&&!i.alive;)i=n.pop();i??=s({...r,modulePath:e.modulePath,database:t});let a=!0;try{let t=await i.run(e);return a=!1,t}finally{a||!i.alive?i.stop():n.push(i)}};return{resolveContentModule:n,run:async e=>{let n=Date.now()+(e.timeoutMs??1e4);i<8?i+=1:await new Promise((e,t)=>{let r=()=>{clearTimeout(i),e()},i=setTimeout(()=>{c.splice(c.indexOf(r),1),t(new a(`timeout`,`Subprocess timed out waiting for a free slot`))},n-Date.now());c.push(r)});try{let i=n-Date.now();return e.reuse?await u({...e,timeoutMs:i}):await o({...r,...e,timeoutMs:i,database:t})}finally{let e=c.shift();e?e():--i}}}}const b=[``,`-wal`,`-shm`,`-journal`];function x(e){if(r(e))return{databaseUrl:e};let t=i(e),n=_(c(h(t)),m(t));return{databaseUrl:u(n).href,fsRead:[h(n)],fsWrite:b.map(e=>`${n}${e}`),allowAddons:!0}}function S(r){let{databaseUrl:i,...a}=x(r.databaseUrl);return y({...a,childEntryPath:_(r.runtimeDir,t),resolveContentModule:t=>_(r.runtimeDir,e,n(t)),fsRead:[r.runtimeDir,...a.fsRead??[]],database:{databaseUrl:i,authToken:r.authToken}})}function C(e){let t=[];for(let n=e;;n=h(n)){let e=_(n,`node_modules`);if(d(e)&&t.push(e),h(n)===n)return t}}function w(e){let t=[],n=e=>{let n=!1;try{n=f(e).isSymbolicLink()}catch{return}if(!n)return;let r=c(e);r.includes(`${v}node_modules${v}`)||t.push(r)};for(let t of T(e)){let r=_(e,t);if(t.startsWith(`@`))for(let e of T(r))n(_(r,e));else n(r)}return t}function T(e){try{return p(e)}catch{return[]}}function E(e){let t=l(new URL(`../../../`,import.meta.url)),{databaseUrl:n,...r}=x(e.databaseUrl);return y({...r,childEntryPath:e.childEntryPath??l(new URL(`./child-entry.js`,import.meta.url)),resolveContentModule:t=>g(t)?t:_(e.contentDir,t),fsRead:[e.contentDir,t,...C(t),...C(e.contentDir),...w(_(t,`node_modules`)),...r.fsRead??[]],database:{databaseUrl:n},viteInvoke:e.viteInvoke})}export{b as LOCAL_DATABASE_FILE_SUFFIXES,E as createDevSubprocessHost,S as createRuntimeSubprocessHost,y as createSubprocessHost};
1
+ import{RUNTIME_SSR_DIRNAME as e,RUNTIME_SUBPROCESS_CHILD_FILENAME as t,serverModuleChunkPath as n}from"../../shared/constants/runtime-layout.js";import{isRemoteDatabaseUrl as r}from"../../content-layer/database/utils/is-remote-database-url.js";import{resolveLocalDatabasePath as i}from"../../content-layer/database/connection.js";import{SubprocessError as a,runSubprocess as o,startReusedSubprocess as s,toRealPath as c}from"./runner.js";import"../../content-layer/server/database.js";import{fileURLToPath as l,pathToFileURL as u}from"node:url";import{existsSync as d,lstatSync as f,readdirSync as p}from"node:fs";import{basename as m,dirname as h,isAbsolute as g,join as _,sep as v}from"node:path";function y(e){let{database:t,resolveContentModule:n,...r}=e,i=0,c=[],l=/* @__PURE__ */ new Map,u=async e=>{let n=l.get(e.modulePath);n||(n=[],l.set(e.modulePath,n));let i=n.pop();for(;i&&!i.alive;)i=n.pop();i??=s({...r,modulePath:e.modulePath,database:t});let a=!0;try{let t=await i.run(e);return a=!1,t}finally{a||!i.alive?i.stop():n.push(i)}};return{resolveContentModule:n,run:async e=>{let n=Date.now()+(e.timeoutMs??1e4);i<8?i+=1:await new Promise((e,t)=>{let r=()=>{clearTimeout(i),e()},i=setTimeout(()=>{c.splice(c.indexOf(r),1),t(new a(`timeout`,`Subprocess timed out waiting for a free slot`))},n-Date.now());c.push(r)});try{let i=n-Date.now();return e.reuse?await u({...e,timeoutMs:i}):await o({...r,...e,timeoutMs:i,database:t})}finally{let e=c.shift();e?e():--i}}}}const b=[``,`-wal`,`-shm`,`-journal`];function x(e){if(r(e))return{databaseUrl:e};let t=i(e),n=_(c(h(t)),m(t));return{databaseUrl:u(n).href,fsRead:[h(n)],fsWrite:b.map(e=>`${n}${e}`),allowAddons:!0}}function S(r){let{databaseUrl:i,...a}=x(r.databaseUrl);return y({...a,childEntryPath:_(r.runtimeDir,t),resolveContentModule:t=>_(r.runtimeDir,e,n(t)),fsRead:[r.runtimeDir,...a.fsRead??[]],database:{databaseUrl:i,authToken:r.authToken}})}function C(e){let t=[];for(let n=e;;n=h(n)){let e=_(n,`node_modules`);if(d(e)&&t.push(e),h(n)===n)return t}}function w(e){let t=[],n=e=>{let n=!1;try{n=f(e).isSymbolicLink()}catch{return}if(!n)return;let r=c(e);r.includes(`${v}node_modules${v}`)||t.push(r)};for(let t of T(e)){let r=_(e,t);if(t.startsWith(`@`))for(let e of T(r))n(_(r,e));else n(r)}return t}function T(e){try{return p(e)}catch{return[]}}function E(e){let t=l(new URL(`../../../`,import.meta.url)),{databaseUrl:n,...r}=x(e.databaseUrl);return y({...r,childEntryPath:e.childEntryPath??l(new URL(`./child-entry.js`,import.meta.url)),resolveContentModule:t=>g(t)?t:_(e.contentDir,t),fsRead:[e.contentDir,t,...C(t),...C(e.contentDir),...w(_(t,`node_modules`)),...r.fsRead??[]],database:{databaseUrl:n},viteInvoke:e.viteInvoke})}export{b as LOCAL_DATABASE_FILE_SUFFIXES,E as createDevSubprocessHost,S as createRuntimeSubprocessHost,y as createSubprocessHost};
@@ -1 +1 @@
1
- import{BUILTIN_TEMPLATE_IDS as e}from"../shared/constants/template-ids.js";import{createContentLayerContext as t}from"../content-layer/context.js";import"../content-layer/server/context.js";import{assembleTemplateSet as n}from"../content-layer/templates/template-set.js";import{createContentPlugins as r}from"../content-layer/plugins/create-content-plugins.js";function i(i,a){if(a?.state)return[...n({registry:a.pluginRegistry,routes:a.state.routeBySlug.values()}).ids()];let o=t({contentDir:i,plugins:r(i)});return[...e,...o.pluginRegistry.listTemplates().map(e=>e.templateId)]}export{i as listRuntimeTemplateIds};
1
+ import{BUILTIN_TEMPLATE_IDS as e}from"../shared/constants/template-ids.js";import{assembleTemplateSet as t}from"../content-layer/templates/template-set.js";import{createContentLayerContext as n}from"../content-layer/context.js";import{createContentPlugins as r}from"../content-layer/plugins/create-content-plugins.js";import"../content-layer/server/context.js";function i(i,a){if(a?.state)return[...t({registry:a.pluginRegistry,routes:a.state.routeBySlug.values()}).ids()];let o=n({contentDir:i,plugins:r(i)});return[...e,...o.pluginRegistry.listTemplates().map(e=>e.templateId)]}export{i as listRuntimeTemplateIds};
@@ -1 +1 @@
1
- import{CONTENT_ASSETS_URL_PREFIX as e}from"./content-assets.js";import{FEEDBACK_ROUTE_PATH as t}from"./feedback.js";import{SEARCH_FACETS_ROUTE_PATH as n,SEARCH_ROUTE_PATH as r}from"./search.js";import{AI_ASSISTANT_ESCALATIONS_ROUTE_PATH as i,AI_ASSISTANT_FEEDBACK_ROUTE_PATH as a,ASK_AI_ROUTE_PATH as o,SEMANTIC_SEARCH_ROUTE_PATH as s}from"./ask-ai.js";import{OTEL_TRACES_ROUTE_PATH as c}from"./telemetry.js";import{CORS_PROXY_ROUTE_PATH as l}from"./cors-proxy.js";import{REPLAY_OAUTH2_ROUTE_PATH as u}from"./replay.js";import{BUILD_ASSETS_URL_PREFIX as d}from"./runtime-layout.js";import{IDP_LOGIN_ROUTE_PATH as f,REVIEW_ROUTE_PATH as p}from"./review.js";const m=`/_realm`,h=`/page-data`,g=`/entity-data`,_=`/server-fn`,v=Object.freeze([m,`/_auth`,d,`/blob-data`,e,l,h,g,_]),y={Health:`/_health`,Favicon:`/favicon.ico`,Info:`/_info`,LlmsTxt:`/llms.txt`,LlmsFullTxt:`/llms-full.txt`,Search:r,SearchFacets:n,AskAi:o,AiAssistantEscalations:i,AiAssistantFeedback:a,SemanticSearch:s,Feedback:t,OtelTraces:c,CorsProxy:l,Review:p,Login:`/login`,Logout:`/logout`,PostLogout:`/post-logout`,AuthIdpLogin:f,AuthOidcCallback:`/_auth/oidc`,AuthRedoclyTokenLogin:`/_auth/redocly-token-login`,AuthDevAuthorize:`/_auth/authorize`,ReplayOAuth2Callback:u},b=Object.freeze(Object.values(y));export{d as BUILD_ASSETS_URL_PREFIX,v as ENGINE_ROUTE_PREFIXES,m as RESERVED_NAMESPACE_PREFIX,g as RUNTIME_ENTITY_DATA_PATH_PREFIX,h as RUNTIME_PAGE_PATH_PREFIX,_ as RUNTIME_SERVER_FN_PATH_PREFIX,b as SYSTEM_ROUTES,y as SystemRoute};
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{IDP_LOGIN_ROUTE_PATH as f,REVIEW_ROUTE_PATH as p}from"./review.js";const m=`/_realm`,h=`/page-data`,g=`/entity-data`,_=`/server-fn`,v=Object.freeze([m,`/_auth`,t,`/blob-data`,e,s,h,g,_]),y={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:p,Login:`/login`,Logout:`/logout`,PostLogout:`/post-logout`,AuthIdpLogin:f,AuthOidcCallback:`/_auth/oidc`,AuthRedoclyTokenLogin:`/_auth/redocly-token-login`,AuthDevAuthorize:`/_auth/authorize`,ReplayOAuth2Callback:c},b=Object.freeze(Object.values(y));export{t as BUILD_ASSETS_URL_PREFIX,v as ENGINE_ROUTE_PREFIXES,m as RESERVED_NAMESPACE_PREFIX,g as RUNTIME_ENTITY_DATA_PATH_PREFIX,h as RUNTIME_PAGE_PATH_PREFIX,_ as RUNTIME_SERVER_FN_PATH_PREFIX,b as SYSTEM_ROUTES,y as SystemRoute};
Binary file
@@ -1 +1 @@
1
- import{L10N_DIR as e}from"../constants/l10n/defaults.js";import{isObject as t}from"../utils/is-object.js";import{slugifySegment as n}from"../utils/routes/slugify-segment.js";import{resolveLocaleContext as r}from"../utils/l10n.js";import{stripLeadingSlash as i}from"../utils/strip-leading-slash.js";import{RBAC_L10N_RULES_KEY as a}from"./types.js";import{escapeGlobLiteral as o}from"./engine.js";function s(t,r){let a=r.locales;if(!r.enabled)return{content:t,l10nRules:{}};let s=a.map(e=>n(e)),c=a.map(t=>`${e}/${o(t)}`),l={...t},u={},d=new Set(Object.keys(t).map(i)),f=(e,t,n)=>{d.has(e)||(d.add(e),l[e]=t,u[e]={canonical:n,generated:!0})};for(let[e,n]of Object.entries(t)){let t=i(e),r=s.findIndex(e=>t.startsWith(`${e}/`));if(r===-1)continue;let a=t.slice(s[r].length+1);u[t]={canonical:a,generated:!1},f(`${c[r]}/${a}`,n,a)}for(let[e,n]of Object.entries(t)){let t=i(e);if(!t.startsWith(`@l10n/`)&&!s.some(e=>t===e||t.startsWith(`${e}/`)))for(let e=0;e<a.length;e+=1)f(`${c[e]}/${t}`,n,t),f(`${s[e]}/${t}`,n,t)}return{content:l,l10nRules:u}}function c(e,n){let r=a in e,i=e.content,o=t(i)?s(i,n):{content:i,l10nRules:{}},c=Object.keys(o.l10nRules).length>0;if(!c&&!r)return e;let{[a]:l,...u}=e;return c?{...u,content:o.content,[a]:o.l10nRules}:u}function l(e,n){let i=r(e.l10n,n),a=e.access;if(!t(a))return e;let o=a.rbac;if(!t(o))return e;let s=c(o,i);return s===o?e:{...e,access:{...a,rbac:s}}}export{l as expandConfigRbacForL10n,c as expandRbacForL10n};
1
+ import{isObject as e}from"../utils/is-object.js";import{L10N_DIR as t}from"../constants/l10n/defaults.js";import{stripLeadingSlash as n}from"../utils/strip-leading-slash.js";import{RBAC_L10N_RULES_KEY as r}from"./types.js";import{escapeGlobLiteral as i}from"./engine.js";import{slugifySegment as a}from"../utils/routes/slugify-segment.js";import{resolveLocaleContext as o}from"../utils/l10n.js";function s(e,r){let o=r.locales;if(!r.enabled)return{content:e,l10nRules:{}};let s=o.map(e=>a(e)),c=o.map(e=>`${t}/${i(e)}`),l={...e},u={},d=new Set(Object.keys(e).map(n)),f=(e,t,n)=>{d.has(e)||(d.add(e),l[e]=t,u[e]={canonical:n,generated:!0})};for(let[t,r]of Object.entries(e)){let e=n(t),i=s.findIndex(t=>e.startsWith(`${t}/`));if(i===-1)continue;let a=e.slice(s[i].length+1);u[e]={canonical:a,generated:!1},f(`${c[i]}/${a}`,r,a)}for(let[t,r]of Object.entries(e)){let e=n(t);if(!e.startsWith(`@l10n/`)&&!s.some(t=>e===t||e.startsWith(`${t}/`)))for(let t=0;t<o.length;t+=1)f(`${c[t]}/${e}`,r,e),f(`${s[t]}/${e}`,r,e)}return{content:l,l10nRules:u}}function c(t,n){let i=r in t,a=t.content,o=e(a)?s(a,n):{content:a,l10nRules:{}},c=Object.keys(o.l10nRules).length>0;if(!c&&!i)return t;let{[r]:l,...u}=t;return c?{...u,content:o.content,[r]:o.l10nRules}:u}function l(t,n){let r=o(t.l10n,n),i=t.access;if(!e(i))return t;let a=i.rbac;if(!e(a))return t;let s=c(a,r);return s===a?t:{...t,access:{...i,rbac:s}}}export{l as expandConfigRbacForL10n,c as expandRbacForL10n};
@@ -1 +1 @@
1
- import{computePathPrefixes as e}from"../utils/routes/compute-path-prefixes.js";import{normalizeRoutePath as t}from"../utils/routes/normalize-route-path.js";import{isRbacScope as n,matchContentScope as r}from"./engine.js";function i(n,r){let i=t(r),a=n.bySlug.get(i);if(a)return a;let o=e(i),s;for(let e of n.wildcards)o.includes(e.slug)&&(s===void 0||e.slug.length>s.slug.length)&&(s=e);return s}function a(e,t,i){return t.hasRbacKey?n(t.rbacValue)?t.rbacValue:(i(`rbac: route "${t.slug}" has an invalid frontmatter "rbac" value — denying access`),{}):r(e,{filePath:t.sourcePath,slug:t.slug})}export{i as findRouteEntry,a as resolveRouteScope};
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 +1 @@
1
- import{compareStrings as e}from"../utils/compare-strings.js";import{isObject as t}from"../utils/is-object.js";import{listSubdirectories as n}from"../utils/list-subdirectories.js";import{stripLeadingSlash as r}from"../utils/strip-leading-slash.js";import{escapeGlobLiteral as i,hasGlobMetachar as a}from"./engine.js";const o=`{folder}`,s=[`teamNamePatterns`,`teamFolders`,`teamFoldersBaseRoles`];function c(n,r,i){let a=Object.keys(t(n.content)?n.content:{}).map(e=>f(e)).filter(e=>e.kind===`team`),o=s.some(e=>e in n);if(a.length===0&&!o&&!h(n))return n;let c=[...new Set(a.flatMap(e=>r[e.prefix]??[]))].sort(e),l={};for(let[e,a]of Object.entries(n))s.includes(e)?i({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`&&t(a)?p(a,r,c,i):e===`features`&&t(a)?Object.fromEntries(Object.entries(a).map(([e,t])=>[e,m(t,c,`access.rbac.features.${e}`,i)])):e===`platform`?m(a,c,`access.rbac.platform`,i):a;return l}function l(e){if(!t(e.content))return[];let n=Object.keys(e.content).map(e=>f(e)).flatMap(e=>e.kind===`team`?[e.prefix]:[]);return[...new Set(n)]}async function u(e,t,r){let i={};for(let a of r)i[a]=(await n(a===``?e:`${e}/${a}`,t)).filter(e=>!e.startsWith(`.`)&&!e.startsWith(`@`));return i}function d(e,n,r){let i=e.access;if(!t(i))return e;let a=i.rbac;if(!t(a))return e;let o=c(a,n,r);return o===a?e:{...e,access:{...i,rbac:o}}}function f(e){let t=r(e).split(`/`),n=t.flatMap((e,t)=>e.includes(o)?[t]:[]);if(n.length===0)return{kind:`plain`};if(n.length>1)return{kind:`invalid`,reason:`only one path segment can be {folder}`};let[i]=n;if(t[i]!==o)return{kind:`invalid`,reason:`{folder} must be a whole path segment`};let s=t.slice(0,i);return s.some(e=>e===``||e.startsWith(`.`)||a(e))?{kind:`invalid`,reason:`the path before {folder} must be a plain directory path`}:{kind:`team`,prefix:s.join(`/`)}}function p(e,t,n,a){let s=new Set(Object.keys(e).filter(e=>f(e).kind===`plain`).map(r)),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,n,d,a);continue}let p=t[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 t=l.replace(o,()=>i(e));s.has(r(t))||(c[t]=m(u,[e],d,a))}}return c}function m(e,n,r,i){if(!t(e))return e;let a={};for(let[t,s]of Object.entries(e))if(!t.includes(o))a[t]=s;else if(n.length===0)i({code:`configuration/invalid`,message:`${r}["${t}"] is ignored: {folder} has no values: no access.rbac.content key with a {folder} segment matched a directory.`});else for(let e of n)a[t.replaceAll(o,()=>e)]=s;return a}function h(e){return t(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
+ import{compareStrings as e}from"../utils/compare-strings.js";import{isObject as t}from"../utils/is-object.js";import{stripLeadingSlash as n}from"../utils/strip-leading-slash.js";import{escapeGlobLiteral as r,hasGlobMetachar as i}from"./engine.js";import{listSubdirectories as a}from"../utils/list-subdirectories.js";const o=`{folder}`,s=[`teamNamePatterns`,`teamFolders`,`teamFoldersBaseRoles`];function c(n,r,i){let a=Object.keys(t(n.content)?n.content:{}).map(e=>f(e)).filter(e=>e.kind===`team`),o=s.some(e=>e in n);if(a.length===0&&!o&&!h(n))return n;let c=[...new Set(a.flatMap(e=>r[e.prefix]??[]))].sort(e),l={};for(let[e,a]of Object.entries(n))s.includes(e)?i({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`&&t(a)?p(a,r,c,i):e===`features`&&t(a)?Object.fromEntries(Object.entries(a).map(([e,t])=>[e,m(t,c,`access.rbac.features.${e}`,i)])):e===`platform`?m(a,c,`access.rbac.platform`,i):a;return l}function l(e){if(!t(e.content))return[];let n=Object.keys(e.content).map(e=>f(e)).flatMap(e=>e.kind===`team`?[e.prefix]:[]);return[...new Set(n)]}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,n,r){let i=e.access;if(!t(i))return e;let a=i.rbac;if(!t(a))return e;let o=c(a,n,r);return o===a?e:{...e,access:{...i,rbac:o}}}function f(e){let t=n(e).split(`/`),r=t.flatMap((e,t)=>e.includes(o)?[t]:[]);if(r.length===0)return{kind:`plain`};if(r.length>1)return{kind:`invalid`,reason:`only one path segment can be {folder}`};let[a]=r;if(t[a]!==o)return{kind:`invalid`,reason:`{folder} must be a whole path segment`};let s=t.slice(0,a);return s.some(e=>e===``||e.startsWith(`.`)||i(e))?{kind:`invalid`,reason:`the path before {folder} must be a plain directory path`}:{kind:`team`,prefix:s.join(`/`)}}function p(e,t,i,a){let s=new Set(Object.keys(e).filter(e=>f(e).kind===`plain`).map(n)),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=t[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 t=l.replace(o,()=>r(e));s.has(n(t))||(c[t]=m(u,[e],d,a))}}return c}function m(e,n,r,i){if(!t(e))return e;let a={};for(let[t,s]of Object.entries(e))if(!t.includes(o))a[t]=s;else if(n.length===0)i({code:`configuration/invalid`,message:`${r}["${t}"] is ignored: {folder} has no values: no access.rbac.content key with a {folder} segment matched a directory.`});else for(let e of n)a[t.replaceAll(o,()=>e)]=s;return a}function h(e){return t(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,4 +1,4 @@
1
- import type { ApiConfig, AsyncApiConfig, GraphQLConfig, ProductConfigOverride, RedoclyConfig } from '@redocly/config';
1
+ import type { ApiConfig, AsyncApiConfig, GraphQLConfig, GrpcConfig, ProductConfigOverride, RedoclyConfig } from '@redocly/config';
2
2
  import type { PlanGates } from '../plan-gates.js';
3
3
  import type { PublicEnv } from '../public-env.js';
4
4
  /** A `redirects` rule as the config loader normalizes it. */
@@ -60,5 +60,6 @@ export type NestedConfig = Omit<ProductConfigOverride, 'apis'> & {
60
60
  apis?: RealmConfig['apis'];
61
61
  asyncapi?: AsyncApiConfig;
62
62
  graphql?: GraphQLConfig;
63
+ grpc?: GrpcConfig;
63
64
  };
64
65
  export {};
@@ -1 +1 @@
1
- import{DEFAULT_LOCALE_PLACEHOLDER as e,L10N_DIR as t}from"../constants/l10n/defaults.js";import{compareStrings as n}from"./compare-strings.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(t){let n=r(t)?t:void 0,i=s(n?.defaultLocale)?n.defaultLocale:e;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=`${t}/`;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(e){let t=/* @__PURE__ */ new Set;for(let n of e){let e=d(n);e!==void 0&&t.add(e)}return[...t].sort(n)}async function g(e,n){return i(`${e}/${t}`,n)}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,n){return!this.enabled||n===this.defaultLocale?e:e===``?`${t}/${n}`:`${t}/${n}/${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(e,t){let{defaultLocale:r}=c(e);return new _(r,[...new Set(t)].filter(e=>e!==r).sort(n))}export{e as DEFAULT_LOCALE_PLACEHOLDER,t 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};
1
+ import{compareStrings as e}from"./compare-strings.js";import{isObject as t}from"./is-object.js";import{DEFAULT_LOCALE_PLACEHOLDER as n,L10N_DIR as r}from"../constants/l10n/defaults.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 r=t(e)?e:void 0,i=s(r?.defaultLocale)?r.defaultLocale:n;if(!Array.isArray(r?.locales))return{defaultLocale:i,locales:void 0};let a=[];for(let e of r.locales)t(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=`${r}/`;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}/${r}`,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===``?`${r}/${t}`:`${r}/${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{n as DEFAULT_LOCALE_PLACEHOLDER,r 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};
@@ -1 +1 @@
1
- import{normalizeRouteSlug as e}from"./normalize-route-slug.js";import{slugifySegment as t}from"./slugify-segment.js";import{toPosixPath as n}from"../to-posix-path.js";import{extname as r,posix as i}from"node:path";function a(a,o){let s=i.normalize(n(a)),c=o||r(s),l=(c===``?s:s.slice(0,-c.length)).split(`/`).filter(Boolean);l.at(-1)===`index`&&l.pop();let u=l.map(e=>t(e));return e(u.join(`/`))}export{a as filePathToRouteSlug};
1
+ import{toPosixPath as e}from"../to-posix-path.js";import{normalizeRouteSlug as t}from"./normalize-route-slug.js";import{slugifySegment as n}from"./slugify-segment.js";import{extname as r,posix as i}from"node:path";function a(a,o){let s=i.normalize(e(a)),c=o||r(s),l=(c===``?s:s.slice(0,-c.length)).split(`/`).filter(Boolean);l.at(-1)===`index`&&l.pop();let u=l.map(e=>n(e));return t(u.join(`/`))}export{a as filePathToRouteSlug};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/framework",
3
- "version": "1.0.0-next.12",
3
+ "version": "1.0.0-next.14",
4
4
  "description": "A modern hybrid CMS and API documentation platform",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -27,15 +27,15 @@
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.11",
31
- "@redocly/config": "0.74.0",
30
+ "@redocly/api-docs": "0.6.0-next.13",
31
+ "@redocly/config": "0.75.0",
32
32
  "@redocly/markdoc": "0.7.1",
33
33
  "@redocly/mock-server": "0.15.0-next.4",
34
34
  "@redocly/openapi-core": "2.78.0",
35
35
  "@redocly/respect-core": "2.78.0",
36
36
  "@redocly/realm-asyncapi-sdk": "0.18.0-next.1",
37
37
  "@redocly/realm-db-client": "0.3.0",
38
- "@redocly/theme": "0.73.0-next.7",
38
+ "@redocly/theme": "0.73.0-next.9",
39
39
  "@tanstack/highlight": "0.0.10",
40
40
  "@vitejs/plugin-react": "6.2.1",
41
41
  "chokidar": "npm:@redocly/chokidar@3.6.0",
@@ -183,7 +183,6 @@
183
183
  "e2e:install": "playwright install chromium",
184
184
  "db:studio": "drizzle-kit studio",
185
185
  "dev:playground": "node --watch-path=dist dist/cli/bin.js preview --project-dir playground",
186
- "browser-shell": "pnpm run build && DEV_SHELL=1 REALM_VITE_CACHE_DIR=src/browser-engine/node_modules/.vite-shell node scripts/engine-vite.mjs --config src/browser-engine/shell/vite.config.ts",
187
186
  "browser-engine": "pnpm run build && REALM_VITE_CACHE_DIR=src/browser-engine/node_modules/.vite-engine node scripts/engine-vite.mjs --config src/browser-engine/shell/vite.config.ts",
188
187
  "browser-engine:build": "pnpm run browser-engine:build:shell && REALM_VITE_CACHE_DIR=src/browser-engine/node_modules/.vite-standalone node src/browser-engine/shell/build-fs-pack.mts --standalone && playwright install --only-shell chromium && node src/browser-engine/shell/record-precompiled-ssr.mts",
189
188
  "browser-engine:build:shell": "pnpm run build && rm -rf dist-engine && REALM_VITE_CACHE_DIR=src/browser-engine/node_modules/.vite-standalone node scripts/engine-vite.mjs optimize --force --config src/browser-engine/shell/vite.config.ts && node src/browser-engine/shell/engine-deps.mts && REALM_STANDALONE=1 REALM_VITE_CACHE_DIR=src/browser-engine/node_modules/.vite-standalone node scripts/engine-vite.mjs build --config src/browser-engine/shell/vite.config.ts",