@redocly/asyncapi-docs
Version:
Async API docs for Redocly Realm
2 lines (1 loc) • 1.74 kB
JavaScript
var s=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var x=(e,r)=>{for(var n in r)s(e,n,{get:r[n],enumerable:!0})},_=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of j(r))!I.call(e,o)&&o!==n&&s(e,o,{get:()=>r[o],enumerable:!(t=O(r,o))||t.enumerable});return e};var P=e=>_(s({},"__esModule",{value:!0}),e);var V={};x(V,{OperationBinding:()=>w});module.exports=P(V);var i=require("react/jsx-runtime"),m=require("@redocly/theme"),d=require("jotai"),l=require("@redocly/openapi-docs"),f=require("./common"),p=require("./JsonSchema"),c=require("../utils"),g=require("../jotai/app"),B=function(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]]);return n};const w=({binding:e,id:r})=>{const n=(0,d.useAtomValue)(g.routingBasePathAtom),t=r?.replace(`/${n}/`,""),o=`/${n}${(0,l.makeDeepLink)(t,"")}`;return(0,i.jsx)(f.BindingPanel,{header:"Operation configuration",children:(({key:u,value:a})=>{const{bindingVersion:S}=a,h=B(a,["bindingVersion"]);switch(u){case"kafka":const b={type:"object",properties:{groupId:(0,c.getSchema)(a.groupId)}},y={type:"object",properties:{clientId:(0,c.getSchema)(a.clientId)}};return(0,i.jsxs)(i.Fragment,{children:[a.groupId&&(0,i.jsx)(p.JsonSchema,{schema:b,slug:o}),a.clientId&&(0,i.jsx)(p.JsonSchema,{schema:y,slug:o})]});default:return(0,i.jsx)(m.JsonViewer,{data:h,expandLevel:3,hideHeader:!0})}})(e)})};0&&(module.exports={OperationBinding});