@redocly/framework 1.0.0-next.1 → 1.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler/build/run.js +1 -1
- package/dist/bundler/build/vite-config.js +2 -2
- package/dist/bundler/vite-config.base.js +8 -8
- package/dist/cli/commands/translate.js +1 -1
- package/dist/cli/validate-react-pages.js +1 -1
- package/dist/client/RuntimeLink.js +1 -0
- package/dist/client/app.js +3 -3
- package/dist/client/experiments/runtime.js +1 -1
- package/dist/client/use-router-for-local-links.js +1 -1
- package/dist/client/utils/routes/is-router-path.js +1 -0
- package/dist/content-layer/config-schema.d.ts +7 -2
- package/dist/content-layer/config-schema.js +1 -1
- package/dist/content-layer/config.d.ts +22 -9
- package/dist/content-layer/config.js +1 -1
- package/dist/content-layer/context.d.ts +2 -0
- package/dist/content-layer/context.js +1 -1
- package/dist/content-layer/database/assets.js +1 -1
- package/dist/content-layer/database/blobs.js +1 -1
- package/dist/content-layer/database/entity-store.d.ts +5 -0
- package/dist/content-layer/database/entity-store.js +1 -1
- package/dist/content-layer/database/files.js +1 -1
- package/dist/content-layer/database/finalize.js +1 -1
- package/dist/content-layer/database/invalidation.d.ts +6 -0
- package/dist/content-layer/database/invalidation.js +26 -26
- package/dist/content-layer/database/link-refs.js +1 -1
- package/dist/content-layer/database/origins.js +1 -1
- package/dist/content-layer/database/problems.js +1 -1
- package/dist/content-layer/database/reset.js +1 -1
- package/dist/content-layer/database/route-query-deps.js +1 -1
- package/dist/content-layer/database/schema.d.ts +33 -0
- package/dist/content-layer/database/schema.js +1 -1
- package/dist/content-layer/database/search-vocab.js +2 -2
- package/dist/content-layer/database/site-config.d.ts +23 -0
- package/dist/content-layer/database/site-config.js +1 -1
- package/dist/content-layer/database/static-files.js +1 -1
- package/dist/content-layer/ingest/finalize-phase.js +1 -1
- package/dist/content-layer/ingest/hook-inputs.js +1 -1
- package/dist/content-layer/ingest/run.js +1 -1
- package/dist/content-layer/ingest/search-sync.js +1 -1
- package/dist/content-layer/ingest/sync.js +1 -1
- package/dist/content-layer/link-checker/delta.js +1 -1
- package/dist/content-layer/link-checker/run-build.js +1 -1
- package/dist/content-layer/loaders/context.js +1 -1
- package/dist/content-layer/markdown/client/markdoc-components.js +2 -2
- package/dist/content-layer/markdown/constants/builtin-tags.js +1 -1
- package/dist/content-layer/markdown/constants/tag-sets.d.ts +2 -0
- package/dist/content-layer/markdown/constants/tag-sets.js +1 -1
- package/dist/content-layer/markdown/nodes/heading.js +1 -1
- package/dist/content-layer/markdown/nodes/table.js +1 -1
- package/dist/content-layer/markdown/resolve/ast.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/code-snippet.js +5 -4
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/code-walkthrough/filesets.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/diagram-file.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/file-reference.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/json-schema.d.ts +2 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/json-schema.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/operation-samples.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/partial.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/svg-content.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc.js +1 -1
- package/dist/content-layer/markdown/resolve/raw-partials.d.ts +2 -1
- package/dist/content-layer/markdown/resolve/raw-partials.js +1 -1
- package/dist/content-layer/markdown/resolve/render-diagrams.d.ts +8 -1
- package/dist/content-layer/markdown/resolve/render-diagrams.js +1 -1
- package/dist/content-layer/markdown/search/to-markdown.js +1 -1
- package/dist/content-layer/markdown/search/to-sections.js +1 -1
- package/dist/content-layer/markdown/search/to-text.d.ts +4 -1
- package/dist/content-layer/markdown/search/to-text.js +5 -5
- package/dist/content-layer/markdown/tags/markdoc-error.d.ts +8 -0
- package/dist/content-layer/markdown/tags/markdoc-error.js +1 -1
- package/dist/content-layer/markdown/tags/variant.d.ts +6 -0
- package/dist/content-layer/markdown/tags/variant.js +1 -0
- package/dist/content-layer/markdown/utils/collect-anchors.js +1 -1
- package/dist/content-layer/markdown/utils/collect-headings.d.ts +3 -1
- package/dist/content-layer/markdown/utils/collect-headings.js +1 -1
- package/dist/content-layer/markdown/utils/first-heading.js +1 -1
- package/dist/content-layer/markdown/utils/heading-slugger.d.ts +8 -0
- package/dist/content-layer/markdown/utils/heading-slugger.js +1 -1
- package/dist/content-layer/markdown/utils/node-source-range.d.ts +3 -3
- package/dist/content-layer/markdown/utils/node-source-range.js +1 -1
- package/dist/content-layer/materialization/asset-reconcile.js +1 -1
- package/dist/content-layer/materialization/entity.js +1 -1
- package/dist/content-layer/plan-gates.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/client/template.js +4 -4
- package/dist/content-layer/plugins/internal/api-docs/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/build-sidebar.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/search-documents.d.ts +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/search-documents.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/server/api-function-telemetry.js +1 -0
- package/dist/content-layer/plugins/internal/api-functions/server/dispatch.js +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/resolve-items.d.ts +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/sidebars.d.ts +1 -1
- package/dist/content-layer/plugins/internal/markdoc/index.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/content-tools.d.ts +4 -1
- package/dist/content-layer/plugins/internal/mcp/content-tools.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/index.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/custom-tools.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/mcp-telemetry.js +1 -1
- package/dist/content-layer/plugins/internal/react-page/index.d.ts +3 -2
- package/dist/content-layer/plugins/internal/react-page/index.js +1 -1
- package/dist/content-layer/plugins/internal/sidebar/bundle.d.ts +2 -1
- package/dist/content-layer/plugins/internal/sidebar/bundle.js +1 -1
- package/dist/content-layer/plugins/internal/sidebar/index.d.ts +2 -1
- package/dist/content-layer/plugins/internal/sidebar/index.js +1 -1
- package/dist/content-layer/plugins/types/plugin.d.ts +5 -0
- package/dist/content-layer/plugins/types/search.d.ts +13 -2
- package/dist/content-layer/plugins/utils/link-access.js +1 -1
- package/dist/content-layer/problems/codes.d.ts +10 -0
- package/dist/content-layer/problems/codes.js +1 -1
- package/dist/content-layer/revisions/delete.js +1 -1
- package/dist/content-layer/search/engine/core/search-engine.js +1 -1
- package/dist/content-layer/search/facet-rows.js +1 -1
- package/dist/content-layer/search/keywords.d.ts +18 -0
- package/dist/content-layer/search/keywords.js +1 -0
- package/dist/content-layer/search/postings/postings-store.d.ts +14 -0
- package/dist/content-layer/search/postings/postings-store.js +1 -1
- package/dist/content-layer/search/store.d.ts +14 -1
- package/dist/content-layer/server/database.js +1 -1
- package/dist/content-layer/versions/group-info.d.ts +21 -0
- package/dist/content-layer/versions/group-info.js +1 -0
- package/dist/content-layer/versions/redirect.d.ts +13 -11
- package/dist/content-layer/versions/redirect.js +1 -1
- package/dist/content-layer/versions/resolve.d.ts +1 -21
- package/dist/content-layer/versions/resolve.js +1 -1
- package/dist/content-layer/versions/version-groups.d.ts +1 -1
- package/dist/content-layer/versions/version-groups.js +1 -1
- package/dist/server/__tests__/rbac-fixture.js +1 -1
- package/dist/server/app.js +3 -3
- package/dist/server/content.js +9 -8
- package/dist/server/html-tags.js +2 -1
- package/dist/server/lambda-entry.js +1 -1
- package/dist/server/node-entry.js +1 -1
- package/dist/server/page-handlers.js +1 -1
- package/dist/server/plugin-context.js +1 -1
- package/dist/server/project-env.d.ts +12 -0
- package/dist/server/project-env.js +1 -0
- package/dist/server/redirects.js +1 -1
- package/dist/server/runtime-config.js +1 -1
- package/dist/server/search/route.js +1 -1
- package/dist/server/search/search-telemetry.js +1 -0
- package/dist/server/ssrf/ssrf-blocklist.js +1 -1
- package/dist/server/subprocess/runner.js +1 -1
- package/dist/shared/constants/dependency-pack.js +1 -1
- package/dist/shared/constants/l10n/langs/ar.js +1 -1
- package/dist/shared/constants/l10n/langs/de.js +1 -1
- package/dist/shared/constants/l10n/langs/en.js +1 -1
- package/dist/shared/constants/l10n/langs/es.js +1 -1
- package/dist/shared/constants/l10n/langs/fr.js +1 -1
- package/dist/shared/constants/l10n/langs/hi.js +1 -1
- package/dist/shared/constants/l10n/langs/it.js +1 -1
- package/dist/shared/constants/l10n/langs/ja.js +1 -1
- package/dist/shared/constants/l10n/langs/ko.js +1 -1
- package/dist/shared/constants/l10n/langs/pl.js +1 -1
- package/dist/shared/constants/l10n/langs/pt-br.js +1 -1
- package/dist/shared/constants/l10n/langs/pt.js +1 -1
- package/dist/shared/constants/l10n/langs/ru.js +1 -1
- package/dist/shared/constants/l10n/langs/uk.js +1 -1
- package/dist/shared/constants/l10n/langs/zh.js +1 -1
- package/dist/shared/experiments.js +1 -1
- package/dist/shared/load-dot-env.js +1 -1
- package/dist/shared/plan-gates.d.ts +3 -2
- package/dist/shared/public-env.d.ts +9 -0
- package/dist/shared/public-env.js +1 -1
- package/dist/shared/search/facets.d.ts +5 -0
- package/dist/shared/search/facets.js +1 -1
- package/dist/shared/types/search.d.ts +1 -0
- package/dist/shared/types/sidebar.d.ts +1 -0
- package/drizzle/20261103061150_site_config_effective_hash/migration.sql +1 -0
- package/drizzle/20261105151816_search_http_path_tokens/migration.sql +1 -0
- package/package.json +10 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compileRouteAccessMatcher as e,matchContentScope as t}from"../../../../server/rbac/engine.js";import{isObject as n}from"../../../../shared/utils/is-object.js";import{SPEC_KIND_OPENAPI as r}from"../../../plugins/types/api-entity.js";import{
|
|
1
|
+
import{compileRouteAccessMatcher as e,matchContentScope as t}from"../../../../server/rbac/engine.js";import{isObject as n}from"../../../../shared/utils/is-object.js";import{SPEC_KIND_OPENAPI as r}from"../../../plugins/types/api-entity.js";import{markdocNodeProblem as i}from"../../utils/node-source-range.js";import{createLruCache as a}from"../../../../shared/utils/lru-cache.js";import{parseMarkdownCached as o}from"../../utils/parse-cache.js";import{resolveResolverTarget as s}from"./context-paths.js";import{createApiEntityKey as c}from"../../../plugins/utils/api-entity-key.js";import{withMockServerOption as l}from"../../../plugins/internal/api-docs/server/options.js";import{annotateApiDocsRbac as u}from"../../../../server/rbac/api-docs.js";import{posix as d}from"node:path";import{REDOCLY_TEAMS_RBAC as f}from"@redocly/config";const p={curl:`shell`,JavaScript:`javascript`,"Node.js":`javascript`,Python:`python`,Java:`java`,"Java8+Apache":`java`,"C#":`csharp`,"C#+Newtonsoft":`csharp`,PHP:`php`,Go:`go`,Ruby:`ruby`,R:`r`},m=/* @__PURE__ */ new WeakMap;async function h(e){let t=m.get(e.node);t===void 0&&(t=g(e),m.set(e.node,t));let n=await t;return{definition:n.definition,problems:n.problems.splice(0)}}async function g(e){let t=e.node.attributes.descriptionFile;if(typeof t!=`string`||t===``||e.entities===void 0)return{definition:null,problems:[]};let n=s(e,t);if(n===null)return _(e,`descriptionFile "${t}" must stay inside the content directory`);let r=c(n.contentPath),i=await e.entities.get(r);return i===null||i.type!==`api`?_(e,`no API description found at ${n.contentPath}`):i.metadata?.specType===`openapi`?{definition:{contentPath:n.contentPath,document:await e.entities.load(r),metadata:i.metadata??{},dataHash:i.status===`ready`?i.dataHash??null:null},problems:[]}:_(e,`${n.contentPath} is not an OpenAPI description`)}function _(e,t){return e.logger?.warn(`${e.node.tag} in ${e.sourceFilePath}: ${t}`),e.node.attributes.descriptionFileInvalid=!0,{definition:null,problems:[i(e.node,t,e.sourceFilePath)]}}const v=(e,t)=>e.node.attributes[t]??void 0;function y(e){let t=n(e.options)?e.options:{};return n(t.mockServer)?{...t,mockServer:{...t.mockServer,position:`off`}}:t}function b(e,t){let r=v(e,`language`),i=v(e,`options`);return{...t,...i,codeSamples:{...n(t.codeSamples)?t.codeSamples:{},...i?.codeSamples,...r&&{languages:[{lang:r}]}}}}async function x(e){let{definition:t,problems:n}=await h(e);if(t===null)return{problems:n};let{buildCodeSamples:r,getRequestBodySamples:i,normalizeOptions:a,resolveOperationSampleContext:s}=await import(`@redocly/api-docs`),c=a({specType:`openapi`,...b(e,y(t.metadata)),markdownParser:o}),l=s(t.document,c,{operationId:v(e,`operationId`),pointer:v(e,`pointer`)});if(!l)return null;let u={exampleKey:v(e,`exampleKey`),mimeType:v(e,`mimeType`),parameters:v(e,`parameters`),requestBody:v(e,`requestBody`),environments:v(e,`environments`),environment:v(e,`environment`)},d=r(l,u).map(e=>({lang:p[e.lang]??e.lang.toLowerCase(),title:e.label??e.lang,source:e.source})),f=c.codeSamples?.languages??[],m=f.findIndex(({lang:e})=>e===`Payload`);if(m!==-1){let e=i(l,{exampleKey:u.exampleKey,mimeType:u.mimeType,titlePrefix:f[m].label});d.splice(m,0,...e)}return d.length>0&&(e.node.attributes[e.attributeName]=d),null}async function S(e){let{definition:t,problems:n}=await h(e);if(t===null)return{problems:n};let{getResponseSamples:r,normalizeOptions:i,resolveOperationSampleContext:a}=await import(`@redocly/api-docs`),s=a(t.document,i({specType:`openapi`,...y(t.metadata),markdownParser:o}),{operationId:v(e,`operationId`),pointer:v(e,`pointer`)});if(!s)return null;let c=r(s,{exampleKey:v(e,`exampleKey`)});return c.length>0&&(e.node.attributes[e.attributeName]=c),null}const C=a({budget:4});function w(e,t,n){let i=async()=>{let{buildItems:i}=await import(`@redocly/api-docs`),a=u(t.document,r,{warn:t=>e.logger?.warn(t)}),{items:s,store:c}=await i({type:r,document:a,options:{...n,specType:r,markdownParser:o},basePath:`/`,markdownParser:o});return{items:s,store:c}};if(t.dataHash===null)return i();let a=JSON.stringify([t.contentPath,t.dataHash,n]),s=C.get(a);return s===void 0&&(s=i(),C.set(a,s)),s}function T(e){return e.startsWith(`#`)?e.slice(1):e}function E(e,t){let n=v(t,`pointer`),r=v(t,`operationId`);if(n!==void 0||r!==void 0)for(let i of e){let e=i.content?.meta;if(n!==void 0&&e?.pointer!==void 0&&T(e.pointer)===T(n)||r!==void 0&&e?.sourceId===r)return i;let a=E(i.items??[],t);if(a!==void 0)return a}}function D(e){return e[f]}function O(e,t,n){for(let r of e){if(r.nodeType!==`container`)continue;let e=D(r)??n;for(let n of r.panels??[]){let r=`children`in n?n.children.find(t):void 0;if(r!==void 0){let t=D(n)??e;return{entry:r,scope:t===void 0?{}:{[f]:t}}}}let i=O(r.children,t,e);if(i!==void 0)return i}}async function k(e,t){return F(e,t,await P(e,t))}async function A(e){let{definition:t,problems:n}=await h(e);if(t===null)return{problems:n};let r=y(t.metadata),{items:i,store:a}=await w(e,t,r),o=E(i,e),s=o?.content?O(o.content.children,e=>e.kind===`code-sample`,D(o)):void 0;if(s===void 0)return null;let c=s.entry,{appendUndeclaredConfigureParameters:l}=await import(`@redocly/api-docs`),u=v(e,`parameters`),d={apiStore:a,options:b(e,r),panel:{...c,source:l(c.source,{...u?.path&&{path:u.path},...u?.query&&{query:u.query},...u?.header&&{headers:u.header},...u?.cookie&&{cookie:u.cookie}}),...s.scope},...await k(e,t.contentPath)};return e.node.attributes[e.attributeName]=d,null}async function j(e){let{definition:t,problems:n}=await h(e);if(t===null)return{problems:n};let r=y(t.metadata),{items:i,store:a}=await w(e,t,r),o=E(i,e),s=o?.content?O(o.content.children,e=>e.kind===`response`&&!!e.responseCodes?.length,D(o)):void 0;if(s?.entry.responseCodes===void 0)return null;let c={apiStore:a,options:r,panel:{responseCodes:s.entry.responseCodes,...s.entry.schemaId!==void 0&&{schemaId:s.entry.schemaId},...s.scope},...await k(e,t.contentPath)};return e.node.attributes[e.attributeName]=c,null}async function M(e){let t=v(e,`pointer`);if(t===void 0)return null;let{definition:n,problems:r}=await h(e);if(n===null)return{problems:r};let i=y(n.metadata),{items:a,store:o}=await w(e,n,i),s=T(t).replace(/^\//,``),c=Object.fromEntries([s,s.replace(/\/value$/,``)].filter(e=>o.exampleStore[e]!==void 0).map(e=>[e,o.exampleStore[e]]));if(Object.keys(c).length===0)return null;let l=(await import(`@redocly/api-docs`)).findExampleEncoding(a,t),u={apiStore:{schemaStore:{},exampleStore:c,securitySchemeStore:{}},options:{...i,...v(e,`options`)},...l!==void 0&&{encoding:l},...await k(e,n.contentPath)};return e.node.attributes[e.attributeName]=u,null}function N(e,t,n,r,i){if(!e.requestBody||!t&&!n)return e;let a={...e.requestBody};if(t&&(a=a[t]?{[t]:a[t]}:{}),n)for(let[e,t]of Object.entries(a)){let o=t.exampleIds?.filter(e=>r[e]?.key!==void 0);if(!o?.length)continue;let s=i(o,n,e=>r[e]);a[e]={...t,exampleIds:s?[s]:[]}}return{...e,requestBody:a}}async function P(e,t){let n=d.relative(d.dirname(e.sourceFilePath),t),{result:r}=await e.markdown.resolveLocalReference(n,e.sourceFilePath);return r.kind===`pageUrl`?r.url:void 0}function F(n,r,i){let a=e(n.config);if(a===null)return{};let o=t(a,{filePath:r,slug:i??null});return{[f]:o??{}}}async function I(e){let{definition:t,problems:i}=await h(e);if(t===null)return{problems:i};let{findExampleIdByKey:a,JsonPointer:s,normalizeOptions:c,resolveOperationSampleContext:d}=await import(`@redocly/api-docs`),f=t.metadata,p=n(f.options)?f.options:{},m=await P(e,t.contentPath),g=l(p,e.config,m),_=v(e,`options`),y={...g,..._??{}},b=c({specType:`openapi`,...y,markdownParser:o}),x=u(t.document,r,{warn:t=>e.logger?.warn(t)}),S=d(x,b,{operationId:v(e,`operationId`),pointer:v(e,`pointer`)});if(!S)return null;let C=N(S.source,v(e,`mimeType`),v(e,`exampleKey`),S.storeCtx.exampleStore,a),w={apiStore:{schemaStore:S.storeCtx.schemaStore,exampleStore:S.storeCtx.exampleStore,securitySchemeStore:S.storeCtx.securitySchemeStore,specVersion:x.openapi},definition:x,operationId:S.operation.operationId??``,operationSource:C,options:y,pointer:s.compile([`paths`,S.pathName,S.method.toLowerCase()]),...F(e,t.contentPath,m)};return e.node.attributes[e.attributeName]=w,null}export{A as resolveOpenapiCodeSamplePanelAttribute,x as resolveOpenapiCodeSamplesAttribute,M as resolveOpenapiExampleAttribute,I as resolveOpenapiReplayAttribute,j as resolveOpenapiResponsePanelAttribute,S as resolveOpenapiResponseSamplesAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocErrorResult as e,replaceWithMarkdocError as t}from"../../tags/markdoc-error.js";import{shiftRange as n}from"../../../../shared/utils/shift-range.js";import{inlinedLinkRefs as r}from"../../../link-checker/node-ref.js";import{resolveResolverTarget as i}from"./context-paths.js";import{getPartialsFolders as a,isPartialPath as o}from"../../utils/partials.js";import{FRONTMATTER_BLOCK_RE as s,computeFrontmatterLineOffset as c}from"../../utils/frontmatter-offset.js";import{substituteStaticVariables as l}from"../../utils/substitute-variables.js";import{resolveMarkdocBuildTimeAttributes as u}from"../markdoc.js";async function d(n){let{node:d,attributeName:p}=n,m=d.attributes[p];if(typeof m!=`string`||m===``||n.io===void 0)return null;let h=i(n,m);if(h===null)return null;if(!o(h.contentPath,n.config)){let t=`Partial ${h.contentPath} must live in a partials folder (markdown.partialsFolders: ${a(n.config).join(`, `)})`;return e(d,t,n.sourceFilePath)}let g=n.partialChain??[n.sourceFilePath];if(g.includes(h.contentPath))return t(d,`Circular partial inclusion: ${[...g,h.contentPath].join(` -> `)}`),{entityDeps:[{kind:`file`,path:h.contentPath}]};if(!await n.io.exists(h.absolutePath)){let t=`Partial file ${h.contentPath} does not exist`;return e(d,t,n.sourceFilePath,[{kind:`file`,path:h.contentPath}])}let _=await n.io.readFile(h.absolutePath),v=_.replace(s,``),y=structuredClone(n.markdown.parseCached(v)),b=await u(y,{tags:n.tags,sourceFilePath:h.contentPath,resolverContext:{config:n.config,contentDir:n.contentDir,entities:n.entities,file:n.file,io:n.io,logger:n.logger,markdown:n.markdown,plugin:n.plugin},partialChain:[...g,h.contentPath],source:v}),x=d.attributes.variables;typeof x==`object`&&x&&!Array.isArray(x)&&l(y,x),d.children=y.children;let S=c(_);return{entityDeps:[{kind:`file`,path:h.contentPath},...b.entityDeps],assetUsages:b.assetUsages,linkRefs:r(b.linkRefs,h.contentPath,S),problems:b.problems.map(e=>f(e,S))}}function f(e,t){if(t===0||e.location?.range===void 0)return e;let r={...e.location,range:n(e.location.range,t)};return{...e,location:r}}export{d as resolvePartialFileAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{delocalizeL10nPath as e}from"../../../../shared/utils/l10n.js";import{
|
|
1
|
+
import{delocalizeL10nPath as e}from"../../../../shared/utils/l10n.js";import{markdocErrorResult as t}from"../../tags/markdoc-error.js";import{resolveResolverTarget as n}from"./context-paths.js";import{prefixSvgIds as r}from"../../utils/prefix-svg-ids.js";async function i(i,a={}){let{node:o,attributeName:s}=i,c=o.attributes[s];if(typeof c!=`string`||c===``||i.io===void 0)return null;let l=n(i,c);if(l===null)return null;let u=[{kind:`file`,path:l.contentPath}],d=l;if(!await i.io.exists(l.absolutePath)){let r=e(i.sourceFilePath);if(d=r===void 0?null:n({...i,sourceFilePath:r},c),d===null||!await i.io.exists(d.absolutePath)){if(a.optional)return null;let e=`SVG file ${l.contentPath} does not exist`;return t(o,e,i.sourceFilePath,u)}u.push({kind:`file`,path:d.contentPath})}let f=await i.io.readFile(d.absolutePath),p=d.contentPath.replace(/[^a-zA-Z0-9_-]/g,`-`);return o.attributes[`${s}RawContent`]=r(f,p),{entityDeps:u}}export{i as resolveSvgContentAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{replaceWithMarkdocError as
|
|
1
|
+
import{markdocErrorResult as e,replaceWithMarkdocError as t}from"../tags/markdoc-error.js";import{walkMarkdocAst as n}from"../utils/walk-markdoc-ast.js";import{getExampleContent as r,walkWithExampleContent as i}from"../utils/reparse-example-fences.js";import{isLocalReference as a}from"./references.js";import{resolveLinkAttribute as o}from"./markdoc-resolvers/link.js";import{resolveIconAttribute as s,resolveImageAttribute as c,resolveImageSrcSetAttribute as l}from"./markdoc-resolvers/image.js";import{resolveCodeSnippetFileAttribute as u}from"./markdoc-resolvers/code-snippet.js";import{resolveSvgContentAttribute as d}from"./markdoc-resolvers/svg-content.js";import{resolveTagRawContentAttribute as f}from"./markdoc-resolvers/tag-raw-content.js";import{resolveHtmlAttrsAttribute as p}from"./markdoc-resolvers/html-attrs.js";import{resolveImageGalleryAttribute as m}from"./markdoc-resolvers/image-gallery.js";import{resolveCodeWalkthroughFilesetsAttribute as h}from"./markdoc-resolvers/code-walkthrough/filesets.js";import{resolvePartialFileAttribute as g}from"./markdoc-resolvers/partial.js";import{resolveDiagramFileAttribute as _}from"./markdoc-resolvers/diagram-file.js";import{resolveParsedYamlAttribute as v,resolveRawContentAttribute as y,resolveRelativePathAttribute as b}from"./markdoc-resolvers/file-reference.js";import{resolveJsonExampleRefAttribute as x,resolveJsonSchemaRefAttribute as S,resolveSampleFromJsonSchemaAttribute as C}from"./markdoc-resolvers/json-schema.js";import{resolveOpenapiCodeSamplePanelAttribute as w,resolveOpenapiCodeSamplesAttribute as T,resolveOpenapiExampleAttribute as E,resolveOpenapiReplayAttribute as D,resolveOpenapiResponsePanelAttribute as O,resolveOpenapiResponseSamplesAttribute as k}from"./markdoc-resolvers/operation-samples.js";import{getAttributeBuildTimeResolver as A}from"./attribute-resolver-key.js";import{PROMPT_TAG as j}from"@redocly/theme/core/constants";import{convertGithubAlertToAdmonition as M}from"@redocly/theme/markdoc/tags/admonition";async function N(e,a){let o=a.tags??{},s=F,c={entityDeps:[],assetUsages:[],linkRefs:[],problems:[]},l=a.resolverContext?.markdown?.disabledTags,u=R(a.source),d=[...n(e,{skipChildren:z})],f=d.flatMap(e=>{let t=r(e);return t?[...i(t,z)]:[]});for(let e of[...d,...f])M(e);let p=f.filter(e=>e.type===`tag`);for(let e of[...d,...p])if(e.type===`link`)await L(s.nativeMdLink,e,`href`,a,c,u);else if(e.type===`image`)await L(s.imageSrc,e,`src`,a,c,u);else if(e.type===`tag`){if(typeof e.tag==`string`&&l?.has(e.tag)){t(e,`The "${e.tag}" tag is not available here.`);continue}let n=typeof e.tag==`string`?o[e.tag]:void 0;for(let[t,r]of Object.entries(n?.attributes??{})){let n=A(r);if(!n)continue;let i=s[n];i&&await L(i,e,t,a,c,u)}}return c}const P=({attributeName:e,markdown:t,node:n,partialChain:r,sourceFilePath:i})=>o(n,e,i,t,r?.[0]),F={imageSrc({attributeName:e,markdown:t,node:n,sourceFilePath:r}){return c(n,e,r,t)},imageSrcSet({attributeName:e,markdown:t,node:n,sourceFilePath:r}){return l(n,e,r,t)},link:P,nativeMdLink:P,async relativeOrCdnIcon(e){let{attributeName:t,markdown:n,node:r,sourceFilePath:i}=e,a=r.attributes[t];return typeof a==`string`&&B(a)&&await d(e,{optional:!0}),s(r,t,i,n)},codeSnippetFile:u,diagramFile:_,svgContent:d,tagRawContent:f,htmlAttrs:p,imageGallery:m,codeWalkthroughFilesets:h,partialFile:g,jsonSchemaRef:S,sampleFromJsonSchema:C,jsonExampleRef:x,openapiCodeSamples:T,openapiCodeSamplePanel:w,openapiReplay:D,openapiResponseSamples:k,openapiResponsePanel:O,openapiExample:E,rawContent:y,parsedYaml:v,relativePath:b};function I(e){let t=/* @__PURE__ */ new Set;for(let n of i(e))n.type===`tag`&&typeof n.tag==`string`&&t.add(n.tag);return[...t].sort()}async function L(t,n,r,i,a,o){let s;try{s=await t({...i.resolverContext,attributeName:r,node:n,sourceFilePath:i.sourceFilePath,tags:i.tags,partialChain:i.partialChain,readSourceLines:o})}catch(t){let r=t instanceof Error?t.message:String(t);s=e(n,r,i.sourceFilePath)}s&&(s.entityDeps&&a.entityDeps.push(...s.entityDeps),s.assetUsages&&a.assetUsages.push(...s.assetUsages),s.linkRefs&&a.linkRefs.push(...s.linkRefs),s.problems&&a.problems.push(...s.problems))}function R(e){let t;return()=>(t??=e.split(/\r?\n/),t)}function z(e){return e.type===`tag`&&e.tag===j}function B(e){let t=(e.split(`#`,1)[0]??e).split(`?`,1)[0]??e;return/\.svg$/i.test(t)&&a(e)}export{F as builtInMarkdocAttributeResolvers,I as collectMarkdocTagNames,z as isPromptTag,N as resolveMarkdocBuildTimeAttributes};
|
|
@@ -9,7 +9,8 @@ export type InlineRawPartialsResult = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Classic Realm's `{% raw-partial file="…" /%}`: the text of a Markdown file from a partials
|
|
11
11
|
* folder, inlined before parsing, so link reference definitions in it apply to the page. A
|
|
12
|
-
* `/` path is content-root-relative, any other is relative to the including file. A
|
|
12
|
+
* `/` path is content-root-relative, any other is relative to the including file. A missing
|
|
13
|
+
* `@l10n/<locale>/` file falls back to its default-locale twin, as in classic Realm. A file
|
|
13
14
|
* that is missing, not Markdown, outside the partials folders, or already being inlined
|
|
14
15
|
* inlines nothing and reports a problem.
|
|
15
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{delocalizeL10nPath as e}from"../../../shared/utils/l10n.js";import{resolveContentPath as t}from"../../../shared/utils/resolve-content-path.js";import{isPartialPath as n}from"../utils/partials.js";import{join as r}from"node:path";const i=/\{% ?raw-partial file="([^"]+)" ?\/?%\}/g;async function a(s,c,l,u=[c]){let d={source:s,entityDeps:[],problems:[]};if(!s.includes(`raw-partial`)||l.io===void 0)return d;let f=/* @__PURE__ */ new Map;for(let[,p]of s.matchAll(i)){if(p===void 0||f.has(p))continue;let i=t(p,c),s=``;if(i===null||!i.endsWith(`.md`)||!n(i,l.config))d.problems.push(o(c,`Raw partial "${p}" must be a Markdown file in a partials folder.`));else if(u.includes(i))d.problems.push(o(c,`Circular raw partial inclusion: ${[...u,i].join(` -> `)}`));else{d.entityDeps.push({kind:`file`,path:i});let t=e(i),n=i;if(await l.io.exists(r(l.contentDir,i))||(t!==void 0&&d.entityDeps.push({kind:`file`,path:t}),n=t!==void 0&&await l.io.exists(r(l.contentDir,t))?t:null),n!==null){let e=await a(await l.io.readFile(r(l.contentDir,n)),i,l,[...u,i]);s=e.source,d.entityDeps.push(...e.entityDeps),d.problems.push(...e.problems)}else d.problems.push(o(c,`Raw partial file ${i} does not exist.`))}f.set(p,s)}return d.source=s.replace(i,(e,t)=>f.get(t)??``),d}function o(e,t){return{code:`markdoc/validation-error`,severity:`warning`,message:t,location:{filePath:e}}}export{a as inlineRawPartials};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Node as MarkdocNode } from '@redocly/markdoc';
|
|
2
|
+
import type { ProblemDraft } from '../../problems/types.js';
|
|
2
3
|
import type { Logger } from '../../../shared/logger.js';
|
|
3
4
|
export type DiagramType = 'mermaid' | 'excalidraw' | 'plantuml';
|
|
4
5
|
export type DiagramInput = {
|
|
@@ -9,9 +10,15 @@ export type DiagramHtmlVariants = {
|
|
|
9
10
|
light: string;
|
|
10
11
|
dark: string;
|
|
11
12
|
error?: string;
|
|
13
|
+
/** True when the service gave no render, so a later render of the same source can succeed. */
|
|
14
|
+
retryable?: boolean;
|
|
12
15
|
};
|
|
13
16
|
/** Include the date in gantt hashes that show the current-day marker. */
|
|
14
17
|
export declare function generateDiagramHash(source: string, type?: DiagramType): string;
|
|
15
18
|
/** Return an error result when the diagram service fails. */
|
|
16
19
|
export declare function renderDiagramsWithVariants(diagrams: DiagramInput[], logger?: Logger): Promise<DiagramHtmlVariants[]>;
|
|
17
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Stamps the rendered SVG variants onto the diagram nodes of `ast`. Returns a
|
|
22
|
+
* `markdoc/diagram-service-failed` problem for each diagram the service did not render.
|
|
23
|
+
*/
|
|
24
|
+
export declare function renderMarkdocDiagrams(ast: MarkdocNode, sourceFilePath: string, logger?: Logger): Promise<ProblemDraft[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdocNodeProblem as e}from"../utils/node-source-range.js";import{DIAGRAM_LANGUAGES as t}from"../nodes/fence.js";import{walkWithExampleContent as n}from"../utils/reparse-example-fences.js";import{createHash as r}from"node:crypto";import{nanoid as i}from"nanoid";const a=/* @__PURE__ */ new Map;function o(e){return r(`sha256`).update(e).digest(`hex`)}function s(e,t=`mermaid`){let n=`${t}:${e}`;if(t===`mermaid`&&e.toLowerCase().includes(`gantt`)&&!e.toLowerCase().includes(`todaymarker off`)){let e=(/* @__PURE__ */ new Date()).toISOString().split(`T`)[0];return o(n+e)}return o(n)}function c(){return globalThis.process?.env?.REDOCLY_DIAGRAM_MICROSERVICE_URL||`https://tools.redocly.com/diagram-renders`}async function l(e,t,n){let r=await fetch(c(),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:e,definitions:t,rayId:n,theme:`both`})});if(r.status!==200)throw Error(`Diagram rendering service returned ${r.status}`);return await r.json()}async function u(e,t){if(e.length===0)return[];let n=/* @__PURE__ */ new Map;for(let{type:t,source:r}of e)if(!a.has(s(r,t))){let e=n.get(t)??[];e.push(r),n.set(t,e)}let r=/* @__PURE__ */ new Map;return await Promise.all([...n].map(async([e,n])=>{let o=i();try{let i=await l(e,n,o);for(let[o,c]of n.entries()){let n=i[o],l=s(c,e);if(!n||n.error){let i=n?.error??`empty service response`;t?.error(`Failed to render ${e} diagram: ${i}`),r.set(l,{light:``,dark:``,error:`Failed to render ${e} diagram: ${i}`,retryable:n===void 0})}else{let e={light:n.light??``,dark:n.dark??``};a.set(l,e),r.set(l,e)}}}catch(i){let a=i instanceof Error?i.message:String(i);t?.error(`Failed to render ${e} diagrams: ${a} (rayId: ${o})`);for(let t of n)r.set(s(t,e),{light:``,dark:``,error:`Failed to render ${e} diagram: ${a}`,retryable:!0})}})),e.map(({type:e,source:t})=>{let n=s(t,e);return r.get(n)??a.get(n)??{light:``,dark:``,error:`Diagram was not rendered`}})}function d(e){return typeof e==`string`&&t.has(e)}function f(e){let t=[];for(let r of n(e))if(r.type===`fence`){let{language:e,content:n}=r.attributes;d(e)&&typeof n==`string`&&t.push({node:r,input:{type:e,source:n}})}else if(r.type===`tag`&&r.tag===`diagram`){let{rawContent:e,type:n}=r.attributes;typeof e==`string`&&d(n)&&t.push({node:r,input:{type:n,source:e}})}return t}async function p(t,n,r){if(!globalThis.process?.versions?.node)return[];let i=f(t);if(i.length===0)return[];let a=await u(i.map(e=>e.input),r),o=[];for(let[t,{node:r}]of i.entries()){let i=a[t];r.attributes.diagramHtml=i.light,r.attributes.diagramHtmlDark=i.dark,i.error&&(r.attributes.diagramError=i.error,i.retryable&&o.push(e(r,i.error,n,`markdoc/diagram-service-failed`)))}return o}export{s as generateDiagramHash,u as renderDiagramsWithVariants,p as renderMarkdocDiagrams};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{headingSlugger as e}from"../utils/heading-slugger.js";import{getInnerText as t}from"../utils/get-inner-text.js";import{builtInMarkdocNodes as n,builtInMarkdocTags as r}from"../constants/builtin-tags.js";import{PROMPT_TAG as i}from"@redocly/theme/core/constants";import a from"@redocly/markdoc";const o=/* @__PURE__ */ new Set([`if`,`else`,i]),s=[`title`,`name`,`label`],c=((e,t)=>typeof t==`string`?t:e??``);function l(e,t={}){return f(e).map(e=>p({type:`document`,children:e},t)).filter(e=>e!==``)}function u(t,n={}){e.reset();let r=[],i=[];for(let e of f(t)){let t=p({type:`document`,children:e},n);t!==``&&(r.push(t),i.push(d(e[0],n.variables)))}return{chunks:r,headings:i}}function d(e,i){if(!v(e)||e.type!==`heading`)return null;let o=a.transform(a.Ast.fromJSON(JSON.stringify(e)),{nodes:n,tags:r,variables:i});if(!a.Tag.isTag(o))return null;let s=typeof o.attributes.id==`string`?o.attributes.id:``;return{heading:t(o.children),anchor:s}}function f(e){let t=v(e)&&Array.isArray(e.children)?e.children:[e],n=[],r=[];for(let e of t)(v(e)&&e.type===`heading`||n.length===0)&&(r=[],n.push(r)),r.push(e);return n}function p(e,t){let n=[];return g(e,n,{listDepth:0,ordered:!1,index:0,options:t}),n.join(``).replace(/(?<![ \t])[ \t]+\n/g,`
|
|
2
2
|
`).replace(/\n{3,}/g,`
|
|
3
3
|
|
|
4
4
|
`).trim()}function m(e,t={}){if(a.Ast.isVariable(e))return Object.hasOwn(t,String(e.path[0]))?new a.Ast.Variable(e.path).resolve({variables:t}):e;if(Array.isArray(e)){let n;for(let r=0;r<e.length;r++){let i=m(e[r],t);i!==e[r]&&((n??=e.slice())[r]=i)}return n??e}if(!v(e)||a.Ast.isAst(e))return e;let n;for(let[r,i]of Object.entries(e)){let a=m(i,t);a!==i&&((n??={...e})[r]=a)}return n??e}function h(e,t){let n=[];for(let r of e??[])g(r,n,t);return n.join(``).trim()}function g(e,t,n){if(!v(e)||e.type===`tag`&&e.tag!==void 0&&o.has(e.tag))return;let r=e.attributes??{},i=r.content;switch(e.type){case`text`:{let e=a.Ast.isVariable(i)?new a.Ast.Variable(i.path).resolve({variables:n.options.variables}):i;typeof e==`string`&&t.push(e);return}case`code`:typeof i==`string`&&t.push(`\`${i}\``);return;case`fence`:{let a=typeof r.language==`string`?r.language:``,o=[];for(let t of e.children??[])g(t,o,n);let s=e.children?.length?o.join(``):i,c=typeof s==`string`?s.replace(/\n$/,``):``;t.push(`\n\`\`\`${a}\n${c}\n\`\`\`\n\n`);return}case`softbreak`:t.push(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../server/rbac/types.js";import{HeadingSlugger as e}from"../utils/heading-slugger.js";import{hidesBodyFromSearch as t,markdocAstToText as n}from"./to-text.js";import{renderedHeadingText as r}from"../utils/heading-text.js";import{
|
|
1
|
+
import"../../../server/rbac/types.js";import{HeadingSlugger as e}from"../utils/heading-slugger.js";import{hidesBodyFromSearch as t,markdocAstToText as n}from"./to-text.js";import{renderedHeadingText as r}from"../utils/heading-text.js";import{isNonControlVariant as i}from"@redocly/theme/markdoc/tags/variant";import{isForAgentsOnly as a}from"@redocly/theme/markdoc/tags/visibility";const o=/^(page|section-\d+)-team-\d+$/;function s(e){return o.exec(e)?.[1]??e}function c(t,i,a={}){let o=g(t)&&Array.isArray(t.children)?t.children:[],s=new e,c={title:i,body:[]},u=[],d=c,f=!1,p=[],_=e=>{let t=e.attributes?.id;return typeof t==`string`?t:s.slug(r(e,a))};for(let e of o){if(!g(e)||e.type!==`heading`){d.body.push(e);for(let t of h(e))_(t);continue}let t=r(e,a),n=_(e),o=m(e);if(o===1){!f&&t!==``&&(c.title=t,f=!0),d=c,p.length=0;continue}let s=t||i,l=p.slice(0,o).filter(e=>e!==void 0);p.length=o,p[o]=s;let v={anchor:n,title:s,ancestors:l,body:[]};u.push(v),d=v}let v=e=>n({type:`document`,children:e}),y=(e,t)=>[e,...l(t).map(({teams:t,children:n},r)=>({...e,docKey:`${e.docKey}-team-${r+1}`,text:v(n),rbacTeams:t})).filter(e=>e.text!==``)];return[...y({docKey:`page`,title:c.title,text:v(c.body)},c.body),...u.flatMap((e,t)=>y({docKey:`section-${t+1}`,anchor:e.anchor,title:e.title,text:v(e.body),path:[c.title,...e.ancestors,e.title]},e.body))]}function l(e){let n=[],r=(e,i)=>{if(g(e)&&!t(e)){if(e.type===`tag`&&e.tag===`if`){let t=u(e.attributes?.primary);if(t===void 0)return;let a=i===void 0?t:t.filter(e=>i.includes(e));if(a.length===0)return;let o=e.children??[],s=o.findIndex(e=>g(e)&&e.type===`tag`&&e.tag===`else`),c=s===-1?o:o.slice(0,s);n.push({teams:a,children:c});for(let e of c)r(e,a);return}for(let t of Object.values(e.slots??{}))r(t,i);for(let t of e.children??[])r(t,i)}};for(let t of e)r(t,void 0);return n}function u(e){if(!f(e))return;let t=Object.values(e.parameters??{});if(e.name===`includes`){let e=d(t);return e===void 0?void 0:[e]}if(e.name!==`or`)return;let n=t.map(e=>f(e)&&e.name===`includes`?d(Object.values(e.parameters??{})):void 0).filter(e=>e!==void 0);return n.length===0?void 0:n}function d([e,t]){let n=p(e,`Variable`)?e.path:void 0;return Array.isArray(n)&&n.length===2&&n[0]===`rbac`&&n[1]===`teams`&&typeof t==`string`&&t!==`*`?t:void 0}function f(e){return p(e,`Function`)}function p(e,t){return typeof e==`object`&&!!e&&e.$$mdtype===t}function m(e){let t=e.attributes?.level;return typeof t==`number`?t:2}function*h(e){if(!(!g(e)||a(e)||i(e))){for(let t of e.children??[])g(t)&&t.type===`heading`&&(yield t),yield*h(t);for(let t of Object.values(e.slots??{}))yield*h(t)}}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{c as markdocAstToSearchSections,s as teamBlockSectionKey};
|
|
@@ -13,5 +13,8 @@ export type PlainNode = {
|
|
|
13
13
|
export declare function markdocAstToText(ast: unknown): string;
|
|
14
14
|
/** The first heading of a stored Markdoc AST, as text; `null` when there is none. */
|
|
15
15
|
export declare function markdocFirstHeading(ast: unknown): string | null;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* A node whose body search never indexes: agent-only content, a variant other than the control,
|
|
18
|
+
* or a prompt (only its title).
|
|
19
|
+
*/
|
|
17
20
|
export declare function hidesBodyFromSearch(node: PlainNode): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{PROMPT_TAG as e}from"@redocly/theme/core/constants";import{
|
|
2
|
-
`).trim()}function
|
|
3
|
-
`);return}if(
|
|
4
|
-
`);return}if(
|
|
5
|
-
`):(
|
|
1
|
+
import{PROMPT_TAG as e}from"@redocly/theme/core/constants";import{VARIANT_TAG as t,isNonControlVariant as n}from"@redocly/theme/markdoc/tags/variant";import{isForAgentsOnly as r}from"@redocly/theme/markdoc/tags/visibility";const i=/* @__PURE__ */ new Set([`document`,`paragraph`,`heading`,`blockquote`,`fence`,`list`,`item`,`table`,`thead`,`tbody`,`tr`,`hr`,`tag`]),a=/* @__PURE__ */ new Set([`if`,`else`]),o=[`title`,`name`,`label`];function s(e){let t=[];return u(e,t),t.join(``).replace(/[ \t]+/g,` `).replace(/(?<!\s)\s*\n\s*/g,`
|
|
2
|
+
`).trim()}function c(e){let t=[e];for(;t.length>0;){let e=t.pop();if(f(e)&&!l(e)){if(e.type===`heading`){let t=s({type:`paragraph`,children:e.children??[]});return t===``?null:t}t.push(...[...e.children??[]].reverse())}}return null}function l(t){return r(t)||n(t)||t.type===`tag`&&t.tag===e}function u(n,r){if(!f(n)||n.type===`tag`&&n.tag!==void 0&&a.has(n.tag))return;if(l(n)){n.tag===e&&d(n,r);return}let s=n.attributes?.content;if(n.type===`text`||n.type===`code`||n.type===`fence`){typeof s==`string`&&r.push(s),n.type===`fence`&&r.push(`
|
|
3
|
+
`);return}if(n.type===`softbreak`||n.type===`hardbreak`){r.push(`
|
|
4
|
+
`);return}if(n.type===`image`){let e=n.attributes?.alt;typeof e==`string`&&r.push(e);return}if(n.type===`tag`&&n.tag!==`html`&&n.tag!==t){let e=o.find(e=>typeof n.attributes?.[e]==`string`);e!==void 0&&r.push(`${n.attributes?.[e]}\n`)}for(let e of Object.values(n.slots??{}))u(e,r);for(let e of n.children??[])u(e,r);n.type!==void 0&&i.has(n.type)?r.push(`
|
|
5
|
+
`):(n.type===`td`||n.type===`th`)&&r.push(` `)}function d(e,t){let n=e.attributes?.title;typeof n==`string`&&n!==``&&t.push(`${n}\n`)}function f(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{l as hidesBodyFromSearch,s as markdocAstToText,c as markdocFirstHeading};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type Node as MarkdocNode, type Schema } from '@redocly/markdoc';
|
|
2
|
+
import type { MarkdocAttributeResolverResult } from '../../plugins/types/markdoc.js';
|
|
3
|
+
import type { EntityInvalidationDep } from '../../plugins/types/plugin.js';
|
|
2
4
|
export declare const MARKDOC_ERROR_TAG = "markdoc-error";
|
|
3
5
|
/**
|
|
4
6
|
* Engine-emitted diagnostic (partial cycle, disabled tag, failed resolver). A block
|
|
@@ -7,3 +9,9 @@ export declare const MARKDOC_ERROR_TAG = "markdoc-error";
|
|
|
7
9
|
export declare const markdocError: Schema;
|
|
8
10
|
/** Rewrite `node` in place into a `markdoc-error` tag carrying `message`. */
|
|
9
11
|
export declare function replaceWithMarkdocError(node: MarkdocNode, message: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* A resolver's failure: the node becomes a `markdoc-error` and the result reports `message`
|
|
14
|
+
* at the node's line in `sourceFilePath`. `entityDeps` are kept so the page resolves again
|
|
15
|
+
* once the file appears or changes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function markdocErrorResult(node: MarkdocNode, message: string, sourceFilePath: string, entityDeps?: readonly EntityInvalidationDep[]): MarkdocAttributeResolverResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@redocly/markdoc";const
|
|
1
|
+
import{markdocNodeProblem as e}from"../utils/node-source-range.js";import t from"@redocly/markdoc";const n=`markdoc-error`,r={selfClosing:!0,attributes:{message:{type:String,render:!1}},transform(e){let n=String(e.attributes.message??`Markdoc error`);return e.inline?new t.Tag(`MarkdocInlineError`,{},[n]):new t.Tag(`Admonition`,{type:`danger`},[n])}};function i(e,t){e.type=`tag`,e.tag=n,e.attributes={message:t},e.annotations=[],e.children=[]}function a(t,n,r,a=[]){return i(t,n),{entityDeps:a,problems:[e(t,n,r)]}}export{n as MARKDOC_ERROR_TAG,r as markdocError,a as markdocErrorResult,i as replaceWithMarkdocError};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Schema } from '@redocly/markdoc';
|
|
2
|
+
/**
|
|
3
|
+
* The theme `variant` tag. Headings in a non-control variant take IDs prefixed with the variant
|
|
4
|
+
* name, so a hidden variant never changes the IDs of the headings that visitors see by default.
|
|
5
|
+
*/
|
|
6
|
+
export declare const variant: Schema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{headingSlugger as e}from"../utils/heading-slugger.js";import t from"@redocly/markdoc";import{variant as n}from"@redocly/theme/markdoc/tags/variant";import{CONTROL as r}from"@redocly/theme/core/constants/experiments";const i={...n.schema,transform(i,a){let o=()=>new t.Tag(n.schema.render,i.transformAttributes(a),i.transformChildren(a)),{name:s}=i.attributes;return typeof s==`string`&&s!==r?e.withScope(s,o):o()}};export{i as variant};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headingSlugger as e}from"./heading-slugger.js";import{builtInMarkdocTags as t}from"../constants/builtin-tags.js";import{walkMarkdocAst as n}from"./walk-markdoc-ast.js";import{renderedHeadingText as r}from"./heading-text.js";import{
|
|
1
|
+
import{headingSlugger as e}from"./heading-slugger.js";import{builtInMarkdocTags as t}from"../constants/builtin-tags.js";import{walkMarkdocAst as n}from"./walk-markdoc-ast.js";import{renderedHeadingText as r}from"./heading-text.js";import{isNonControlVariant as i}from"@redocly/theme/markdoc/tags/variant";import{isForAgentsOnly as a}from"@redocly/theme/markdoc/tags/visibility";import{detailsAnchorId as o}from"@redocly/theme/core/utils/details";function s(t,o={}){e.reset();let s=[],f=!0,m=e=>a(e)||i(e);for(let i of n(t,{skipChildren:m})){let t=(i.type===`tag`&&i.tag===`html`?u(i):[i.attributes.id]).filter(e=>typeof e==`string`);if(t.length>0){s.push(...t);continue}if(i.type===`tag`&&i.tag===`accordion`){let{title:e}=i.attributes;typeof e==`string`&&l(s,e);continue}if(c(i,`details`)){let e=i.children.find(e=>c(e,`summary`));e!==void 0&&!d(e,o)&&(p(e)&&(f=!1),l(s,r(e,o)));continue}i.type!==`heading`||d(i,o)||(p(i)&&(f=!1),s.push(e.slug(r(i,o))))}return{ids:[...new Set(s)],exhaustive:f}}function c(e,t){return e.type===`tag`&&e.tag===`html`&&String(e.attributes.name).toLowerCase()===t}function l(e,t){t.trim()!==``&&e.push(o(t))}function u(e){let t=e.attributes.attrs;if(typeof t!=`object`||!t)return[];let{id:n,name:r}=t;return String(e.attributes.name).toLowerCase()===`a`?[n,r]:[n]}function d(e,t){for(let r of n(e))if(f(r.attributes,t))return!0;return!1}function f(e,t){if(Array.isArray(e))return e.some(e=>f(e,t));if(typeof e!=`object`||!e)return!1;let n=e.$$mdtype;if(n===`Variable`){let[n]=e.path??[];return typeof n!=`string`||!(n in t)}return n===`Function`||n===void 0&&Object.values(e).some(e=>f(e,t))}function p(e){for(let r of n(e))if(r.type===`tag`&&typeof r.tag==`string`&&!(r.tag in t))return!0;return!1}export{s as collectAnchors};
|
|
@@ -7,6 +7,8 @@ export type PageHeading = {
|
|
|
7
7
|
export declare function collectHeadings(node: RenderableTreeNode): PageHeading[];
|
|
8
8
|
/**
|
|
9
9
|
* Numbers every Heading tag in document order (`__idx`); the theme renders the page's
|
|
10
|
-
* copy/LLM actions next to heading 0.
|
|
10
|
+
* copy/LLM actions next to heading 0. Every variant of an experiment numbers its headings from
|
|
11
|
+
* where the experiment starts, and the count goes on after the control, so each variant numbers
|
|
12
|
+
* like the control it replaces. Mutates in place — renumbering is idempotent.
|
|
11
13
|
*/
|
|
12
14
|
export declare function stampHeadingIndexes(node: RenderableTreeNode): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isMarkdocTag as e}from"./is-markdoc-tag.js";import{getInnerText as t}from"./get-inner-text.js";function
|
|
1
|
+
import{isMarkdocTag as e}from"./is-markdoc-tag.js";import{getInnerText as t}from"./get-inner-text.js";import{isNonControlVariantTag as n}from"@redocly/theme/markdoc/tags/variant";function r(e){let t=[];return i(e,t),t}function i(t,r){if(!e(t)||n(t))return;let o=a(t);o&&r.push(o);for(let e of t.children??[])i(e,r)}function a(e){let{anchorId:n,headline:r,headlineLevel:i,id:a,level:o}=e.attributes;if(e.name===`Heading`&&typeof a==`string`&&typeof o==`number`)return{id:a,depth:o,value:t(e.children)};if(e.name===`NumberedItem`&&typeof n==`string`&&typeof i==`number`&&Array.isArray(r))return{id:n,depth:i,value:t(r)}}function o(t){let r=0,i=t=>{if(!e(t))return;if(t.name===`Heading`&&(t.attributes.__idx=r,r+=1),t.name!==`Experiment`){for(let e of t.children??[])i(e);return}let a=r,o=a;for(let s of t.children??[])r=a,i(s),e(s)&&!n(s)&&(o=r);r=o};i(t)}export{r as collectHeadings,o as stampHeadingIndexes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseMarkdownFirstHeading as e}from"./parse-cache.js";import{markdocFirstHeading as t}from"../search/to-text.js";import{PROMPT_TAG as n}from"@redocly/theme/core/constants";import{
|
|
1
|
+
import{parseMarkdownFirstHeading as e}from"./parse-cache.js";import{markdocFirstHeading as t}from"../search/to-text.js";import{PROMPT_TAG as n}from"@redocly/theme/core/constants";import{isNonControlVariant as r}from"@redocly/theme/markdoc/tags/variant";import{isForAgentsOnly as i}from"@redocly/theme/markdoc/tags/visibility";function a(a){return t(e(a,e=>e.tag===n||i(e)||r(e)))}export{a as markdownFirstHeading};
|
|
@@ -3,6 +3,14 @@ export declare class HeadingSlugger {
|
|
|
3
3
|
#private;
|
|
4
4
|
/** Adds a number when the same ID occurs more than once. */
|
|
5
5
|
slug(value: string): string;
|
|
6
|
+
/** An explicit ID; in a scope, prefixed and numbered like a slug of that scope. */
|
|
7
|
+
explicit(id: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Runs `fn` with every ID prefixed by the slug of `scope` and a dot. A slug never holds a dot,
|
|
10
|
+
* so a scoped ID never equals an unscoped slug, and slugs taken inside never change the IDs
|
|
11
|
+
* outside.
|
|
12
|
+
*/
|
|
13
|
+
withScope<T>(scope: string, fn: () => T): T;
|
|
6
14
|
reset(): void;
|
|
7
15
|
}
|
|
8
16
|
export declare const headingSlugger: HeadingSlugger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=/[\0-\x1F!-,:-@[-^`{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0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D7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC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uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var t=class{#e=/* @__PURE__ */ new Map;slug(t){let n=t.toLowerCase().replace(e,``).replace(/ /g,`-`).replace(/[./]/g,``)||`_
|
|
1
|
+
const e=/[\0-\x1F!-,:-@[-^`{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\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B40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var t=class{#e=/* @__PURE__ */ new Map;#t=/* @__PURE__ */ new Map;#n;slug(e){let t=n(e);return this.#n===void 0?r(this.#e,t):r(this.#t,`${this.#n}.${t}`)}explicit(e){return this.#n===void 0?e:r(this.#t,`${this.#n}.${e}`)}withScope(e,t){let r=this.#n;this.#n=n(e);try{return t()}finally{this.#n=r}}reset(){this.#e.clear(),this.#t.clear()}};function n(t){return t.toLowerCase().replace(e,``).replace(/ /g,`-`).replace(/[./]/g,``)||`_`}function r(e,t){let n=t;for(;e.has(n);){let r=(e.get(n)??0)+1;e.set(n,r),n=`${t}-${r}`}return e.set(n,0),n}const i=new t;export{t as HeadingSlugger,i as headingSlugger};
|
|
@@ -13,8 +13,8 @@ type Located = Pick<MarkdocNode, 'type' | 'inline' | 'location'> | {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function markdocNodeRange(node: Located): SourceRange | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* A `markdoc/validation-error`
|
|
17
|
-
* the file the node was parsed from (a partial for an inlined node).
|
|
16
|
+
* A `code` problem (default `markdoc/validation-error`) for `message` at the node's line in
|
|
17
|
+
* `filePath`, the file the node was parsed from (a partial for an inlined node).
|
|
18
18
|
*/
|
|
19
|
-
export declare function markdocNodeProblem(node: Located, message: string, filePath: string): ProblemDraft;
|
|
19
|
+
export declare function markdocNodeProblem(node: Located, message: string, filePath: string, code?: string): ProblemDraft;
|
|
20
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let t=e.location?.start.line;if(t===void 0)return;let n=t+1,r=e.type===`tag`&&!(`inline`in e&&e.inline)?n:e.location?.end.line??n;return{start:{line:n},end:{line:r}}}function t(t,n,r){return{code
|
|
1
|
+
function e(e){let t=e.location?.start.line;if(t===void 0)return;let n=t+1,r=e.type===`tag`&&!(`inline`in e&&e.inline)?n:e.location?.end.line??n;return{start:{line:n},end:{line:r}}}function t(t,n,r,i=`markdoc/validation-error`){return{code:i,message:n,location:{filePath:r,range:e(t)??{start:{line:1},end:{line:1}}}}}export{t as markdocNodeProblem,e as markdocNodeRange};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buildContentAssetUrl as e,deriveContentAssetFilename as t}from"../plugins/internal/assets/url.js";import{getContentAssetsOutputDir as n}from"../../shared/constants/runtime-layout.js";import{garbageCollectOrphanAssets as r}from"../database/assets.js";import{dirname as i,join as a}from"node:path";async function o(e,t,n){await e.mkdir(i(t),{recursive:!0});let r=`${t}.tmp-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;await n(r),await e.rename(r,t)}async function s(e,r){let{usage:i}=r,s=r.filename??t(i.path,i.hash,i.tag),c=a(r.contentDir,i.path),l=a(n(r.contentDir),s);if(!await e.exists(c))return null;let u={path:i.path,hash:i.hash,kind:i.kind,filename:s};try{if(await e.exists(l))return u;await o(e,l,t=>e.copyFile(c,t))}catch(e){if(e instanceof Error&&/EACCES|EPERM/.test(e.message))return u;throw e}return u}async function c(e,t){let{removed:
|
|
1
|
+
import{buildContentAssetUrl as e,deriveContentAssetFilename as t}from"../plugins/internal/assets/url.js";import{getContentAssetsOutputDir as n}from"../../shared/constants/runtime-layout.js";import{garbageCollectOrphanAssets as r}from"../database/assets.js";import{dirname as i,join as a}from"node:path";async function o(e,t,n){await e.mkdir(i(t),{recursive:!0});let r=`${t}.tmp-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;await n(r),await e.rename(r,t)}async function s(e,r){let{usage:i}=r,s=r.filename??t(i.path,i.hash,i.tag),c=a(r.contentDir,i.path),l=a(n(r.contentDir),s);if(!await e.exists(c))return null;let u={path:i.path,hash:i.hash,kind:i.kind,filename:s};try{if(await e.exists(l))return u;await o(e,l,t=>e.copyFile(c,t))}catch(e){if(e instanceof Error&&/EACCES|EPERM/.test(e.message))return u;throw e}return u}async function c(e,t){let{removed:n,orphanedFilenames:i}=await r(t.database,{logger:t.logger});return await u(e,{...t,filenames:i}),{removedRows:n.length,sweptFilenames:i}}async function l(e,t){await u(e,t)}async function u(e,t){let r=n(t.contentDir);await Promise.all(t.filenames.map(n=>e.unlink(a(r,n)).catch(e=>{d(e)||t.logger?.warn(`Could not remove a published content asset`,{filename:n,error:e instanceof Error?e.message:String(e)})})))}function d(e){return e instanceof Error&&/ENOENT|NotFoundError/.test(`${e.name} ${e.message}`)}async function f(e,t){let r=[],i=[],a=[];if(t.registered.length===0)return{restored:r,missingSources:i,failed:a};let o=/* @__PURE__ */ new Set;try{for(let r of await e.readdir(n(t.contentDir)))o.add(r.name)}catch{}let c=/* @__PURE__ */ new Map;for(let e of t.registered)o.has(e.filename)||c.set(e.filename,e);let l=[...c];for(let n=0;n<l.length;n+=16)await Promise.all(l.slice(n,n+16).map(async([n,o])=>{try{let a=await s(e,{contentDir:t.contentDir,filename:n,usage:{path:o.path,hash:o.hash,kind:o.kind===`image`?`image`:`file`}});a?r.push(a.filename):i.push(o.path)}catch{a.push(o.path)}}));return{restored:r,missingSources:i,failed:a}}function p(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.set(`${n.path}|${n.hash}`,n);return[...t.values()]}function m(t){let n;for(let r of t)r.l10n&&(n??={},(n[r.l10n.locale]??={})[r.l10n.canonicalUrl]=e(r.path,r.hash,r.tag));return n}export{m as buildL10nAssetMap,p as dedupeAssetUsages,c as garbageCollectOrphanAssetFiles,s as reconcileAsset,l as removeReplacedAssetFiles,f as restoreMissingAssetFiles,o as writeFileAtomically};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hashJsonValue as e}from"../database/utils/json.js";import{
|
|
1
|
+
import{hashJsonValue as e}from"../database/utils/json.js";import{entities as t,entityDeps as n,files as r,loaderConfigDeps as i}from"../database/schema.js";import{collectDataRefMarkers as a}from"./data-ref.js";import{replaceBlobRefsForEntityTx as o}from"../database/blobs.js";import{dedupeRouteQueryDependencies as s}from"../plugins/utils/route-index.js";import{MaterializationError as c,ProblemError as l}from"../problems/problem-error.js";import{replaceAssetRefsForEntityTx as u,upsertAssetsTx as d}from"../database/assets.js";import{createProblem as f}from"../problems/codes.js";import{problemRow as p,replaceEntityProblemsExceptCodesTx as m}from"../database/problems.js";import{replaceLinkRefsForEntityTx as h,upsertTargetInventoryTx as g}from"../database/link-refs.js";import{detectMarkdocPayloadFlag as _}from"../markdown/server/render.js";import{buildL10nAssetMap as v,dedupeAssetUsages as y,reconcileAsset as b,removeReplacedAssetFiles as x}from"./asset-reconcile.js";import{cutEntityRevisionTx as S}from"../revisions/cut.js";import{replaceRouteQueryDepsTx as C}from"../database/route-query-deps.js";import{replaceEntityRuntimeDeps as w}from"../database/origins.js";import{SEARCH_PROBLEM_CODES as T}from"../problems/producers.js";import{and as E,eq as D}from"drizzle-orm";const O=/* @__PURE__ */ new WeakMap;async function k(e){let t=await A(e.database,e.key);if(!t)throw Error(`Entity "${e.key}" is not registered.`);if(t.kind===`inline`){if(t.data===null)throw Error(`Inline entity "${e.key}" is missing its stored data.`);return t.data}if(t.status===`ready`&&t.data!==null)return t.data;let n=O.get(e.database);n===void 0&&(n=/* @__PURE__ */ new Map,O.set(e.database,n));let r=n.get(e.key);if(r!==void 0)return r;let i=j(e,t);n.set(e.key,i);try{return await i}finally{n.delete(e.key)}}async function A(e,n){let[r]=await e.db.select({id:t.id,key:t.key,kind:t.kind,pluginId:t.pluginId,loaderId:t.loaderId,loaderArgs:t.loaderArgs,type:t.type,metadata:t.metadata,status:t.status,data:t.data,markdoc:t.markdoc,dataHash:t.dataHash,version:t.version,revisionCreatedAt:t.revisionCreatedAt,isSystem:t.isSystem,invalidationSeq:t.invalidationSeq}).from(t).where(E(D(t.key,n),D(t.isCurrent,1))).limit(1);return r}async function j(i,l){if(!l.loaderId)throw Error(`Entity "${i.key}" is missing its loader id.`);let O=i.loaderRegistry.getEntityLoaderById(l.loaderId);if(!O)throw Error(`Entity loader "${l.loaderId}" is not registered.`);let[k]=await i.database.db.select({path:r.path,fileId:r.id}).from(n).leftJoin(r,D(n.originFileId,r.id)).where(D(n.entityId,l.id)).limit(1);if(!k&&!l.isSystem)throw Error(`Entity "${i.key}" has no origin dependency.`);let A=i.loaderContextFactory(O,l.loaderArgs,k?.path??``),j;try{j=await O.definition.handler(A)}catch(e){throw await M(i,l.id,e),new c(`Entity "${i.key}" failed to load.`,{cause:e})}let P=JSON.stringify(j.value??null),F=JSON.parse(P),I=j.markdoc??_(P),L=I?v(j.assetUsages??[]):void 0,R=L?{...I,l10nAssets:L}:I,z=a(F),B=Array.from(new Set(z.map(e=>e.blobKey))),V=y(j.assetUsages??[]),{contentDir:H}=i,U=H?(await Promise.all(V.map(e=>b(A.io,{contentDir:H,usage:e})))).filter(e=>e!==null):[],W=[];return await i.database.db.transaction(async n=>{let r=Date.now(),a=e(F),c=(l.dataHash??null)!==a,_=l.revisionCreatedAt;if(c&&(_=Math.max(r,l.revisionCreatedAt+1)),(await n.update(t).set({status:`ready`,data:F,markdoc:R,type:j.type??l.type,metadata:j.metadata??l.metadata,dataHash:a,revisionCreatedAt:_}).where(E(D(t.id,l.id),D(t.invalidationSeq,l.invalidationSeq))).returning({id:t.id})).length===0)return;c&&l.data!==null&&i.revisions?.capture&&i.revisions.isTracked(k?.path??``)&&await S(n,{current:l,max:i.revisions.max});let v=A._trackedConfig;await N(n,l.id,v?.collectDependencies()??[]);let y=A._loadedEntityKeys,b=A._globPatterns;if((j.entityDeps!==void 0||y.length>0||b.length>0)&&await w(n,{entityId:l.id,originPluginId:O.pluginId,isSystem:!!l.isSystem,deps:[...j.entityDeps??[],...y.map(e=>({kind:`entity`,key:e})),...b.map(e=>({kind:`glob`,pattern:e}))]}),await C(n,{originPluginId:O.pluginId,hook:`loader`,entityId:l.id,dependencies:s(A._routeQueries)}),await m(n,l.id,T,(j.problems??[]).map(e=>p(f(e),{scope:`entity`,entityId:l.id}))),await o(n,{entityId:l.id,blobKeys:B}),W=await d(n,U),await u(n,{entityId:l.id,refs:V.map(({path:e,hash:t})=>({path:e,hash:t}))}),(j.linkRefs!==void 0||j.targetInventories!==void 0)&&k?.path&&(await h(n,{entityId:l.id,originFileId:k.fileId,originPluginId:O.pluginId,filePath:k.path,drafts:j.linkRefs??[]}),k.fileId!==null))for(let e of j.targetInventories??[])await g(n,{fileId:k.fileId,originPluginId:O.pluginId,draft:e})}),H&&W.length>0&&await x(A.io,{contentDir:H,filenames:W,logger:i.logger}),F}async function M(e,t,n){let r=n instanceof l?n.draft:{code:`plugin/loader-failed`,message:`Loader failed for entity "${e.key}": ${n instanceof Error?n.message:String(n)}`,data:{entityKey:e.key}};try{let n=p(f(r),{scope:`entity`,entityId:t});await e.database.db.transaction(async e=>{await m(e,t,T,[n])})}catch{}}async function N(e,t,n){await e.delete(i).where(D(i.entityId,t)),n.length!==0&&await e.insert(i).values(n.map(e=>({...e,entityId:t})))}export{k as materializeEntityByKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isAdvancedSearchEnabled as e}from"../shared/search/facets.js";import{isObject as t}from"../shared/utils/is-object.js";import{isAiHidden as n}from"../shared/ask-ai/config-gate.js";const r=[[`products`,`products`],[`catalogClassic`,`catalog`],[`catalogClassic`,`catalogClassic`],[`l10n`,`l10n`],[`apiFunctions`,`apiFunctions`],[`redirects`,`redirects`],[`banner`,`banner`]];function i(i,a,u){if(!a.PLAN_GATES)return i;let d=o(a.PLAN_GATES);d||u(`PLAN_GATES is not a token, so the features of the plan are off.`);let f=e=>!!d?.[e],p=e=>d?.[e]!==!1,m=d!==void 0&&!(`cookieConsent`in d),h={rbac:f(`rbac`),sso:f(`sso`),analytics:f(`analytics`),advancedSearch:f(`advancedSearch`),aiSearch:f(`aiSearchLimit`),mcp:f(`mcp`),mcpGateway:f(`mcpGateway`),cookieConsent:m||f(`cookieConsent`),removeAttribution:!d?.pricingTier||f(`removeAttribution`),products:p(`products`),catalogClassic:p(`catalogClassic`),l10n:p(`l10n`),apiFunctions:p(`apiFunctions`),mockServer:p(`mockServer`),seo:p(`seo`),redirects:p(`redirects`),breadcrumbs:p(`breadcrumbs`),banner:p(`banner`),codeWalkthrough:p(`codeWalkthrough`),customPlugins:p(`customPlugins`),markdown:p(`markdown`),openapi:p(`openapi`),asyncapi:p(`asyncapi`),graphql:p(`graphql`),reactPages:p(`reactPages`),soap:p(`soap`),customPackages:p(`customPackages`)},g=e=>u(`\`${e}\` is not in this project's plan and is ignored.`),_={...i,planGates:h};h.customPackages||(_.allowedPackages=l(d?.allowedPackages));for(let e of[`rbac`,`sso`]){if(h[e]||!t(_.access)||_.access[e]===void 0)continue;g(`access.${e}`);let{[e]:n,...r}=_.access;_.access=r}!h.analytics&&_.analytics!==void 0&&(g(`analytics`),delete _.analytics),!f(`removeAttribution`)&&_.removeAttribution!==void 0&&(_.removeAttribution===!0&&g(`removeAttribution`),delete _.removeAttribution);for(let[e,t]of r)h[e]||_[t]===void 0||(c(_[t])&&g(t),delete _[t]);if(!h.advancedSearch){let t=s(_.search);t.filters!==void 0&&e(i)&&g(`search.filters`),_.search={...t,filters:{...s(t.filters),hide:!0}}}if(h.aiSearch||((_.aiAssistant!==void 0||s(_.search).ai!==void 0)&&!n(i)&&g(`aiAssistant`),_.aiAssistant={...s(_.aiAssistant),hide:!0}),!h.mcp){let e=s(_.mcp);_.mcp!==void 0&&e.hide!==!0&&g(`mcp`),_.mcp={...e,hide:!0}}if(!h.mockServer){let e=s(_.mockServer);_.mockServer!==void 0&&e.off!==!0&&g(`mockServer`),_.mockServer={...e,off:!0}}if(!h.breadcrumbs){let e=s(_.breadcrumbs);_.breadcrumbs!==void 0&&e.hide!==!0&&g(`breadcrumbs`),_.breadcrumbs={...e,hide:!0}}return h.seo||(_.seo!==void 0&&g(`seo`),_.seo={llmstxt:{hide:!0}}),_.consent!==void 0&&m?u("The PLAN_GATES token has no cookieConsent claim, so `consent` stays on."):_.consent!==void 0&&!h.cookieConsent&&(u("`consent` is not in this project's plan and is ignored: analytics loads without consent."),delete _.consent),_}function a(e){return{code:`configuration/ignored`,message:`${e} are not in this project's plan, so this file is ignored.`}}function o(e){try{let n=(e.split(`.`)[1]??``).replace(/-/g,`+`).replace(/_/g,`/`),r=JSON.parse(atob(n));return t(r)?r:void 0}catch{return}}function s(e){return t(e)?e:{}}function c(e){return Array.isArray(e)?e.length>0:t(e)?Object.keys(e).length>0:e!==void 0}function l(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:[]}export{i as applyPlanGates,a as notInPlanProblem};
|
|
1
|
+
import{isAdvancedSearchEnabled as e}from"../shared/search/facets.js";import{isObject as t}from"../shared/utils/is-object.js";import{isAiHidden as n}from"../shared/ask-ai/config-gate.js";const r=[[`products`,`products`],[`catalogClassic`,`catalog`],[`catalogClassic`,`catalogClassic`],[`l10n`,`l10n`],[`apiFunctions`,`apiFunctions`],[`redirects`,`redirects`],[`banner`,`banner`]];function i(i,a,u){if(!a.PLAN_GATES)return i;let d=o(a.PLAN_GATES);d||u(`PLAN_GATES is not a token, so the features of the plan are off.`);let f=e=>!!d?.[e],p=e=>d?.[e]!==!1,m=d!==void 0&&!(`cookieConsent`in d),h={rbac:f(`rbac`),sso:f(`sso`),analytics:f(`analytics`),advancedSearch:f(`advancedSearch`),aiSearch:f(`aiSearchLimit`),mcp:f(`mcp`),mcpGateway:f(`mcpGateway`),cookieConsent:m||f(`cookieConsent`),removeAttribution:!d?.pricingTier||f(`removeAttribution`),products:p(`products`),catalogClassic:p(`catalogClassic`),l10n:p(`l10n`),apiFunctions:p(`apiFunctions`),mockServer:p(`mockServer`),seo:p(`seo`),redirects:p(`redirects`),breadcrumbs:p(`breadcrumbs`),banner:p(`banner`),codeWalkthrough:p(`codeWalkthrough`),customPlugins:p(`customPlugins`),markdown:p(`markdown`),openapi:p(`openapi`),asyncapi:p(`asyncapi`),graphql:p(`graphql`),reactPages:p(`reactPages`),soap:p(`soap`),customPackages:p(`customPackages`),customMarkdocTags:p(`customMarkdocTags`),customMcpTools:p(`customMcpTools`)},g=e=>u(`\`${e}\` is not in this project's plan and is ignored.`),_={...i,planGates:h};h.customPackages||(_.allowedPackages=l(d?.allowedPackages));for(let e of[`rbac`,`sso`]){if(h[e]||!t(_.access)||_.access[e]===void 0)continue;g(`access.${e}`);let{[e]:n,...r}=_.access;_.access=r}!h.analytics&&_.analytics!==void 0&&(g(`analytics`),delete _.analytics),!f(`removeAttribution`)&&_.removeAttribution!==void 0&&(_.removeAttribution===!0&&g(`removeAttribution`),delete _.removeAttribution);for(let[e,t]of r)h[e]||_[t]===void 0||(c(_[t])&&g(t),delete _[t]);if(!h.advancedSearch){let t=s(_.search);t.filters!==void 0&&e(i)&&g(`search.filters`),_.search={...t,filters:{...s(t.filters),hide:!0}}}if(h.aiSearch||((_.aiAssistant!==void 0||s(_.search).ai!==void 0)&&!n(i)&&g(`aiAssistant`),_.aiAssistant={...s(_.aiAssistant),hide:!0}),!h.mcp){let e=s(_.mcp);_.mcp!==void 0&&e.hide!==!0&&g(`mcp`),_.mcp={...e,hide:!0}}if(!h.mockServer){let e=s(_.mockServer);_.mockServer!==void 0&&e.off!==!0&&g(`mockServer`),_.mockServer={...e,off:!0}}if(!h.breadcrumbs){let e=s(_.breadcrumbs);_.breadcrumbs!==void 0&&e.hide!==!0&&g(`breadcrumbs`),_.breadcrumbs={...e,hide:!0}}return h.seo||(_.seo!==void 0&&g(`seo`),_.seo={llmstxt:{hide:!0}}),_.consent!==void 0&&m?u("The PLAN_GATES token has no cookieConsent claim, so `consent` stays on."):_.consent!==void 0&&!h.cookieConsent&&(u("`consent` is not in this project's plan and is ignored: analytics loads without consent."),delete _.consent),_}function a(e){return{code:`configuration/ignored`,message:`${e} are not in this project's plan, so this file is ignored.`}}function o(e){try{let n=(e.split(`.`)[1]??``).replace(/-/g,`+`).replace(/_/g,`/`),r=JSON.parse(atob(n));return t(r)?r:void 0}catch{return}}function s(e){return t(e)?e:{}}function c(e){return Array.isArray(e)?e.length>0:t(e)?Object.keys(e).length>0:e!==void 0}function l(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:[]}export{i as applyPlanGates,a as notInPlanProblem};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{REPLAY_OAUTH2_ROUTE_PATH as e}from"../../../../../shared/constants/replay.js";import{withPathPrefix as t}from"../../../../../shared/path-prefix.js";import{API_DOCS_INFO_BLOCK_DEP_KEY as n,API_DOCS_RENDER_DEP_KEY as r,apiPageTitle as i}from"../server/shared.js";import{ApiDocsLayoutContext as a,PageContext as o}from"../../../../../client/contexts.js";import{MarkdocRenderer as s,markdocComponents as c}from"../../../../markdown/client/markdoc-components.js";import{rebaseItemLinks as l}from"./rebase-item-links.js";import{apiDocsTelemetryConfig as u}from"../../../../../client/telemetry/config.js";import{withReplayOptions as d}from"../../../../../client/replay-options.js";import{JsonSchemaTag as f}from"../../../../markdown/client/JsonSchemaTag.js";import{JsonExample as p}from"../../../../markdown/client/OpenapiTagComponents.js";import{withEventHandlers as m}from"./event-handlers.js";import{useContext as h,useEffect as g,useMemo as _
|
|
1
|
+
import{REPLAY_OAUTH2_ROUTE_PATH as e}from"../../../../../shared/constants/replay.js";import{withPathPrefix as t}from"../../../../../shared/path-prefix.js";import{API_DOCS_INFO_BLOCK_DEP_KEY as n,API_DOCS_RENDER_DEP_KEY as r,apiPageTitle as i}from"../server/shared.js";import{ApiDocsLayoutContext as a,PageContext as o}from"../../../../../client/contexts.js";import{MarkdocRenderer as s,markdocComponents as c}from"../../../../markdown/client/markdoc-components.js";import{rebaseItemLinks as l}from"./rebase-item-links.js";import{apiDocsTelemetryConfig as u}from"../../../../../client/telemetry/config.js";import{withReplayOptions as d}from"../../../../../client/replay-options.js";import{JsonSchemaTag as f}from"../../../../markdown/client/JsonSchemaTag.js";import{JsonExample as p}from"../../../../markdown/client/OpenapiTagComponents.js";import{withEventHandlers as m}from"./event-handlers.js";import{useContext as h,useEffect as g,useMemo as _}from"react";import{useLocation as v}from"react-router";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";import{useThemeConfig as C}from"@redocly/theme/core/hooks";import{LayoutVariant as w}from"@redocly/theme/components/SidebarActions/SidebarActions";import{useLoaderData as T}from"virtual:realm-runtime";import{userMarkdocComponents as E}from"virtual:realm-markdoc-components";import{RedoclyApiDocs as D,apiDocsMarkdocComponents as O}from"@redocly/api-docs";import{Breadcrumbs as k}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{CatalogClassicInfoBlock as A}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{MissingTranslationNotice as j}from"@redocly/theme/components/MissingTranslationNotice/MissingTranslationNotice";import{ThreePanelLayout as M}from"@redocly/theme/layouts/ThreePanelLayout";const N={...c,JsonSchema:E.JsonSchema??f,JsonExample:E.JsonExample??p,...O},P={parse:e=>e,render:e=>/* @__PURE__ */ b(s,{ast:e,components:N})},F={MiddlePanelHeader:I};function I(){return/* @__PURE__ */ x(y,{children:[/* @__PURE__ */ b(k,{}),/* @__PURE__ */ b(V,{})]})}function L(e){return(e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e).toLowerCase()}function R({page:e}){let t=T(r),i=T(n),{layout:o}=h(a),s=z(),c=_(()=>t&&{...m(d(t.options)),oAuth2RedirectURI:B(),userClaims:s,unstable_hooks:F},[t,s]),f=e.slug.toLowerCase(),p=_(()=>t&&t.basePath!==f?l(t.items,t.basePath,f):t?.items,[t,f]);if(U(e.metadata,p,t?.title),!t)return null;let g=u();return/* @__PURE__ */ x(y,{children:[i&&/* @__PURE__ */ b(H,{layout:o,children:/* @__PURE__ */ b(A,{metadata:i})}),/* @__PURE__ */ b(D,{items:p,store:t.store,options:c,basePath:f,layout:o,markdownAdapter:P,telemetryConfig:g})]})}function z(){let e=h(o)?.auth?.userInfo,t=e?.isAuthenticated?e.email:void 0,n=e?.isAuthenticated?e.name:void 0;return _(()=>({email:t,name:n}),[t,n])}function B(){if(typeof window<`u`)return new URL(t(e),window.location.origin).toString()}const V=S(j)`
|
|
2
2
|
width: 100%;
|
|
3
|
-
`,
|
|
3
|
+
`,H=S(M)`
|
|
4
4
|
&& {
|
|
5
|
-
padding-right: ${({layout:e})=>e===
|
|
5
|
+
padding-right: ${({layout:e})=>e===w.THREE_PANEL?`calc(var(--panel-gap-horizontal) * 2)`:`var(--panel-gap-horizontal)`};
|
|
6
6
|
}
|
|
7
|
-
`;function
|
|
7
|
+
`;function U(e,t,n){let{pathname:r}=v(),{seo:a}=C(),o=a?.projectTitle,s=t?i(e,t,L(r),n):void 0;g(()=>{s&&(document.title=o?`${s} | ${o}`:s)},[s,o])}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineContentPlugin as e}from"../../define.js";import{createEntityLoader as t}from"../../../loaders/define.js";import{runtimeFile as n}from"../../utils/runtime-file.js";import{runtimeTemplate as r}from"../../templates.js";import{SEARCH_GROUP_FACET_FIELD as i}from"../../../../shared/search/facets.js";import{configuredFacetFields as a,extractFacetsFromFrontmatter as o,invalidFacetValueProblems as s,searchCategoryOf as c}from"../../../search/facet-values.js";import{toPosixPath as l}from"../../../../shared/utils/to-posix-path.js";import{TRANSLATIONS_FILE_PATTERN as u}from"../../../../shared/constants/l10n/defaults.js";import{isObject as d}from"../../../../shared/utils/is-object.js";import{notInPlanProblem as f}from"../../../plan-gates.js";import{filePathToRouteSlug as p}from"../../../../shared/utils/routes/file-path-to-route-slug.js";import{SPEC_KIND_ARAZZO as m,SPEC_KIND_ASYNCAPI as h,SPEC_KIND_GRAPHQL as g,SPEC_KIND_OPENAPI as _}from"../../types/api-entity.js";import{isPlanFeatureGranted as v}from"../../../../shared/plan-gates.js";import{packMarkdocAstsDeep as y,unpackMarkdocAstsDeep as b}from"../../../markdown/utils/packed-ast.js";import{parseMarkdownCached as x}from"../../../markdown/utils/parse-cache.js";import{createApiEntityKey as S}from"../../utils/api-entity-key.js";import{API_DOCS_API_LOADER_ID as ee,API_DOCS_PLUGIN_ID as te,API_DOCS_RENDER_DEP_KEY as ne,API_DOCS_RENDER_LOADER_ID as C,API_DOCS_SIDEBAR_LOADER_ID as w,API_DOCS_TEMPLATE_ID as T,SPEC_DOWNLOAD_ROUTE_PATHS as E,SPEC_PATH_PARAM as re}from"./server/shared.js";import{resolveApiBundleConfig as ie,resolveApiOptions as ae,resolveNestedFeedback as oe,schemaCatalogLink as se,withDownloadUrls as ce,withFeedbackOption as le,withMockServerOption as ue}from"./server/options.js";import{annotateApiDocsRbac as de}from"../../../../server/rbac/api-docs.js";import{SERVER_ONLY_VALUE_KEY as D}from"../../../loaders/server-only-value.js";import{getLoadedProjectPlugins as fe}from"../../project/loaded-set.js";import{API_OUTPUT_MANIFEST_KEY as O}from"../../../api-outputs.js";import{API_DOCS_MARKDOC_TAG_SET as k,resolveMarkdocTagSet as A}from"../../../markdown/constants/tag-sets.js";import{pageLocale as j}from"../../utils/page-locale.js";import{buildBundledApiDefinition as M,resolveLlmsDescriptions as N}from"./server/build-definition.js";import{collectSidebarSubpathTargets as P,toSidebarSubtree as F,toSubpathTarget as I}from"./server/build-sidebar.js";import{buildApiDocsMarkdownDocs as L}from"./server/markdown-docs.js";import{join as R,relative as z}from"node:path";import B from"@redocly/markdoc";const V=[`.yaml`,`.yml`,`.json`,`.gql`,`.graphql`],pe={[_]:`OpenAPI`,[h]:`AsyncAPI`,[g]:`GraphQL`,[m]:`Arazzo`},H=t(C,async e=>{let{buildItems:t}=await import(`@redocly/api-docs`),n=G(e),r=await e.io.readFile(n.absolutePath),i=e.routes.byFilePath(e.file.path)?.slug,a=ce(e.args.options,e.file.path,e.args.kind),o=e.args.kind===`openapi`?ue(a,e.config,i):a,s={entityDeps:[],assetUsages:[],linkRefs:[],problems:[],pending:[]},c=W(e.contentDir),l={markdown:e.markdown,loader:{config:e.config,entities:e.entities,file:e.file,io:e.io,logger:e.logger,plugin:e.plugin},sink:s},u=await M({kind:e.args.kind,source:r,relativePath:n.relativePath,contentDir:e.contentDir,pagePath:e.file.path,options:o,bundle:K(e.args,c),metadata:X(e.args.options),markdownResolution:l,rbac:{warn:t=>e.logger?.warn(t)}}),f={...d(u.document)&&d(u.document.info)?{infoDescription:u.document.info.description}:{},...await N(u.document,l,{contentDir:e.contentDir,specPath:n.relativePath,pagePath:e.file.path})};e.args.kind===`openapi`&&o.showSchemaCatalogLinks&&d(u.document)&&(u.document[`x-schema-catalog-link`]=se(e.file.path)),u.options=le(u.options,u.document,e.args.feedback??e.config.feedback);let p=i?.toLowerCase()??`/`,{items:m,store:h,specType:g}=await t({...u,basePath:p,markdownParser:e=>B.compact(x(e))}),_=JSON.stringify({items:y(m),store:y(h),options:u.options,specType:g,basePath:p,title:ye(u.document,e.args.kind,m),metadata:ve(u.document),[D]:{llms:f}});return{value:await e.createBlobRef(_,{format:`json`}),entityDeps:[...J(e.file.path,[...u.fileDependencies,...c.paths]),...s.entityDeps],assetUsages:s.assetUsages,markdoc:{tagSet:k},linkRefs:s.linkRefs,problems:s.problems}},{async searchable(e,t){if(t.route===void 0||t.route.metadata.excludeFromSearch===!0)return{docs:[]};let n=b(e),r=await we(t.entities,t.route.originFilePath),l={...t.route.metadata,...d(n.metadata)?n.metadata:{}},{category:u,isInvalid:f}=c(l),{facets:p,invalidFields:m}=o(l,a(t.config)),{buildApiDocsSearchDocuments:h}=await import(`./server/search-documents.js`);return{...h(n,r,{groupKey:u,facets:p,warn:e=>t.logger?.warn(e)}),problems:s([...m,...f?[i]:[]],t.route.originFilePath)}},async markdown(e,t){if(t.route===void 0)return null;let n=b(e),r=t.route.originFilePath??void 0,i=r?await t.entities.load(S(r)).catch(()=>void 0):void 0,{tags:a}=await A(k);return L(n,_e(i,n[D]?.llms),r,{tags:a,locale:j(t)})},usesProjectMarkdocSchema:!0}),U=t(ee,async e=>{let t=G(e),n=await e.io.readFile(t.absolutePath),r=W(e.contentDir),i=await M({kind:e.args.kind,source:n,relativePath:t.relativePath,contentDir:e.contentDir,bundle:K(e.args,r),metadata:X(e.args.options)}),a=e.args.kind===g,o=a?n:JSON.stringify(i.document);return{value:o.length>65536?await e.createBlobRef(o,{format:a?`text`:`json`}):a?n:i.document,metadata:{...Z(e.file.path,e.args.kind,e.args.options,e.args.rbac),...he(i.document,e.routes.byFilePath(e.file.path)?.slug)},entityDeps:J(e.file.path,[...i.fileDependencies,...r.paths])}});function W(e){let t=fe(e)?.lintPlugins??[];return{plugins:t,paths:t.map(t=>l(z(e,t.path))).filter(e=>e!==``&&!e.startsWith(`../`))}}function G(e){let t=e.args.source?.path??e.file.path;return{relativePath:t,absolutePath:R(e.contentDir,t)}}function me(e){let t=e[O];return d(t)&&typeof t.root==`string`?t.root:void 0}function K(e,t){let{config:n,configDir:r}=e.bundleConfig??{config:{},configDir:``};return{config:n,configDir:r,plugins:t.plugins}}function he(e,t){let n=d(e)&&d(e.info)?e.info:{},r=d(n[`x-metadata`])?n[`x-metadata`]:{},i=typeof n.description==`string`?n.description.trim():``;return{...t===void 0?{}:{routeSlug:t},...Q(n.version)?{version:String(n.version)}:{},...typeof r.apiId==`string`?{apiId:r.apiId}:{},description:i||void 0}}const q=t(w,async e=>{let{buildNavItems:t,collectPreviousRouteSlugs:n}=await import(`@redocly/api-docs`),r=await e.entities.load(S(e.file.path)),i=e.args.kind===`graphql`?(await import(`graphql`)).parse(r):r,a=de(i,e.args.kind,{warn:t=>e.logger?.warn(t)}),{items:o}=await t({type:e.args.kind,document:a,options:e.args.options,basePath:`/`,markdownParser:x}),s=F(o),c=n(o).map(({from:e})=>I(e));return{value:s,targetInventories:[{kind:`subpath`,exhaustive:!0,targets:[...P(s),...c]}]}});function J(e,t){return[{kind:`file`,path:e},...t.map(e=>({kind:`file`,path:e}))]}const ge={arazzo:`Arazzo Docs`,asyncapi:`AsyncAPI Docs`,graphql:`GraphQL Docs`,openapi:`OpenAPI Docs`};function _e(e,t){if(t===void 0||!d(e))return e;let n=d(e.info)?e.info:{},r=d(e.components)?e.components:{};return{...e,...t.infoDescription===void 0?{}:{info:{...n,description:t.infoDescription}},...t.servers===void 0?{}:{servers:t.servers},...t.securitySchemes===void 0?{}:{components:{...r,securitySchemes:t.securitySchemes}}}}function ve(e){let t=d(e)&&d(e.info)?e.info:{};return d(t[`x-metadata`])?t[`x-metadata`]:{}}function ye(e,t,n){let r=d(e)&&d(e.info)?e.info:{};if(typeof r.title==`string`&&r.title!==``)return r.title;let i=d(n[0])?n[0].label:void 0;return typeof i==`string`&&i!==``?i:ge[t]}const be=[`rbac`,`sidebar`,`excludeFromSearch`,`template`];function Y(e,t){let n=d(e.manifest.info)?e.manifest.info:{},r={};typeof n.title==`string`&&(r.title=n.title),Q(n.version)&&(r.version=String(n.version)),typeof n.summary==`string`&&(r.summary=n.summary),d(n[`x-metadata`])&&Object.assign(r,n[`x-metadata`]),d(t.metadata)&&Object.assign(r,t.metadata);for(let e of be)delete r[e];return r}function X(e){return d(e.metadata)?e.metadata:void 0}function xe(e){let t=X(e)?.title;return typeof t==`string`&&t.length>0?t:void 0}function Z(e,t,n,r){let i=xe(n);return{specType:t,sourcePath:e,...i===void 0?{}:{title:i},...r===void 0?{}:{rbac:r},...Object.keys(n).length>0?{options:n}:{},...d(n.mockServer)?{mockServer:n.mockServer}:{}}}function Q(e){return typeof e==`string`||typeof e==`number`}function Se(e){if(e.ext===`.gql`||e.ext===`.graphql`)return g;let{openapi:t,swagger:n,asyncapi:r,arazzo:i}=e.manifest;return Q(t)||Q(n)?_:Q(r)?h:Q(i)?m:null}const Ce=e({id:te,version:`0.41.0`,content:{filter:{extensions:V},async extractFile(e,t){if(u.test(e.path))return null;let n=Se(e);if(n===null)return null;if(n!==`arazzo`&&!v(t.config,n))return{routes:[],problems:[f(`${pe[n]} documents`)]};let r=e.path,i=me(e.manifest),a=i??r,{rbac:o,...s}=await ae(t.io,t.config,r,n,a),c={filePath:r,kind:n,options:s,...o===void 0||!v(t.config,`rbac`)?{}:{rbac:o}};i!==void 0&&(c.source={path:i});let l=await oe(t.io,t.config,a);if(l!==void 0&&(c.feedback=l),n!==`graphql`){let e=await ie(t.io,t.config,r,a);Object.keys(e.config).length>0&&(c.bundleConfig=e)}let d=U.withArgs(c,{stableKey:S(r),type:`api`,metadata:Z(r,n,s,c.rbac)});if(n===`arazzo`)return{routes:[],entities:[d]};let m=Y(e,s);s.excludeFromSearch===!0&&(m.excludeFromSearch=!0),m.type=n,c.rbac!==void 0&&(m.rbac=c.rbac);let h=H.withArgs(c,{stableKey:`api-docs:render:${r}`}),g=q.withArgs(c,{stableKey:`api-docs:sidebar:${r}`}),_=p(r);return{routes:[{deps:{[ne]:h},metadata:m,routeId:`page`,sidebarSubtree:g,slug:null,slugHint:_,template:T,wildcardPrefix:!0}],entities:[d,h,g]}}},loaders:[U,H,q],templates:{[T]:r(n(`./client/template.tsx`,import.meta.url))},server:{routes:[$(E.bundle,`bundle`),$(E.deprecatedBundle,`bundle`),$(E.graphql,`graphql`)]}});function $(e,t){return{method:`GET`,path:e+re,handler:{filePath:`./server/spec-download.ts`,importer:import.meta.url,exportName:t}}}async function we(e,t){if(t)try{return await e.load(S(t))}catch{return}}export{Ce as apiDocsContentPlugin};
|
|
1
|
+
import{defineContentPlugin as e}from"../../define.js";import{createEntityLoader as t}from"../../../loaders/define.js";import{runtimeFile as n}from"../../utils/runtime-file.js";import{runtimeTemplate as r}from"../../templates.js";import{SEARCH_API_TITLE_FACET_FIELD as i,SEARCH_API_VERSION_FACET_FIELD as a,SEARCH_GROUP_FACET_FIELD as o}from"../../../../shared/search/facets.js";import{configuredFacetFields as s,extractFacetsFromFrontmatter as c,invalidFacetValueProblems as l,searchCategoryOf as u}from"../../../search/facet-values.js";import{toPosixPath as d}from"../../../../shared/utils/to-posix-path.js";import{TRANSLATIONS_FILE_PATTERN as f}from"../../../../shared/constants/l10n/defaults.js";import{isObject as p}from"../../../../shared/utils/is-object.js";import{notInPlanProblem as m}from"../../../plan-gates.js";import{filePathToRouteSlug as h}from"../../../../shared/utils/routes/file-path-to-route-slug.js";import{SPEC_KIND_ARAZZO as g,SPEC_KIND_ASYNCAPI as _,SPEC_KIND_GRAPHQL as v,SPEC_KIND_OPENAPI as y}from"../../types/api-entity.js";import{isPlanFeatureGranted as b}from"../../../../shared/plan-gates.js";import{packMarkdocAstsDeep as x,unpackMarkdocAstsDeep as S}from"../../../markdown/utils/packed-ast.js";import{parseMarkdownCached as C}from"../../../markdown/utils/parse-cache.js";import{createApiEntityKey as w}from"../../utils/api-entity-key.js";import{API_DOCS_API_LOADER_ID as T,API_DOCS_PLUGIN_ID as ee,API_DOCS_RENDER_DEP_KEY as E,API_DOCS_RENDER_LOADER_ID as D,API_DOCS_SIDEBAR_LOADER_ID as te,API_DOCS_TEMPLATE_ID as O,SPEC_DOWNLOAD_ROUTE_PATHS as k,SPEC_PATH_PARAM as ne}from"./server/shared.js";import{resolveApiBundleConfig as re,resolveApiOptions as ie,resolveNestedFeedback as ae,schemaCatalogLink as oe,withDownloadUrls as se,withFeedbackOption as ce,withMockServerOption as le}from"./server/options.js";import{annotateApiDocsRbac as ue}from"../../../../server/rbac/api-docs.js";import{SERVER_ONLY_VALUE_KEY as A}from"../../../loaders/server-only-value.js";import{getLoadedProjectPlugins as de}from"../../project/loaded-set.js";import{API_OUTPUT_MANIFEST_KEY as j}from"../../../api-outputs.js";import{API_DOCS_MARKDOC_TAG_SET as M,resolveMarkdocTagSet as N}from"../../../markdown/constants/tag-sets.js";import{pageLocale as P}from"../../utils/page-locale.js";import{buildBundledApiDefinition as F,resolveLlmsDescriptions as I}from"./server/build-definition.js";import{collectSidebarSubpathTargets as L,toSidebarSubtree as R,toSubpathTarget as z}from"./server/build-sidebar.js";import{buildApiDocsMarkdownDocs as B}from"./server/markdown-docs.js";import{join as V,relative as H}from"node:path";import fe from"@redocly/markdoc";const pe=[`.yaml`,`.yml`,`.json`,`.gql`,`.graphql`],me={[y]:`OpenAPI`,[_]:`AsyncAPI`,[v]:`GraphQL`,[g]:`Arazzo`},U=t(D,async e=>{let{buildItems:t}=await import(`@redocly/api-docs`),n=K(e),r=await e.io.readFile(n.absolutePath),i=e.routes.byFilePath(e.file.path)?.slug,a=se(e.args.options,e.file.path,e.args.kind),o=e.args.kind===`openapi`?le(a,e.config,i):a,s={entityDeps:[],assetUsages:[],linkRefs:[],problems:[],pending:[]},c=G(e.contentDir),l={markdown:e.markdown,loader:{config:e.config,entities:e.entities,file:e.file,io:e.io,logger:e.logger,plugin:e.plugin},sink:s},u=await F({kind:e.args.kind,source:r,relativePath:n.relativePath,contentDir:e.contentDir,pagePath:e.file.path,options:o,bundle:q(e.args,c),metadata:X(e.args.options),markdownResolution:l,rbac:{warn:t=>e.logger?.warn(t)}}),d={...p(u.document)&&p(u.document.info)?{infoDescription:u.document.info.description}:{},...await I(u.document,l,{contentDir:e.contentDir,specPath:n.relativePath,pagePath:e.file.path})};e.args.kind===`openapi`&&o.showSchemaCatalogLinks&&p(u.document)&&(u.document[`x-schema-catalog-link`]=oe(e.file.path)),u.options=ce(u.options,u.document,e.args.feedback??e.config.feedback);let f=i?.toLowerCase()??`/`,{items:m,store:h,specType:g}=await t({...u,basePath:f,markdownParser:e=>fe.compact(C(e))}),_=JSON.stringify({items:x(m),store:x(h),options:u.options,specType:g,basePath:f,title:be(u.document,e.args.kind,m),metadata:ye(u.document),[A]:{llms:d}});return{value:await e.createBlobRef(_,{format:`json`}),entityDeps:[...Y(e.file.path,[...u.fileDependencies,...c.paths]),...s.entityDeps],assetUsages:s.assetUsages,markdoc:{tagSet:M},linkRefs:s.linkRefs,problems:s.problems}},{async searchable(e,t){if(t.route===void 0||t.route.metadata.excludeFromSearch===!0)return{docs:[]};let n=S(e),r=await Ee(t.entities,t.route.originFilePath),d={...t.route.metadata,...p(n.metadata)?n.metadata:{}},{category:f,isInvalid:m}=u(d),{facets:h,invalidFields:g}=c({[i]:t.route.metadata.title,[a]:t.route.metadata.version,...d},s(t.config)),{buildApiDocsSearchDocuments:_}=await import(`./server/search-documents.js`);return{..._(n,r,{groupKey:f,facets:h,warn:e=>t.logger?.warn(e)}),problems:l([...g,...m?[o]:[]],t.route.originFilePath)}},async markdown(e,t){if(t.route===void 0)return null;let n=S(e),r=t.route.originFilePath??void 0,i=r?await t.entities.load(w(r)).catch(()=>void 0):void 0,{tags:a}=await N(M);return B(n,ve(i,n[A]?.llms),r,{tags:a,locale:P(t)})},usesProjectMarkdocSchema:!0}),W=t(T,async e=>{let t=K(e),n=await e.io.readFile(t.absolutePath),r=G(e.contentDir),i=await F({kind:e.args.kind,source:n,relativePath:t.relativePath,contentDir:e.contentDir,bundle:q(e.args,r),metadata:X(e.args.options)}),a=e.args.kind===v,o=a?n:JSON.stringify(i.document);return{value:o.length>65536?await e.createBlobRef(o,{format:a?`text`:`json`}):a?n:i.document,metadata:{...Z(e.file.path,e.args.kind,e.args.options,e.args.rbac),...ge(i.document,e.routes.byFilePath(e.file.path)?.slug)},entityDeps:Y(e.file.path,[...i.fileDependencies,...r.paths])}});function G(e){let t=de(e)?.lintPlugins??[];return{plugins:t,paths:t.map(t=>d(H(e,t.path))).filter(e=>e!==``&&!e.startsWith(`../`))}}function K(e){let t=e.args.source?.path??e.file.path;return{relativePath:t,absolutePath:V(e.contentDir,t)}}function he(e){let t=e[j];return p(t)&&typeof t.root==`string`?t.root:void 0}function q(e,t){let{config:n,configDir:r}=e.bundleConfig??{config:{},configDir:``};return{config:n,configDir:r,plugins:t.plugins}}function ge(e,t){let n=p(e)&&p(e.info)?e.info:{},r=p(n[`x-metadata`])?n[`x-metadata`]:{},i=typeof n.description==`string`?n.description.trim():``;return{...t===void 0?{}:{routeSlug:t},...Q(n.version)?{version:String(n.version)}:{},...typeof r.apiId==`string`?{apiId:r.apiId}:{},description:i||void 0}}const J=t(te,async e=>{let{buildNavItems:t,collectPreviousRouteSlugs:n}=await import(`@redocly/api-docs`),r=await e.entities.load(w(e.file.path)),i=e.args.kind===`graphql`?(await import(`graphql`)).parse(r):r,a=ue(i,e.args.kind,{warn:t=>e.logger?.warn(t)}),{items:o}=await t({type:e.args.kind,document:a,options:e.args.options,basePath:`/`,markdownParser:C}),s=R(o),c=n(o).map(({from:e})=>z(e));return{value:s,targetInventories:[{kind:`subpath`,exhaustive:!0,targets:[...L(s),...c]}]}});function Y(e,t){return[{kind:`file`,path:e},...t.map(e=>({kind:`file`,path:e}))]}const _e={arazzo:`Arazzo Docs`,asyncapi:`AsyncAPI Docs`,graphql:`GraphQL Docs`,openapi:`OpenAPI Docs`};function ve(e,t){if(t===void 0||!p(e))return e;let n=p(e.info)?e.info:{},r=p(e.components)?e.components:{};return{...e,...t.infoDescription===void 0?{}:{info:{...n,description:t.infoDescription}},...t.servers===void 0?{}:{servers:t.servers},...t.securitySchemes===void 0?{}:{components:{...r,securitySchemes:t.securitySchemes}}}}function ye(e){let t=p(e)&&p(e.info)?e.info:{};return p(t[`x-metadata`])?t[`x-metadata`]:{}}function be(e,t,n){let r=p(e)&&p(e.info)?e.info:{};if(typeof r.title==`string`&&r.title!==``)return r.title;let i=p(n[0])?n[0].label:void 0;return typeof i==`string`&&i!==``?i:_e[t]}const xe=[`rbac`,`sidebar`,`excludeFromSearch`,`template`];function Se(e,t){let n=p(e.manifest.info)?e.manifest.info:{},r={};typeof n.title==`string`&&(r.title=n.title),Q(n.version)&&(r.version=String(n.version)),typeof n.summary==`string`&&(r.summary=n.summary),p(n[`x-metadata`])&&Object.assign(r,n[`x-metadata`]),p(t.metadata)&&Object.assign(r,t.metadata);for(let e of xe)delete r[e];return r}function X(e){return p(e.metadata)?e.metadata:void 0}function Ce(e){let t=X(e)?.title;return typeof t==`string`&&t.length>0?t:void 0}function Z(e,t,n,r){let i=Ce(n);return{specType:t,sourcePath:e,...i===void 0?{}:{title:i},...r===void 0?{}:{rbac:r},...Object.keys(n).length>0?{options:n}:{},...p(n.mockServer)?{mockServer:n.mockServer}:{}}}function Q(e){return typeof e==`string`||typeof e==`number`}function we(e){if(e.ext===`.gql`||e.ext===`.graphql`)return v;let{openapi:t,swagger:n,asyncapi:r,arazzo:i}=e.manifest;return Q(t)||Q(n)?y:Q(r)?_:Q(i)?g:null}const Te=e({id:ee,version:`0.43.0`,content:{filter:{extensions:pe},async extractFile(e,t){if(f.test(e.path))return null;let n=we(e);if(n===null)return null;if(n!==`arazzo`&&!b(t.config,n))return{routes:[],problems:[m(`${me[n]} documents`)]};let r=e.path,i=he(e.manifest),a=i??r,{rbac:o,...s}=await ie(t.io,t.config,r,n,a),c={filePath:r,kind:n,options:s,...o===void 0||!b(t.config,`rbac`)?{}:{rbac:o}};i!==void 0&&(c.source={path:i});let l=await ae(t.io,t.config,a);if(l!==void 0&&(c.feedback=l),n!==`graphql`){let e=await re(t.io,t.config,r,a);Object.keys(e.config).length>0&&(c.bundleConfig=e)}let u=W.withArgs(c,{stableKey:w(r),type:`api`,metadata:Z(r,n,s,c.rbac)});if(n===`arazzo`)return{routes:[],entities:[u]};let d=Se(e,s);s.excludeFromSearch===!0&&(d.excludeFromSearch=!0),d.type=n,c.rbac!==void 0&&(d.rbac=c.rbac);let p=U.withArgs(c,{stableKey:`api-docs:render:${r}`}),g=J.withArgs(c,{stableKey:`api-docs:sidebar:${r}`}),_=h(r);return{routes:[{deps:{[E]:p},metadata:d,routeId:`page`,sidebarSubtree:g,slug:null,slugHint:_,template:O,wildcardPrefix:!0}],entities:[u,p,g]}}},loaders:[W,U,J],templates:{[O]:r(n(`./client/template.tsx`,import.meta.url))},server:{routes:[$(k.bundle,`bundle`),$(k.deprecatedBundle,`bundle`),$(k.graphql,`graphql`)]}});function $(e,t){return{method:`GET`,path:e+ne,handler:{filePath:`./server/spec-download.ts`,importer:import.meta.url,exportName:t}}}async function Ee(e,t){if(t)try{return await e.load(w(t))}catch{return}}export{Te as apiDocsContentPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isRbacScope as e}from"../../../../../server/rbac/engine.js";import{REDOCLY_TEAMS_RBAC as t}from"@redocly/config";function n(e){return e.map(o)}function r(e){let t=/* @__PURE__ */ new Set,n=e=>{for(let r of e){let e=i(r.slugSuffix??``);e!==``&&t.add(e),r.items&&r.items.length>0&&n(r.items)}};return n(e),[...t]}function i(e){return e.replace(/^\/+/,``)}function a(e){return e===``||e.startsWith(`/`)?e:`/${e}`}function o(n){let r={};n.label!==void 0&&(r.label=n.label),n.link!==void 0&&(r.slugSuffix=a(n.link)),n.httpVerb!==void 0&&(r.httpVerb=n.httpVerb),n.deprecated!==void 0&&(r.deprecated=n.deprecated),n.badges!==void 0&&(r.badges=n.badges),n.external!==void 0&&(r.external=n.external),n.separatorLine!==void 0&&(r.separatorLine=n.separatorLine),n.icon!==void 0&&(r.icon=n.icon),n.variant!==void 0&&(r.variant=n.variant);let i=n[t];return e(i)&&(r[t]=i),n.type===`separator
|
|
1
|
+
import{isRbacScope as e}from"../../../../../server/rbac/engine.js";import{REDOCLY_TEAMS_RBAC as t}from"@redocly/config";function n(e){return e.map(o)}function r(e){let t=/* @__PURE__ */ new Set,n=e=>{for(let r of e){let e=i(r.slugSuffix??``);e!==``&&t.add(e),r.items&&r.items.length>0&&n(r.items)}};return n(e),[...t]}function i(e){return e.replace(/^\/+/,``)}function a(e){return e===``||e.startsWith(`/`)?e:`/${e}`}function o(n){let r={};n.label!==void 0&&(r.label=n.label),n.link!==void 0&&(r.slugSuffix=a(n.link)),n.httpVerb!==void 0&&(r.httpVerb=n.httpVerb),n.deprecated!==void 0&&(r.deprecated=n.deprecated),n.badges!==void 0&&(r.badges=n.badges),n.external!==void 0&&(r.external=n.external),n.separatorLine!==void 0&&(r.separatorLine=n.separatorLine),n.icon!==void 0&&(r.icon=n.icon),n.variant!==void 0&&(r.variant=n.variant);let i=n[t];return e(i)&&(r[t]=i),(n.type===`link`||n.type===`group`||n.type===`separator`)&&(r.type=n.type),r.type===`separator`&&(r.separatorLine=!0),n.items&&n.items.length>0&&(r.items=n.items.map(o)),r}export{r as collectSidebarSubpathTargets,n as toSidebarSubtree,i as toSubpathTarget};
|