UNPKG

@redocly/asyncapi-docs

Version:

Async API docs for Redocly Realm

2 lines (1 loc) 4.47 kB
var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var y=(i,r)=>{for(var c in r)s(i,c,{get:r[c],enumerable:!0})},C=(i,r,c,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of m(r))!b.call(i,a)&&a!==c&&s(i,a,{get:()=>r[a],enumerable:!(o=u(r,a))||o.enumerable});return i};var j=i=>C(s({},"__esModule",{value:!0}),i);var k={};y(k,{ChannelBinding:()=>O});module.exports=j(k);var n=require("react/jsx-runtime"),l=require("react"),d=require("@redocly/theme"),t=require("./common"),p=require("../hooks"),x=function(i,r){var c={};for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&r.indexOf(o)<0&&(c[o]=i[o]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(i);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(i,o[a])&&(c[o[a]]=i[o[a]]);return c};const O=({binding:i})=>{const[r,c]=(0,l.useState)(!1),{getProtocolLabel:o}=(0,p.useProtocolLabels)({amqp:Object.assign({},i.value||{})}),a=()=>{c(!r)},h=({key:f,value:e})=>{const{bindingVersion:_}=e,g=x(e,["bindingVersion"]);switch(f){case"kafka":return(0,n.jsxs)(n.Fragment,{children:[e.topic&&(0,n.jsxs)(t.HeaderWrapper,{children:[(0,n.jsx)("span",{"data-testid":"topic-label",children:"Topic"}),(0,n.jsx)("span",{children:(0,n.jsx)(t.TagStyled,{borderless:!0,"data-testid":"topic-value",children:e.topic})})]}),e.partitions&&(0,n.jsxs)(t.HeaderWrapper,{children:[(0,n.jsx)("span",{"data-testid":"partitions-label",children:"Partitions"}),(0,n.jsx)("span",{children:(0,n.jsx)(t.TagStyled,{borderless:!0,color:"blue","data-testid":"partitions-value",children:e.partitions})})]}),e.replicas&&(0,n.jsxs)(t.HeaderWrapper,{children:[(0,n.jsx)("span",{"data-testid":"replicas-label",children:"Replicas"}),(0,n.jsx)("span",{children:(0,n.jsx)(t.TagStyled,{borderless:!0,color:"green","data-testid":"replicas-value",children:e.replicas})})]}),e.topicConfiguration&&(0,n.jsxs)("div",{children:[(0,n.jsx)(t.HeaderWrapper,{expandable:!0,onClick:a,children:(0,n.jsx)(t.MoreDetailsButton,{expanded:r})}),r&&(0,n.jsxs)(t.TopicConfigurationWrapper,{children:[e.topicConfiguration["cleanup.policy"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"\u0421leanup policy"}),(0,n.jsx)("span",{children:e.topicConfiguration["cleanup.policy"].join(", ")})]}),e.topicConfiguration["retention.ms"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Retention, ms"}),(0,n.jsx)("span",{children:e.topicConfiguration["retention.ms"]})]}),e.topicConfiguration["retention.bytes"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Retention, bytes"}),(0,n.jsx)("span",{children:e.topicConfiguration["retention.bytes"]})]}),e.topicConfiguration["delete.retention.ms"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Delete retention, ms"}),(0,n.jsx)("span",{children:e.topicConfiguration["delete.retention.ms"]})]}),e.topicConfiguration["max.message.bytes"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Max message bytes"}),(0,n.jsx)("span",{children:e.topicConfiguration["max.message.bytes"]})]}),e.topicConfiguration["confluent.key.schema.validation"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Confluent key schema validation"}),(0,n.jsx)("span",{children:String(e.topicConfiguration["confluent.key.schema.validation"])})]}),e.topicConfiguration["confluent.key.subject.name.strategy"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Confluent key subject name strategy"}),(0,n.jsx)("span",{children:e.topicConfiguration["confluent.key.subject.name.strategy"]})]}),e.topicConfiguration["confluent.value.schema.validation"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Confluent value schema validation"}),(0,n.jsx)("span",{children:String(e.topicConfiguration["confluent.value.schema.validation"])})]}),e.topicConfiguration["confluent.value.subject.name.strategy"]&&(0,n.jsxs)(t.TopicConfiguration,{children:[(0,n.jsx)("span",{children:"Confluent value subject name strategy"}),(0,n.jsx)("span",{children:e.topicConfiguration["confluent.value.subject.name.strategy"]})]})]})]})]});default:return(0,n.jsx)(d.JsonViewer,{data:g,expandLevel:3,hideHeader:!0})}};return(0,n.jsx)(t.BindingPanel,{header:o("channelBinding"),children:h(i)})};0&&(module.exports={ChannelBinding});