@asyncapi/studio
Version:
One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow.
2 lines • 4.82 MB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2472],{99539:function(e,t,i){"use strict";i.d(t,{rT:function(){return s}});var n=i(45561),r=i.n(n),o=function(e,t,i,n){function r(e){return e instanceof i?e:new i(function(t){t(e)})}return new(i||(i=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?i(e.value):r(e.value).then(s,a)}l((n=n.apply(e,t||[])).next())})};function s(){return{validate:a,parse:l,getMimeTypes:c}}function a(e){return o(this,void 0,void 0,function*(){let t=[];try{x(e.data)}catch(i){i instanceof Error&&t.push({message:i.message,path:e.path})}return t})}function l(e){var t,i;return o(this,void 0,void 0,function*(){let n=yield E(e.data),r=e.meta.message,o=null===(i=null===(t=null==r?void 0:r.bindings)||void 0===t?void 0:t.kafka)||void 0===i?void 0:i.key;if(o){let e=yield E(o);r["x-parser-original-bindings-kafka-key"]=o,r.bindings.kafka.key=e}return n})}function c(){return["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/vnd.apache.avro;version=1.8.2","application/vnd.apache.avro+json;version=1.8.2","application/vnd.apache.avro+yaml;version=1.8.2"]}let d="^[\0-\xff]*$",u=-2147483648,p=2147483647,h=-0x8000000000000000,f=0x7fffffffffffffff-1,m={null:"null",boolean:"boolean",int:"integer",long:"integer",float:"number",double:"number",bytes:"string",string:"string",fixed:"string",map:"object",array:"array",enum:"string",record:"object",uuid:"string"};function g(e,t,i){e.doc&&(t.description=e.doc),void 0!==e.default&&(t.default=e.default);let n=y(e);void 0!==n&&i[n]&&(t["x-parser-schema-id"]=n)}function y(e){let t;return e.name&&(t=e.namespace?`${e.namespace}.${e.name}`:e.name),t}function v(e,t,i){Array.isArray(e.type)&&e.type.includes("null")||i||(t.required=t.required||[],t.required.push(e.name))}function b(e,t){let i=e,n=t;if(Array.isArray(e)&&e.length>0){let t=e.length>1&&"null"===e[0];i=e[+t],void 0!==n.oneOf&&(n=n.oneOf[0])}return{type:i,jsonSchema:n}}function _(e,t,i){if(!(void 0===t||i.examples||Array.isArray(e)))switch(e){case"boolean":i.examples=["true"===t];break;case"int":i.examples=[parseInt(t,10)];break;default:i.examples=[t]}}function w(e,t,i){let n=b(e,i),r=n.type,o=n.jsonSchema;function s(...e){e.forEach(e=>{let i=!0;"minLength"===e||"maxLength"===e?i=t[e]>-1:"multipleOf"===e&&(i=t[e]>0),void 0!==t[e]&&i&&(o[e]=t[e])})}switch(_(r,t.example,o),r){case"int":case"long":case"float":case"double":s("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(o.format=t.logicalType),s("pattern","minLength","maxLength");break;case"array":s("minItems","maxItems","uniqueItems")}}function x(e){r().Type.forSchema(e)}function S(e,t,i){void 0!==t&&(e[t]=i)}function C(e,t,i={}){return o(this,void 0,void 0,function*(){let n={};if(Array.isArray(e))return $(n,e,t,i);let r=e.type||e;switch(n.type=m[r],r){case"int":n.minimum=u,n.maximum=p;break;case"long":n.minimum=h,n.maximum=f;break;case"bytes":n.pattern=d;break;case"fixed":n.pattern=d,n.minLength=e.size,n.maxLength=e.size;break;case"map":n.additionalProperties=yield C(e.values,!1);break;case"array":n.items=yield C(e.items,!1);break;case"enum":n.enum=e.symbols;break;case"float":case"double":n.format=r;break;case"record":{let t=yield j(e,i,n);S(i,y(e),t),n.properties=Object.fromEntries(t.entries());break}default:{let t=i[y(e)];t&&(n=t)}}return g(e,n,i),w(r,e,n),n})}function j(e,t,i){return o(this,void 0,void 0,function*(){let n=new Map;for(let r of e.fields)if(t[r.type]){n.set(r.name,t[r.type]);let e=n.get(r.name),o=Object.assign({name:r.name},e);v(o,i,void 0!==o.default)}else{let e=yield C(r.type,!1,t);v(r,i,void 0!==r.default),g(r,e,t),w(r.type,r,e),n.set(r.name,e),S(t,y(r.type),e)}return n})}function $(e,t,i,n){return o(this,void 0,void 0,function*(){e.oneOf=[];let r=null;for(let o of t){let t=yield C(o,i,n);"null"===(o.type||o)?r=t:(e.oneOf.push(t),S(n,y(o),t))}return r&&e.oneOf.push(r),e})}function E(e){return o(this,void 0,void 0,function*(){return C(e,!0)})}},24894:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertOpenAPI=t.convert=void 0;let n=i(67607),r=i(83598),o=i(69286),s=i(19605),a=i(47623),l=i(85652),c=Object.assign(Object.assign(Object.assign({},r.converters),o.converters),s.converters),d=Object.keys(c);function u(e,t,i={}){let{format:r,document:o}=(0,l.serializeInput)(e);if("openapi"in o)throw Error("Cannot convert OpenAPI document. Use convertOpenAPI function instead.");let s=o.asyncapi,a=d.indexOf(s),u=d.indexOf(t);if(-1===a||-1===u)throw Error(`Cannot convert from ${s} to ${t}.`);if(a>u)throw Error(`Cannot downgrade from ${s} to ${t}.`);if(a===u)throw Error("Cannot convert to the same version.");a++;let p=o;for(let e=a;e<=u;e++)p=c[d[e]](p,i);return"yaml"===r?(0,n.dump)(p,{skipInvalid:!0}):p}function p(e,t,i={}){let{format:r,document:o}=(0,l.serializeInput)(e),s=o.openapi,c=a.converters[s];if(!c)throw Error(`We are not able to convert OpenAPI ${s} to AsyncAPI, please raise a feature request.`);let d=c(o,i);return"yaml"===r?(0,n.dump)(d,{skipInvalid:!0}):d}t.convert=u,t.convertOpenAPI=p},83598:function(e,t){"use strict";function i(e,t){return e.asyncapi="1.0.0",e}function n(e,t){return e.asyncapi="1.1.0",e}function r(e,t){return e.asyncapi="1.2.0",e}Object.defineProperty(t,"__esModule",{value:!0}),t.converters=void 0,t.converters={"1.0.0":i,"1.1.0":n,"1.2.0":r}},46344:function(e,t,i){"use strict";n={value:!0},t.O=void 0;var n,r=i(24894);Object.defineProperty(t,"O",{enumerable:!0,get:function(){return r.convert}})},47623:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.converters=void 0;let n=i(85652);function r(e,t={}){let i=t.perspective||"server",r={asyncapi:"3.0.0",info:o(e.info,e),servers:e.servers?s(e.servers,e):void 0,channels:{},operations:{},components:m(e)},{channels:a,operations:l}=c(e.paths,i);return r.channels=a,r.operations=l,(0,n.removeEmptyObjects)(r),(0,n.sortObjectKeys)(r,["asyncapi","info","defaultContentType","servers","channels","operations","components"])}function o(e,t){return(0,n.sortObjectKeys)(Object.assign(Object.assign({},e),{tags:[t.tags],externalDocs:t.externalDocs}),["title","version","description","termsOfService","contact","license","tags","externalDocs"])}function s(e,t){let i={},r=t.security;return e.forEach(e=>{let o=a(e.url);if((0,n.isRefObject)(e)){i[o]=e;return}let{host:s,pathname:c,protocol:d}=l(e.url);e.host=s,void 0!==c&&(e.pathname=c),void 0!==d&&void 0===e.protocol&&(e.protocol=d),delete e.url,r&&(e.security=r.map(e=>e),delete t.security),i[o]=(0,n.sortObjectKeys)(e,["host","pathname","protocol","protocolVersion","title","summary","description","variables","security","tags","externalDocs","bindings"])}),i}function a(e){let{host:t,pathname:i}=l(e),n=t.split(".").slice(-2).join("."),r=i?i.split("/")[1]:"";return`${n}${r?`_${r}`:""}`.replace(/[^a-zA-Z0-9_]/g,"_")}function l(e){let[t,i]=e.split("://");i||(i=t);let[n,...r]=i.split("/");return r.length?{host:n,pathname:`/${r.join("/")}`,protocol:t}:{host:n,pathname:void 0,protocol:t}}function c(e,t){var i;let r={},o={};if(e)for(let[s,a]of Object.entries(e)){if(!(0,n.isPlainObject)(a))continue;let e=((0,n.isRefObject)(a),a),l=s.replace(/^\//,"").replace(/\//g,"_")||"root";for(let[a,c]of(r[l]={address:s,messages:{},parameters:d(s,e.parameters)},Object.entries(e)))if(["get","post","put","delete","patch","options","head","trace"].includes(a)&&(0,n.isPlainObject)(c)){let e=c,s=e.operationId||`${a}${l}`;if(o[s]={action:"client"===t?"send":"receive",channel:(0,n.createRefObject)("channels",l),summary:e.summary,description:e.description,tags:null===(i=e.tags)||void 0===i?void 0:i.map(e=>({name:e})),bindings:{http:{method:a.toUpperCase()}},messages:[]},e.requestBody){let t=h(e.requestBody,s,a);Object.assign(r[l].messages,t),o[s].messages.push(...Object.keys(t).map(e=>(0,n.createRefObject)("channels",l,"messages",e)))}if(e.responses){let t=f(e.responses,s,a);Object.assign(r[l].messages,t),o[s].reply={channel:(0,n.createRefObject)("channels",l),messages:Object.keys(t).map(e=>(0,n.createRefObject)("channels",l,"messages",e))}}if(e.responses&&Object.keys(e.responses).length>0&&(o[s].reply={channel:(0,n.createRefObject)("channels",l),messages:Object.entries(e.responses).map(([e,t])=>(0,n.createRefObject)("channels",l,"messages",`${s}Response${e}`))}),e.parameters){let t=u(e.parameters);Object.keys(t).length>0&&(r[l].parameters=Object.assign(Object.assign({},r[l].parameters),t))}}(0,n.removeEmptyObjects)(r[l])}return{channels:r,operations:o}}function d(e,t=[]){var i;let n={};return((null===(i=e.match(/\{([^}]+)\}/g))||void 0===i?void 0:i.map(e=>e.slice(1,-1)))||[]).forEach(e=>{let i=t.find(t=>t.name===e&&"path"===t.in);i?n[e]=p(i):n[e]={description:`Path parameter ${e}`}}),n}function u(e){let t={};return e.forEach(e=>{(0,n.isRefObject)(e)||"query"!==e.in||(t[e.name]=p(e))}),t}function p(e){let t={description:e.description};switch(e.required&&(t.required=e.required),e.schema&&!(0,n.isRefObject)(e.schema)&&(e.schema.enum&&(t.enum=e.schema.enum),void 0!==e.schema.default&&(t.default=e.schema.default)),e.examples&&(t.examples=Object.values(e.examples).map(e=>(0,n.isRefObject)(e)?e:e.value)),e.in){case"query":case"header":case"cookie":t.location=`$message.header#/${e.name}`;break;case"path":break;default:t.location=`$message.payload#/${e.name}`}return t}function h(e,t,i){let r={};return(0,n.isPlainObject)(e.content)&&Object.entries(e.content).forEach(([n,o])=>{let s=`${t}Request`;r[s]={name:s,title:`${i.toUpperCase()} request`,contentType:n,payload:g(o.schema),summary:e.description}}),r}function f(e,t,i){let r={};return Object.entries(e).forEach(([e,o])=>{if((0,n.isPlainObject)(o.content))Object.entries(o.content).forEach(([n,s])=>{let a=`${t}Response${e}`;r[a]={name:a,title:`${i.toUpperCase()} response ${e}`,contentType:n,payload:g(s.schema),summary:o.description,headers:o.headers?S(o.headers):void 0}});else{let n=`${t}Response${e}`;r[n]={name:n,title:`${i.toUpperCase()} response ${e}`,summary:o.description}}}),r}function m(e){let t={};if(e.components){if(e.components.schemas&&(t.schemas=y(e.components.schemas)),e.components.securitySchemes&&(t.securitySchemes=v(e.components.securitySchemes)),e.components.parameters)for(let[i,r]of(t.parameters={},Object.entries(e.components.parameters)))(0,n.isRefObject)(r)?t.parameters[i]=r:t.parameters[i]=p(r);e.components.responses&&(t.messages=_(e.components.responses)),e.components.requestBodies&&(t.messageTraits=w(e.components.requestBodies)),e.components.headers&&(t.messageTraits=Object.assign(Object.assign({},t.messageTraits||{}),x(e.components.headers))),e.components.examples&&(t.examples=e.components.examples)}return(0,n.removeEmptyObjects)(t)}function g(e){return(0,n.isRefObject)(e)?e.$ref.startsWith("./")||e.$ref.startsWith("http")?{schemaFormat:"application/vnd.oai.openapi;version=3.0.0",schema:e}:e:{schemaFormat:"application/vnd.oai.openapi;version=3.0.0",schema:e}}function y(e){let t={};for(let[i,n]of Object.entries(e))t[i]=g(n);return t}function v(e){let t={};for(let[i,n]of Object.entries(e))t[i]=b(n);return t}function b(e){let t={type:e.type,description:e.description};if("oauth2"===e.type&&e.flows){let n=JSON.parse(JSON.stringify(e.flows));function i(e){for(let t in e)e.hasOwnProperty(t)&&("scopes"===t?(e.availableScopes=e[t],delete e[t]):"object"==typeof e[t]&&i(e[t]))}i(n),t.flows=n,e.scopes&&(t.scopes=Object.keys(e.scopes))}else"http"===e.type?(t.scheme=e.scheme,"bearer"===e.scheme&&(t.bearerFormat=e.bearerFormat)):"apiKey"===e.type&&(t.in=e.in,t.name=e.name);return t}function _(e){let t={};for(let[i,r]of Object.entries(e))(0,n.isPlainObject)(r.content)?Object.entries(r.content).forEach(([e,n])=>{t[i]={name:i,contentType:e,payload:g(n.schema),summary:r.description,headers:r.headers?S(r.headers):void 0}}):t[i]={name:i,summary:r.description};return t}function w(e){let t={};for(let[i,r]of Object.entries(e))if(!(0,n.isRefObject)(r)&&r.content){let e=Object.keys(r.content)[0];t[i]={name:i,contentType:e,description:r.description},r.content[e].schema&&r.content[e].schema.properties&&r.content[e].schema.properties.headers&&(t[i].headers=r.content[e].schema.properties.headers)}return t}function x(e){let t={};for(let[i,n]of Object.entries(e))t[`Header${i}`]={headers:{type:"object",properties:{[i]:n.schema},required:[i]}};return t}function S(e){let t={};for(let[i,r]of Object.entries(e))(0,n.isRefObject)(r)||(t[i]=r.schema||{});return{type:"object",properties:t}}t.converters={"3.0.0":r}},69286:function(e,t,i){"use strict";var n=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i};Object.defineProperty(t,"__esModule",{value:!0}),t.converters=void 0;let r=i(85652);function o(e,t){if(e.asyncapi="2.0.0-rc1",e.servers){let t=e.security;e.servers=e.servers.map(e=>{let{scheme:i,schemeVersion:r}=e,o=Object.assign(Object.assign({},n(e,["scheme","schemeVersion"])),{protocol:i});return r&&(o.protocolVersion=r),t&&(o.security=t),o})}if(e.topics){let t=e.baseTopic?`${e.baseTopic}.`:"";e.channels=Object.entries(e.topics).reduce((e,[i,n])=>(n.publish&&(n.publish={message:n.publish}),n.subscribe&&(n.subscribe={message:n.subscribe}),e[i=(0,r.dotsToSlashes)(`${t}${i}`)]=n,e),{})}else e.stream?e.channels={"/":m(e.stream)}:e.events&&(e.channels={"/":f(e.events)});return delete e.topics,delete e.stream,delete e.events,delete e.baseTopic,delete e.security,e}function s(e,t){if(e.asyncapi="2.0.0-rc2",e.servers){let t={};e.servers.forEach((e,i)=>{e.baseChannel&&delete e.baseChannel,t[0===i?"default":`server${i}`]=e}),e.servers=t}return e.channels&&Object.entries(e.channels).forEach(([e,t])=>{if(t.parameters){let i={},n=e.match(/\{([^\}]{1,100})\}/g).map(e=>e.substr(1,e.length-2));t.parameters.forEach((e,t)=>{let r=e.name||n[t];e.name&&delete e.name,i[r]=e}),t.parameters=i}t.publish&&t.publish.message&&g(t.publish.message),t.subscribe&&t.subscribe.message&&g(t.subscribe.message),t.protocolInfo&&(t.bindings=t.protocolInfo,delete t.protocolInfo),t.publish&&t.publish.protocolInfo&&(t.publish.bindings=t.publish.protocolInfo,delete t.publish.protocolInfo),t.subscribe&&t.subscribe.protocolInfo&&(t.subscribe.bindings=t.subscribe.protocolInfo,delete t.subscribe.protocolInfo)}),e.components&&e.components.parameters&&Object.values(e.components.parameters).forEach(e=>{e.name&&delete e.name}),e}function a(e,t){return e.asyncapi="2.0.0",e}function l(e,t){return e.asyncapi="2.1.0",e}function c(e,t){return e.asyncapi="2.2.0",e}function d(e,t){return e.asyncapi="2.3.0",e}function u(e,t){return e.asyncapi="2.4.0",e}function p(e,t){return e.asyncapi="2.5.0",e}function h(e,t){return e.asyncapi="2.6.0",e}function f(e){let t={};return e.receive&&(t.publish={message:{oneOf:e.receive}}),e.send&&(t.subscribe={message:{oneOf:e.send}}),t}function m(e){let t={};return e.read&&(t.publish={message:{oneOf:e.read}}),e.write&&(t.subscribe={message:{oneOf:e.write}}),t}function g(e){e.oneOf?e.oneOf.forEach(e=>{e.protocolInfo&&(e.bindings=e.protocolInfo,delete e.protocolInfo),e.headers&&(e.headers=y(e.headers))}):(e.protocolInfo&&(e.bindings=e.protocolInfo,delete e.protocolInfo),e.headers&&(e.headers=y(e.headers)))}function y(e){return{type:"object",properties:Object.assign({},e)}}t.converters={"2.0.0-rc1":o,"2.0.0-rc2":s,"2.0.0":a,"2.1.0":l,"2.2.0":c,"2.3.0":d,"2.4.0":u,"2.5.0":p,"2.6.0":h}},19605:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.converters=void 0;let n=i(85652);function r(e,t){var i;e.asyncapi="3.0.0";let r=Object.assign({pointOfView:"application",useChannelIdExtension:!0,convertServerComponents:!0,convertChannelComponents:!0,failOnParameterReference:!1},null!==(i=t.v2tov3)&&void 0!==i?i:{});r.idGenerator=r.idGenerator||$(r);let a={refs:new Map};return o(e,a),(0,n.isPlainObject)(e.servers)&&(e.servers=s(e.servers,e)),(0,n.isPlainObject)(e.channels)&&(e.channels=l(e.channels,e,r,a)),f(e,r,a),C(e,a.refs,"",e),(0,n.sortObjectKeys)(e,["asyncapi","id","info","defaultContentType","servers","channels","operations","components"])}function o(e,t){e.tags&&(e.info.tags=e.tags,t.refs.set((0,n.createRefPath)("tags"),(0,n.createRefPath)("info","tags")),delete e.tags),e.externalDocs&&(e.info.externalDocs=e.externalDocs,t.refs.set((0,n.createRefPath)("externalDocs"),(0,n.createRefPath)("info","externalDocs")),delete e.externalDocs),e.info=(0,n.sortObjectKeys)(e.info,["title","version","description","termsOfService","contact","license","tags","externalDocs"])}function s(e,t){let i={};return Object.entries(e).forEach(([e,r])=>{if((0,n.isRefObject)(r)){i[e]=r;return}let{host:o,pathname:s,protocol:a}=x(r.url);r.host=o,void 0!==s&&(r.pathname=s),void 0!==a&&void 0===r.protocol&&(r.protocol=a),delete r.url,r.security&&(r.security=b(r.security,t)),i[e]=(0,n.sortObjectKeys)(r,["host","pathname","protocol","protocolVersion","title","summary","description","variables","security","tags","externalDocs","bindings"])}),i}function a(e){let{kind:t,channel:i,asyncapi:r,operations:o,context:s,inComponents:a,channelId:l,channelAddress:c,options:u,oldPath:p}=e,h=i[t],f=a?["components","operations"]:["operations"];if((0,n.isPlainObject)(h)){let{operationId:e,operation:m,messages:g}=d({asyncapi:r,kind:t,channel:i,channelId:l,oldChannelId:c,operation:h,inComponents:a},u,s);return h.security&&(m.security=b(h.security,r)),f.push(e),s.refs.set((0,n.createRefPath)(...p,t),(0,n.createRefPath)(...f)),o[e]=m,delete i[t],null!=g?g:{}}return{}}function l(e,t,i,r,o=!1){let s={};return Object.entries(e).forEach(([e,l])=>{let d=o?["components","channels",e]:["channels",e],u=i.idGenerator({asyncapi:t,kind:"channel",key:e,path:d,object:l}),p=o?["components","channels",u]:["channels",u];if(r.refs.set((0,n.createRefPath)(...d),(0,n.createRefPath)(...p)),(0,n.isRefObject)(l)){s[u]=l;return}l.address=e;let f=l.servers;Array.isArray(f)&&(l.servers=f.map(e=>(0,n.createRefObject)("servers",e))),(0,n.isPlainObject)(l.parameters)&&(l.parameters=m(l.parameters));let g={},y=a({kind:"publish",channel:l,asyncapi:t,operations:g,context:r,inComponents:o,channelId:u,channelAddress:e,options:i,oldPath:d}),v=a({kind:"subscribe",channel:l,asyncapi:t,operations:g,context:r,inComponents:o,channelId:u,channelAddress:e,options:i,oldPath:d});if(y||v){let e=Object.assign(Object.assign({},y),v);l.messages=h({messages:e})}c({operations:g,inComponents:o,asyncapi:t,oldPath:d}),s[u]=(0,n.sortObjectKeys)(l,["address","messages","title","summary","description","servers","parameters","tags","externalDocs","bindings"])}),s}function c(e){var t,i,r,o,s;let{operations:a,inComponents:l,asyncapi:c,oldPath:d}=e;if(Object.keys(a)){if(l){let e=c.components=null!==(t=c.components)&&void 0!==t?t:{};if(e.operations=Object.assign(Object.assign({},null!==(i=e.operations)&&void 0!==i?i:{}),a),S(null!==(r=c.channels)&&void 0!==r?r:{},d)){let e=Object.keys(a).reduce((e,t)=>(e[t]=(0,n.createRefObject)("components","operations",t),e),{});c.operations=Object.assign(Object.assign({},null!==(o=c.operations)&&void 0!==o?o:{}),e)}}else c.operations=Object.assign(Object.assign({},null!==(s=c.operations)&&void 0!==s?s:{}),a)}}function d(e,t,i){let{asyncapi:r,channelId:o,oldChannelId:s,kind:a,inComponents:l}=e,c=Object.assign({},e.operation),d=["channels",s];l&&d.unshift("components");let h=["channels",o];l&&h.unshift("components");let f=t.idGenerator({asyncapi:r,kind:"operation",key:a,path:d,object:e.operation,parentId:o});c.channel=(0,n.createRefObject)(...h);try{delete c.operationId}catch(e){}let m="publish"===a;"application"===t.pointOfView?c.action=m?"receive":"send":c.action=m?"send":"receive";let g=c.message,y={};if(g){delete c.message;let e=["channels",s,a,"message"],n=["channels",o,"messages"];l&&(e.unshift("components"),n.unshift("components")),p(y=u(g,n,e,r,t,i,f),n,c)}return{operationId:f,operation:(0,n.sortObjectKeys)(c,["action","channel","title","summary","description","security","tags","externalDocs","bindings","traits"]),messages:y}}function u(e,t,i,r,o,s,a){if(Array.isArray(e.oneOf))return e.oneOf.reduce((e,l,c)=>{let d=[...i,"oneOf",c],u=o.idGenerator({asyncapi:r,kind:"message",key:c,path:d,object:l,parentId:a});return s.refs.set((0,n.createRefPath)(...d),(0,n.createRefPath)(...t,u)),e[u]=l,e},{});{let l=o.idGenerator({asyncapi:r,kind:"message",key:"message",path:i,object:e,parentId:a});return s.refs.set((0,n.createRefPath)(...i),(0,n.createRefPath)(...t,l)),{[l]:e}}}function p(e,t,i){if(Object.keys(null!=e?e:{}).length>0){let r=[];Object.entries(e).forEach(([e,i])=>{if((0,n.isRemoteRef)(i))r.push(Object.assign({},i));else{let i=[...t,e];r.push((0,n.createRefObject)(...i))}}),i.messages=r}}function h(e){let t=Object.assign({},e.messages);return Object.entries(t).forEach(([e,t])=>{if(delete t.messageId,void 0!==t.schemaFormat){let e=t.payload;t.payload={schemaFormat:t.schemaFormat,schema:e},delete t.schemaFormat}}),t}function f(e,t,i){let r=e.components;(0,n.isPlainObject)(r)&&(t.convertServerComponents&&(0,n.isPlainObject)(r.servers)&&(r.servers=s(r.servers,e)),t.convertChannelComponents&&(0,n.isPlainObject)(r.channels)&&(r.channels=l(r.channels,e,t,i,!0)),(0,n.isPlainObject)(r.securitySchemes)&&(r.securitySchemes=v(r.securitySchemes)),(0,n.isPlainObject)(r.messages)&&(r.messages=h({messages:r.messages})),(0,n.isPlainObject)(r.parameters)&&(r.parameters=m(r.parameters)))}function m(e){let t={};return Object.entries(e).forEach(([e,i])=>{t[e]=g(i)}),t}function g(e){var t,i,n,r,o,s,a,l,c,d,u,p,h,f,m;let g=null!==(t=e.$ref)&&void 0!==t?t:null;if(null!==g)return{$ref:g};(null===(i=e.schema)||void 0===i?void 0:i.$ref)&&console.warn("Could not convert parameter object because the `.schema` property was a reference.\nThis have to be changed manually if you want any of the properties included. For now your parameter is an empty object after conversion. The reference was "+(null===(n=e.schema)||void 0===n?void 0:n.$ref));let v=null!==(o=null===(r=e.schema)||void 0===r?void 0:r.enum)&&void 0!==o?o:null,b=null!==(a=null===(s=e.schema)||void 0===s?void 0:s.const)&&void 0!==a?a:null,_=null!==(c=null===(l=e.schema)||void 0===l?void 0:l.default)&&void 0!==c?c:null,w=null!==(p=null!==(d=e.description)&&void 0!==d?d:null===(u=e.schema)||void 0===u?void 0:u.description)&&void 0!==p?p:null,x=null!==(f=null===(h=e.schema)||void 0===h?void 0:h.examples)&&void 0!==f?f:null,S=null!==(m=e.location)&&void 0!==m?m:null;y(e.schema);let C=["location","schema","description"];return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Object.entries(e).filter(([e])=>!C.includes(e))),null===v?null:{enum:v}),null===b?null:{enum:[b]}),null===_?null:{default:_}),null===w?null:{description:w}),null===x?null:{examples:x}),null===S?null:{location:S})}function y(e){if(void 0===e)return;let t=Object.entries(e).filter(([e])=>!["$ref","enum","const","default","examples","description"].includes(e));if(t.length>0){let e=t.map(([e,t])=>`- schema.${e} with value: ${JSON.stringify(t)} are no longer supported`);console.warn(`Found properties in parameter schema that are no longer supported. Conversion completes with empty parameter object.
${e.join("\n")}`)}}function v(e){let t={};return Object.entries(e).forEach(([e,i])=>{t[e]=w(i)}),t}function b(e,t){let i=[];return e.forEach(e=>{Object.entries(e).forEach(([e,r])=>{if(!r.length){i.push((0,n.createRefObject)("components","securitySchemes",e));return}let o=(0,n.getValueByPath)(t,["components","securitySchemes",e]);if("oauth2"===o.type||"openIdConnect"===o.type){let e=w(o);i.push(Object.assign(Object.assign({},e),{scopes:[...r]}))}})}),i}t.converters={"3.0.0":r};let _=["implicit","password","clientCredentials","authorizationCode"];function w(e){let t=JSON.parse(JSON.stringify(e));return t.flows&&_.forEach(e=>{let i=t.flows[e];(null==i?void 0:i.scopes)&&(i.availableScopes=i.scopes,delete i.scopes)}),t}function x(e){let[t,i]=e.split("://");i||(i=t);let[n,...r]=i.split("/");return r.length?{host:n,pathname:`/${r.join("/")}`,protocol:t}:{host:n,pathname:void 0,protocol:t}}function S(e,t){for(let i of Object.values(e))if((0,n.isRefObject)(i)&&(0,n.createRefPath)(...t)===i.$ref)return!0;return!1}function C(e,t,i,n){if("$ref"===i&&"string"==typeof e){let r=j(e,t);"string"==typeof r&&(n[i]=r);return}if(Array.isArray(e))return e.forEach((i,n)=>C(i,t,n,e));if(e&&"object"==typeof e)for(let i in e)C(e[i],t,i,e)}function j(e,t){let i=[];t.forEach((t,n)=>{e.startsWith(n)&&i.push(n)}),i.sort((e,t)=>e.length-t.length);let n=i.pop();if(!n)return;let r=t.get(n);if(r)return e.replace(n,r)}function $(e){let t=e.useChannelIdExtension;return e=>{let{asyncapi:i,kind:n,object:r,key:o,parentId:s}=e;switch(n){case"channel":return E(r,o,t);case"operation":return r.operationId||(s?`${s}.${o}`:n);case"message":return P(r,i,s,o);default:return""}}}function E(e,t,i){if((0,n.isRefObject)(e))return t;let r=e;return i&&r["x-channelId"]||t}function P(e,t,i,r){let o;if((0,n.isRefObject)(e)){let i=(0,n.getValueByRef)(t,e.$ref);if(null==i?void 0:i.messageId)return i.messageId}let s=e.messageId;if(s)return s;let a=i.split(".");return(o=1===a.length?i:a.pop(),"number"==typeof r)?`${o}.message.${r}`:`${o}.message`}},85652:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyObjects=t.sortObjectKeys=t.getValueByPath=t.getValueByRef=t.isRemoteRef=t.isRefObject=t.createRefPath=t.createRefObject=t.isPlainObject=t.dotsToSlashes=t.objectToSchema=t.serializeInput=void 0;let n=i(67607);function r(e){let t=!1;try{if("object"==typeof e)return{format:"json",document:JSON.parse(JSON.stringify(e))};let i=JSON.parse(e);if("object"==typeof i)return{format:"json",document:i};return t=!0,{format:"yaml",document:(0,n.load)(e)}}catch(i){try{if(t)throw i;return{format:"yaml",document:(0,n.load)(e)}}catch(e){throw Error("AsyncAPI document must be a valid JSON or YAML document.")}}}function o(e){return{type:"object",properties:Object.assign({},e)}}function s(e){return e.replace(/\./g,"/")}function a(e){return!!(e&&"object"==typeof e&&!Array.isArray(e))}function l(...e){return{$ref:c(...e)}}function c(...e){return`#/${e.map(String).map(m).join("/")}`}function d(e){return!!(e&&"$ref"in e)}function u(e){return d(e)&&!e.$ref.startsWith("#")}function p(e,t){if(t.startsWith("#"))return h(e,t.substring(2).split("/").map(g))}function h(e,t){let i=0,n=t.length;for(;null!=e&&i<n;)e=e[t[i++]];return i==n?e:void 0}function f(e,t){let i={};return t.forEach(t=>{t in e&&(i[t]=e[t])}),Object.keys(e).forEach(n=>{t.includes(n)||(i[n]=e[n])}),i}function m(e){return e.replace(/[~/]{1}/g,e=>{switch(e){case"/":return"~1";case"~":return"~0"}return e})}function g(e){return e.includes("~")?e.replace(/~[01]/g,e=>{switch(e){case"~1":return"/";case"~0":return"~"}return e}):e}function y(e){return Object.keys(e).forEach(t=>{e[t]&&"object"==typeof e[t]?(y(e[t]),0===Object.keys(e[t]).length&&delete e[t]):void 0===e[t]&&delete e[t]}),e}t.serializeInput=r,t.objectToSchema=o,t.dotsToSlashes=s,t.isPlainObject=a,t.createRefObject=l,t.createRefPath=c,t.isRefObject=d,t.isRemoteRef=u,t.getValueByRef=p,t.getValueByPath=h,t.sortObjectKeys=f,t.removeEmptyObjects=y},96656:function(e,t,i){"use strict";let n;i.d(t,{x:function(){return h}});var r=i(21063),o=i.n(r),s=i(19228),a=i.n(s),l=i(43020),c=i.n(l);let d={type:"object",definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1}},properties:{title:{type:"string"},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1};var u=function(e,t,i,n){function r(e){return e instanceof i?e:new i(function(t){t(e)})}return new(i||(i=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?i(e.value):r(e.value).then(s,a)}l((n=n.apply(e,t||[])).next())})};let p=i(38012);function h(){return{validate:f,parse:m,getMimeTypes:g}}function f(e){return u(this,void 0,void 0,function*(){let t=_().getSchema("openapi"),i=[];return!t(e.data)&&t.errors&&(i=y(e.path,[...t.errors])),i})}function m(e){return u(this,void 0,void 0,function*(){let t=p(e.data,{cloneSchema:!0,keepNotSupported:["discriminator","readOnly","writeOnly","deprecated","xml","example"]});return v(t),t})}function g(){return["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}function y(e,t){return t.map(t=>({message:t.message,path:[...e,...t.instancePath.replace(/^\//,"").split("/")]}))}function v(e){if(void 0!==e.example){let t=e.examples||[];t.push(e.example),e.examples=t,delete e.example}void 0!==e.$schema&&delete e.$schema,b(e.properties),b(e.patternProperties),b(e.additionalProperties),b(e.items),b(e.additionalItems),b(e.oneOf),b(e.anyOf),b(e.allOf),b(e.not)}function b(e){for(let t in e){let i=e[t];void 0!==i.xml&&(i["x-xml"]=i.xml,delete i.xml),v(e[t])}}function _(){return n||(n=new(o())({allErrors:!0,meta:!0,messages:!0,strict:!1,allowUnionTypes:!0,unicodeRegExp:!1}),a()(n),c()(n),n.addSchema(d,"openapi")),n}},85796:function(e,t,i){"use strict";var n;n={value:!0},n=n=n=t.so=n=n=n=n=n=n=n=n=n=n=n=n=n=n=n=void 0;let r=i(40675),o=i(1232);function s(e){let[t,i,n]=e.split("."),[r,o]=n.split("-rc");return{version:e,major:Number(t),minor:Number(i),patch:Number(r),rc:o&&Number(o)}}function a(e,t,i){"object"==typeof i&&i&&(i[String(e=e.startsWith("x-")?e:`x-${e}`)]=t)}function l(e,t){if(!c(t))return t;let i=c(e)?Object.assign({},e):{};return Object.keys(t).forEach(e=>{let n=t[e];null===n?delete i[e]:i[e]=l(i[e],n)}),i}function c(e){return!!e&&"object"==typeof e&&!1===Array.isArray(e)}function d(e){return e.includes("~")?e.replace(/~[01]/g,e=>{switch(e){case"~1":return"/";case"~0":return"~"}return e}):e}function u(e){return e.startsWith("#")?e.substring(1):e}function p(e){return e.split("/").filter(Boolean).map(d)}n=function(e,t,i){return{source:i,input:t,parsed:e,semver:s(e.asyncapi)}},n=s,n=function(e){return"string"==typeof e?e:JSON.stringify(e,void 0,2)},n=function(e){return e.some(e=>e.severity===o.DiagnosticSeverity.Error)},n=function(e){return e.some(e=>e.severity===o.DiagnosticSeverity.Warning)},n=function(e){return e.some(e=>e.severity===o.DiagnosticSeverity.Information)},n=function(e){return e.some(e=>e.severity===o.DiagnosticSeverity.Hint)},n=function(e,t,i){a(e,t,i.json())},n=a,n=l,n=c,n=function(e){return c(e)&&"$ref"in e&&"string"==typeof e.$ref},n=function(e){return p(u(e))},n=function(e,t,i){if(!(e instanceof Error))return[];let n=i?i.getRangeForJsonPath([]):r.Document.DEFAULT_RANGE;return[{code:"uncaught-error",message:`${t}. Name: ${e.name}, message: ${e.message}, stack: ${e.stack}`,path:[],severity:o.DiagnosticSeverity.Error,range:n}]},n=function(e){return e.replace(/[~/]{1}/g,e=>{switch(e){case"/":return"~1";case"~":return"~0"}return e})},t.so=d},616:function(e,t,i){"use strict";i.d(t,{Aw:function(){return g},Ne:function(){return b},Ny:function(){return y},QG:function(){return m},Xf:function(){return s},b6:function(){return d},bI:function(){return a},h3:function(){return v},i3:function(){return p},jf:function(){return h},pw:function(){return c},qx:function(){return f},sw:function(){return o},uq:function(){return l},yY:function(){return u}});var n=i(46905),r=i.n(n);let o="x-parser-spec-parsed",s="x-parser-spec-stringified",a="x-parser-api-version",l="x-parser-message-name",c="x-parser-message-parsed",d="x-parser-schema-id",u="x-parser-original-schema-format",p="x-parser-original-payload",h="x-parser-original-traits",f="x-parser-circular",m="x-parser-circular-props",g="x-parser-unique-object-id",y=/^x-[\w\d.\-_]+$/,v=Object.keys(r().schemas),b=v[v.length-1]},26280:function(e,t,i){"use strict";i.d(t,{a4:function(){return e3},M2:function(){return e8},dw:function(){return e6}});class n{constructor(e,t={}){this._json=e,this._meta=t}json(e){return void 0===e||null===this._json||void 0===this._json?this._json:this._json[e]}meta(e){return void 0===e?this._meta:this._meta?this._meta[e]:void 0}jsonPath(e){return"string"!=typeof e?this._meta.pointer:`${this._meta.pointer}/${e}`}createModel(e,t,i){return new e(t,Object.assign(Object.assign({},i),{asyncapi:this._meta.asyncapi}))}}class r extends Array{constructor(e,t={}){super(...e),this.collections=e,this._meta=t}has(e){return void 0!==this.get(e)}all(){return this.collections}isEmpty(){return 0===this.collections.length}filterBy(e){return this.collections.filter(e)}meta(e){return void 0===e?this._meta:this._meta?this._meta[String(e)]:void 0}}class o extends r{get(e){return e=e.startsWith("x-")?e:`x-${e}`,this.collections.find(t=>t.id()===e)}}class s extends n{id(){return this._meta.id}value(){return this._json}}var a=i(46763);function l(e,t,i,n){return new e(t,Object.assign(Object.assign({},i),{asyncapi:i.asyncapi||(null==n?void 0:n.meta().asyncapi)}))}function c(e,t,i){let n=new Set,r=new Set;function o(e){n.has(e.json())||(n.add(e.json()),r.add(e))}let s=Object.values(a.sb);return i||(s=s.filter(e=>e!==a.sb.Components)),(0,a.C$)(e,o,s),new t(Array.from(r))}var d=i(616);class u extends r{get(e){return this.collections.find(t=>t.protocol()===e)}extensions(){let e=[];return Object.entries(this._meta.originalData||{}).forEach(([t,i])=>{d.Ny.test(t)&&e.push(l(s,i,{id:t,pointer:`${this._meta.pointer}/${t}`,asyncapi:this._meta.asyncapi}))}),new o(e)}}class p extends n{protocol(){return this._meta.protocol}version(){return this._json.bindingVersion||"latest"}value(){let e=Object.assign({},this._json);return delete e.bindingVersion,e}extensions(){return b(this)}}class h extends n{url(){return this._json.url}hasDescription(){return y(this)}description(){return v(this)}extensions(){return b(this)}}class f extends r{get(e){return this.collections.find(t=>t.name()===e)}}class m extends n{name(){return this._json.name}hasDescription(){return y(this)}description(){return v(this)}extensions(){return b(this)}hasExternalDocs(){return _(this)}externalDocs(){return w(this)}}function g(e){let t=e.json("bindings")||{};return new u(Object.entries(t||{}).map(([t,i])=>l(p,i,{protocol:t,pointer:e.jsonPath(`bindings/${t}`)},e)),{originalData:t,asyncapi:e.meta("asyncapi"),pointer:e.jsonPath("bindings")})}function y(e){return!!v(e)}function v(e){return e.json("description")}function b(e){let t=[];return Object.entries(e.json()).forEach(([i,n])=>{d.Ny.test(i)&&t.push(l(s,n,{id:i,pointer:e.jsonPath(i)},e))}),new o(t)}function _(e){return Object.keys(e.json("externalDocs")||{}).length>0}function w(e){if(_(e))return new h(e.json("externalDocs"))}function x(e){return new f((e.json("tags")||[]).map((t,i)=>l(m,t,{pointer:e.jsonPath(`tags/${i}`)},e)))}class S extends n{hasName(){return!!this._json.name}name(){return this._json.name}hasUrl(){return!!this._json.url}url(){return this._json.url}hasEmail(){return!!this._json.email}email(){return this._json.email}extensions(){return b(this)}}class C extends n{name(){return this._json.name}hasUrl(){return!!this._json.url}url(){return this._json.url}extensions(){return b(this)}}class j extends n{title(){return this._json.title}version(){return this._json.version}hasId(){return!!this._meta.asyncapi.parsed.id}id(){return this._meta.asyncapi.parsed.id}hasDescription(){return y(this)}description(){return v(this)}hasTermsOfService(){return!!this._json.termsOfService}termsOfService(){return this._json.termsOfService}hasContact(){return Object.keys(this._json.contact||{}).length>0}contact(){let e=this._json.contact;return e&&this.createModel(S,e,{pointer:"/info/contact"})}hasLicense(){return Object.keys(this._json.license||{}).length>0}license(){let e=this._json.license;return e&&this.createModel(C,e,{pointer:"/info/license"})}hasExternalDocs(){return Object.keys(this._meta.asyncapi.parsed.externalDocs||{}).length>0}externalDocs(){if(this.hasExternalDocs()){let e=this._meta.asyncapi.parsed;return this.createModel(h,e.externalDocs,{pointer:"/externalDocs"})}}tags(){return new f((this._meta.asyncapi.parsed.tags||[]).map((e,t)=>this.createModel(m,e,{pointer:`/tags/${t}`})))}extensions(){return b(this)}}class $ extends r{get(e){return this.collections.find(t=>t.id()===e)}filterBySend(){return this.filterBy(e=>e.operations().filterBySend().length>0)}filterByReceive(){return this.filterBy(e=>e.operations().filterByReceive().length>0)}}class E extends r{get(e){return this.collections.find(t=>t.id()===e)}}var P=i(86570);class O extends n{id(){return this.$id()||this._meta.id||this.json(d.b6)}$comment(){if("boolean"!=typeof this._json)return this._json.$comment}$id(){if("boolean"!=typeof this._json)return this._json.$id}$schema(){return"boolean"==typeof this._json?"http://json-schema.org/draft-07/schema#":this._json.$schema||"http://json-schema.org/draft-07/schema#"}additionalItems(){return"boolean"==typeof this._json?this._json:"boolean"==typeof this._json.additionalItems?this._json.additionalItems:void 0===this._json.additionalItems||null!==this._json.additionalItems&&this.createModel(O,this._json.additionalItems,{pointer:`${this._meta.pointer}/additionalItems`,parent:this})}additionalProperties(){return"boolean"==typeof this._json?this._json:"boolean"==typeof this._json.additionalProperties?this._json.additionalProperties:void 0===this._json.additionalProperties||null!==this._json.additionalProperties&&this.createModel(O,this._json.additionalProperties,{pointer:`${this._meta.pointer}/additionalProperties`,parent:this})}allOf(){if("boolean"!=typeof this._json&&Array.isArray(this._json.allOf))return this._json.allOf.map((e,t)=>this.createModel(O,e,{pointer:`${this._meta.pointer}/allOf/${t}`,parent:this}))}anyOf(){if("boolean"!=typeof this._json&&Array.isArray(this._json.anyOf))return this._json.anyOf.map((e,t)=>this.createModel(O,e,{pointer:`${this._meta.pointer}/anyOf/${t}`,parent:this}))}const(){if("boolean"!=typeof this._json)return this._json.const}contains(){if("boolean"!=typeof this._json&&"object"==typeof this._json.contains)return this.createModel(O,this._json.contains,{pointer:`${this._meta.pointer}/contains`,parent:this})}contentEncoding(){if("boolean"!=typeof this._json)return this._json.contentEncoding}contentMediaType(){if("boolean"!=typeof this._json)return this._json.contentMediaType}default(){if("boolean"!=typeof this._json)return this._json.default}definitions(){if("boolean"!=typeof this._json&&"object"==typeof this._json.definitions)return Object.entries(this._json.definitions).reduce((e,[t,i])=>(e[t]=this.createModel(O,i,{pointer:`${this._meta.pointer}/definitions/${t}`,parent:this}),e),{})}description(){if("boolean"!=typeof this._json)return this._json.description}dependencies(){if("boolean"!=typeof this._json&&"object"==typeof this._json.dependencies)return Object.entries(this._json.dependencies).reduce((e,[t,i])=>(e[t]=Array.isArray(i)?i:this.createModel(O,i,{pointer:`${this._meta.pointer}/dependencies/${t}`,parent:this}),e),{})}deprecated(){return"boolean"!=typeof this._json&&(this._json.deprecated||!1)}discriminator(){if("boolean"!=typeof this._json)return this._json.discriminator}else(){if("boolean"!=typeof this._json&&"object"==typeof this._json.else)return this.createModel(O,this._json.else,{pointer:`${this._meta.pointer}/else`,parent:this})}enum(){if("boolean"!=typeof this._json)return this._json.enum}examples(){if("boolean"!=typeof this._json)return this._json.examples}exclusiveMaximum(){if("boolean"!=typeof this._json)return this._json.exclusiveMaximum}exclusiveMinimum(){if("boolean"!=typeof this._json)return this._json.exclusiveMinimum}format(){if("boolean"!=typeof this._json)return this._json.format}isBooleanSchema(){return"boolean"==typeof this._json}if(){if("boolean"!=typeof this._json&&"object"==typeof this._json.if)return this.createModel(O,this._json.if,{pointer:`${this._meta.pointer}/if`,parent:this})}isCircular(){let e=this._meta.parent;for(;e;){if(e._json===this._json)return!0;e=e._meta.parent}return!1}items(){if("boolean"!=typeof this._json&&"object"==typeof this._json.items)return Array.isArray(this._json.items)?this._json.items.map((e,t)=>this.createModel(O,e,{pointer:`${this._meta.pointer}/items/${t}`,parent:this})):this.createModel(O,this._json.items,{pointer:`${this._meta.pointer}/items`,parent:this})}maximum(){if("boolean"!=typeof this._json)return this._json.maximum}maxItems(){if("boolean"!=typeof this._json)return this._json.maxItems}maxLength(){if("boolean"!=typeof this._json)return this._json.maxLength}maxProperties(){if("boolean"!=typeof this._json)return this._json.maxProperties}minimum(){if("boolean"!=typeof this._json)return this._json.minimum}minItems(){if("boolean"!=typeof this._json)return this._json.minItems}minLength(){if("boolean"!=typeof this._json)return this._json.minLength}minProperties(){if("boolean"!=typeof this._json)return this._json.minProperties}multipleOf(){if("boolean"!=typeof this._json)return this._json.multipleOf}not(){if("boolean"!=typeof this._json&&"object"==typeof this._json.not)return this.createModel(O,this._json.not,{pointer:`${this._meta.pointer}/not`,parent:this})}oneOf(){if("boolean"!=typeof this._json&&Array.isArray(this._json.oneOf))return this._json.oneOf.map((e,t)=>this.createModel(O,e,{pointer:`${this._meta.pointer}/oneOf/${t}`,parent:this}))}pattern(){if("boolean"!=typeof this._json)return this._json.pattern}patternProperties(){if("boolean"!=typeof this._json&&"object"==typeof this._json.patternProperties)return Object.entries(this._json.patternProperties).reduce((e,[t,i])=>(e[t]=this.createModel(O,i,{pointer:`${this._meta.pointer}/patternProperties/${t}`,parent:this}),e),{})}properties(){if("boolean"!=typeof this._json&&"object"==typeof this._json.properties)return Object.entries(this._json.properties).reduce((e,[t,i])=>(e[t]=this.createModel(O,i,{pointer:`${this._meta.pointer}/properties/${t}`,parent:this}),e),{})}property(e){if("boolean"!=typeof this._json&&"object"==typeof this._json.properties&&"object"==typeof this._json.properties[e])return this.createModel(O,this._json.properties[e],{pointer:`${this._meta.pointer}/properties/${e}`,parent:this})}propertyNames(){if("boolean"!=typeof this._json&&"object"==typeof this._json.propertyNames)return this.createModel(O,this._json.propertyNames,{pointer:`${this._meta.pointer}/propertyNames`,parent:this})}readOnly(){return"boolean"!=typeof this._json&&(this._json.readOnly||!1)}required(){if("boolean"!=typeof this._json)return this._json.required}schemaFormat(){return this._meta.schemaFormat||(0,P.Xv)(this._meta.asyncapi.semver.version)}then(){if("boolean"!=typeof this._json&&"object"==typeof this._json.then)return this.createModel(O,this._json.then,{pointer:`${this._meta.pointer}/then`,parent:this})}title(){if("boolean"!=typeof this._json)return this._json.title}type(){if("boolean"!=typeof this._json)return this._json.type}uniqueItems(){return"boolean"!=typeof this._json&&(this._json.uniqueItems||!1)}writeOnly(){return"boolean"!=typeof this._json&&(this._json.writeOnly||!1)}hasExternalDocs(){return _(this)}externalDocs(){return w(this)}extensions(){return b(this)}}class k extends n{id(){return this._meta.id}hasSchema(){return!!this._json.schema}schema(){if(this._json.schema)return this.createModel(O,this._json.schema,{pointer:`${this._meta.pointer}/schema`})}hasLocation(){return!!this._json.location}location(){return this._json.location}hasDescription(){return y(this)}description(){return v(this)}extensions(){return b(this)}}class A extends r{get(e){return this.collections.find(t=>t.id()===e)}filterBySend(){return this.filterBy(e=>e.operations().filterBySend().length>0)}filterByReceive(){return this.filterBy(e=>e.operations().filterByReceive().length>0)}}class I extends r{get(e){return this.collections.find(t=>t.id()===e)}filterBySend(){return this.filterBy(e=>e.isSend())}filterByReceive(){return this.filterBy(e=>e.isReceive())}}class T extends r{get(e){return this.collections.find(t=>t.id()===e)}}class N extends n{location(){return this._json.location}hasDescription(){return y(this)}description(){return v(this)}extensions(){return b(this)}}class L extends r{get(e){return this.collections.find(t=>t.name()===e)}}class D extends n{hasName(){return!!this._json.name}name(){return this._json.name}hasSummary(){return!!this._json.summary}summary(){return this._json.summary}hasHeaders(){return!!this._json.headers}headers(){return this._json.headers}hasPayload(){return!!this._json.payload}payload(){return this._json.payload}extensions(){return b(this)}}class M extends n{id(){return this._json.messageId||this._meta.id||this.json(d.uq)}hasSchemaFormat(){return void 0!==this.schemaFormat()}schemaFormat(){return this._json.schemaFormat||(0,P.Xv)(this._meta.asyncapi.semver.version)}hasMessageId(){return!!this._json.messageId}hasCorrelationId(){return!!this._json.correlationId}correlationId(){if(this._json.correlationId)return this.createModel(N,this._json.correlationId,{pointer:`${this._meta.pointer}/correlationId`})}hasContentType(){return!!this._json.contentType}contentType(){var e;return this._json.contentType||(null===(e=this._meta.asyncapi)||void 0===e?void 0:e.parsed.defaultContentType)}hasHeaders(){return!!this._json.headers}headers(){if(this._json.headers)return this.createModel(O,this._json.headers,{pointer:`${this._meta.pointer}/headers`})}hasName(){return!!this._json.name}name(){return this._json.name}hasTitle(){return!!this._json.title}title(){return this._json.title}hasSummary(){return!!this._json.summary}summary(){return this._json.summary}hasDescription(){return y(this)}description(){return v(this)}hasExternalDocs(){return _(this)}externalDocs(){return w(this)}examples(){return new L((this._json.examples||[]).map((e,t)=>this.createModel(D,e,{pointer:`${this._meta.pointer}/examples/${t}`})))}tags(){return x(this)}bindings(){return g(this)}extensions(){return b(this)}}class R extends r{get(e){return this.collections.find(t=>t.id()===e)}filterBySend(){return this.filterBy(e=>e.operations().filterBySend().length>0)}filterByReceive(){return this.filterBy(e=>e.operations().filterByReceive().length>0)}}var F=i(69059);class B extends M{hasPayload(){return!!this._json.payload}payload(){if(this._json.payload)return this.createModel(O,this._json.payload,{pointer:`${this._meta.pointer}/payload`,schemaFormat:this._json.schemaFormat})}servers(){let e=[],t=[];return this.channels().forEach(i=>{i.servers().forEach(i=>{t.includes(i.json())||(t.push(i.json()),e.push(i))})}),new R(e)}channels(){let e=[],t=[];return this.operations().all().forEach(i=>{i.channels().forEach(i=>{t.includes(i.json())||(t.push(i.json()),e.push(i))})}),new $(e)}operations(){var e;let t=[];return Object.entries((null===(e=this._meta.asyncapi)||void 0===e?void 0:e.parsed.channels)||{}).forEach(([e,i])=>{["subscribe","publish"].forEach(n=>{let r=i[n];r&&(r.message===this._json||(r.message.oneOf||[]).includes(this._json))&&t.push(this.createModel(G,r,{id:"",pointer:`/channels/${(0,F.xO)(e)}/${n}`,action:n}))})}),new I(t)}traits(){return new T((this._json.traits||[]).map((e,t)=>this.createModel(M,e,{id:"",pointer:`${this._meta.pointer}/traits/${t}`})))}}class V extends r{get(e){return this.collections.find(t=>t.id()===e)}}class z extends n{hasAuthorizationUrl(){return!!this.json().authorizationUrl}authorizationUrl(){return this.json().authorizationUrl}hasTokenUrl(){return!!this.json().tokenUrl}tokenUrl(){return this.json().tokenUrl}hasRefreshUrl(){return!!this._json.refreshUrl}refreshUrl(){return this._json.refreshUrl}scopes(){return this._json.scopes}extensions(){return b(this)}}class q exten