@redocly/asyncapi-docs
Version:
Async API docs for Redocly Realm
26 lines (25 loc) • 3.76 kB
JavaScript
var f=Object.create;var d=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var D=(i,r)=>{for(var o in r)d(i,o,{get:r[o],enumerable:!0})},g=(i,r,o,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!y.call(i,t)&&t!==o&&d(i,t,{get:()=>r[t],enumerable:!(c=b(r,t))||c.enumerable});return i};var V=(i,r,o)=>(o=i!=null?f(S(i)):{},g(r||!i||!i.__esModule?d(o,"default",{value:i,enumerable:!0}):o,i)),w=i=>g(d({},"__esModule",{value:!0}),i);var W={};D(W,{ServerOverviewSection:()=>v});module.exports=w(W);var n=require("react/jsx-runtime"),m=require("@redocly/theme"),x=require("@redocly/openapi-docs"),l=V(require("styled-components")),p=require("react/jsx-runtime"),e=require("./common");const z=i=>{const r=i.title||i.summary||i.description;return(0,n.jsxs)(e.Block,{children:[(0,n.jsx)(e.Header,{children:"Info"}),(0,n.jsxs)(e.Section,{children:[(0,n.jsx)(e.Label,{children:"Host:"}),(0,n.jsx)(e.Value,{children:i.host})]}),(0,n.jsxs)(e.Section,{children:[(0,n.jsxs)(e.Label,{children:["Protocol",i.protocolVersion?" and version":"",":"]}),(0,n.jsxs)(e.Value,{children:[i.protocol,i.protocolVersion&&`, ${i.protocolVersion}`]})]}),r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a,{}),i.title&&(0,n.jsxs)(e.Section,{children:[(0,n.jsx)(e.Label,{children:"Title:"}),(0,n.jsx)(e.Value,{children:i.title})]}),i.summary&&(0,n.jsxs)(e.Section,{children:[(0,n.jsx)(e.Label,{children:"Summary:"}),(0,n.jsx)(e.Value,{children:i.summary})]}),i.description&&(0,n.jsxs)(e.Section,{children:[(0,n.jsx)(e.Label,{children:"Description:"}),(0,n.jsx)(e.Value,{children:i.description})]})]})]})},T=i=>(0,n.jsxs)(e.Block,{children:[(0,n.jsx)(e.Header,{children:"Variables"}),i.map(({key:r,value:o},c,t)=>(0,n.jsxs)(p.Fragment,{children:[(0,n.jsxs)(e.Section,{children:[(0,n.jsx)(E,{children:r}),o.default&&(0,n.jsxs)(h,{children:["Default",(0,n.jsx)(m.Tag,{size:"small",borderless:!0,children:o.default})]}),o.description&&(0,n.jsx)(F,{children:o.description}),o.enum&&(0,n.jsxs)(h,{children:["Enum",(0,n.jsx)(I,{children:o.enum.map(s=>(0,n.jsx)(m.Tag,{size:"small",borderless:!0,children:s},s))})]})]}),c<t.length-1&&(0,n.jsx)(a,{})]},r))]}),j=i=>(0,n.jsxs)(e.Block,{children:[(0,n.jsx)(e.Header,{children:"Tags"}),i.map((r,o,c)=>(0,n.jsxs)(p.Fragment,{children:[(0,n.jsxs)(e.Section,{children:[(0,n.jsx)(e.Value,{children:r.name}),r.description&&(0,n.jsx)(e.Label,{children:r.description}),r.externalDocs&&(0,n.jsx)(e.ExternalDocumentationWrapper,{children:(0,n.jsx)(x.ExternalDocumentation,{externalDocs:r.externalDocs,compact:!0})})]}),o<c.length-1&&(0,n.jsx)(a,{})]},r.name))]}),v=({server:i})=>{const r=Object.entries(i.variables||{}).map(([t,s])=>({key:t,value:s})),o=i.tags&&i.tags.length>0,c=r.length>0;return(0,n.jsxs)(O,{"data-component-name":"ServerOverviewSection/ServerOverviewSection",children:[z(i),c&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a,{}),T(r)]}),o&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a,{}),i.tags&&j(i.tags)]})]})},O=l.default.div`
display: flex;
flex-direction: column;
gap: var(--spacing-base);
`,a=l.default.div`
border-bottom: 1px solid var(--border-color-secondary);
`,h=l.default.span`
display: flex;
gap: var(--spacing-xxs);
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
color: var(--text-color-primary);
`,E=(0,l.default)(h)`
padding-bottom: var(--spacing-xxs);
font-weight: var(--font-weight-semibold);
`,F=l.default.p`
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
color: var(--text-color-primary);
margin: 0;
`,I=l.default.span`
display: flex;
gap: var(--spacing-xxs);
flex-wrap: wrap;
`;0&&(module.exports={ServerOverviewSection});