UNPKG

@redocly/asyncapi-docs

Version:

Async API docs for Redocly Realm

2 lines (1 loc) 2.33 kB
var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var f=(r,n)=>{for(var d in n)i(r,d,{get:n[d],enumerable:!0})},b=(r,n,d,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of g(n))!y.call(r,e)&&e!==d&&i(r,e,{get:()=>n[e],enumerable:!(a=m(n,e))||a.enumerable});return r};var u=r=>b(i({},"__esModule",{value:!0}),r);var j={};f(j,{MessageBinding:()=>S});module.exports=u(j);var t=require("react/jsx-runtime"),s=require("@redocly/theme"),o=require("./common"),c=require("./JsonSchema"),l=require("../utils"),k=function(r,n){var d={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(d[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,a=Object.getOwnPropertySymbols(r);e<a.length;e++)n.indexOf(a[e])<0&&Object.prototype.propertyIsEnumerable.call(r,a[e])&&(d[a[e]]=r[a[e]]);return d};const S=({binding:r,slug:n})=>(0,t.jsx)(o.BindingPanel,{header:"Message configuration",children:(({key:a,value:e})=>{const{bindingVersion:O}=e,h=k(e,["bindingVersion"]);switch(a){case"kafka":const p={type:"object",properties:{key:(0,l.getSchema)(e.key)}};return(0,t.jsxs)(t.Fragment,{children:[e.key&&(0,t.jsx)(c.JsonSchema,{schema:p,slug:n}),e.schemaIdLocation&&(0,t.jsxs)(o.HeaderWrapper,{children:[(0,t.jsx)("span",{"data-testid":"schema-id-location-label",children:"Schema ID Location"}),(0,t.jsx)("span",{children:(0,t.jsx)(o.TagStyled,{borderless:!0,"data-testid":"schema-id-location-value",children:e.schemaIdLocation})})]}),e.schemaIdPayloadEncoding&&(0,t.jsxs)(o.HeaderWrapper,{children:[(0,t.jsx)("span",{"data-testid":"schema-id-payload-encoding-label",children:"Schema ID payload encoding"}),(0,t.jsx)("span",{children:(0,t.jsx)(o.TagStyled,{borderless:!0,"data-testid":"schema-id-payload-encoding-value",children:e.schemaIdPayloadEncoding})})]}),e.schemaLookupStrategy&&(0,t.jsxs)(o.HeaderWrapper,{children:[(0,t.jsx)("span",{"data-testid":"schema-lookup-strategy-label",children:"Schema lookup strategy"}),(0,t.jsx)("span",{children:(0,t.jsx)(o.TagStyled,{borderless:!0,"data-testid":"schema-lookup-strategy-value",children:e.schemaLookupStrategy})})]})]});default:return(0,t.jsx)(s.JsonViewer,{data:h,expandLevel:3,hideHeader:!0})}})(r)});0&&(module.exports={MessageBinding});