micro-tests/server/combo/swagger-ui/swagger-ui.js

2 lines
250 KiB
JavaScript
Raw Permalink Normal View History

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(()=>(()=>{var e={6024:(e,t,r)=>{"use strict";r.d(t,{Z:()=>v});var n=r(4250),s=r.n(n),a=r(1093),o=r.n(a),l=r(8493),i=r.n(l),c=r(3942),p=r.n(c),u=r(6689),d=r.n(u);const m=require("react-immutable-pure-component");var h=r.n(m),g=r(8082),f=r.n(g),y=r(580),E=r.n(y);class v extends(h()){constructor(){super(...arguments),o()(this,"getModelName",(e=>-1!==i()(e).call(e,"#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==i()(e).call(e,"#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0)),o()(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:n,schema:a,required:o,name:l,isRef:i,specPath:c,displayName:p,includeReadOnly:u,includeWriteOnly:m}=this.props;const h=e("ObjectModel"),g=e("ArrayModel"),f=e("PrimitiveModel");let y="object",E=a&&a.get("$$ref");if(!l&&E&&(l=this.getModelName(E)),!a&&E&&(a=this.getRefSchema(l)),!a)return d().createElement("span",{className:"model model-title"},d().createElement("span",{className:"model-title__text"},p||l),d().createElement("img",{src:r(2517),height:"20px",width:"20px"}));const v=n.isOAS3()&&a.get("deprecated");switch(i=void 0!==i?i:!!E,y=a&&a.get("type")||y,y){case"object":return d().createElement(h,s()({className:"object"},this.props,{specPath:c,getConfigs:t,schema:a,name:l,deprecated:v,isRef:i,includeReadOnly:u,includeWriteOnly:m}));case"array":return d().createElement(g,s()({className:"array"},this.props,{getConfigs:t,schema:a,name:l,deprecated:v,required:o,includeReadOnly:u,includeWriteOnly:m}));default:return d().createElement(f,s()({},this.props,{getComponent:e,getConfigs:t,schema:a,name:l,deprecated:v,required:o}))}}}o()(v,"propTypes",{schema:p()(f()).isRequired,getComponent:E().func.isRequired,getConfigs:E().func.isRequired,specSelectors:E().object.isRequired,name:E().string,displayName:E().string,isRef:E().bool,required:E().bool,expandDepth:E().number,depth:E().number,specPath:f().list.isRequired,includeReadOnly:E().bool,includeWriteOnly:E().bool})},5623:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var n=r(1093),s=r.n(n),a=r(7252),o=r.n(a),l=r(6689),i=r.n(l),c=r(3883),p=r.n(c),u=(r(580),r(1890)),d=r(7504);class m extends i().Component{constructor(e,t){super(e,t),s()(this,"getDefinitionUrl",(()=>{let{specSelectors:e}=this.props;return new(p())(e.url(),d.Z.location).toString()}));let{getConfigs:r}=e,{validatorUrl:n}=r();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===n?"https://validator.swagger.io/validator":n}}UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:r}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===r?"https://validator.swagger.io/validator":r})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),r=(0,u.Nm)(this.state.validatorUrl);return"object"==typeof t&&o()(t).length?null:this.state.url&&(0,u.hW)(this.state.validatorUrl)&&(0,u.hW)(this.state.url)?i().createElement("span",{className:"float-right"},i().createElement("a",{target:"_blank",rel:"noopener noreferrer",href:`${r}/debug?url=${encodeURIComponent(this.state.url)}`},i().createElement(h,{src:`${r}?url=${encodeURIComponent(this.state.url)}`,alt:"Online validator badge"}))):null}}class h extends i().Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?i().createElement("img",{alt:"Error"}):this.state.loaded?i().createElement("img",{src:this.props.src,alt:this.props.alt}):null}}},2552:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d,s:()=>m});var n=r(6689),s=r.n(n),a=(r(580),r(963));const o=requ
//# sourceMappingURL=swagger-ui.js.map