@redocly/redoc-revel 0.141.0-next.2 → 0.141.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +357 -0
- package/dist/cli/develop.js +1 -1
- package/dist/cli/utils/react-pages-check.d.ts +11 -0
- package/dist/cli/utils/react-pages-check.js +1 -0
- package/dist/client/App.js +1 -1
- package/dist/client/app/Sidebar/useSidebarItems.js +1 -1
- package/dist/client/app/hooks/products/useProducts.d.ts +2 -0
- package/dist/client/app/hooks/useBanner.js +1 -1
- package/dist/client/app/hooks/useUserClaims.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.d.ts +2 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-example.d.ts +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-example.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-response-sample.d.ts +2 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-response-sample.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.d.ts +2 -1
- package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.js +1 -1
- package/dist/client/app/markdoc/hooks/use-store.d.ts +12 -0
- package/dist/client/app/markdoc/hooks/use-store.js +1 -1
- package/dist/client/app/webmcp/tools/shared.d.ts +2 -3
- package/dist/client/app/webmcp/tools/shared.js +1 -1
- package/dist/client/providers/post-message/PostMessageConnection.d.ts +2 -2
- package/dist/client/providers/post-message/PostMessageProvider.d.ts +2 -2
- package/dist/client/providers/post-message/use-post-message.d.ts +1 -1
- package/dist/client/runtime/errors/page-async-component-error.d.ts +4 -0
- package/dist/client/runtime/errors/page-async-component-error.js +1 -0
- package/dist/client/runtime/loader.js +1 -1
- package/dist/client/types/index.d.ts +0 -1
- package/dist/compiled/@redocly/platform-utils/pii/index.mjs +1 -0
- package/dist/compiled/@redocly/platform-utils/pii/package.json +1 -0
- package/dist/constants/l10n/langs/ar.js +1 -1
- package/dist/constants/l10n/langs/de.js +1 -1
- package/dist/constants/l10n/langs/en.js +1 -1
- package/dist/constants/l10n/langs/es.js +1 -1
- package/dist/constants/l10n/langs/fr.js +1 -1
- package/dist/constants/l10n/langs/hi.js +1 -1
- package/dist/constants/l10n/langs/it.js +1 -1
- package/dist/constants/l10n/langs/ja.js +1 -1
- package/dist/constants/l10n/langs/ko.js +1 -1
- package/dist/constants/l10n/langs/pl.js +1 -1
- package/dist/constants/l10n/langs/pt-BR.js +1 -1
- package/dist/constants/l10n/langs/pt.js +1 -1
- package/dist/constants/l10n/langs/ru.js +1 -1
- package/dist/constants/l10n/langs/uk.js +1 -1
- package/dist/constants/l10n/langs/zh.js +1 -1
- package/dist/markdoc/helpers/get-resolved-sample-code-block.js +4 -4
- package/dist/markdoc/nodes/fence/index.js +1 -1
- package/dist/markdoc/nodes/table.js +1 -1
- package/dist/markdoc/tags/index.d.ts +6 -18
- package/dist/markdoc/tags/openapi-code-sample.js +1 -1
- package/dist/markdoc/tags/openapi-response-sample.js +1 -1
- package/dist/markdoc/tags/replay-openapi.js +1 -1
- package/dist/server/api-routes/run-api-routes-worker.js +1 -1
- package/dist/server/config/env-config.d.ts +0 -2
- package/dist/server/config/env-schema.d.ts +0 -1
- package/dist/server/config/env-schemas/feature-flags.d.ts +0 -1
- package/dist/server/config/env-schemas/feature-flags.js +1 -1
- package/dist/server/constants/assets.d.ts +3 -0
- package/dist/server/constants/assets.js +1 -0
- package/dist/server/constants/common.d.ts +0 -3
- package/dist/server/constants/common.js +1 -1
- package/dist/server/constants/config-schema.d.ts +12 -0
- package/dist/server/constants/config-schema.js +1 -0
- package/dist/server/constants/plugins/search.d.ts +0 -1
- package/dist/server/constants/plugins/search.js +1 -1
- package/dist/server/constants/project-plugins.d.ts +2 -0
- package/dist/server/constants/project-plugins.js +1 -0
- package/dist/server/constants/versions.d.ts +3 -0
- package/dist/server/constants/versions.js +1 -0
- package/dist/server/esbuild/esbuild.js +2 -2
- package/dist/server/esbuild/plugins/assets-resolver.js +1 -1
- package/dist/server/esbuild/plugins/dependency-resolver.js +1 -1
- package/dist/server/external-plugins/resolve-external-plugins.js +1 -1
- package/dist/server/fs/fs.js +1 -1
- package/dist/server/plugins/api-docs/index.js +1 -1
- package/dist/server/plugins/api-docs/options.js +1 -1
- package/dist/server/plugins/api-docs/search/create-indexer.d.ts +1 -4
- package/dist/server/plugins/api-docs/search/create-indexer.js +1 -1
- package/dist/server/plugins/api-docs/search/get-ai-search-documents.js +22 -22
- package/dist/server/plugins/api-docs/search/search-resolver.js +1 -1
- package/dist/server/plugins/api-docs/spec-download.api.js +1 -1
- package/dist/server/plugins/api-docs/utils/is-api-doc.js +1 -1
- package/dist/server/plugins/api-docs/utils/relative-path-to-base-slug.js +1 -1
- package/dist/server/plugins/config-parser/loaders/content-slugs-loader.d.ts +1 -10
- package/dist/server/plugins/config-parser/loaders/content-slugs-loader.js +1 -1
- package/dist/server/plugins/config-parser/loaders/index.d.ts +1 -1
- package/dist/server/plugins/config-parser/loaders/redocly-config-loader.js +1 -1
- package/dist/server/plugins/config-parser/loaders/utils/calculate-content-slugs.d.ts +32 -0
- package/dist/server/plugins/config-parser/loaders/utils/calculate-content-slugs.js +1 -0
- package/dist/server/plugins/config-parser/loaders/versions-config-loader.d.ts +0 -2
- package/dist/server/plugins/config-parser/loaders/versions-config-loader.js +1 -1
- package/dist/server/plugins/create-slugify.d.ts +1 -1
- package/dist/server/plugins/create-slugify.js +1 -1
- package/dist/server/plugins/default-theme/resolve-products-config.d.ts +1 -0
- package/dist/server/plugins/default-theme/resolve-products-config.js +1 -1
- package/dist/server/plugins/get-reserved-routes.js +1 -1
- package/dist/server/plugins/lifecycle.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/helpers/load-openapi-bundle.d.ts +1 -0
- package/dist/server/plugins/markdown/attribute-resolvers/helpers/load-openapi-bundle.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/index.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-code-samples.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-operation.d.ts +10 -0
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-operation.js +1 -0
- package/dist/server/plugins/markdown/compiler.js +1 -1
- package/dist/server/plugins/markdown/markdoc/markdoc-options.d.ts +1 -1
- package/dist/server/plugins/markdown/markdoc/markdoc-options.js +1 -1
- package/dist/server/plugins/markdown/runtime-transform.js +1 -1
- package/dist/server/plugins/markdown/utils/resolve-markdown-template.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/execute-schema.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/manage-credentials.js +2 -2
- package/dist/server/plugins/mcp/constants.d.ts +2 -2
- package/dist/server/plugins/mcp/constants.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/core/create-anonymous-session.d.ts +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/core/search.js +2 -2
- package/dist/server/plugins/mcp/docs-mcp/tools/index.d.ts +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.d.ts +2 -2
- package/dist/server/plugins/mcp/gateway-mcp/subject.d.ts +2 -2
- package/dist/server/plugins/mcp/gateway-mcp/subject.js +1 -1
- package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
- package/dist/server/plugins/mcp/utils/route-reservation.d.ts +9 -0
- package/dist/server/plugins/mcp/utils/route-reservation.js +1 -0
- package/dist/server/plugins/nav-utils.js +1 -1
- package/dist/server/plugins/pages/validators/validate-react-pages.d.ts +8 -1
- package/dist/server/plugins/pages/validators/validate-react-pages.js +1 -1
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +1 -1
- package/dist/server/plugins/search/engines/flexsearch/search-index.js +1 -1
- package/dist/server/plugins/search/engines/typesense/index.js +1 -1
- package/dist/server/plugins/search/llmstxt/create-llms-txt-generator.js +1 -1
- package/dist/server/plugins/search/llmstxt/index.js +4 -4
- package/dist/server/plugins/utils.d.ts +0 -4
- package/dist/server/plugins/utils.js +1 -1
- package/dist/server/ssr/index.js +1 -1
- package/dist/server/ssr/server-side-props/get-default-static-props.d.ts +1 -0
- package/dist/server/ssr/utils.js +11 -9
- package/dist/server/store.d.ts +2 -1
- package/dist/server/store.js +1 -1
- package/dist/server/tools/notifiers/formatter.js +1 -1
- package/dist/server/types/plugins/common.d.ts +2 -0
- package/dist/server/types/web-server.d.ts +5 -0
- package/dist/server/utils/content/parse-base-name.d.ts +15 -0
- package/dist/server/utils/content/parse-base-name.js +1 -0
- package/dist/server/utils/crypto/sha-dir-path-short.js +1 -1
- package/dist/server/utils/errors.d.ts +2 -1
- package/dist/server/utils/errors.js +1 -1
- package/dist/server/utils/llmstxt/resolve-llms-txt-md.d.ts +5 -0
- package/dist/server/utils/llmstxt/resolve-llms-txt-md.js +1 -1
- package/dist/server/utils/product.d.ts +1 -0
- package/dist/server/utils/rbac/can-access-feature.d.ts +5 -0
- package/dist/server/utils/rbac/can-access-feature.js +1 -0
- package/dist/server/utils/rbac/can-anonymous-access-mcp-feature.js +1 -1
- package/dist/server/utils/rbac/has-scope-access.d.ts +3 -0
- package/dist/server/utils/rbac/has-scope-access.js +1 -0
- package/dist/server/utils/rbac.d.ts +19 -11
- package/dist/server/utils/rbac.js +1 -1
- package/dist/server/web-server/auth.js +3 -3
- package/dist/server/web-server/routes/ask-ai.js +1 -1
- package/dist/server/web-server/routes/dynamic-route.js +1 -1
- package/dist/server/web-server/routes/error.js +1 -1
- package/dist/server/web-server/routes/index.js +1 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-client-metadata.js +1 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-oauth.d.ts +0 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
- package/dist/server/web-server/routes/page-data.d.ts +2 -1
- package/dist/server/web-server/routes/page-data.js +1 -1
- package/dist/server/web-server/routes/semantic-search.js +1 -1
- package/dist/server/web-server/utils.d.ts +1 -1
- package/dist/server/web-server/utils.js +1 -1
- package/dist/server/workers/worker-config.js +1 -1
- package/dist/utils/l10n/build-i18n-config.js +1 -1
- package/package.json +13 -11
- package/dist/client/app/ReviewComments/ReviewComments.d.ts +0 -4
- package/dist/client/app/ReviewComments/ReviewComments.js +0 -7
- package/dist/client/types/post-message.d.ts +0 -68
- package/dist/client/types/post-message.js +0 -0
- package/dist/compiled/@redocly/pii/index.mjs +0 -1
- package/dist/compiled/@redocly/pii/package.json +0 -1
- package/dist/server/utils/llmstxt/get-llms-txt-md-path-by-slug.d.ts +0 -19
- package/dist/server/utils/llmstxt/get-llms-txt-md-path-by-slug.js +0 -1
- package/dist/server/utils/search/highlight-text-for-search.d.ts +0 -3
- package/dist/server/utils/search/highlight-text-for-search.js +0 -1
- package/dist/server/utils/search/text-match.d.ts +0 -6
- package/dist/server/utils/search/text-match.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as m,readFileSync as F}from"node:fs";import{createRequire as k}from"node:module";import s from"node:path";import{resolvePlugins as A}from"@redocly/openapi-core";import{
|
|
1
|
+
import{existsSync as m,readFileSync as F}from"node:fs";import{createRequire as k}from"node:module";import s from"node:path";import{resolvePlugins as A}from"@redocly/openapi-core";import{DEFAULT_THEME_PLUGIN_PATH as c,STYLES_FILE as S}from"../constants/common.js";import{DEFAULT_PROJECT_PLUGIN_PATHS as d}from"../constants/project-plugins.js";import{GATED_PLUGINS as v}from"../constants/entitlements.js";import{DEFAULT_THEME_NAME as h}from"../../constants/common.js";import{isDefined as _}from"../../utils/guards/is-defined.js";import{isPlainObject as g}from"../../utils/guards/is-plain-object.js";import{logger as C}from"../tools/notifiers/logger.js";import{reporter as L}from"../tools/notifiers/reporter.js";import{sha as w}from"../utils/crypto/sha.js";import{resolveModule as P}from"./resolve-module.js";import{EntitlementsProvider as I}from"../entitlements/entitlements-provider.js";const f={sha:"",value:Promise.resolve({resolvedPlugins:[],errors:[]})};async function re(e,r=[]){const n=w(JSON.stringify(r));if(f.sha!==n){f.sha=n;const o=M(e),a=N(e,r,o),p=await A(a,e)||[];if(!a.some(i=>d.includes(i))){const i=d[0],l=s.join(e,i);p.push({id:"",absolutePath:l,path:i})}f.value=Promise.all(p.map(i=>b(i,i.path===o?c:i.path))).then(i=>{const l=i.filter(_),j=l.filter(u=>u?.type&&["error","warning"].includes(u.type)),D=l.filter(u=>u.type==="resolvedPlugin");return{errors:j,resolvedPlugins:D}})}const t=await f.value;if(t.errors.length)for(let o=0;o<t.errors.length;o++)await L.panicOnBuildContentError(t.errors[o].error);return t.resolvedPlugins}function M(e){const r=s.resolve(e,"package.json");if(!y(s.dirname(r)))return P(c)??c;const n=E(o=>k(r).resolve(o)),t=E(P);return n&&t&&n!==t&&C.warn("The project declares %s %s, and Realm uses it instead of the %s it was built with.",h,n,t),c}function y(e){const r=T(s.join(e,"package.json")),n=[r?.dependencies,r?.devDependencies].some(o=>g(o)&&h in o),t=s.dirname(e);return n||t!==e&&y(t)}function E(e){try{const r=e(`${h}/package.json`),n=r&&T(r)?.version;return typeof n=="string"?n:void 0}catch{return}}function T(e){try{const r=JSON.parse(F(e,"utf8"));return g(r)?r:void 0}catch{return}}function N(e,r=[],n){const t=[...r];for(const o of d)!t.includes(o)&&m(s.join(e,o))&&t.push(o);return t.includes(c)||t.unshift(n),t}async function b(e,r){if(!e.absolutePath||!r)return{type:"error",error:`Plugin with path "${e}" not found`};const n=s.dirname(e.absolutePath),{lifecyclePlugin:t,config:o}=R(e,r);return{name:s.dirname(r),type:"resolvedPlugin",isNpmPackage:O(r),pluginDirAbsolutePath:n,lifecyclePlugin:t,config:o,stylesFile:s.resolve(n,S),markdoc:U(n)}}function O(e){const r=s.dirname(e);return P(s.join(r,"package.json"))!=null}function R(e,r){const n=I.instance(),t=!n.canAccessFeature("customPlugins")&&!v.includes(r),o=e.requiredEntitlements&&v.includes(r)&&!e.requiredEntitlements.every(a=>n.canAccessFeature(a));return t||o?{lifecyclePlugin:{id:e.id},config:{}}:{lifecyclePlugin:{id:e.id,processContent:e.processContent,afterRoutesCreated:e.afterRoutesCreated,loaders:e.loaders,requiredEntitlements:e.requiredEntitlements},config:{schema:e.redoclyConfigSchema,ejectIgnore:e.ejectIgnore}}}function U(e){const r=s.resolve(e,"markdoc"),n=s.join(r,"schema.ts");if(!m(n))return null;const t=s.join(r,"components.tsx");return{schemaFile:n,componentsFile:m(t)?t:void 0}}export{re as resolveExternalPlugins};
|
package/dist/server/fs/fs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as f from"chokidar";import h from"path";import*as p from"node:fs/promises";import{createHash as l}from"node:crypto";import{slash as o}from"../../utils/path/slash.js";import{logger as c}from"../tools/notifiers/logger.js";import{sha1 as m}from"../utils/crypto/sha1.js";import{USER_THEME_ALIAS as u,USER_SKILLS_ALIAS as g,USER_SKILL_FILENAME as w}from"../../constants/common.js";import{debouncedEmit as L}from"./utils/debounced-emit.js";import{trackAccessStore as r}from"./utils/async-storage.js";import{removeBom as S}from"./utils/string-utils.js";const E=`${g}(/.*)?`,y=w.replace(".","\\."),v=new RegExp(`^(${E}|${y})$`);class j{cwd;ignored;filesList=new Map;watcher;#t=new Map;#e=[];constructor(t,e=[]){this.cwd=t,this.ignored=e,this.watcher=this.#i()}get ready(){return this.watcher.then(()=>!0)}getFileInfo(t){return this.filesList.get(t)}watch(t){this.#e.push(t)}async dispose(){(await this.watcher).close()}exists(t){const e=this.filesList.has(t);return r.getStore()?.push({type:"exists",path:t,hash:e?"t":"f"}),e}async read(t,e="utf-8"){try{let s=await p.readFile(h.join(this.cwd,t),e);s=S(s);const i=m(s);r.getStore()?.push({type:"read",path:t,hash:i});const a=this.filesList.get(t);return a&&(a.hash=i),s}catch(s){throw r.getStore()?.push({type:"read",path:t,hash:"error"}),s}}scan(t){const e=[],s=l("sha1");this.filesList.forEach(a=>{(!t||t.test(a.relativePath))&&(e.push(a),s.update(a.relativePath))});const i=s.digest("base64");return this.#t.set(t,i),r.getStore()?.push({type:"scan",hash:i,pattern:t}),e}emitCodeUpdated(){this.emit({event:"code-updated"})}addVirtualFile(t,e){this.filesList.set(t,{relativePath:t,realRelativePath:e.realRelativePath,hash:e.hash,isVirtual:!0}),r.getStore()?.push({type:"read",path:t,hash:e.hash??""})}getPatternScanHash(t){return this.#t.get(t)}#s(t){return v.test(t)}emit=L(async t=>{for(const e of t)if(!("path"in e&&this.#s(e.path)))switch(e.event){case"add":this.filesList.set(e.path,{relativePath:e.path,realRelativePath:e.path,hash:void 0,isVirtual:!1});for(const s of this.#t.keys())s&&s.test(e.path)&&this.#t.set(s,void 0),s||this.#t.set(s,void 0);break;case"change":{const s=this.filesList.get(e.path);s&&(s.hash=void 0);break}case"unlink":this.filesList.delete(e.path);for(const s of this.#t.keys())s&&s.test(e.path)&&this.#t.delete(s),s||this.#t.delete(s);break}for(const e of this.#e)await e(t)});async#i(){return c.startTiming("init-fs"),new Promise((t,e)=>{const s=f.watch(this.cwd,{usePolling:!1,ignoreInitial:!0,ignored:[new RegExp(`(/.git/|/node_modules/|${u})`),h.join(this.cwd,"public"),h.join(this.cwd,"README.md"),...this.ignored]});s.on("ready",()=>{this.filesList=this.#a(s.getWatched()),t(s),c.infoTime("init-fs","File system scan completed")}).on("error",e).on("add",(i,a)=>{this.emit({event:"add",path:o(h.relative(this.cwd,i)),stats:a})}).on("change",(i,a)=>{this.emit({event:"change",path:o(h.relative(this.cwd,i)),stats:a})}).on("unlink",i=>{this.emit({event:"unlink",path:o(h.relative(this.cwd,i))})})})}#a(t){const e=new Map;for(const s of Object.keys(t))for(const i of t[s]){const a=h.join(s,i);if(t[a])continue;const d=o(h.dirname(h.relative(this.cwd,a))),n=h.posix.join(d,i);this.#s(n)||e.set(n,{relativePath:n,realRelativePath:n,isVirtual:!1,hash:void 0})}return e}}export{j as Fs};
|
|
1
|
+
import*as f from"chokidar";import h from"path";import*as p from"node:fs/promises";import{createHash as l}from"node:crypto";import{slash as o}from"../../utils/path/slash.js";import{logger as c}from"../tools/notifiers/logger.js";import{sha1 as m}from"../utils/crypto/sha1.js";import{USER_THEME_ALIAS as u,USER_SKILLS_ALIAS as g,USER_SKILL_FILENAME as w}from"../../constants/common.js";import{debouncedEmit as L}from"./utils/debounced-emit.js";import{trackAccessStore as r}from"./utils/async-storage.js";import{removeBom as S}from"./utils/string-utils.js";const E=`${g}(/.*)?`,y=w.replace(".","\\."),v=new RegExp(`^(${E}|${y})$`);class j{cwd;ignored;filesList=new Map;watcher;#t=new Map;#e=[];constructor(t,e=[]){this.cwd=t,this.ignored=e,this.watcher=this.#i()}get ready(){return this.watcher.then(()=>!0)}getFileInfo(t){return this.filesList.get(t)}watch(t){this.#e.push(t)}async dispose(){(await this.watcher).close()}exists(t){const e=this.filesList.has(t);return r.getStore()?.push({type:"exists",path:t,hash:e?"t":"f"}),e}async read(t,e="utf-8"){try{let s=await p.readFile(h.join(this.cwd,t),e);s=S(s);const i=m(s);r.getStore()?.push({type:"read",path:t,hash:i});const a=this.filesList.get(t);return a&&(a.hash=i),s}catch(s){throw r.getStore()?.push({type:"read",path:t,hash:"error"}),s}}scan(t){const e=[],s=l("sha1");this.filesList.forEach(a=>{(!t||t.test(a.relativePath))&&(e.push(a),s.update(a.relativePath))});const i=s.digest("base64");return this.#t.set(t,i),r.getStore()?.push({type:"scan",hash:i,pattern:t}),e}emitCodeUpdated(){this.emit({event:"code-updated"})}addVirtualFile(t,e){this.filesList.set(t,{relativePath:t,realRelativePath:e.realRelativePath,hash:e.hash,isVirtual:!0}),r.getStore()?.push({type:"read",path:t,hash:e.hash??""})}getPatternScanHash(t){return this.#t.get(t)}#s(t){return v.test(t)}emit=L(async t=>{for(const e of t)if(!("path"in e&&this.#s(e.path)))switch(e.event){case"add":this.filesList.set(e.path,{relativePath:e.path,realRelativePath:e.path,hash:void 0,isVirtual:!1});for(const s of this.#t.keys())s&&s.test(e.path)&&this.#t.set(s,void 0),s||this.#t.set(s,void 0);break;case"change":{const s=this.filesList.get(e.path);s&&(s.hash=void 0);break}case"unlink":this.filesList.delete(e.path);for(const s of this.#t.keys())s&&s.test(e.path)&&this.#t.delete(s),s||this.#t.delete(s);break}for(const e of this.#e)await e(t)});async#i(){return c.startTiming("init-fs"),new Promise((t,e)=>{const s=f.watch(this.cwd,{usePolling:!1,ignoreInitial:!0,ignored:[new RegExp(`(/.git/|/node_modules/|${u}|/@sdk(/|$))`),h.join(this.cwd,"public"),h.join(this.cwd,"README.md"),...this.ignored]});s.on("ready",()=>{this.filesList=this.#a(s.getWatched()),t(s),c.infoTime("init-fs","File system scan completed")}).on("error",e).on("add",(i,a)=>{this.emit({event:"add",path:o(h.relative(this.cwd,i)),stats:a})}).on("change",(i,a)=>{this.emit({event:"change",path:o(h.relative(this.cwd,i)),stats:a})}).on("unlink",i=>{this.emit({event:"unlink",path:o(h.relative(this.cwd,i))})})})}#a(t){const e=new Map;for(const s of Object.keys(t))for(const i of t[s]){const a=h.join(s,i);if(t[a])continue;const d=o(h.dirname(h.relative(this.cwd,a))),n=h.posix.join(d,i);this.#s(n)||e.set(n,{relativePath:n,realRelativePath:n,isVirtual:!1,hash:void 0})}return e}}export{j as Fs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{REDOCLY_ROUTE_RBAC as
|
|
1
|
+
import{REDOCLY_ROUTE_RBAC as T,REDOCLY_TEAMS_RBAC as I}from"@redocly/config";import{mcpTagSchemas as ae,schemaDefinitionTag as ie,markdocParser as j,collectPreviousRouteSlugs as ne}from"@redocly/api-docs";import{withPathPrefix as N}from"@redocly/theme/core/utils";import{API_DOCS_TEMPLATE_ID as V,GRAPHQL_SPEC_SLUG as ce,PUBLIC_RBAC_SCOPE_ITEM as $}from"../../../constants/common.js";import{DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as pe,PUBLIC_API_DEFINITIONS_FOLDER as ue}from"../../constants/common.js";import{API_DOCS_SHARED_DATA_PREFIX as O}from"../../constants/plugins/api-docs.js";import{fromCurrentDir as le}from"../../utils/paths.js";import{normalizeRouteSlug as de}from"../../../utils/path/normalize-route-slug.js";import{removeTrailingSlash as me}from"../../../utils/url/remove-trailing-slash.js";import{isTranslationFallback as fe}from"../../fs/utils/is-translation-fallback.js";import{createSlugify as ge}from"../create-slugify.js";import{apiDocLoader as he,apiDocsLoader as Se}from"./loader.js";import{getTemplatePath as W}from"./get-template-path.js";import{storeDefinitionBundles as De}from"./store-definition-bundles.js";import{definitionAccessKey as Pe,describeDefinitionAccess as ye}from"./definition-access.js";import{telemetryTraceStep as Ae}from"../../../cli/telemetry/helpers/trace-step.js";import{searchResolver as ve}from"./search/search-resolver.js";import{getAiDocumentsStore as Ie}from"./search/get-ai-search-documents.js";import{getApiConfigByPath as Re}from"../get-api-config.js";import{getRouteSlugsForPath as be}from"../utils.js";import{collectItemRoutes as _e}from"./utils/collect-item-routes.js";import{isChunkCurrent as Ce}from"./utils/decorators.js";import{applyNavItemToRoot as Te}from"./utils/apply-nav-item-to-root.js";import{buildRoutesMapping as we}from"./utils/build-routes-mapping.js";import{buildItemPositions as Ee}from"./utils/build-item-positions.js";import{resolveApiDocTitle as ke}from"./utils/resolve-api-doc-title.js";import{resolveConfigRbac as K}from"./utils/resolve-config-rbac.js";import{relativePathToBaseSlug as Oe}from"./utils/relative-path-to-base-slug.js";import{normalizeApiVersion as Fe}from"./utils/normalize-api-version.js";import{importApiDocsBuilder as z}from"./import-api-docs-builder.js";import{envConfig as G}from"../../config/env-config.js";import{logger as Me}from"../../tools/notifiers/logger.js";const F="openapi-spec-download",H={timeoutMs:15e3,maxResponseSizeMB:20},Le={asyncapi:"AsyncAPI Docs",graphql:"GraphQL Docs",openapi:"OpenAPI Docs"};async function Pt(){let t=[],r=new Map;const s=new WeakMap;let a=new Set,g={},A={};function J(o,D,R){const v=s.get(o)??new Map;s.set(o,v);const P=D??"";return v.get(P)===R?!1:(v.set(P,R),!0)}return{id:"api-docs",requiredEntitlements:["openapi","asyncapi","graphql"],loaders:{"api-doc":he,"api-docs":Se},processContent:async(o,D)=>{await Ae("com.redocly.build.plugin.apiDocs",async()=>{o.createRequestHandler(F,le(import.meta.url,"./spec-download.api.js")),o.addApiRoute({slug:ue+"/*",requestHandlerId:F,httpMethod:"all",...H,[I]:$,getStaticData:async()=>({props:{definitionAccess:A}})}),o.addApiRoute({slug:pe+"/*",requestHandlerId:F,httpMethod:"all",...H,[I]:$,getStaticData:async()=>({props:{definitionAccess:A}})}),o.addApiRoute({slug:ce+"/*",requestHandlerId:F,httpMethod:"all",...H,[I]:$,getStaticData:async()=>({props:{definitionAccess:A}})});const R=o.createTemplate(V,W("../../../client/templates/api-docs/template.js")),v=o.registerServerPropsGetter(V,W("./get-server-props.js")),P=await D.getConfig();r=new Map,g={};const y=await o.loadApiDocuments(D);De(y,o.outdir),A={};const w=!!P.plugins?.some(e=>typeof e=="string"&&e.startsWith("@redocly/portal-plugin-async-api/"));w&&y.some(e=>e.type==="asyncapi")&&Me.warn("The plugin '@redocly/portal-plugin-async-api' is deprecated. Please remove it from your config to use built-in AsyncAPI docs.");const c=w?y.filter(e=>e.type!=="asyncapi"):y;t=c.map(({markdocChunks:e,relativePath:u,isVirtual:p,customOutputRelativeFile:i,realRelativePath:S})=>({chunks:e??[],relativePath:u,realRelativePath:S,isVirtual:i!=null||p}));const{buildItems:n}=await z(o.serverOutDir),m=(await D.cache.load("content-slugs","content-slugs")).data,h=ge(m),E=e=>de(h(e));for(const e of y){const u=Pe(e);if(u===void 0)continue;const p=E(e.customOutputRelativeFile||e.relativePath);A[u]=ye(e,p)}for(const e of c){const u=e.customOutputRelativeFile||e.relativePath,p=E(u);xe(e,p);const{items:i,store:S}=await n({type:e.type,document:e.document,options:e.options,basePath:p,markdownParser:j}),b=`${O}${e.relativePath}`,M=G.isDevelopMode?e.relativePath:void 0,l=$e(e.document),_=l?.["x-metadata"],C=e.isVirtual?void 0:_?.apiId,L={document:e,basePath:p,sourcePath:M,apiId:C,build:{items:i,store:S}};await o.createSharedData(b,Y(L,i,S));const Z=K(e.config),B=!!e.options.excludeFromSearch,ee=e.type==="openapi",te=_e(i,Z),oe=fe(e),f=te.map(d=>{const x=d.metadata?.seo,k={fsPath:u,templateId:R,sharedData:[{key:"apiDocsStore",id:b}],serverPropsGetterIds:[v],excludeFromSearch:B,getStaticData:qe(d.label,x,oe),[I]:d[I]};return Object.assign(k,Ne(d.link,p)),ee&&d.httpVerb&&(k.httpVerb=d.httpVerb,k.metadata={subType:"openapi-operation"}),k});if(!f.length)continue;const U=ke(l,e.type,i),re=Fe(l?.version),q={type:e.type,title:U,version:re,description:typeof l?.description=="string"?l.description:void 0,summary:typeof l?.summary=="string"?l.summary:void 0,...l?.["x-metadata"]&&typeof l["x-metadata"]=="object"?l["x-metadata"]:{}};f[0]={...f[0],metadata:q,hasClientRoutes:!0,getSidebar:(d,x)=>Te(X(i),p,x),getNavText:()=>U??Le[e.type]??"API Docs",getSearchDocuments:ve(i,q,o.getSearchFacets,o.setSearchFacets,B,S,e.document),getAiDocumentsStore:Ie({getBuild:()=>L.build,metadata:q,document:e.document,specType:e.type,excludeFromSearch:B,basePath:p,getSearchFacets:o.getSearchFacets,markdocTags:{...ae,schemaDefinition:ie}})};const se=f[0];f[0]=f[f.length-1],f[f.length-1]=se;for(const d of f)o.addRoute(d);if(C){const d=Re(e.config?.apis,e.realRelativePath);g[C]={[I]:d.rbac,[T]:{fsPath:u}}}r.set(b,L)}})},afterRoutesCreated:async(o,D)=>{const{buildItems:R,simplifyAstStructure:v}=await z(o.serverOutDir);for(const c of r.values())Q(o,c.build.items);const P=new Set,y=new Set;for(const{chunks:c,relativePath:n,isVirtual:m}of t){const h=`${O}${n}`,E=be(o.getAllRoutes(),n);for(const{node:e,markdown:u,pointer:p,key:i,relativePath:S}of c){const{ast:b,compoundHash:M}=await o.parseMarkdoc({input:{content:u,relativePath:S,isVirtual:m},resource:p,context:D,deps:{sharedDataIds:[`${O}${S}`],routeSlugs:E}});if(P.add(p),!(i==="graphql-docs"?e?.description?.value!==void 0:!!i&&Ce(e,i,u))||!J(e,i,M))continue;y.add(h);const _=v(b);if(i==="graphql-docs"){e.description&&(e.description.value=_);const C=`${O}${S}`;Be(r.get(C),_)}else i&&(e[i]=_)}}const w=a.difference(P);for(const c of w)D.cache.delete(c);a=P,Object.entries(g).forEach(([c,n])=>{const m=n[T]?.fsPath;if(!m)return;const h=o.getRouteByFsPath(m)?.baseSlug;g[c]={...n,[T]:{...n[T],slug:h},slug:h}}),o.setGlobalData({apiProducts:g});for(const[c,n]of r){if(!y.has(c))continue;const{items:m,store:h}=await R({type:n.document.type,document:n.document.document,options:n.document.options,basePath:n.basePath,markdownParser:j});n.build={items:m,store:h},Q(o,m),await o.createSharedData(c,Y(n,m,h))}}}}function Q(t,r){for(const{from:s,to:a}of ne(r))t.getConfig().redirects?.[s]||t.getRouteBySlug(s,{followRedirect:!1})||(t.addRouteAlias(s,a),t.addRedirect(s,{to:a},{trackOriginalSource:!1}))}function Y({document:t,basePath:r,sourcePath:s,apiId:a},g,A){return{[I]:K(t.config),[T]:{slug:me(r),fsPath:t.customOutputRelativeFile||t.relativePath},items:g,store:A,options:t.options,baseSlug:r,routesMapping:G.isDevelopMode?we(g,r):{},graphqlPositions:G.isDevelopMode&&t.type==="graphql"?Ee(g,r):void 0,sourcePath:s,apiId:a}}function Be(t,r){t?.document.type!=="graphql"||!t.document.options||(t.document.options.info={...t.document.options.info||{},description:r})}function qe(t,r,s){return async function(a){return{...s?{isTranslationFallback:!0}:{},props:{settings:{baseUrlPath:N(a.baseSlug)},disableAutoScroll:!0,seo:{title:t,...r}}}}}function xe(t,r){const s=t.options?.mockServer,a=N(`/_mock${Oe(t.relativePath)}`);s?.url===a&&(t.options={...t.options,mockServer:{...s,url:N(`/_mock${r}`)}})}function Ne(t,r){if(t===r)return{};const s=r==="/"?"/":`${r}/`;if(t.startsWith(s)){const a=t.slice(s.length);return a?{slugSuffix:a}:{}}return{slug:t}}function $e(t){if(t&&typeof t=="object"&&"info"in t)return t.info}function X(t){return t.map(({content:r,items:s,...a})=>({...a,...s&&{items:X(s)}}))}export{Pt as apiDocsPlugin,Ne as toRouteSlugFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as L from"node:path";import{descriptionOptions as x,markdocParser as A}from"@redocly/api-docs";import{combineUrls as i}from"@redocly/theme/core/openapi";import{withPathPrefix as E}from"@redocly/theme/core/utils";import{GRAPHQL_SPEC_SLUG as D}from"../../../constants/common.js";import{PUBLIC_API_DEFINITIONS_FOLDER as f,PUBLIC_STATIC_FOLDER as F}from"../../constants/common.js";import{envConfig as S}from"../../config/env-config.js";import{deepMerge as w}from"../../../utils/object/deep-merge.js";import{normalizeFeedbackOptions as R}from"./utils/normalize-feedback-options.js";import{replaceFileExtension as p}from"./utils/replace-file-extension.js";import{relativePathToBaseSlug as B}from"./utils/relative-path-to-base-slug.js";const I={tags:{},nodes:{},components:{}};function U(o,r){if(!(o?.off!==!0))return o;const e=B(r);return{url:E(`/_mock${e}`),position:"first",description:"Mock server",...o}}function M(o,r){return(r==="graphql"?[i(D,`${p(o,L.posix.extname(o))}?download`)]:[i(f,`${p(o,".json")}?download`),i(f,`${p(o,".yaml")}?download`)]).map(e=>({url:E(e)}))}function j(o,r,l){const{rootConfig:e,config:s,apiConfig:c,mergedConfig:t,relativePath:a}=l,n=w(e?.[o]||{},s[o]||{},c[o]||c.theme?.[o]||{}),_=r["x-feedback"]||n.feedback||s.feedback,b=!!t[o]?.excludeFromSearch||!!t.theme?.[o]?.excludeFromSearch||!!e?.[o]?.excludeFromSearch||!!e?.theme?.[o]?.excludeFromSearch,C=t.rbac||c.rbac,g=R(_),h=s.metadata,u=M(a,o),O={...g&&{feedback:g},mockServer:U(t?.mockServer||e?.mockServer,a),disableRouter:!0,downloadUrls:n.downloadUrls||u,replayDefinitionUrl:o!=="graphql"&&a.startsWith(`${F}/`)?void 0:u[0]?.url,excludeFromSearch:b,rbac:C,markdownParser:A,replayFeatures:{graphql:S.REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED??!1,asyncapi:S.REDOCLY_EXP_REPLAY_ASYNCAPI_ENABLED??!1}},k=x(o,r,h);let m;if(o==="graphql"){const d=n;m={title:d.info?.title,...h,...d.metadata??{}}}else m={description:r.info?.description,...k.metadata};o==="openapi"&&n.showSchemaCatalogLinks&&(r["x-schema-catalog-link"]=i(f,a));const P=n.markdocOptions??I;return{...n,...O,...k,markdocOptions:P,metadata:m}}export{M as buildDownloadUrls,j as createOptions};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ExampleEntry, GraphqlStoreMeta, SchemaEntry, SearchIndexerOptions } from '@redocly/api-docs';
|
|
1
|
+
import type { SearchIndexerOptions } from '@redocly/api-docs';
|
|
3
2
|
import type { RenderTagFn } from '../../../../types/index.js';
|
|
4
3
|
export type DescriptionFormatter = NonNullable<SearchIndexerOptions['formatDescription']>;
|
|
5
4
|
/**
|
|
@@ -7,6 +6,4 @@ export type DescriptionFormatter = NonNullable<SearchIndexerOptions['formatDescr
|
|
|
7
6
|
* llms.txt. Tags render through `renderTag` (their `renderForLlms`).
|
|
8
7
|
*/
|
|
9
8
|
export declare function createLlmDescriptionFormatter(renderTag?: RenderTagFn): DescriptionFormatter;
|
|
10
|
-
/** The shared api-docs indexer with Markdown descriptions — AI search documents and llms.txt need Markdown. */
|
|
11
|
-
export declare function createApiDocsSearchIndexer(basePath: string, formatDescription: DescriptionFormatter, schemaStore?: Record<string, SchemaEntry>, document?: Record<string, unknown>, exampleStore?: Record<string, ExampleEntry>, graphqlMeta?: GraphqlStoreMeta): ApiDocsSearchIndexer;
|
|
12
9
|
//# sourceMappingURL=create-indexer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocParser as a,parseMarkdown as f}from"@redocly/api-docs";import{toMarkdown as m}from"../../markdown/search/to-markdown.js";function u(i){const n=new Map;return r=>{if(typeof r=="string"&&!r.includes("{%"))return r;const o=typeof r=="string"?n.get(r):void 0;if(o!==void 0)return o;const t=f(r,{markdownParser:a}),e=!t||typeof t=="string"?t??"":m(Array.isArray(t)?t:[t],{renderTag:i}).trim();return typeof r=="string"&&n.set(r,e),e}}export{u as createLlmDescriptionFormatter};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import C from"node:path";import{REDOCLY_TEAMS_RBAC as v}from"@redocly/config";import{nodeTypes as y,contentType as
|
|
2
|
-
`+cn
|
|
1
|
+
import C from"node:path";import{REDOCLY_TEAMS_RBAC as v}from"@redocly/config";import{ApiDocsSearchIndexer as an,nodeTypes as y,contentType as b,isGraphqlFieldsNode as pn,resolveGraphqlItemFields as un}from"@redocly/api-docs";import{normalizeApiVersion as dn}from"../utils/normalize-api-version.js";import{replaceFileExtension as w}from"../utils/replace-file-extension.js";import{isResourcePubliclyAccessible as mn,canDownloadApiDefinition as hn,extractTeamsFromScopeItems as yn}from"../../../utils/rbac.js";import{getMarkdownCopyPath as $n}from"@redocly/theme/core/utils";import{PUBLIC_API_DEFINITIONS_FOLDER as B}from"../../../constants/common.js";import{GRAPHQL_SPEC_SLUG as gn}from"../../../../constants/common.js";import{isPlainObject as $}from"../../../../utils/guards/is-plain-object.js";import{ANONYMOUS_AUTH_DETAILS as bn}from"../../../constants/rbac.js";import{toMarkdown as U}from"../../markdown/search/to-markdown.js";import{createRenderTagFn as An}from"../../markdown/search/create-render-tag-fn.js";import{getLocaleFromRelativePath as In}from"../../../fs/utils/get-locale-from-relative-path.js";import{getBuildTranslateContext as On}from"../../../utils/l10n/get-build-translate-context.js";import{getPublicEnvVariables as Pn}from"../../../utils/envs/get-public-env-variables.js";import{llmsTxtLink as H}from"../../search/llmstxt/index.js";import{formatDocumentMetadata as Sn}from"../../search/utils.js";import{extractDocumentSearchFacets as xn}from"./search-facets.js";import{createLlmDescriptionFormatter as Cn}from"./create-indexer.js";function I(t,s){return s==="openapi"&&"openapi"in t}function Y(t,s){return s==="asyncapi"&&"asyncapi"in t}function re({getBuild:t,metadata:s,document:r,specType:c,excludeFromSearch:n,basePath:o,getSearchFacets:e,markdocTags:l}){return async(i,f,m,a)=>{if(n)return;const{items:d,store:u}=t(),h={...a.markdocOptions?.tags,...l},{locale:en,translate:tn}=await On(i.slug,a.getGlobalData?.().l10n),O=An(h,en,tn,{env:Pn()}),L=a.getConfig(),T=In(i.fsPath),D=Cn(O),on=new an({basePath:o,store:u,document:r,formatDescription:D}).documents(d),j=new Map;for(const x of on)j.set(x.url,x);const E=typeof s.title=="string"?s.title:void 0,M=dn(s.version),R=xn(i.metadata||{},E,M,e),P=[],S=[],V=vn(r,s),F=V?D(V):void 0,_=Ln(s,F,r,c,D),q=Tn(c,s,i.fsPath,L),G=new Map,rn=K(d,L,G,O),sn=_+q+`
|
|
2
|
+
`+rn,cn=_+q;S.push({title:E||"API Overview",description:F,content:sn,slug:o,fsPath:i.fsPath,includeInLLMsTxt:!0}),P.push({title:E||"API Overview",content:cn,url:o,fsPath:i.fsPath,locale:T,product:i.product?.name,facets:R});const ln=r&&I(r,c)?r.security:void 0,k=x=>{for(const p of x){if(!p.content||!p.link){p.items?.length&&k(p.items);continue}const fn=j.get(p.link),z=p.content.contentType,W=p[v],J=W?yn(W):void 0,Q=J?.length?J:void 0;if(z===b.ITEM){const g=Rn(p,r,c)??X(p,fn,c,M,ln,O,u);if(g){const A=p.label||"";S.push({title:A,description:void 0,content:g,slug:p.link,fsPath:i.fsPath,includeInLLMsTxt:!1}),P.push({title:A,content:g,url:p.link,fsPath:i.fsPath,locale:T,product:i.product?.name,facets:R,rbacTeams:Q})}}else if(z===b.GROUP){const g=kn(p,L,c,G,O,u);if(g){const A=p.label||"";S.push({title:A,description:void 0,content:g.llmstxt,slug:p.link,fsPath:i.fsPath,includeInLLMsTxt:!1}),P.push({title:A,content:g.aiSearch,url:p.link,fsPath:i.fsPath,locale:T,product:i.product?.name,facets:R,rbacTeams:Q})}}p.items?.length&&k(p.items)}};return k(d),{async getLLMsTxts(){return S},async getSearchDocuments(){return P}}}}function vn(t,s){const r=$(t?.info)?t.info:void 0,c=$(r?.["x-metadata"])?r["x-metadata"]:{},o=(typeof c.description=="string"?c.description:void 0)??r?.description??s.description;return typeof o=="string"?o||void 0:o&&typeof o=="object"?o:void 0}function Ln(t,s,r,c,n){const o=typeof t.title=="string"?t.title:"",e=typeof t.summary=="string"?t.summary:"",l=typeof t.version=="string"?t.version:"";let i=o?`# ${o}
|
|
3
3
|
|
|
4
4
|
`:"";if(i+=s?`${s}
|
|
5
5
|
|
|
6
6
|
`:"",i+=e?`${e}
|
|
7
7
|
|
|
8
8
|
`:"",i+=l?`Version: ${l}
|
|
9
|
-
`:"",r){if(
|
|
10
|
-
`);const m=f["x-metadata"],a=Object.entries($(m)?m:{}).filter(([u,h])=>u!=="description"||typeof h!="string"),d=
|
|
9
|
+
`:"",r){if(I(r,c)){const{info:f}=r;f?.license?.name&&(i+=`License: ${f.license.name}
|
|
10
|
+
`);const m=f["x-metadata"],a=Object.entries($(m)?m:{}).filter(([u,h])=>u!=="description"||typeof h!="string"),d=Sn(Object.fromEntries(a));d&&(i+=`
|
|
11
11
|
Metadata:
|
|
12
12
|
${d}
|
|
13
|
-
`)}else if(
|
|
13
|
+
`)}else if(Y(r,c)){const{info:f}=r;f?.license?.name&&(i+=`License: ${f.license.name}
|
|
14
14
|
`)}}return i+=`
|
|
15
|
-
`,i+=
|
|
15
|
+
`,i+=Dn(r,c,n),i+=En(r,c,n),i}function Tn(t,s,r,c){if(!r)return"";let n,o,e;if(t==="openapi")n=C.posix.join(B,w(r,".yaml")),o="## Download OpenAPI description",e="OpenAPI definition";else if(t==="asyncapi")n=C.posix.join(B,w(r,".yaml")),o="## Download AsyncAPI description",e="AsyncAPI definition";else if(t==="graphql"){const f=C.posix.extname(r)||".graphql";n=C.posix.join(gn,w(r,f)),o="## Download GraphQL schema",e="GraphQL schema"}else return"";if(!hn(n,c.access?.rbac??{},c.access?.requiresLogin??!1,bn))return"";const i=typeof s.title=="string"&&s.title||e;return`${o}
|
|
16
16
|
|
|
17
|
-
- ${
|
|
17
|
+
- ${H({title:i,description:void 0,slug:n,siteUrl:c.seo?.siteUrl})}`}function Dn(t,s,r){if(!t)return"";if(I(t,s)){const c=Array.isArray(t.servers)?t.servers.filter($):[];if(!c.length)return"";let n=`## Servers
|
|
18
18
|
|
|
19
19
|
`;for(const o of c){o.description&&(n+=`${r(o.description)}
|
|
20
20
|
`),n+=`\`\`\`
|
|
@@ -26,7 +26,7 @@ ${o.url}
|
|
|
26
26
|
`,i.default&&(n+=` Default: ${JSON.stringify(i.default)}
|
|
27
27
|
`),Array.isArray(i.enum)&&(n+=` Enum: ${i.enum.map(f=>JSON.stringify(f)).join(", ")}
|
|
28
28
|
`);n+=`
|
|
29
|
-
`}}return n}if(
|
|
29
|
+
`}}return n}if(Y(t,s)){const c=Object.entries($(t.servers)?t.servers:{}).filter(([,o])=>$(o));if(!c.length)return"";let n=`## Servers
|
|
30
30
|
|
|
31
31
|
`;for(const[o,e]of c)n+=`### ${o}
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ ${o.url}
|
|
|
36
36
|
`),e.protocolVersion&&(n+=`Protocol Version: ${e.protocolVersion}
|
|
37
37
|
`),e.pathname&&(n+=`Pathname: ${e.pathname}
|
|
38
38
|
`),n+=`
|
|
39
|
-
`;return n}return""}function
|
|
39
|
+
`;return n}return""}function En(t,s,r){if(!t||!I(t,s))return"";const c=t.components?.securitySchemes;if(!c)return"";let n=`## Security
|
|
40
40
|
|
|
41
41
|
`;for(const[o,e]of Object.entries(c)){if(!e||"$ref"in e)continue;const l=e;n+=`### ${o}
|
|
42
42
|
|
|
@@ -53,9 +53,9 @@ ${o.url}
|
|
|
53
53
|
`),f.scopes)){n+=`Scopes:
|
|
54
54
|
`;for(const[m,a]of Object.entries(f.scopes))n+=`- \`${m}\`: ${a}
|
|
55
55
|
`}n+=`
|
|
56
|
-
`}return n}function
|
|
56
|
+
`}return n}function K(t,s,r,c){let n="";const o=(e,l)=>{for(const i of e)if(!(!i.link||!nn(i,s))){if(i.content?.contentType===b.GROUP)n+=`${l} ${i.label||""}
|
|
57
57
|
|
|
58
|
-
`,i.items?.length&&o(i.items,l+"#");else if(i.content?.contentType===
|
|
58
|
+
`,i.items?.length&&o(i.items,l+"#");else if(i.content?.contentType===b.ITEM){let f=r.get(i.link);if(f===void 0){const m=i,a=m.httpVerb,d=m.httpPath,u=a&&d?`${a.toUpperCase()} ${d}`:i.label||"",h=N(i.content.children,c);f=` - ${H({title:u,description:h?h.slice(0,200):void 0,slug:$n(i.link),siteUrl:s.seo?.siteUrl})}`,r.set(i.link,f)}n+=f}}};return o(t,"##"),n}function X(t,s,r,c,n,o,e){if(!t.content)return;const l=t,i=t.label||"",f=N(t.content.children,o),m=t.content.meta?.deprecated;let a=`# ${i}${m?" (deprecated)":""}
|
|
59
59
|
|
|
60
60
|
`;if(f&&(a+=`${f}
|
|
61
61
|
|
|
@@ -64,8 +64,8 @@ ${o.url}
|
|
|
64
64
|
`),c&&(a+=`Version: ${c}
|
|
65
65
|
`);const h=wn(t.content.children,n);h&&(a+=`Security: ${h}
|
|
66
66
|
`)}return s?.parameters?.length&&r!=="graphql"&&(a+=`
|
|
67
|
-
`+
|
|
68
|
-
`),r==="graphql"&&(a+=
|
|
67
|
+
`+Un(s.parameters)+`
|
|
68
|
+
`),r==="graphql"&&(a+=Nn(t.content.children,e,o)),a}function Rn(t,s,r){if(t.httpVerb!=="tool"||!s||!I(s,r))return;const c=t.content?.meta?.name,n=c?s["x-mcp"]?.tools?.find(e=>e.name===c):void 0;if(!n)return;let o=`# ${t.label||n.name}
|
|
69
69
|
|
|
70
70
|
`;return typeof n.description=="string"&&n.description&&(o+=`${n.description}
|
|
71
71
|
|
|
@@ -81,25 +81,25 @@ ${JSON.stringify(n.inputSchema,null,2)}
|
|
|
81
81
|
${JSON.stringify(n.outputSchema,null,2)}
|
|
82
82
|
\`\`\`
|
|
83
83
|
|
|
84
|
-
`),o}function
|
|
84
|
+
`),o}function kn(t,s,r,c,n,o){if(!t.content)return;const e=t.label||"",l=N(t.content.children,n);let i=`# ${e}
|
|
85
85
|
|
|
86
86
|
`;if(l&&(i+=`${l}
|
|
87
87
|
|
|
88
|
-
`),r==="graphql"){let m="";const a=d=>{for(const u of d??[])if(!(!u.content||!
|
|
88
|
+
`),r==="graphql"){let m="";const a=d=>{for(const u of d??[])if(!(!u.content||!nn(u,s)))if(u.content.contentType===b.ITEM){const h=X(u,void 0,r,void 0,void 0,n,o);h&&(m+=`${h}
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
-
`)}else u.content.contentType===
|
|
92
|
+
`)}else u.content.contentType===b.GROUP&&a(u.items)};return a(t.items),{llmstxt:i+m,aiSearch:i}}const f=K(t.items??[],s,c,n);return{llmstxt:i+f,aiSearch:i}}function wn(t,s){const r=[],c=n=>{for(const o of n)if(o.nodeType===y.SECURITY){const e=o;for(const l of e.requirements)for(const i of l.schemes)i[v]||i.name&&!r.includes(i.name)&&r.push(i.name)}else(o.nodeType===y.CONTAINER||o.nodeType===y.OVERVIEW_SECTION_WRAPPER)&&c(o.children)};if(c(t),r.length)return r.join(", ");if(s?.length){const n=s.flatMap(o=>Object.keys(o));if(n.length)return[...new Set(n)].join(", ")}}function Un(t){const s={};for(const c of t){const n=`${c.place}${c.mediaType?` (${c.mediaType})`:""}`;s[n]||(s[n]=[]),s[n].push(c)}return Object.entries(s).map(([c,n])=>{const o=n.map(e=>{const l=[...e.path||[],e.name],i=Array.isArray(e.description)?e.description.join(" "):e.description;let f=` - \`${l.join(".")}\` (${e.type}${e.required?", required":""})
|
|
93
93
|
`;return i&&(f+=` ${i.trim()}
|
|
94
94
|
`),e.enum?f+=` Enum: ${e.enum.map(m=>JSON.stringify(m)).join(", ")}
|
|
95
95
|
`:e.example&&(f+=` Example: ${e.example}
|
|
96
|
-
`),f});return`## ${
|
|
96
|
+
`),f});return`## ${Z(c)}:
|
|
97
97
|
|
|
98
98
|
${o.join(`
|
|
99
99
|
`)}`}).join(`
|
|
100
|
-
`)}function
|
|
101
|
-
## ${
|
|
100
|
+
`)}function Nn(t,s,r){let c="";const n=o=>{for(const e of o)if(e.nodeType===y.ITEM){const l=pn(e)?un(e,s??{}):void 0;l&&(c+=jn(l,e.variant,r))}else(e.nodeType===y.CONTAINER||e.nodeType===y.OVERVIEW_SECTION_WRAPPER)&&n(e.children)};return n(t),c}function jn(t,s,r){let n=`
|
|
101
|
+
## ${Z(s==="return-type"?"Return type":s==="graphql-args"||s==="arguments"?"Arguments":s==="graphql-fields"?"Fields":s)}:
|
|
102
102
|
|
|
103
|
-
`;const o=e=>{const l=e.description?
|
|
104
|
-
`};if(t.type){const e=t.type.description?
|
|
105
|
-
`}else if(!t.fields.length)return"";for(const e of t.fields)n+=o(e);return n}function
|
|
103
|
+
`;const o=e=>{const l=e.description?U(Array.isArray(e.description)?e.description:[e.description],{renderTag:r}).trim():"";return` - \`${e.name}\` (${e.type.display})${l?`: ${l}`:""}
|
|
104
|
+
`};if(t.type){const e=t.type.description?U(Array.isArray(t.type.description)?t.type.description:[t.type.description],{renderTag:r}).trim():"";n+=` Type: ${t.type.display}`,e&&(n+=` - ${e}`),n+=`
|
|
105
|
+
`}else if(!t.fields.length)return"";for(const e of t.fields)n+=o(e);return n}function N(t,s){const r=[],c=o=>{for(const e of o)if(e.nodeType===y.MARKDOC){const l=e.content,i=Array.isArray(l)?l:[l],f=U(i,{renderTag:s}).trim();f&&r.push(f)}else(e.nodeType===y.CONTAINER||e.nodeType===y.OVERVIEW_SECTION_WRAPPER)&&c(e.children)};return c(t),r.join(" ").trim()||void 0}function Z(t){return t.charAt(0).toUpperCase()+t.slice(1)}function nn(t,s){return s.access?.requiresLogin?!0:mn({slug:t.link||"",[v]:t[v]},s)}export{re as getAiDocumentsStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{REDOCLY_ROUTE_RBAC as
|
|
1
|
+
import{REDOCLY_ROUTE_RBAC as m,REDOCLY_TEAMS_RBAC as c}from"@redocly/config";import{extractDocumentSearchFacets as g,setDocumentSearchFacets as A}from"./search-facets.js";import{ApiDocsSearchIndexer as D}from"@redocly/api-docs";import{normalizeApiVersion as S}from"../utils/normalize-api-version.js";function _(p,s,r,l,u,h,d){return async t=>{if(u)return[];const i=t.baseSlug||t.slug,R=new D({basePath:i,store:h,document:d}),e=typeof s.title=="string"?s.title:void 0,n=S(s.version),a=g(t.metadata||{},e,n,r);A(a,r,l);const f=[];for(const o of R.documents(p))f.push(Object.assign(o,{path:[],...o.url===i&&e&&{title:n?`${e} (${n})`:e},[c]:o[c]??t[c],[m]:t[m]??{slug:t.slug,fsPath:t.fsPath},facets:a}));return f}}export{_ as searchResolver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"node:path";import{existsSync as u}from"node:fs";import{readFile as I}from"node:fs/promises";import L from"js-yaml";import{withoutPathPrefix as j}from"@redocly/theme/core/utils";import{DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as g,PUBLIC_API_DEFINITIONS_FOLDER as w}from"../../constants/common.js";import{GRAPHQL_SPEC_SLUG as T}from"../../../constants/common.js";import{requestDefinitionAccessKey as C}from"./definition-access.js";import{canDownloadApiDefinition as U,filterDataByAccessDeep as B}from"../../utils/rbac.js";import{API_DOWNLOAD_PREFIXES as G}from"../../utils/is-api-download-link.js";import{decodeRequestPath as W}from"../../utils/decode-request-path.js";import{replaceFileExtension as X}from"./utils/replace-file-extension.js";const v=[".json",".yaml",".yml"],H=[".graphql",".gql"];function F(r,o){const t=e.parse(r);return e.join(t.dir,t.name+o)}const J=async(r,o,t)=>{const{isAuthenticated:a,teams:m,claims:{email:d}}=o.user,S=new URL(r.url),n=W(j(S.pathname));if(n===void 0||n.endsWith("/"))return new Response("Bad Request",{status:400});const c=G.find(i=>n.startsWith(`${i}/`));if(c===void 0)return new Response("Not found",{status:404});const p=c===T,s=n.slice(c.length),
|
|
1
|
+
import e from"node:path";import{existsSync as u}from"node:fs";import{readFile as I}from"node:fs/promises";import L from"js-yaml";import{withoutPathPrefix as j}from"@redocly/theme/core/utils";import{DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as g,PUBLIC_API_DEFINITIONS_FOLDER as w}from"../../constants/common.js";import{GRAPHQL_SPEC_SLUG as T}from"../../../constants/common.js";import{requestDefinitionAccessKey as C}from"./definition-access.js";import{canDownloadApiDefinition as U,filterDataByAccessDeep as B}from"../../utils/rbac.js";import{API_DOWNLOAD_PREFIXES as G}from"../../utils/is-api-download-link.js";import{decodeRequestPath as W}from"../../utils/decode-request-path.js";import{replaceFileExtension as X}from"./utils/replace-file-extension.js";const v=[".json",".yaml",".yml"],H=[".graphql",".gql"];function F(r,o){const t=e.parse(r);return e.join(t.dir,t.name+o)}const J=async(r,o,t)=>{const{isAuthenticated:a,teams:m,claims:{email:d}}=o.user,S=new URL(r.url),n=W(j(S.pathname));if(n===void 0||n.endsWith("/"))return new Response("Bad Request",{status:400});const c=G.find(i=>n.startsWith(`${i}/`));if(c===void 0)return new Response("Not found",{status:404});const p=c===T,s=n.slice(c.length),f=e.extname(s);if(!(p?H:v).includes(f))return new Response("Not found",{status:404});const{rbac:h={},requiresLogin:P=!1}=o.config.access||{},y=(t.props?.definitionAccess??{})[C(p,X(s.slice(1),""))];if(!U(n,h,P,{isAuthenticated:a,email:d,teams:m},y))return new Response("Unauthorized",{status:a?403:401});const l=t.props?.outdir||"";if(p){const i=e.join(l,w,s);if(!u(i))return new Response("Not found",{status:404});const q=await I(i,"utf-8");return new Response(q,{headers:{"Content-Type":"application/graphql"}})}const E=e.join(l,w,F(s,".json")),R=e.join(l,g,F(s,".json")),A=u(E),D=u(R);if(!A&&!D)return new Response("Not found",{status:404});const _=await I(A?E:R,"utf-8"),x=JSON.parse(_),N=B(x,{isAuthenticated:a,email:d,teams:m},h,P),O=f===".yaml"?L.dump(N,{noRefs:!0}):JSON.stringify(N,null,2);return new Response(O,{headers:{"Content-Type":f===".yaml"?"application/yaml":"application/json"}})};var ie=J;export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"node:path";import{CONFIG_FILE_NAME as O}from"../../../../constants/common.js";import{normalizeRouteSlug as l}from"../../../../utils/path/normalize-route-slug.js";import{removeLeadingSlash as x}from"../../../../utils/url/remove-leading-slash.js";import{parseBaseName as w}from"
|
|
1
|
+
import c from"node:path";import{CONFIG_FILE_NAME as O}from"../../../../constants/common.js";import{normalizeRouteSlug as l}from"../../../../utils/path/normalize-route-slug.js";import{removeLeadingSlash as x}from"../../../../utils/url/remove-leading-slash.js";import{parseBaseName as w}from"../../../utils/content/parse-base-name.js";const m=async(t,e)=>{if(!t.match(/(\.ya?ml|\.json)$/)||c.posix.basename(t)===O||await e.isPathIgnored(t))return null;const s=e.fs.getFileInfo(t);if(!s)return null;try{const{data:o}=await e.cache.load(s.realRelativePath,"yaml");return o??null}catch{return null}},L=async(t,e)=>{const s=await m(t,e);return!!(s?.openapi||s?.swagger)},j=async(t,e)=>!!(await m(t,e))?.asyncapi,F=t=>!!t.match(/(\.gql|\.graphql)$/),U=async(t,e,s,o)=>{const{getRouteBySlug:d,getRouteByFsPath:f}=s,i={isOpenapiDetected:!1,isOpenapiValid:!1},g={isOpenapiDetected:!0,isOpenapiValid:!1},h={isOpenapiDetected:!0,isOpenapiValid:!0};let r=t.toLowerCase();if(t.startsWith("/"))r=l(t);else if(t.startsWith("./")||t.startsWith("../")){const n=f(e)?.slug;if(!n)return i;const{isIndexFile:a}=w(e);r=a?l(c.posix.join(n,t)):l(c.posix.join(n,"../",t))}else return i;const p=r.toLowerCase().split("/");for(let n=p.length;n>=0;n--){const a=p.slice(0,n).join("/"),y=p.slice(n).join("/"),u=d(a)||f(x(a));if(u)return await L(u.fsPath,o)?y?g:h:i}return i};export{j as isAsyncapiDoc,F as isGraphqlDoc,U as isOpenApiURL,L as isOpenapiDoc};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i from"node:path";import{isL10nPath as m}from"../../../fs/utils/is-l10n-path.js";import{getLocaleFromRelativePath as n}from"../../../fs/utils/get-locale-from-relative-path.js";import{removeL10nPrefix as s}from"../../../fs/utils/remove-l10n-prefix.js";import{parseBaseName as p}from"
|
|
1
|
+
import i from"node:path";import{isL10nPath as m}from"../../../fs/utils/is-l10n-path.js";import{getLocaleFromRelativePath as n}from"../../../fs/utils/get-locale-from-relative-path.js";import{removeL10nPrefix as s}from"../../../fs/utils/remove-l10n-prefix.js";import{parseBaseName as p}from"../../../utils/content/parse-base-name.js";function h(r){const{baseName:t,isIndexFile:a}=p(r),e=i.posix.dirname(r),o=a?e==="."?"":e:e==="."?t:i.posix.join(e,t);return m(o)?("/"+n(o).toLowerCase()+"/"+s(o)).replace(/\/{2,}/g,"/"):("/"+o).replace(/\/{2,}/g,"/")}export{h as relativePathToBaseSlug};
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import type { LoaderFn } from '../../../types';
|
|
2
|
-
|
|
3
|
-
pageVsPage: number;
|
|
4
|
-
dirVsDir: number;
|
|
5
|
-
};
|
|
6
|
-
export type ContentSlugs = {
|
|
7
|
-
fileSlugs: Map<string, string>;
|
|
8
|
-
dirSlugs: Map<string, string>;
|
|
9
|
-
collisions: SlugCollisions;
|
|
10
|
-
};
|
|
11
|
-
export declare const IGNORED_EXTS: Set<string>;
|
|
2
|
+
import type { ContentSlugs } from './utils/calculate-content-slugs.js';
|
|
12
3
|
export declare const contentSlugsLoader: LoaderFn<ContentSlugs>;
|
|
13
4
|
//# sourceMappingURL=content-slugs-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{logger as o}from"../../../tools/notifiers/logger.js";import{calculateContentSlugs as p}from"./utils/calculate-content-slugs.js";const f={pageVsPage:"File slug collision: %s wanted %s, assigned %s",dirVsDir:"Directory slug collision: %s wanted %s, assigned %s"},C=async(w,{fs:t,cache:a,getConfig:n})=>{const i=o.startTiming(),r=(await a.load("versions-config","versions-config")).data,{markdown:l}=await n(),c=l?.partialsFolders??[],e=t.scan().map(({relativePath:s})=>s),g=await p(e,{isIgnored:async s=>(await a.load(s,"is-ignored")).data,partialsFolders:c,versionsConfig:r,onCollision:({kind:s,relativePath:d,desiredSlug:m,assignedSlug:u})=>o.verbose(f[s],d,m,u)});return o.verboseTime(i,"Calculated slugs. Number of file paths processed: "+e.length),g};export{C as contentSlugsLoader};
|
|
@@ -3,7 +3,7 @@ export declare const DEFAULT_LOADERS: {
|
|
|
3
3
|
'redocly-config': import("../../../types/fs.js").LoaderFn;
|
|
4
4
|
'product-config': import("../../../types/fs.js").LoaderFn;
|
|
5
5
|
'versions-config': import("../../../types/fs.js").LoaderFn;
|
|
6
|
-
'content-slugs': import("../../../types/fs.js").LoaderFn<import("./content-slugs
|
|
6
|
+
'content-slugs': import("../../../types/fs.js").LoaderFn<import("./utils/calculate-content-slugs.js").ContentSlugs>;
|
|
7
7
|
'is-ignored': import("../../../types/fs.js").LoaderFn<boolean>;
|
|
8
8
|
yaml: import("../../../types/fs.js").LoaderFn;
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_SEARCH_ENGINE as
|
|
1
|
+
import{DEFAULT_SEARCH_ENGINE as A,rootRedoclyConfigSchema as d}from"@redocly/config";import F from"is-glob";import{I18N_DIR_NAME as u,L10N_DIR_NAME as l}from"../../../constants/common.js";import{ROOT_CONFIG_SCHEMA as f}from"../../../constants/config-schema.js";import{CONFIG_FILE_NAME as m}from"../../../../constants/common.js";import{deepMerge as C}from"../../../../utils/object/deep-merge.js";import{logger as i}from"../../../tools/notifiers/logger.js";import{EntitlementsProvider as b}from"../../../entitlements/entitlements-provider.js";import{readAndValidateConfig as h}from"./utils/read-and-validate-config.js";import{resolveExternalPlugins as y}from"../../../external-plugins/resolve-external-plugins.js";import{getPathForAllLocales as p}from"../../../fs/utils/get-path-for-all-locales.js";import{parseRbacConfig as E}from"../../../utils/rbac.js";import{RbacConfigLocation as R,validateRbacConfig as S}from"../../validate-rbac-config.js";const _=["**/_partials/**"],$=async(e,{fs:n},s)=>{const r=await h(e,n,s,async t=>e===m?v(n.cwd,t?.plugins||[]):void 0);if(r?.access?.rbac){const t=await E(r.access.rbac);r.access.rbac=t,S(t,e===m?R.RootRedoclyYaml:void 0)}(r?.l10n||r?.i18n)&&(r.l10n=w(r),r.i18n=void 0);const c=C(r||{},{markdown:{partialsFolders:(r?.markdown?.partialsFolders||_).flatMap(t=>p(t,n))}});return I({...c,configPath:e,ignore:L(r?.ignore,n)})};async function v(e,n){const s=await y(e,n),r=s.map(a=>a.config.schema?a.lifecyclePlugin.id:""),c={};for(const a of s){const o=a.lifecyclePlugin?.id;a.config.schema&&o&&d.properties&&(c[o]=a.config.schema)}return{...f,properties:{...c,...f.properties},$id:d.$id+r.join("")}}function I(e){const n=b.instance();if(n.canAccessFeature("apiFunctions")||(e.apiFunctions=void 0),n.canAccessFeature("products")||(e.products=void 0),n.canAccessFeature("breadcrumbs")||(e.breadcrumbs={hide:!0}),n.canAccessFeature("seo")||(e.seo={llmstxt:{hide:!0}}),n.canAccessFeature("redirects")||(e.redirects={}),n.canAccessFeature("l10n")||(e.l10n=void 0),n.canAccessFeature("rbac")||e.access&&(e.access.rbac=void 0),n.canAccessFeature("sso")||e.access&&(e.access.sso=void 0),n.canAccessFeature("ssoDirect")||(e.ssoDirect=void 0),n.canAccessFeature("catalogClassic")||(e.catalog=void 0,e.catalogClassic=void 0),n.canAccessFeature("scorecard")||(e.scorecard=void 0,e.scorecardClassic=void 0),n.canAccessFeature("scorecards")||(e.scorecards=void 0),n.canAccessFeature("devOnboarding")||(e.developerOnboarding=void 0),n.canAccessFeature("analytics")||(e.analytics=void 0),n.canAccessFeature("removeAttribution")||(e.removeAttribution=void 0),n.canAccessFeature("mockServer")||(e.mockServer={off:!0}),n.canAccessFeature("advancedSearch")||e.search&&(e.search.engine=A),n.canAccessFeature("banner")||(e.banner=void 0),e.consent){const s=n.entitlements;s&&!Object.prototype.hasOwnProperty.call(s,"cookieConsent")?i.warn("The plan gates token has no cookieConsent entry. The consent option stays on."):n.canAccessFeature("cookieConsent")||(i.error("The consent option requires the Enterprise+ plan. It is ignored, and analytics loads without consent."),e.consent=void 0)}return e}function L(e=[],n){return["static",...e].flatMap(s=>F(s)&&(s.startsWith("*")||s.startsWith(l)||s.startsWith("/"+l)||s.startsWith(u)||s.startsWith("/"+u))?s:p(s,n))}function w(e){return e.i18n&&i.warn("The `i18n` configuration is deprecated. Please use `l10n` instead."),e.l10n||e.i18n||{}}export{$ as redoclyConfigLoader};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { VersionedFolderConfig } from '@redocly/config';
|
|
2
|
+
export type SlugCollisions = {
|
|
3
|
+
pageVsPage: number;
|
|
4
|
+
dirVsDir: number;
|
|
5
|
+
};
|
|
6
|
+
export type ContentSlugs = {
|
|
7
|
+
fileSlugs: Map<string, string>;
|
|
8
|
+
dirSlugs: Map<string, string>;
|
|
9
|
+
collisions: SlugCollisions;
|
|
10
|
+
};
|
|
11
|
+
export type SlugCollision = {
|
|
12
|
+
kind: keyof SlugCollisions;
|
|
13
|
+
relativePath: string;
|
|
14
|
+
desiredSlug: string;
|
|
15
|
+
assignedSlug: string;
|
|
16
|
+
};
|
|
17
|
+
export type ContentSlugsOptions = {
|
|
18
|
+
isIgnored: (relativePath: string) => boolean | Promise<boolean>;
|
|
19
|
+
partialsFolders: string[];
|
|
20
|
+
versionsConfig: Map<string, VersionedFolderConfig>;
|
|
21
|
+
onCollision?: (collision: SlugCollision) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const IGNORED_EXTS: Set<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Assigns a route slug to each content file and folder. A file with an `IGNORED_EXTS` extension,
|
|
26
|
+
* an ignored file and a Markdown partial get none; a slug already held gets a numbered suffix.
|
|
27
|
+
*
|
|
28
|
+
* @param relativePaths - Paths relative to the content root, in any order; not modified.
|
|
29
|
+
* @returns The slug of each file and folder, and how many slugs got a numbered suffix.
|
|
30
|
+
*/
|
|
31
|
+
export declare function calculateContentSlugs(relativePaths: readonly string[], { isIgnored, partialsFolders, versionsConfig, onCollision }: ContentSlugsOptions): Promise<ContentSlugs>;
|
|
32
|
+
//# sourceMappingURL=calculate-content-slugs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"path";import{combineUrls as m}from"@redocly/theme/core/utils/urls";import{VERSION_SEPARATOR as c}from"../../../../constants/versions.js";import{removeTrailingSlash as h}from"../../../../../utils/url/remove-trailing-slash.js";import{slash as w}from"../../../../../utils/path/slash.js";import{parsePathVersions as b}from"../../../../../utils/path/parse-path-versions.js";import{GithubSlugger as D,slug as p}from"../../../../../utils/slugger.js";import{parseBaseName as P}from"../../../../utils/content/parse-base-name.js";import{isPartial as E}from"../../../markdown/is-partial.js";const F=new Set([".jpg",".jpeg",".png",".gif",".webp",".svg",".ico",".avif",".mp3",".wav",".ogg",".m4a",".mp4",".avi",".mov",".webm",".pdf",".doc",".docx",".zip",".rar",".gz",".ttf",".woff",".woff2"]);async function A(e,{isIgnored:i,partialsFolders:o,versionsConfig:a,onCollision:l}){const g=new Map,u=new Map,n=new Set,s={pageVsPage:0,dirVsDir:0},t=new D;u.set(".","/"),u.set("/","/");const d=[...e].sort((r,S)=>S.localeCompare(r));for(const r of d){if(F.has(f.posix.extname(r))||await i(r)||f.posix.extname(r)===".md"&&E(r,o))continue;const S=w(r).replace(new RegExp("^(@i18n|@l10n)\\/"),""),V=z(r,a);I(S,{defaultVersion:V,fileSlugs:g,dirSlugs:u,allFileSlugsList:n,githubSlugger:t,collisions:s,onCollision:l})}return{fileSlugs:g,dirSlugs:u,collisions:s}}function z(e,i){const o=b(e);return o==null?null:i.get(o.versionFolderPath)?.defaultVersion}function I(e,i){const o=i.fileSlugs.get(e);if(o)return o;const a=f.posix.dirname(e),l=N(a,i)||"",{baseName:g,isIndexFile:u}=P(e),n=i.dirSlugs.has(f.posix.join(a,g));let s;if(!u&&n){const t=p(m(l,g));i.allFileSlugsList.has(t)||(s=t)}if(!s){const t=u?i.dirSlugs.get(a):void 0;if(t)s=t;else{const d=m(l,g),r=p(d);s=i.githubSlugger.slug(d),s!==r&&(i.collisions.pageVsPage++,i.onCollision?.({kind:"pageVsPage",relativePath:e,desiredSlug:r,assignedSlug:s}))}}s=h(s),i.fileSlugs.set(e,s),i.allFileSlugsList.add(s)}function N(e,i){if(i.dirSlugs.has(e))return i.dirSlugs.get(e);const o=h(f.posix.normalize(e)).split("/");let a="/",l="";for(const g of o){l=f.posix.join(l,g);const u=j(g,i.defaultVersion);let n=i.dirSlugs.get(l);if(!n){const s=m("/",a,u),t=p(s);n=i.githubSlugger.slug(s),n!==t&&(i.collisions.dirVsDir++,i.onCollision?.({kind:"dirVsDir",relativePath:l,desiredSlug:t,assignedSlug:n}))}n.endsWith("/")||(n=n+"/"),i.dirSlugs.set(l,n),a=n}return i.dirSlugs.get(e)}function j(e,i){if(!e.startsWith(c))return e;const o=e.substring(c.length);return o===i?"":o}export{F as IGNORED_EXTS,A as calculateContentSlugs};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { VersionedFolderConfig } from '@redocly/config';
|
|
2
1
|
import type { LoaderFn } from '../../../types';
|
|
3
2
|
export declare const versionsConfigLoader: LoaderFn;
|
|
4
|
-
export declare function getDefaultVersionByPath(path: string, versionsConfig: Map<string, VersionedFolderConfig>): string | null | undefined;
|
|
5
3
|
//# sourceMappingURL=versions-config-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"path";import{I18N_DIR_NAME as v,L10N_DIR_NAME as c,RESERVED_DIR_NAMES as p}from"../../../constants/common.js";import{VERSION_SEPARATOR as V,VERSIONED_FOLDER_REGEXP_MATCH as P}from"../../../constants/versions.js";import{parsePathVersions as h}from"../../../../utils/path/parse-path-versions.js";import{compareVersions as g}from"../../../../utils/version/compare-versions.js";import{reporter as u}from"../../../tools/notifiers/reporter.js";import{logger as y}from"../../../tools/notifiers/logger.js";const S=async(i,{cache:r,fs:n})=>{const e=new Map,a=n.scan();await E(a);for(const{relativePath:s}of a){if(d.posix.basename(s)==="versions.yaml"){await F(s,e,r);continue}const o=h(s);if(o==null||p.includes(V+o.versionName))continue;const t=e.get(o.versionFolderPath)||{versionedFiles:new Map,versions:[]},l=t.versionedFiles.get(o.filePathInVersion)||new Set,f={version:o.versionName};l.add(f.version),!t.hasVersionsConfig&&t.versions.findIndex(m=>m.version===o.versionName)===-1&&t.versions.push(f),t.versionedFiles.set(o.filePathInVersion,l),e.set(o.versionFolderPath,t)}return I(e)};async function F(i,r,n){let e=d.posix.dirname(i);e==="."?e="/":e=e.endsWith("/")?e:e+"/",e.startsWith(v+"/")&&(e=e.slice(v.length+1)),e.startsWith(c+"/")&&(e=e.slice(c.length+1));const s=(await n.load(i,"yaml")).data;s.versions&&!Array.isArray(s.versions)?(await u.panicOnBuild(`Property 'versions' must be an array at %rp. Got '${typeof s.versions}'.`,i),s.versions=[]):(!s.versions||s.versions.length===0)&&y.warn("Property 'versions' is empty at %rp. This is likely a mistake.",i);const o=r.get(e)||{versionedFiles:new Map,versions:[]};o.hasVersionsConfig=!0,o.versions=s.versions||[],s.default&&(o.defaultVersion=s.default),r.set(e,o)}async function E(i){const r=new Set;for(const{relativePath:n}of i){const e=h(n);if(!(e?.versionFolderPath&&p.includes(e?.versionFolderPath))){if(e?.versionFolderPath==null){(n.match(P)?.length||0)>1&&await u.panicOnBuild(`Nested versions are not supported. Detected nested versions in path: "${n}".`);continue}r.has(e.versionFolderPath)||r.add(e.versionFolderPath)}}}function I(i){for(const[r,n]of i){const e=n.hasVersionsConfig?n.versions:n.versions.sort((o,t)=>g(t.version,o.version)),a=n.hasVersionsConfig?e[e.length-1]:e[0],s=n.defaultVersion||a?.version;i.set(r,{...n,versions:e,defaultVersion:s})}return i}export{S as versionsConfigLoader};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContentSlugs } from './config-parser/loaders/content-slugs
|
|
1
|
+
import type { ContentSlugs } from './config-parser/loaders/utils/calculate-content-slugs.js';
|
|
2
2
|
/**
|
|
3
3
|
* Creates the canonical fsPath -> route slug function backed by the
|
|
4
4
|
* precalculated `content-slugs` cache. The cache is the single place where
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"path";import{combineUrls as n}from"@redocly/theme/core/utils";import{removeTrailingSlash as a}from"../../utils/url/remove-trailing-slash.js";import{slash as p}from"../../utils/path/slash.js";import{slug as f}from"../utils/index.js";import{parseBaseName as u}from"
|
|
1
|
+
import s from"path";import{combineUrls as n}from"@redocly/theme/core/utils";import{removeTrailingSlash as a}from"../../utils/url/remove-trailing-slash.js";import{slash as p}from"../../utils/path/slash.js";import{slug as f}from"../utils/index.js";import{parseBaseName as u}from"../utils/content/parse-base-name.js";function b(i){return function(r){const o=p(r).replace(new RegExp("^(@i18n|@l10n)\\/"),""),l=i?.fileSlugs.get(o)||i?.dirSlugs.get(a(o));if(l)return l;const{baseName:t,isIndexFile:m}=u(r);let e=s.dirname(r.replace(new RegExp("^(@i18n|@l10n)\\/"),""));return e=e==="."?"/":e,n("/",f(m?e:n(e,t)),"/")}}export{b as createSlugify};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import f from"path";import{productConfigOverrideSchema as A,REDOCLY_TEAMS_RBAC as O,REDOCLY_ROUTE_RBAC as S}from"@redocly/config";import{CONFIG_FILE_NAME as b}from"../../../constants/common.js";import{findDeepFirst as B}from"../../../utils/tree/find-deep-first.js";import{removeTrailingSlash as D}from"../../../utils/url/remove-trailing-slash.js";import{addTrailingSlash as E}from"../../../utils/url/add-trailing-slash.js";import{reporter as k}from"../../tools/notifiers/reporter.js";import{logger as F}from"../../tools/notifiers/logger.js";import{FileNotFoundError as I,resolveAssetPath as _}from"../../utils/index.js";import{safeParsePartial as j}from"../config-parser/safe-parse.js";import{resolveLinksFromConfig as v,resolveItems as $}from"../nav-utils.js";import{resolveLogoConfig as T}from"./resolve-logo.js";import{pickUiAccessibleConfig as z}from"./index.js";import{getExcludedFromLinkCheckerPatterns as N}from"../sidebars/utils.js";const ie=async(o,e,r)=>{if(!o)return;const n={};for(const t of Object.keys(o)){let c;const m=o[t].icon;if(m)try{c=await _(m,r.fs,{fromFileRelativePath:b,contentDir:e.contentDir,outdir:e.outdir})}catch(w){w instanceof I?await k.panicOnBuildContentError(`Could not resolve icon for product "${t}": file ${m} does not exist`):await k.panicOnBuild(`Could not resolve icon for product "${t}": ${w.message}`)}const{name:C,nameTranslationKey:a,folder:d}=o[t],s=f.posix.join(d,"redocly.yaml"),u=r.fs.exists(s)?await r.cache.load(s,"product-config"):void 0,p=u?.data&&j(A,u.data),l=await W(d,r,e);if(!l){await k.panicOnBuild(`Could not resolve first link for product "${t}"`);continue}const P=e.getRouteBySlug(l),g=f.join(e.contentDir,d),i=p&&z(p),y=Object.keys(i?.logo||{}).length>0?await T(i?.logo,s,e.outdir,r.fs):void 0,h=N(e.getConfig()),L={navFile:s,excludedFromLinkCheckerPatterns:h};n[t]={name:C,nameTranslationKey:a,folder:d,icon:c,slug:r.slugify(f.normalize(d)),link:l,configOverride:i&&{logo:Object.keys(y||{}).length>0?y:void 0,navbar:await v(i.navbar,g,e,r,L),footer:await v(i.footer,g,e,r,L),feedback:i.feedback,sidebar:i.sidebar,search:i.search&&{...i.search,suggestedPages:await v(i.search?.suggestedPages,g,e,r,{navFile:b,excludedFromLinkCheckerPatterns:h})},codeSnippet:i.codeSnippet,breadcrumbs:i.breadcrumbs&&{...i.breadcrumbs,prefixItems:await v(i.breadcrumbs?.prefixItems||[],g,e,r,{navFile:b,excludedFromLinkCheckerPatterns:h})},palette:i.palette,analytics:i.analytics,mockServer:i.mockServer},[O]:P?.[O],[S]:P?.[S]},F.verbose(`Resolved config for product "${t}"`)}return n};async function W(o,e,r){const n=E(f.posix.normalize(o)),t=D(e.slugify(f.normalize(o))),c=r.getRouteBySlug(t);if(c&&c.fsPath.startsWith(n))return c.slug;const m=e.fs.scan(/sidebars\.yaml$/).filter(u=>u.relativePath.startsWith(n)),a=U(m)[0]?.relativePath;if(a){const u=await e.cache.load(a,"yaml"),p=await $(u.data,f.dirname(a),r,e,{navFile:a}),l=R(p);if(l)return F.verbose(`Found product first link "${l}" in sidebar "${a}"`),l}const d=await $([{directory:`${n}`}],f.dirname("sidebars.yaml"),r,e,{navFile:"sidebars.yaml"}),s=R(d);return s&&F.verbose(`Found product first link "${s}" in product folder "${n}"`),s}function R(o){return(o?B(o,r=>!!r.link):void 0)?.link}function U(o){return o.sort((e,r)=>{const n=e.relativePath.split("/").length,t=r.relativePath.split("/").length;return n!==t?n-t:e.relativePath.localeCompare(r.relativePath,void 0,{numeric:!0})})}export{W as getProductFirstLink,ie as resolveProductsConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MCP_ROUTE as
|
|
1
|
+
import{MCP_ROUTE as t,PUBLIC_MCP_ROUTE as r}from"@redocly/theme/core/constants/mcp";import{EntitlementsProvider as E}from"../entitlements/entitlements-provider.js";import{isMcpRouteServedByConfig as m,isPublicMcpRouteServedByConfig as p}from"./mcp/utils/route-reservation.js";const o={mcp:t,mcpPublic:r};function n(){return!!E.instance().canAccessFeature("mcp")}const u=[{slug:o.mcp,isEnabled:e=>m(e)&&n()},{slug:o.mcpPublic,isEnabled:e=>n()&&p(e)}];function d(e,i,s=[]){return[...u,...s].some(c=>c.slug===e&&c.isEnabled(i))}export{o as RESERVED_ROUTES,d as isRouteReserved};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import B from"@redocly/portal-plugin-mock-server";import{REDOCLY_ROUTE_RBAC as x}from"@redocly/config";import{combineUrls as E,withPathPrefix as L}from"@redocly/theme/core/utils";import{VERSION_SEPARATOR as k}from"../constants/
|
|
1
|
+
import B from"@redocly/portal-plugin-mock-server";import{REDOCLY_ROUTE_RBAC as x}from"@redocly/config";import{combineUrls as E,withPathPrefix as L}from"@redocly/theme/core/utils";import{VERSION_SEPARATOR as k}from"../constants/versions.js";import{removeTrailingSlash as N}from"../../utils/url/remove-trailing-slash.js";import{removeLeadingSlash as j}from"../../utils/url/remove-leading-slash.js";import{isTruthy as $}from"../../utils/guards/is-truthy.js";import{normalizeRouteSlug as D}from"../../utils/path/normalize-route-slug.js";import{parsePathVersions as V}from"../../utils/path/parse-path-versions.js";import{reporter as v}from"../tools/notifiers/reporter.js";import{logger as P}from"../tools/notifiers/logger.js";import{envConfig as S}from"../config/env-config.js";import{shaDirPathShort as M}from"../utils/crypto/sha-dir-path-short.js";import{writeServerRebuildTrigger as _,generateBrowserPluginsModule as q,generateClientRoutes as z,generateTemplatesModule as H}from"../esbuild/generate.js";import{customPagesPlugin as U}from"../../server/plugins/pages/index.js";import{apiDocsPlugin as G}from"../../server/plugins/api-docs/index.js";import{configParserPlugin as I}from"./config-parser/index.js";import{createSlugify as W}from"./create-slugify.js";import{markdownPlugin as K}from"./markdown/index.js";import{searchPlugin as Y}from"./search/index.js";import{skillsPlugin as J}from"./skills/index.js";import{defaultThemePlugin as Q}from"./default-theme/index.js";import{apiKeyMgmtPlugin as X}from"./dev-onboarding/index.js";import{apiFunctionsPlugin as Z}from"./api-functions/index.js";import{scorecardClassicPlugin as ee}from"./scorecard-classic/index.js";import{lintPlugin as te}from"./lint/index.js";import{resolveExternalPlugins as oe}from"../external-plugins/resolve-external-plugins.js";import{sidebarsPlugin as ie}from"./sidebars/index.js";import{l10nPlugin as re}from"./l10n/index.js";import{validateRedirects as ne}from"../utils/redirects/validate-redirects.js";import{analyticsPlugins as se}from"./analytics/index.js";import{consentPlugin as ae}from"./consent/index.js";import{sitemapPlugin as le}from"./sitemap/index.js";import{entitlementsPlugin as ce}from"./entitlements/index.js";import{getBilledPagesCount as ue}from"../utils/index.js";import{telemetry as fe}from"../../cli/telemetry/index.js";import{telemetryTraceStep as b}from"../../cli/telemetry/helpers/trace-step.js";import{EntitlementsProvider as A}from"../entitlements/entitlements-provider.js";import{enforceLoginPlugin as me}from"./enforce-login/index.js";import{ssoPlugin as de}from"./sso/index.js";import{Cache as ge}from"../fs/cache.js";import{ContentFs as pe}from"../fs/content-fs.js";import{findProductBySlug as Pe}from"../utils/product.js";import{isRouteReserved as ye}from"./get-reserved-routes.js";import{catalogClassicPlugin as he}from"./catalog-classic/index.js";import{arazzoDocsPlugin as Re}from"./arazzo-docs/index.js";const Ce=[I,me,de,Q,re,K,G,Re,ee,te,Z,U,X,he,{importPath:"./catalog-entities/plugin.js",loadCondition:()=>S.NEW_CATALOG_ENABLED??!1},{importPath:"./scorecards/plugin.js",loadCondition:()=>S.NEW_SCORECARDS_ENABLED??!1},{importPath:"./mcp/index.js",loadCondition:()=>A.instance().canAccessFeature("mcp")},ie,le,ce,Y,J,B,ae,...se];async function Pt(t,e=Ce){return await b("com.redocly.build.pluginsInit",async()=>{const r=[],R=A.instance(),y={};for(const s of e){let u;if("loadCondition"in s){if(!s.loadCondition())continue;const i=await import(s.importPath);if(!i.default||typeof i.default!="function"){await v.panicOnBuild(`Dynamic plugin ${s.importPath} does not export a default export or it is not a function`);continue}u=i.default}else u=s;const h=await u(t);for(const[i,f]of Object.entries(h.loaders||{}))y[i]&&await v.panicOnBuild(`Duplicate loader with name ${i}`),y[i]=f;(!h.requiredEntitlements||h.requiredEntitlements?.every(i=>R.canAccessFeature(i)))&&r.push(h)}const l=new pe(t.contentDir);await l.ready;const c=new ge(l);return c.setLoaders(y),P.verbose("All plugins instantiated"),{pluginInstances:r,lifecycleContext:be(l,c)}})}function O(t){P.verbose("Generating templates"),b("com.redocly.build.writeClientEntries",()=>{H(t),q(t),z(t)})}async function ve(t){const e=t.getAllRoutes();ue(e)||await v.panicOnBuild("No routes created by plugins. Please check your project configuration.")}async function yt(t,e,r,R={}){const y=A.instance();try{await b("com.redocly.build.pluginsRun",async()=>{e.startPluginsRun();const l=S.isDevelopMode&&e.buildRevision>0,c=l?F(e):"";let s=[];await b("com.redocly.build.pluginsProcessContent",async i=>{for(const o of t){const a=P.startTiming();await o.processContent?.(e,r),P.verboseTime(a,`processContent for ${o.id}`)}s=(await oe(e.contentDir,e.config.plugins)).map(o=>o.lifecyclePlugin).filter(o=>$(o)&&(!o.requiredEntitlements||o.requiredEntitlements?.every(a=>y.canAccessFeature(a)))),r.cache.setLoaders(Object.fromEntries(s.flatMap(o=>Object.entries(o.loaders||{}))));for(const o of s){const a=P.startTiming();await o.processContent?.(e,r),P.verboseTime(a,`processContent for ${o.id}`)}i?.setAttribute("externalPluginsProcessed",s.length.toString())});const u=await we(e,r),h=[...t,...s];O(e),S.isDevelopMode?await e.userCodeReady:e.buildRevision++,await b("com.redocly.build.pluginsAfterRoutesCreated",async()=>{for(const i of h){const f=P.startTiming();await i.afterRoutesCreated?.(e,u),P.verboseTime(f,`afterRoutesCreated for ${i.id}`)}}),ne(e),await e.reportUnsetEnvVars(),await ve(e),O(e),l&&c!==F(e)&&(e.markRequestHandlersEntryOutdated(),_(e.serverOutDir))})}catch(l){const c="Unhandled error in plugin. "+l.message+`
|
|
2
2
|
`+l.stack;fe.sendCliErrorCaughtMessage([{id:"cli",object:"error",uri:"urn:redocly:realm:cli:error:cli",message:c}]),R.failFast?await v.panic(c):await v.panicOnBuild(c)}finally{e.finishPluginsRun()}}async function we(t,e){const{cache:r,fs:R}=e,y=await e.getConfig(),l=Object.values(y.products||{}),c=(await r.load("versions-config","versions-config")).data,s=(await r.load("content-slugs","content-slugs")).data,u=W(s);for(const{duplicateInAllLocales:i,slugSuffix:f,sharedData:o=[],redirectFrom:a=[],...d}of t.newRoutes){const w=D(d.slug?d.slug:u(d.fsPath)),g=N(f?E(w,f):w),n={...d,[x]:{slug:g,fsPath:d.fsPath},slug:g,baseSlug:w,versions:h(d.fsPath,f),product:Pe(l,g,u)};ye(g,y)&&await v.panicOnBuildContentError(`Route "${g}" is reserved and cannot be used. Please choose a different slug for "${d.fsPath}".`),t.routesByFsPath.set(n.fsPath,n.slug),t.routesBySlug.set(n.slug,n);for(const{key:p,id:m}of o)t.addRouteSharedData(n.slug,p,m);for(const p of a)t.addRedirect(p.from,{type:p.type,to:n.slug});if(i)for(const p of R.localeFolders){const m={...n,slug:"/"+p.toLowerCase()+n.slug};t.routesByFsPath.set(m.fsPath,m.slug),t.routesBySlug.set(m.slug,m);for(const{key:C,id:T}of o)t.addRouteSharedData(m.slug,C,T);for(const C of a){const T=E(R.localizationFolder,p,C.from);t.addRedirect(T,{type:C.type,to:m.slug},{trackOriginalSource:!1})}}}return t.newRoutes=[],{...e,slugify:u};function h(i,f=""){const o=V(i);if(!o?.versionName)return;const{versionFolderPath:a,filePathInVersion:d,versionName:w}=o,g=c.get(a);if(g)return g.versions.map(n=>{const p=g.defaultVersion===n.version,m=j(E(a,k+n.version,d)),C=u(m);return{version:n.version,label:n.name||n.version,link:D(E(C,f)),default:p,active:w===n.version,folderId:M(`${a}`)}})}}function be(t,e){return{fs:t,cache:e,getConfig:async(r=".")=>(await e.load(r,"nearest-redocly-config",t.localeFolders)).data,isPathIgnored:async r=>(await e.load(r,"is-ignored")).data,withPathPrefix:L,logger:P}}function F(t){return[...t.apiRoutesRequestHandlers.keys(),...t.getMcpTools().map(e=>`${e.name}:${e.importPath}`)].sort().join(",")}export{Ce as INTERNAL_PLUGINS,be as createLifecycleContext,Pt as initPlugins,yt as runPlugins,O as writeClientEntries};
|
|
@@ -6,4 +6,5 @@ export type OpenapiBundle = {
|
|
|
6
6
|
rawOptions: RawApiDocsOptions;
|
|
7
7
|
};
|
|
8
8
|
export declare function loadOpenapiBundle(node: Node, context: LifecycleContext): Promise<OpenapiBundle | undefined>;
|
|
9
|
+
export declare function loadFullOpenapiBundle(node: Node, context: LifecycleContext): Promise<OpenapiBundle | undefined>;
|
|
9
10
|
//# sourceMappingURL=load-openapi-bundle.d.ts.map
|