@redocly/realm 0.134.0-next.5 → 0.134.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @redocly/realm
2
2
 
3
+ ## 0.134.0-next.6
4
+
5
+ ### Minor Changes
6
+
7
+ - 508d0a99e9a: Added support for default values in `redocly.yaml` environment variable references.
8
+ The default value is used only when the environment variable is not set.
9
+
10
+ ### Patch Changes
11
+
12
+ - 03d74403dfe: Fixed docs MCP server to flush response headers immediately and send SSE keepalive pings, preventing proxy timeouts (504) during long-running tool calls.
13
+ - @redocly/openapi-docs@3.22.0-next.5
14
+ - @redocly/asyncapi-docs@1.11.0-next.5
15
+ - @redocly/graphql-docs@1.11.0-next.5
16
+ - @redocly/portal-plugin-mock-server@0.19.0-next.5
17
+
3
18
  ## 0.134.0-next.5
4
19
 
5
20
  ### Patch Changes
@@ -1,29 +1,29 @@
1
- import{isPrimitive as v}from"../../../../utils/guards/is-primitive.js";import{getNodeAttribute as c}from"../../../../markdoc/helpers/get-node-attribute.js";import{getVariable as T}from"../../../../markdoc/helpers/get-variable.js";import{isTag as C}from"../../../../markdoc/helpers/guards/is-tag.js";import{isNode as N}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as A}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isVariable as E}from"../../../../markdoc/helpers/guards/is-variable.js";import{isExampleNode as w}from"../../../../markdoc/helpers/guards/is-example-node.js";import{isFenceNode as x}from"../../../../markdoc/helpers/guards/is-fence-node.js";function s(a,n={}){const r=[];for(const e of a){if(v(e)){const i=n.isTrim?d(String(e)):String(e);i&&r.push(i)}else if(N(e))switch(e.type){case"text":r.push(s([c(e,"content")],n));break;case"code":r.push(`\`${s([c(e,"content")],n)}\``);break;case"blockquote":r.push(`> ${s(e.children,n)}
2
- `);break;case"fence":const i=c(e,"process")===!1;r.push(f(e,n,i));break;case"list":const l=c(e,"ordered")||!1,o=c(e,"marker"),u=e.children.map((t,h)=>`${" ".repeat((n?.indent??0)*2)}${l?h+1:""}${o} ${s([t],{...n??{},indent:(n?.indent??0)+1})}`);r.push(`${u.join("")}
3
- `);break;case"item":r.push(e.children.map(t=>`${s([t],n).trimEnd()}
4
- `).join(""));break;case"thead":const p=e.children.map(t=>s([t],n));r.push(`${p}| ${" --- |".repeat(e.children?.[0]?.children.length)}
5
- `);break;case"tr":const $=e.children.map(t=>s([t],n));r.push(`| ${$.join(" | ")} |
6
- `);break;case"em":r.push(`*${s(e.children,n)}*`);break;case"strong":r.push(`**${s(e.children,n)}**`);break;case"softbreak":case"hardbreak":r.push(`
1
+ import{isPrimitive as v}from"../../../../utils/guards/is-primitive.js";import{getNodeAttribute as c}from"../../../../markdoc/helpers/get-node-attribute.js";import{getVariable as T}from"../../../../markdoc/helpers/get-variable.js";import{isTag as C}from"../../../../markdoc/helpers/guards/is-tag.js";import{isNode as N}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as y}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isVariable as A}from"../../../../markdoc/helpers/guards/is-variable.js";import{isExampleNode as B}from"../../../../markdoc/helpers/guards/is-example-node.js";import{isFenceNode as E}from"../../../../markdoc/helpers/guards/is-fence-node.js";function a(s,n={}){const r=[];for(const e of s){if(v(e)){const i=n.isTrim?u(String(e)):String(e);i&&r.push(i)}else if(N(e))switch(e.type){case"text":r.push(a([c(e,"content")],n));break;case"code":r.push(`\`${a([c(e,"content")],n)}\``);break;case"blockquote":r.push(`> ${a(e.children,n)}
2
+ `);break;case"fence":const i=c(e,"process")===!1;r.push(f(e,n,i));break;case"list":const l=c(e,"ordered")||!1,o=c(e,"marker"),d=e.children.map((t,h)=>`${" ".repeat((n?.indent??0)*2)}${l?h+1:""}${o} ${a([t],{...n??{},indent:(n?.indent??0)+1})}`);r.push(`${d.join("")}
3
+ `);break;case"item":r.push(e.children.map(t=>`${a([t],n).trimEnd()}
4
+ `).join(""));break;case"thead":const p=e.children.map(t=>a([t],n));r.push(`${p}| ${" --- |".repeat(e.children?.[0]?.children.length)}
5
+ `);break;case"tr":const $=e.children.map(t=>a([t],n));r.push(`| ${$.join(" | ")} |
6
+ `);break;case"em":r.push(`*${a(e.children,n)}*`);break;case"strong":r.push(`**${a(e.children,n)}**`);break;case"softbreak":case"hardbreak":r.push(`
7
7
  `);break;case"hr":r.push(`
8
8
 
9
9
  ---
10
10
 
11
- `);break;case"heading":const k=c(e,"level")??0;r.push(`${"#".repeat(k)} ${s(e.children,n)}
12
- `);break;case"image":const g=c(e,"alt")||"",b=c(e,"src")||"";r.push(`![${g}](${b})`);break;case"link":const j=c(e,"href")||"";r.push(`[${s(e.children,n)}](${j})`);break;case"paragraph":case"table":r.push(`${s(e.children,n)}
13
- `);break;case"tag":if(A(e)&&n.skipConditionals)continue;if(w(e)){r.push(...e.children.map(t=>{if(x(t)){const h=c(t,"process")!==!0;return f(t,n,h)}return s([t],n)}));continue}if(e.tag==="code-snippet"){const t=c(e,"rawContent");if(t){const h=c(e,"language"),m=c(e,"title"),S=`
11
+ `);break;case"heading":const g=c(e,"level")??0;r.push(`${"#".repeat(g)} ${a(e.children,n)}
12
+ `);break;case"image":const k=c(e,"alt")||"",b=c(e,"src")||"";r.push(`![${k}](${b})`);break;case"link":const j=c(e,"href")||"";r.push(`[${a(e.children,n)}](${j})`);break;case"paragraph":case"table":r.push(`${a(e.children,n)}
13
+ `);break;case"tag":if(y(e)&&n.skipConditionals)continue;if(B(e)){r.push(...e.children.map(t=>{if(E(t)){const h=c(t,"process")!==!0;return f(t,n,h)}return a([t],n)}));continue}if(e.tag==="code-snippet"){const t=c(e,"rawContent");if(t){const h=c(e,"language"),m=c(e,"title"),S=`
14
14
  \`\`\`${`${h||""}${m?`${h?" ":""}${m}`:""}`}
15
15
  ${t.trimEnd()}
16
16
  \`\`\`
17
- `;r.push(S)}continue}if(e.tag==="json-example"){const t=y(e);t&&r.push(t);continue}if(e.tag==="json-schema"){const t=B(e);t&&r.push(t);continue}r.push(`${s(e.children,n)}`);break;default:r.push(s(e.children,n));break}else C(e)&&r.push(s(e.children,n));E(e)&&r.push(s([T(e,n.variables)],n))}return n.isTrim?d(r.map(e=>d(e)).join("")):r.join("")}function d(a){return a.replace(/^[ \t\r\f]+|[ \t\r\f]+$/g,"")}function f(a,n={},r=!1){const e=c(a,"title"),i=c(a,"language"),l=`${i||""}${e?`${i?" ":""}${e}`:""}`,o=r?(c(a,"content")||"").trimEnd():s(a.children,n).trimEnd();return`
17
+ `;r.push(S)}continue}if(e.tag==="json-example"){const t=w(e);t&&r.push(t);continue}if(e.tag==="json-schema"){const t=x(e);t&&r.push(t);continue}if(n.renderTag){const t=n.renderTag(e,{getBody:()=>a(e.children,n)});if(t!==void 0){r.push(t);continue}}r.push(`${a(e.children,n)}`);break;default:r.push(a(e.children,n));break}else C(e)&&r.push(a(e.children,n));A(e)&&r.push(a([T(e,n.variables)],n))}return n.isTrim?u(r.map(e=>u(e)).join("")):r.join("")}function u(s){return s.replace(/^[ \t\r\f]+|[ \t\r\f]+$/g,"")}function f(s,n={},r=!1){const e=c(s,"title"),i=c(s,"language"),l=`${i||""}${e?`${i?" ":""}${e}`:""}`,o=r?(c(s,"content")||"").trimEnd():a(s.children,n).trimEnd();return`
18
18
  \`\`\`${l}
19
19
  ${o}
20
20
  \`\`\`
21
- `}function y(a){const n=c(a,"json")??c(a,"valueResolved")??c(a,"schemaResolved"),r=c(a,"title");return n===null?null:`
21
+ `}function w(s){const n=c(s,"json")??c(s,"valueResolved")??c(s,"schemaResolved"),r=c(s,"title");return n===null?null:`
22
22
  \`\`\`${`json${r?` ${r}`:""}`}
23
23
  ${JSON.stringify(n,null,2)}
24
24
  \`\`\`
25
- `}function B(a){const n=c(a,"schemaResolved");if(n===null)return null;const{components:r,openapi:e,...i}=n,{__root:l,...o}=r?.schemas||{},u=l?{...l,...Object.keys(o).length>0?{components:{schemas:o}}:{},...i}:n;return`
25
+ `}function x(s){const n=c(s,"schemaResolved");if(n===null)return null;const{components:r,openapi:e,...i}=n,{__root:l,...o}=r?.schemas||{},d=l?{...l,...Object.keys(o).length>0?{components:{schemas:o}}:{},...i}:n;return`
26
26
  \`\`\`json
27
- ${JSON.stringify(u,null,2)}
27
+ ${JSON.stringify(d,null,2)}
28
28
  \`\`\`
29
- `}export{s as toMarkdown};
29
+ `}export{a as toMarkdown};
@@ -1 +1 @@
1
- import{logger as N}from"../../../tools/notifiers/logger.js";import{isNode as h}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as T}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isContentNode as m}from"../../../../markdoc/helpers/guards/is-content-node.js";import{getNodeAttribute as u}from"../../../../markdoc/helpers/get-node-attribute.js";import{extractRbacFromCondition as w}from"../../../../markdoc/helpers/extract-rbac-from-condition-node.js";import{TextNode as l}from"./nodes/text-node.js";import{TAG_TITLE_ATTRIBUTES as b,TagNode as p}from"./nodes/tag-node.js";import{HeadingNode as a}from"./nodes/heading-node.js";import{joinSectionContent as d}from"./join-section-content.js";class B{#s;#o;#i;#r;#c;constructor({ast:i,partials:t,skipConditionals:r=!1,getInnerContent:s,renderTag:o}){if(this.#s=i,this.#o=t,this.#i=r,this.#r=s,this.#c=o,!this.#s||!h(this.#s))throw new Error("ast is not a valid Markdoc Node.")}*transform(){yield*this.#e(this.#s,{parentNode:null})}*#e(i,t,r=this.#r){if(!(!i||!h(i))){if(T(i)){if(this.#i)return;const s=w(i);s&&s.length>0&&(yield*this.#t(i,{...t,rbacTeams:s},r));return}if(m(i)){yield new l({node:i,content:r([i],{skipConditionals:this.#i}),...t});return}if(i.type==="heading"){yield new a({node:i,content:r([i],{skipConditionals:this.#i}),rbacTeams:t?.rbacTeams});return}if(i.type==="tag"){yield*this.#l(i,t,r);return}yield*this.#t(i,t,r)}}*#l(i,t,r=this.#r){switch(i.tag){case"partial":{const s=i.attributes.file,o=i.attributes.variables??{};if(s&&this.#o[s]){yield*this.#e(this.#o[s],t,(e,n)=>r(e,{...n,variables:o}));return}N.warn(`Could not create search indexes for partial \u201C${s}\u201D: file not found`);return}case"cards":case"tabs":case"code-walkthrough":{yield*this.#t(i,t,r);return}case"markdoc-example":{const s=r([i],{skipConditionals:this.#i});yield new l({node:i,content:s,...t});return}case"code-snippet":{const s=u(i,"title"),o=r([i],{skipConditionals:this.#i});if(s){const e=new p({node:i,content:s,...t});t={...t,parentNode:e},yield e}o&&(yield new l({node:i,content:o,...t}));return}default:{const s=this.#n(i,t,r);if(s){yield*s;return}const o=b.find(c=>c in i.attributes),e=(o&&u(i,o))??"",n=typeof e=="string"?e:r([e]);if(n){const c=new p({node:i,content:n,...t});t={...t,parentNode:c},yield c}if(y(i))yield*this.#t(i,t,r);else{const c=r([i],{skipConditionals:this.#i});c&&(yield new l({node:i,content:c,...t}))}return}}}#n(i,t,r){const s=()=>y(i)?d([...this.#t(i,t,r)]):"",o=this.#c?.(i,{getBody:s});return o===void 0?void 0:[new l({node:i,content:o,...t})]}*#t(i,t,r=this.#r){for(const s of[...Object.values(i.slots),...i.children])for(const o of this.#e(s,t,r))o instanceof a&&(t={...t,parentNode:o}),yield o}}function y(f){return f.children.length>0||Object.keys(f.slots).length>0}export{B as AstToSearchNodeTransformer};
1
+ import{logger as N}from"../../../tools/notifiers/logger.js";import{isNode as f}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as T}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isContentNode as m}from"../../../../markdoc/helpers/guards/is-content-node.js";import{getNodeAttribute as u}from"../../../../markdoc/helpers/get-node-attribute.js";import{extractRbacFromCondition as w}from"../../../../markdoc/helpers/extract-rbac-from-condition-node.js";import{TextNode as l}from"./nodes/text-node.js";import{TAG_TITLE_ATTRIBUTES as b,TagNode as p}from"./nodes/tag-node.js";import{HeadingNode as y}from"./nodes/heading-node.js";import{joinSectionContent as d}from"./join-section-content.js";class B{#r;#o;#e;#s;#c;constructor({ast:i,partials:t,skipConditionals:s=!1,getInnerContent:r,renderTag:o}){if(this.#r=i,this.#o=t,this.#e=s,this.#s=r,this.#c=o,!this.#r||!f(this.#r))throw new Error("ast is not a valid Markdoc Node.")}#i(){return{skipConditionals:this.#e,renderTag:this.#c}}*transform(){yield*this.#l(this.#r,{parentNode:null})}*#l(i,t,s=this.#s){if(!(!i||!f(i))){if(T(i)){if(this.#e)return;const r=w(i);r&&r.length>0&&(yield*this.#t(i,{...t,rbacTeams:r},s));return}if(m(i)){yield new l({node:i,content:s([i],this.#i()),...t});return}if(i.type==="heading"){yield new y({node:i,content:s([i],this.#i()),rbacTeams:t?.rbacTeams});return}if(i.type==="tag"){yield*this.#n(i,t,s);return}yield*this.#t(i,t,s)}}*#n(i,t,s=this.#s){switch(i.tag){case"partial":{const r=i.attributes.file,o=i.attributes.variables??{};if(r&&this.#o[r]){yield*this.#l(this.#o[r],t,(e,n)=>s(e,{...n,variables:o}));return}N.warn(`Could not create search indexes for partial \u201C${r}\u201D: file not found`);return}case"cards":case"tabs":case"code-walkthrough":{yield*this.#t(i,t,s);return}case"markdoc-example":{const r=s([i],this.#i());yield new l({node:i,content:r,...t});return}case"code-snippet":{const r=u(i,"title"),o=s([i],this.#i());if(r){const e=new p({node:i,content:r,...t});t={...t,parentNode:e},yield e}o&&(yield new l({node:i,content:o,...t}));return}default:{const r=this.#h(i,t,s);if(r){yield*r;return}const o=b.find(c=>c in i.attributes),e=(o&&u(i,o))??"",n=typeof e=="string"?e:s([e]);if(n){const c=new p({node:i,content:n,...t});t={...t,parentNode:c},yield c}if(a(i))yield*this.#t(i,t,s);else{const c=s([i],this.#i());c&&(yield new l({node:i,content:c,...t}))}return}}}#h(i,t,s){const r=()=>a(i)?d([...this.#t(i,t,s)]):"",o=this.#c?.(i,{getBody:r});return o===void 0?void 0:[new l({node:i,content:o,...t})]}*#t(i,t,s=this.#s){for(const r of[...Object.values(i.slots),...i.children])for(const o of this.#l(r,t,s))o instanceof y&&(t={...t,parentNode:o}),yield o}}function a(h){return h.children.length>0||Object.keys(h.slots).length>0}export{B as AstToSearchNodeTransformer};
@@ -9,5 +9,6 @@ export declare const McpErrorCodes: {
9
9
  readonly InvalidParams: -32602;
10
10
  };
11
11
  export declare const DEFAULT_CONNECTION_TIMEOUT_MS = 30000;
12
+ export declare const SSE_KEEPALIVE_INTERVAL_MS = 15000;
12
13
  export declare const MAX_DOCUMENTS_PER_CATEGORY = 3;
13
14
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- const r={Docs:"docs"},o={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},e=3e4,t=3;export{e as DEFAULT_CONNECTION_TIMEOUT_MS,t as MAX_DOCUMENTS_PER_CATEGORY,o as McpErrorCodes,r as McpServerType};
1
+ const r={Docs:"docs"},o={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},e=3e4,t=15e3,E=3;export{e as DEFAULT_CONNECTION_TIMEOUT_MS,E as MAX_DOCUMENTS_PER_CATEGORY,o as McpErrorCodes,r as McpServerType,t as SSE_KEEPALIVE_INTERVAL_MS};
@@ -1 +1 @@
1
- import{toFetchResponse as C,toReqRes as v}from"fetch-to-node";import{logger as l}from"../../../tools/notifiers/logger.js";import{isObject as S}from"../../../../utils/guards/is-object.js";import{createDocsMcpServer as b}from"../servers/docs-server.js";import{filterApiDescriptionsByRbac as N}from"../utils.js";import{createMethodNotAllowedError as O,withErrorHandling as U}from"./errors.js";import{McpServerType as k}from"../constants.js";import{constructInvalidTokenResponse as E,constructUnauthorizedResponse as H,handleMcpAuth as I,shouldHandleMcpAuth as j}from"../auth/auth-handlers.js";import{extractTokenFromAuthHeader as L}from"../utils/jwt.js";const c="X-Redocly-AI-Metadata";function J(r){if(r)try{const e=JSON.parse(r);if(S(e))return e;l.warn(`Ignoring ${c} header: not a JSON object.`)}catch{l.warn(`Ignoring ${c} header: invalid JSON.`)}}const P=async(r,e,m)=>{const p=!!e?.config?.access?.requiresLogin,d=e?.config?.access?.rbac||{};let s;const u=r.headers.get("Authorization");if(j(p,d)){const{isAuthenticated:n,isTokenValid:a,currentUser:t,accessToken:i}=await I(r,e);if(!n)return H(new URL(r.url).origin);if(!a)return E();t&&(e.user=t),s=i}else u&&(s=L(u||"")??void 0);let o;const g=async()=>{o&&(await o.cleanup(),o=void 0)};return await U(async()=>{if(r.method==="GET")return new Response(JSON.stringify({error:"Method Not Allowed",message:`In order to use this MCP server, you need register it in your MCP Client (VS Code, Cursor, Claude Code, etc.) using that URL: ${r.url}`}),{status:405,headers:{"Content-Type":"application/json"}});if(r.method!=="POST")return O();const n=m,a=n?.props?.config?.apiDescriptionsMap||{},t=n?.props?.config?.mcpDocsServerName||"Docs MCP server",{config:{mcp:i={}}}=e,h=N(a,e.user,d,p),M=e.config.products?Object.values(e.config.products).map(T=>T?.name):[],A=i.docs?.name||t,R=J(r.headers.get(c)),w=n?.props?.tools||[];o=await b({name:A,tools:w,context:{...e,accessToken:s,outdir:e.outdir||"",baseUrl:e.baseUrl||new URL(r.url).origin,apiDescriptionsMap:h,products:M,metadata:R}});const y=await r.json(),{req:D,res:f}=v(r);return await o.transport.handleRequest(D,f,y),C(f)},k.Docs,g)};var Q=P;export{Q as default};
1
+ import{toFetchResponse as C,toReqRes as S}from"fetch-to-node";import{logger as m}from"../../../tools/notifiers/logger.js";import{isObject as b}from"../../../../utils/guards/is-object.js";import{createDocsMcpServer as N}from"../servers/docs-server.js";import{filterApiDescriptionsByRbac as k}from"../utils.js";import{createMethodNotAllowedError as O,withErrorHandling as U}from"./errors.js";import{attachSseKeepalive as E}from"./sse-keepalive.js";import{McpServerType as H}from"../constants.js";import{constructInvalidTokenResponse as I,constructUnauthorizedResponse as j,handleMcpAuth as L,shouldHandleMcpAuth as J}from"../auth/auth-handlers.js";import{extractTokenFromAuthHeader as P}from"../utils/jwt.js";const d="X-Redocly-AI-Metadata";function $(r){if(r)try{const e=JSON.parse(r);if(b(e))return e;m.warn(`Ignoring ${d} header: not a JSON object.`)}catch{m.warn(`Ignoring ${d} header: invalid JSON.`)}}const z=async(r,e,h)=>{const u=!!e?.config?.access?.requiresLogin,f=e?.config?.access?.rbac||{};let s;const l=r.headers.get("Authorization");if(J(u,f)){const{isAuthenticated:t,isTokenValid:a,currentUser:n,accessToken:i}=await L(r,e);if(!t)return j(new URL(r.url).origin);if(!a)return I();n&&(e.user=n),s=i}else l&&(s=P(l||"")??void 0);let o;const g=async()=>{o&&(await o.cleanup(),o=void 0)};return await U(async()=>{if(r.method==="GET")return new Response(JSON.stringify({error:"Method Not Allowed",message:`In order to use this MCP server, you need register it in your MCP Client (VS Code, Cursor, Claude Code, etc.) using that URL: ${r.url}`}),{status:405,headers:{"Content-Type":"application/json"}});if(r.method!=="POST")return O();const t=h,a=t?.props?.config?.apiDescriptionsMap||{},n=t?.props?.config?.mcpDocsServerName||"Docs MCP server",{config:{mcp:i={}}}=e,M=k(a,e.user,f,u),A=e.config.products?Object.values(e.config.products).map(p=>p?.name):[],R=i.docs?.name||n,w=$(r.headers.get(d)),y=t?.props?.tools||[];o=await N({name:R,tools:y,context:{...e,accessToken:s,outdir:e.outdir||"",baseUrl:e.baseUrl||new URL(r.url).origin,apiDescriptionsMap:M,products:A,metadata:w}});const D=await r.json(),{req:T,res:c}=S(r),v=E(c);try{await o.transport.handleRequest(T,c,D)}catch(p){throw v.stop(),p}return C(c)},H.Docs,g)};var Z=z;export{Z as default};
@@ -0,0 +1,15 @@
1
+ import type { ServerResponse } from 'node:http';
2
+ export type SseKeepalive = {
3
+ stop: () => void;
4
+ };
5
+ /**
6
+ * Wraps res.writeHead so that, the moment the transport starts an SSE response
7
+ * (status 200 + Content-Type: text/event-stream), headers are flushed immediately
8
+ * (so intermediary proxies like CloudFront receive them before their origin
9
+ * response timeout) and SSE comment pings are written on an interval.
10
+ *
11
+ * Returns a handle whose stop() clears the timer; it also auto-stops on the
12
+ * response's 'finish'/'close'/'error' events.
13
+ */
14
+ export declare function attachSseKeepalive(res: ServerResponse, intervalMs?: number): SseKeepalive;
15
+ //# sourceMappingURL=sse-keepalive.d.ts.map
@@ -0,0 +1,3 @@
1
+ import{SSE_KEEPALIVE_INTERVAL_MS as u}from"../constants.js";const s="text/event-stream",d=`: keepalive
2
+
3
+ `;function p(t){const[a,r,o]=t;if(a!==200)return!1;const e=typeof r=="object"&&r!==null?r:o;if(!e||typeof e!="object")return!1;if(!Array.isArray(e)){for(const[n,i]of Object.entries(e))if(n.toLowerCase()==="content-type")return String(i).toLowerCase().includes(s);return!1}if(e.length&&Array.isArray(e[0]))return e.some(([n,i])=>String(n).toLowerCase()==="content-type"&&String(i).toLowerCase().includes(s));for(let n=0;n+1<e.length;n+=2)if(String(e[n]).toLowerCase()==="content-type"&&String(e[n+1]).toLowerCase().includes(s))return!0;return!1}function S(t,a=u){let r,o=!1;const e=()=>{o=!0,r&&(clearInterval(r),r=void 0)},n=()=>!t.writableEnded&&!t.destroyed,i=()=>{o||r||(r=setInterval(()=>{if(!n()){e();return}try{t.write(d)}catch{e()}},a),r.unref?.())};t.once("finish",e),t.once("close",e),t.once("error",e);const c=t.writeHead.bind(t);return t.writeHead=function(...f){t.writeHead=c;const l=c(...f);if(!o&&p(f)){try{t.flushHeaders()}catch{}i()}return l},{stop:e}}export{S as attachSseKeepalive};
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * Interpolates environment variables in a string using the format {{ process.env.VARIABLE_NAME }}.
3
+ * Supports optional quoted default values applied when the variable is not set,
4
+ * e.g. {{ process.env.VARIABLE_NAME || "default" }} (both `|` and `||` separators are accepted).
3
5
  *
4
6
  * @param value - The string containing environment variable templates to interpolate
5
7
  * @returns An object containing:
6
8
  * - interpolatedValue: The string with all environment variables replaced with their values
7
- * - unsetVars: Array of environment variable names that were not found
9
+ * - unsetVars: Array of environment variable names that were not found and had no default
8
10
  * - interpolatedVars: Array of environment variable names that were successfully resolved
9
11
  */
10
12
  export declare function interpolateEnvVariables(value: string): {
@@ -1 +1 @@
1
- import{readEnvVariable as i}from"./read-env-variable.js";const l=/{{\s*process\.env\.([A-Z0-9_]+)\s*}}/gi;function V(r){let e=r;const t=new Set,a=new Set,c=[...r.matchAll(l)];for(const s of c){const n=s[1].toUpperCase(),o=i(n);o===void 0?t.add(n):(e=e.replace(s[0],o),a.add(n))}return{interpolatedValue:e,unsetVars:Array.from(t),interpolatedVars:Array.from(a)}}export{V as interpolateEnvVariables};
1
+ import{readEnvVariable as d}from"./read-env-variable.js";const i=/{{\s*process\.env\.([A-Z0-9_]+)\s*(?:\|\|?\s*(?:"([^"]*)"|'([^']*)'))?\s*}}/gi;function V(s){let e=s;const t=new Set,r=new Set,c=[...s.matchAll(i)];for(const n of c){const a=n[1].toUpperCase(),o=n[2]??n[3],l=d(a);l!==void 0?(e=e.replace(n[0],l),r.add(a)):o!==void 0?(e=e.replace(n[0],o),r.add(a)):t.add(a)}return{interpolatedValue:e,unsetVars:Array.from(t),interpolatedVars:Array.from(r)}}export{V as interpolateEnvVariables};
@@ -1 +1 @@
1
- import{context as n,SpanStatusCode as s,trace as o}from"@opentelemetry/api";import{envConfig as a}from"../../config/env-config.js";const m=e=>{const t=o?.getSpan(n.active());return t&&(t.setStatus({code:s.ERROR,message:e.message}),t.recordException(e),t.end()),e instanceof Error&&"name"in e&&e.name==="URIError"?new Response("Malformed URL",{status:400}):a.isDevelopMode&&e?.name==="PageMissingDefaultExportError"?new Response(e.message,{status:200}):new Response("Internal Server Error",{status:500})};export{m as errorHandler};
1
+ import{context as s,SpanStatusCode as n,trace as a}from"@opentelemetry/api";import{envConfig as o}from"../../config/env-config.js";const c=t=>{const e=a?.getSpan(s.active());return t instanceof Error&&"name"in t&&t.name==="URIError"?(e&&(e.setStatus({code:n.OK}),e.end()),new Response("Malformed URL",{status:400})):t instanceof SyntaxError?(e&&(e.setStatus({code:n.OK}),e.end()),new Response("Invalid JSON",{status:400})):(e&&(e.setStatus({code:n.ERROR,message:t.message}),e.recordException(t),e.end()),o.isDevelopMode&&t?.name==="PageMissingDefaultExportError"?new Response(t.message,{status:200}):new Response("Internal Server Error",{status:500}))};export{c as errorHandler};
@@ -1,9 +1,11 @@
1
1
  import type { Node, Variable, RenderableTreeNode, Function } from '@markdoc/markdoc';
2
+ import type { RenderTagFn } from '../server/types/plugins/markdown.js';
2
3
  export type GetInnerContentFnOptions = {
3
4
  indent?: number;
4
5
  isTrim?: boolean;
5
6
  skipConditionals?: boolean;
6
7
  variables?: Record<string, unknown>;
8
+ renderTag?: RenderTagFn;
7
9
  };
8
10
  export type GetInnerContentFn = (children: (RenderableTreeNode | Node | Variable | Function)[], options?: GetInnerContentFnOptions) => string;
9
11
  //# sourceMappingURL=markdoc.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/realm",
3
- "version": "0.134.0-next.5",
3
+ "version": "0.134.0-next.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -91,12 +91,12 @@
91
91
  "xpath": "0.0.34",
92
92
  "yaml-ast-parser": "0.0.43",
93
93
  "zod": "^3.25.76",
94
- "@redocly/asyncapi-docs": "1.11.0-next.4",
94
+ "@redocly/asyncapi-docs": "1.11.0-next.5",
95
95
  "@redocly/config": "0.49.0",
96
- "@redocly/graphql-docs": "1.11.0-next.4",
97
- "@redocly/openapi-docs": "3.22.0-next.4",
96
+ "@redocly/graphql-docs": "1.11.0-next.5",
97
+ "@redocly/openapi-docs": "3.22.0-next.5",
98
98
  "@redocly/portal-legacy-ui": "0.17.0-next.1",
99
- "@redocly/portal-plugin-mock-server": "0.19.0-next.4",
99
+ "@redocly/portal-plugin-mock-server": "0.19.0-next.5",
100
100
  "@redocly/realm-asyncapi-sdk": "0.12.0-next.3",
101
101
  "@redocly/theme": "0.66.0-next.4"
102
102
  },