This is an automated email from the ASF dual-hosted git repository. lhotari pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
commit 1d09d5a561b53e59a7e462dbce6007513abb4d46 Author: Lari Hotari <[email protected]> AuthorDate: Fri Jun 12 01:27:50 2026 +0300 Support OpenAPI 3 REST API docs for Pulsar 5.0.0+ and master The Gradle build on apache/pulsar master generates OpenAPI 3 documents via :pulsar-broker:generateOpenApiSpecs, replacing the Maven swagger profile's Swagger 2.0 output. Pre-5.0 releases keep their Swagger 2.0 documents and existing locations. - swagger_generator.py: run the Gradle generateOpenApiSpecs task (unconditionally, since it is incremental and prunes stale output) instead of skipping Swagger generation on Gradle checkouts; point the Gradle swagger output dir at pulsar-broker/build/openapi - RestApi.tsx: render master and 5.0+ specs with a vendored Redoc 2.5.3 bundle (supports OpenAPI 3 and converts Swagger 2.0); keep the legacy Redoc 1.x viewer for pre-5.0 versions; also accept the apiVersion query param casing that docs links generate - getVersion(): accept pre-release versions such as 5.0.0-M1 - swagger remark plugin: fall back to OpenAPI 3 servers[0].url when Swagger 2.0 basePath is absent --- src/pages/RestApi/RestApi.tsx | 69 +- src/server/remarkPlugins/swagger/index.ts | 5 +- src/utils/index.js | 5 +- static/js/redoc2.standalone.min.js | 1838 ++++++++++++++++++++++++ tools/pytools/lib/execute/pulsar_build.py | 2 +- tools/pytools/lib/execute/swagger_generator.py | 34 +- 6 files changed, 1888 insertions(+), 65 deletions(-) diff --git a/src/pages/RestApi/RestApi.tsx b/src/pages/RestApi/RestApi.tsx index 690257ec423..573049f2684 100644 --- a/src/pages/RestApi/RestApi.tsx +++ b/src/pages/RestApi/RestApi.tsx @@ -34,13 +34,24 @@ function parseVersion(pathName) { } } - return [version, apiversion]; + return [version, apiversion, swagger]; +} + +// Pulsar 5.0.0 (starting with 5.0.0-M1) and master publish OpenAPI 3 documents +// generated by the Gradle build; they need the Redoc 2.x bundle. Earlier +// releases keep their Swagger 2.0 documents and the legacy Redoc 1.x viewer. +function usesOpenApi3(version) { + if (version === "master" || version === "next") { + return true; + } + const major = parseInt(version.split(".")[0], 10); + return !isNaN(major) && major >= 5; } class RestApi extends React.Component { componentDidMount() { let pathName = window.location.pathname; - let [version, apiversion] = parseVersion(pathName); + let [version, apiversion, swagger] = parseVersion(pathName); let params = window.location.search; params = params.replace("?", ""); @@ -53,7 +64,7 @@ class RestApi extends React.Component { if (param[0] === "version") { version = param[1]; } - if (param[0] === "apiversion") { + if (param[0] === "apiversion" || param[0] === "apiVersion") { apiversion = param[1]; } } @@ -61,49 +72,17 @@ class RestApi extends React.Component { const wrapper = document.querySelector(".container"); const redoc = document.createElement("redoc"); - - if (pathName.indexOf("admin-rest-api") >= 0) { - redoc.setAttribute( - "spec-url", - "/swagger/" + version + "/" + apiversion + "/swagger.json" - ); - } else if (pathName.indexOf("functions-rest-api") >= 0) { - redoc.setAttribute( - "spec-url", - "/swagger/" + version + "/" + apiversion + "/swaggerfunctions.json" - ); - } else if (pathName.indexOf("source-rest-api") >= 0) { - redoc.setAttribute( - "spec-url", - "/swagger/" + version + "/" + apiversion + "/swaggersource.json" - ); - } else if (pathName.indexOf("sink-rest-api") >= 0) { - redoc.setAttribute( - "spec-url", - "/swagger/" + version + "/" + apiversion + "/swaggersink.json" - ); - } else if (pathName.indexOf("packages-rest-api") >= 0) { - redoc.setAttribute( - "spec-url", - "/swagger/" + version + "/" + apiversion + "/swaggerpackages.json" - ); - } else if (pathName.indexOf("transactions-rest-api") >= 0) { - redoc.setAttribute( - "spec-url", - "/swagger/" + version + "/" + apiversion + "/swaggertransactions.json" - ); - } else if (pathName.indexOf("lookup-rest-api") >= 0) { - redoc.setAttribute( - "spec-url", - "/swagger/" + version + "/" + apiversion + "/swaggerlookup.json" - ); - } - redoc.setAttribute("lazy-rendering", "true"); - const redocLink = document.createElement("script"); - redocLink.setAttribute( - "src", - "/js/redoc.min.js" + redoc.setAttribute( + "spec-url", + "/swagger/" + version + "/" + apiversion + "/" + swagger + ".json" ); + const redocLink = document.createElement("script"); + if (usesOpenApi3(version)) { + redocLink.setAttribute("src", "/js/redoc2.standalone.min.js"); + } else { + redoc.setAttribute("lazy-rendering", "true"); + redocLink.setAttribute("src", "/js/redoc.min.js"); + } const script = document.querySelector(".container script"); wrapper.insertBefore(redoc, script); wrapper.insertBefore(redocLink, script); diff --git a/src/server/remarkPlugins/swagger/index.ts b/src/server/remarkPlugins/swagger/index.ts index f9fdacf99a4..9b965134620 100644 --- a/src/server/remarkPlugins/swagger/index.ts +++ b/src/server/remarkPlugins/swagger/index.ts @@ -200,7 +200,10 @@ async function processLinkNode(target: Target, context: Context) { current.path.length > longest.path.length ? current : longest ); - const foundPath = swaggerJson.basePath + longestMatch.path; + // Swagger 2.0 documents carry the API prefix in basePath; OpenAPI 3 + // documents (Pulsar 5.0.0+/master) carry it in servers[0].url. + const basePath = swaggerJson.basePath ?? swaggerJson.servers?.[0]?.url ?? ''; + const foundPath = basePath + longestMatch.path; const foundMethod = longestMatch.method.toUpperCase(); const restApiBaseUrl = context.restApiBaseUrlMapping[apiType]; diff --git a/src/utils/index.js b/src/utils/index.js index ce423e1f083..b9ca97145af 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -49,8 +49,9 @@ export function setVersion(version) { export function getVersion() { try { - if (/version=[0-9.x]+/.test(location.href)) { - return location.href.match(/version=([0-9.x]+)/)[1]; + // Also match pre-release versions such as 5.0.0-M1 + if (/version=[0-9A-Za-z.\-x]+/.test(location.href)) { + return location.href.match(/version=([0-9A-Za-z.\-x]+)/)[1]; } } catch (error) { console.error(error); diff --git a/static/js/redoc2.standalone.min.js b/static/js/redoc2.standalone.min.js new file mode 100644 index 00000000000..1f14e14a166 --- /dev/null +++ b/static/js/redoc2.standalone.min.js @@ -0,0 +1,1838 @@ +/*! For license information please see redoc.standalone.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):"function"==typeof define&&define.amd?define(["null"],t):"object"==typeof exports?exports.Redoc=t(require("null")):e.Redoc=t(e.null)}(this,function(e){return function(){var t={4206:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const n=r(2785),i=r(7582),o=r(1498),s=r(2791),a="https://json-schema. [...] + || (${a} == "string" && ${i} && ${i} == +${i})`).assign(l,s._`+${i}`);case"integer":return void n.elseIf(s._`${a} === "boolean" || ${i} === null + || (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,s._`+${i}`);case"boolean":return void n.elseIf(s._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf(s._`${i} === "true" || ${i} === 1`).assign(l,!0);case"null":return n.elseIf(s._`${i} === "" || ${i} === 0 || ${i} === false`),void n.assign(l,null);case"array":n.elseIf(s._`${a} === "string" || ${a} === "number" + || ${a} === "boolean" || ${i} === null`).assign(l,s._`[${i}]`)}}n.else(),h(e),n.endIf(),n.if(s._`${l} !== undefined`,()=>{n.assign(i,l),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,()=>e.assign(s._`${t}[${r}]`,n))}(e,l)})}(e,t,a):h(e)})}return c},t.checkDataType=p,t.checkDataTypes=d,t.reportTypeError=h;const n=r(9485),i=r(9160),o=r(695),s=r(9288),a=r(2124);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType)) [...] + missingProperty: ${i}, + depsCount: ${t}, + deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),l(e,r)}};function a(e,t=e.schema){const{gen:r,data:i,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const u=(0,o.propertyInData)(r,i,l,s.opts.ownProperties);e.setParam [...] ":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function k(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function S(e,t,r){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}for(var E=new Array(256),O=new Array(256),_=0;_<256;_++)E[_]=w(_)?1:0,O[_]=w(_);function P(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t [...] + @media ${t?"print, ":""} screen and (max-width: ${t=>t.theme.breakpoints[e]}) ${r||""} { + ${ps(...n)}; + } + `},greaterThan(e){return(...t)=>ps` + @media (min-width: ${t=>t.theme.breakpoints[e]}) { + ${ps(...t)}; + } + `},between(e,t){return(...r)=>ps` + @media (min-width: ${t=>t.theme.breakpoints[e]}) and (max-width: ${e=>e.theme.breakpoints[t]}) { + ${ps(...r)}; + } + `}};var gs=us;function ys(e){return t=>{if(t.theme.extensionsHook)return t.theme.extensionsHook(e,t)}}const bs=gs.div` + padding: 20px; + color: red; +`;class vs extends r.Component{constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e){return this.setState({error:e}),!1}render(){return this.state.error?r.createElement(bs,null,r.createElement("h1",null,"Something went wrong..."),r.createElement("small",null," ",this.state.error.message," "),r.createElement("p",null,r.createElement("details",null,r.createElement("summary",null,"Stack trace"),r.createElement("pre",null,this.state.error.stack))),r.createElement("small",nul [...] + 0% { + transform: rotate(0deg); } + 100% { + transform: rotate(360deg); + } +`,ws=gs(e=>r.createElement("svg",{className:e.className,version:"1.1",width:"512",height:"512",viewBox:"0 0 512 512"},r.createElement("path",{d:"M275.682 147.999c0 10.864-8.837 19.661-19.682 19.661v0c-10.875 0-19.681-8.796-19.681-19.661v-96.635c0-10.885 8.806-19.661 19.681-19.661v0c10.844 0 19.682 8.776 19.682 19.661v96.635z"}),r.createElement("path",{d:"M275.682 460.615c0 10.865-8.837 19.682-19.682 19.682v0c-10.875 0-19.681-8.817-19.681-19.682v-96.604c0-10.885 8.806-19.681 19.681-19.681 [...] + animation: 2s ${xs} linear infinite; + width: 50px; + height: 50px; + content: ''; + display: inline-block; + margin-left: -25px; + + path { + fill: ${e=>e.color}; + } +`,ks=gs.div` + font-family: helvetica, sans; + width: 100%; + text-align: center; + font-size: 25px; + margin: 30px 0 20px 0; + color: ${e=>e.color}; +`;class Ss extends r.PureComponent{render(){return r.createElement("div",{style:{textAlign:"center"}},r.createElement(ks,{color:this.props.color},"Loading ..."),r.createElement(ws,{color:this.props.color}))}}var Es=n(5556);const Os=r.createContext(new _i({})),_s=Os.Provider,Ps=Os.Consumer;var $s=n(854),As=n(8921),Cs=n(65);var js=n(5156),Ts=n(228),Ns=n(1095),Is=n.n(Ns);const Rs=Ns.parse;class Ls{static baseName(e,t=1){const r=Ls.parse(e);return r[r.length-t]}static dirName(e,t=1){const r= [...] + width: calc(100% - ${e=>e.theme.rightPanel.width}); + padding: 0 ${e=>e.theme.spacing.sectionHorizontal}px; + + ${({$compact:e,theme:t})=>ms.lessThan("medium",!0)` + width: 100%; + padding: ${`${e?0:t.spacing.sectionVertical}px ${t.spacing.sectionHorizontal}px`}; + `}; +`,cp=gs.div.attrs(e=>({[eh]:e.id}))` + padding: ${e=>e.theme.spacing.sectionVertical}px 0; + + &:last-child { + min-height: calc(100vh + 1px); + } + + & > &:last-child { + min-height: initial; + } + + ${ms.lessThan("medium",!0)` + padding: 0; + `} + ${({$underlined:e})=>e?"\n position: relative;\n\n &:not(:last-of-type):after {\n position: absolute;\n bottom: 0;\n width: 100%;\n display: block;\n content: '';\n border-bottom: 1px solid rgba(0, 0, 0, 0.2);\n }\n ":""} +`,up=gs.div` + width: ${e=>e.theme.rightPanel.width}; + color: ${({theme:e})=>e.rightPanel.textColor}; + background-color: ${e=>e.theme.rightPanel.backgroundColor}; + padding: 0 ${e=>e.theme.spacing.sectionHorizontal}px; + + ${ms.lessThan("medium",!0)` + width: 100%; + padding: ${e=>`${e.theme.spacing.sectionVertical}px ${e.theme.spacing.sectionHorizontal}px`}; + `}; +`,pp=gs(up)` + background-color: ${e=>e.theme.rightPanel.backgroundColor}; +`,dp=gs.div` + display: flex; + width: 100%; + padding: 0; + + ${ms.lessThan("medium",!0)` + flex-direction: column; + `}; +`,fp={1:"1.85714em",2:"1.57143em",3:"1.27em"},hp=e=>ps` + font-family: ${({theme:e})=>e.typography.headings.fontFamily}; + font-weight: ${({theme:e})=>e.typography.headings.fontWeight}; + font-size: ${fp[e]}; + line-height: ${({theme:e})=>e.typography.headings.lineHeight}; +`,mp=gs.h1` + ${hp(1)}; + color: ${({theme:e})=>e.colors.text.primary}; + + ${ys("H1")}; +`,gp=gs.h2` + ${hp(2)}; + color: ${({theme:e})=>e.colors.text.primary}; + margin: 0 0 20px; + + ${ys("H2")}; +`,yp=gs.h2` + ${hp(3)}; + color: ${({theme:e})=>e.colors.text.primary}; + + ${ys("H3")}; +`,bp=gs.h3` + color: ${({theme:e})=>e.rightPanel.textColor}; + + ${ys("RightPanelHeader")}; +`,vp=gs.h5` + border-bottom: 1px solid rgba(38, 50, 56, 0.3); + margin: 1em 0 1em 0; + color: rgba(38, 50, 56, 0.5); + font-weight: normal; + text-transform: uppercase; + font-size: 0.929em; + line-height: 20px; + + ${ys("UnderlinedHeader")}; +`,xp=(0,r.createContext)(void 0),{Provider:wp,Consumer:kp}=xp;function Sp(e){const{spec:t,specUrl:i,options:o,onLoaded:s,children:a}=e,[l,c]=r.useState(null),[u,p]=r.useState(null);if(u)throw u;r.useEffect(()=>{!function(){return e=this,r=function*(){if(t||i){c(null);try{const e=yield function(e){return t=this,r=function*(){const t=new As.Config({}),r={config:t,base:Qn?window.location.href:process.cwd()};Qn&&(t.resolve.http.customFetch=n.g.fetch),"object"==typeof e&&null!==e?r.doc={sourc [...] + ${e} { + cursor: pointer; + margin-left: -20px; + padding: 0; + line-height: 1; + width: 20px; + display: inline-block; + outline: 0; + } + ${e}:before { + content: ''; + width: 15px; + height: 15px; + background-size: contain; + background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS4 [...] + opacity: 0.5; + visibility: hidden; + display: inline-block; + vertical-align: middle; + } + + h1:hover > ${e}::before, h2:hover > ${e}::before, ${e}:hover::before { + visibility: visible; + } +`,Op=gs(function(e){const t=r.useContext(xp),n=r.useCallback(r=>{t&&function(e,t,r){t.defaultPrevented||0!==t.button||(e=>!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey))(t)||(t.preventDefault(),e.replace(encodeURI(r)))}(t.menu.history,r,e.to)},[t,e.to]);return t?r.createElement("a",{className:e.className,href:t.menu.history.linkForId(e.to),onClick:n,"aria-label":e.to},e.children):null})` + ${Ep("&")}; +`;function _p(e){return r.createElement(Op,{to:e.to})}const Pp={left:"90deg",right:"-90deg",up:"-180deg",down:"0"},$p=gs(e=>r.createElement("svg",{className:e.className,style:e.style,version:"1.1",viewBox:"0 0 24 24",x:"0",xmlns:"http://www.w3.org/2000/svg",y:"0","aria-hidden":"true"},r.createElement("polygon",{points:"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "})))` + height: ${e=>e.size||"18px"}; + width: ${e=>e.size||"18px"}; + min-width: ${e=>e.size||"18px"}; + vertical-align: middle; + float: ${e=>e.float||""}; + transition: transform 0.2s ease-out; + transform: rotateZ(${e=>Pp[e.direction||"down"]}); + + polygon { + fill: ${({color:e,theme:t})=>e&&t.colors.responses[e]&&t.colors.responses[e].color||e}; + } +`,Ap=gs.span` + display: inline-block; + padding: 2px 8px; + margin: 0; + background-color: ${e=>e.color||e.theme.colors[e.type].main}; + color: ${e=>e.theme.colors[e.type].contrastText}; + font-size: ${e=>e.theme.typography.code.fontSize}; + vertical-align: middle; + line-height: 1.6; + border-radius: 4px; + font-weight: ${({theme:e})=>e.typography.fontWeightBold}; + font-size: 12px; + + span[type] { + margin-left: 4px; + } +`,Cp=ps` + text-decoration: line-through; + color: #707070; +`,jp=gs.caption` + text-align: right; + font-size: 0.9em; + font-weight: normal; + color: ${e=>e.theme.colors.text.secondary}; +`,Tp=gs.td` + border-left: 1px solid ${e=>e.theme.schema.linesColor}; + box-sizing: border-box; + position: relative; + padding: 10px 10px 10px 0; + + ${ms.lessThan("small")` + display: block; + overflow: hidden; + `} + + tr:first-of-type > &, + tr.last > & { + border-left-width: 0; + background-position: top left; + background-repeat: no-repeat; + background-size: 1px 100%; + } + + tr:first-of-type > & { + background-image: linear-gradient( + to bottom, + transparent 0%, + transparent 22px, + ${e=>e.theme.schema.linesColor} 22px, + ${e=>e.theme.schema.linesColor} 100% + ); + } + + tr.last > & { + background-image: linear-gradient( + to bottom, + ${e=>e.theme.schema.linesColor} 0%, + ${e=>e.theme.schema.linesColor} 22px, + transparent 22px, + transparent 100% + ); + } + + tr.last + tr > & { + border-left-color: transparent; + } + + tr.last:first-child > & { + background: none; + border-left-color: transparent; + } +`,Np=gs(Tp)` + padding: 0; +`,Ip=gs(Tp)` + vertical-align: top; + line-height: 20px; + white-space: nowrap; + font-size: 13px; + font-family: ${e=>e.theme.typography.code.fontFamily}; + + &.deprecated { + ${Cp}; + } + + ${({kind:e})=>"patternProperties"===e&&ps` + > span.property-name { + display: inline-table; + white-space: break-spaces; + margin-right: 20px; + + ::before, + ::after { + content: '/'; + filter: opacity(0.2); + } + } + `} + + ${({kind:e=""})=>["field","additionalProperties","patternProperties"].includes(e)?"":"font-style: italic"}; + + ${ys("PropertyNameCell")}; +`,Rp=gs.td` + border-bottom: 1px solid #9fb4be; + padding: 10px 0; + width: ${e=>e.theme.schema.defaultDetailsWidth}; + box-sizing: border-box; + + tr.expanded & { + border-bottom: none; + } + + ${ms.lessThan("small")` + padding: 0 20px; + border-bottom: none; + border-left: 1px solid ${e=>e.theme.schema.linesColor}; + + tr.last > & { + border-left: none; + } + `} + + ${ys("PropertyDetailsCell")}; +`,Lp=gs.span` + color: ${e=>e.theme.schema.linesColor}; + font-family: ${e=>e.theme.typography.code.fontFamily}; + margin-right: 10px; + + &::before { + content: ''; + display: inline-block; + vertical-align: middle; + width: 10px; + height: 1px; + background: ${e=>e.theme.schema.linesColor}; + } + + &::after { + content: ''; + display: inline-block; + vertical-align: middle; + width: 1px; + background: ${e=>e.theme.schema.linesColor}; + height: 7px; + } +`,Dp=gs.div` + padding: ${({theme:e})=>e.schema.nestingSpacing}; +`,Mp=gs.table` + border-collapse: separate; + border-radius: 3px; + font-size: ${e=>e.theme.typography.fontSize}; + + border-spacing: 0; + width: 100%; + + > tr { + vertical-align: middle; + } + + ${ms.lessThan("small")` + display: block; + > tr, > tbody > tr { + display: block; + } + `} + + ${ms.lessThan("small",!1," and (-ms-high-contrast:none)")` + td { + float: left; + width: 100%; + } + `} + + & + ${Dp}, + & + ${Dp} + ${Dp} + ${Dp}, + & + ${Dp} + ${Dp} + ${Dp} + ${Dp} + ${Dp} { + margin: ${({theme:e})=>e.schema.nestingSpacing}; + margin-right: 0; + background: ${({theme:e})=>e.schema.nestedBackground}; + } + + & + ${Dp} + ${Dp}, + & + ${Dp} + ${Dp} + ${Dp} + ${Dp}, + & + ${Dp} + ${Dp} + ${Dp} + ${Dp} + ${Dp} + ${Dp} { + background: #ffffff; + } +`,zp=gs.div` + margin: 0 0 3px 0; + display: inline-block; +`,Fp=gs.span` + font-size: 0.9em; + margin-right: 10px; + color: ${e=>e.theme.colors.primary.main}; + font-family: ${e=>e.theme.typography.headings.fontFamily}; +} +`,Bp=gs.button` + display: inline-block; + margin-right: 10px; + margin-bottom: 5px; + font-size: 0.8em; + cursor: pointer; + border: 1px solid ${e=>e.theme.colors.primary.main}; + padding: 2px 10px; + line-height: 1.5em; + outline: none; + &:focus { + box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary.main}; + } + + ${({$deprecated:e})=>e&&Cp||""}; + + ${e=>e.$active?`\n color: white;\n background-color: ${e.theme.colors.primary.main};\n &:focus {\n box-shadow: none;\n background-color: ${Dn(.15,e.theme.colors.primary.main)};\n }\n `:`\n color: ${e.theme.colors.primary.main};\n background-color: white;\n `} +`,Up=gs.div` + font-size: 0.9em; + font-family: ${e=>e.theme.typography.code.fontFamily}; + &::after { + content: ' ['; + } +`,qp=gs.div` + font-size: 0.9em; + font-family: ${e=>e.theme.typography.code.fontFamily}; + &::after { + content: ']'; + } +`;function Vp(e){return t=>!!t.type&&t.type.tabsRole===e}const Wp=Vp("Tab"),Hp=Vp("TabList"),Gp=Vp("TabPanel");function Yp(e,t){return r.Children.map(e,e=>null===e?null:function(e){return Wp(e)||Hp(e)||Gp(e)}(e)?t(e):e.props&&e.props.children&&"object"==typeof e.props.children?(0,r.cloneElement)(e,{...e.props,children:Yp(e.props.children,t)}):e)}function Kp(e,t){return r.Children.forEach(e,e=>{null!==e&&(Wp(e)||Gp(e)?t(e):e.props&&e.props.children&&"object"==typeof e.props.children&&(Hp( [...] + > ul { + list-style: none; + padding: 0; + margin: 0; + margin: 0 -5px; + + > li { + padding: 5px 10px; + display: inline-block; + + background-color: ${({theme:e})=>e.codeBlock.backgroundColor}; + border-bottom: 1px solid rgba(0, 0, 0, 0.5); + cursor: pointer; + text-align: center; + outline: none; + color: ${({theme:e})=>Dn(e.colors.tonalOffset,e.rightPanel.textColor)}; + margin: 0 + ${({theme:e})=>`${e.spacing.unit}px ${e.spacing.unit}px ${e.spacing.unit}px`}; + border: 1px solid ${({theme:e})=>Dn(.05,e.codeBlock.backgroundColor)}; + border-radius: 5px; + min-width: 60px; + font-size: 0.9em; + font-weight: bold; + + &.react-tabs__tab--selected { + color: ${e=>e.theme.colors.text.primary}; + background: ${({theme:e})=>e.rightPanel.textColor}; + &:focus { + outline: auto; + } + } + + &:only-child { + flex: none; + min-width: 100px; + } + + &.tab-success { + color: ${e=>e.theme.colors.responses.success.tabTextColor}; + } + + &.tab-redirect { + color: ${e=>e.theme.colors.responses.redirect.tabTextColor}; + } + + &.tab-info { + color: ${e=>e.theme.colors.responses.info.tabTextColor}; + } + + &.tab-error { + color: ${e=>e.theme.colors.responses.error.tabTextColor}; + } + } + } + > .react-tabs__tab-panel { + background: ${({theme:e})=>e.codeBlock.backgroundColor}; + & > div, + & > pre { + padding: ${e=>4*e.theme.spacing.unit}px; + margin: 0; + } + + & > div > pre { + padding: 0; + } + } +`,wd=(gs(xd)` + > ul { + display: block; + > li { + padding: 2px 5px; + min-width: auto; + margin: 0 15px 0 0; + font-size: 13px; + font-weight: normal; + border-bottom: 1px dashed; + color: ${({theme:e})=>Dn(e.colors.tonalOffset,e.rightPanel.textColor)}; + border-radius: 0; + background: none; + + &:last-child { + margin-right: 0; + } + + &.react-tabs__tab--selected { + color: ${({theme:e})=>e.rightPanel.textColor}; + background: none; + } + } + } + > .react-tabs__tab-panel { + & > div, + & > pre { + padding: ${e=>2*e.theme.spacing.unit}px 0; + } + } +`,gs.div` + /** + * Based on prism-dark.css + */ + + code[class*='language-'], + pre[class*='language-'] { + /* color: white; + background: none; */ + text-shadow: 0 -0.1em 0.2em black; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + @media print { + code[class*='language-'], + pre[class*='language-'] { + text-shadow: none; + } + } + + /* Code blocks */ + pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: hsl(30, 20%, 50%); + } + + .token.punctuation { + opacity: 0.7; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.number, + .token.constant, + .token.symbol { + color: #4a8bb3; + } + + .token.boolean { + color: #e64441; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #a0fbaa; + & + a, + & + a:visited { + color: #4ed2ba; + text-decoration: underline; + } + } + + .token.property.string { + color: white; + } + + .token.operator, + .token.entity, + .token.url, + .token.variable { + color: hsl(40, 90%, 60%); + } + + .token.atrule, + .token.attr-value, + .token.keyword { + color: hsl(350, 40%, 70%); + } + + .token.regex, + .token.important { + color: #e90; + } + + .token.important, + .token.bold { + font-weight: bold; + } + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } + + .token.deleted { + color: red; + } + + ${ys("Prism")}; +`),kd=gs.div` + opacity: 0.7; + transition: opacity 0.3s ease; + text-align: right; + &:focus-within { + opacity: 1; + } + > button { + background-color: transparent; + border: 0; + color: inherit; + padding: 2px 10px; + font-family: ${({theme:e})=>e.typography.fontFamily}; + font-size: ${({theme:e})=>e.typography.fontSize}; + line-height: ${({theme:e})=>e.typography.lineHeight}; + cursor: pointer; + outline: 0; + + :hover, + :focus { + background: rgba(255, 255, 255, 0.1); + } + } +`,Sd=gs.div` + &:hover ${kd} { + opacity: 1; + } +`,Ed=gs(wd).attrs({as:"pre"})` + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: ${e=>e.theme.typography.code.fontSize}; + overflow-x: auto; + margin: 0; + + white-space: ${({theme:e})=>e.typography.code.wrap?"pre-wrap":"pre"}; +`;function Od(e){return getComputedStyle(e)}function _d(e,t){for(var r in t){var n=t[r];"number"==typeof n&&(n+="px"),e.style[r]=n}return e}function Pd(e){var t=document.createElement("div");return t.className=e,t}var $d="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ad(e,t){if(!$d)throw new Error("No element matching method supported");return $d.call(e,t [...] + position: relative; +`;class pf extends r.Component{constructor(){super(...arguments),this.handleRef=e=>{this._container=e}}componentDidMount(){const e=this._container.parentElement&&this._container.parentElement.scrollTop||0;this.inst=new af(this._container,this.props.options||{}),this._container.scrollTo&&this._container.scrollTo(0,e)}componentDidUpdate(){this.inst.update()}componentWillUnmount(){this.inst.destroy()}render(){const{children:e,className:t,updateFn:n}=this.props;return n&&n(this.componentDidU [...] + position: absolute; + pointer-events: none; + z-index: 1; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + right: 8px; + margin: auto; + text-align: center; + polyline { + color: ${e=>"dark"===e.variant&&"white"}; + } +`,hf=r.memo(e=>{const{options:t,onChange:n,placeholder:i,value:o="",variant:s,className:a}=e;return r.createElement("div",{className:a},r.createElement(ff,{variant:s}),r.createElement("select",{onChange:e=>{const{selectedIndex:r}=e.target;n(t[i?r-1:r])},value:o,className:"dropdown-select"},i&&r.createElement("option",{disabled:!0,hidden:!0,value:i},i),t.map(({idx:e,value:t,title:n},i)=>r.createElement("option",{key:e||t+i,value:t},n||t))),r.createElement("label",null,o))}),mf=cs(hf)` + label { + box-sizing: border-box; + min-width: 100px; + outline: none; + display: inline-block; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + color: ${({theme:e})=>e.colors.text.primary}; + vertical-align: bottom; + width: ${({fullWidth:e})=>e?"100%":"auto"}; + text-transform: none; + padding: 0 22px 0 4px; + + font-size: 0.929em; + line-height: 1.5em; + font-family: inherit; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .dropdown-select { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + border: none; + appearance: none; + cursor: pointer; + + color: ${({theme:e})=>e.colors.text.primary}; + line-height: inherit; + font-family: inherit; + } + box-sizing: border-box; + min-width: 100px; + outline: none; + display: inline-block; + border-radius: 2px; + border: 1px solid rgba(38, 50, 56, 0.5); + vertical-align: bottom; + padding: 2px 0px 2px 6px; + position: relative; + width: auto; + background: white; + color: #263238; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + font-size: 0.929em; + line-height: 1.5em; + cursor: pointer; + transition: border 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; + + &:hover, + &:focus-within { + border: 1px solid ${e=>e.theme.colors.primary.main}; + color: ${e=>e.theme.colors.primary.main}; + box-shadow: 0px 0px 0px 1px ${e=>e.theme.colors.primary.main}; + } +`,gf=cs(mf)` + margin-left: 10px; + text-transform: none; + font-size: 0.969em; + + font-size: 1em; + border: none; + padding: 0 1.2em 0 0; + background: transparent; + + &:hover, + &:focus-within { + border: none; + box-shadow: none; + label { + color: ${e=>e.theme.colors.primary.main}; + text-shadow: 0px 0px 0px ${e=>e.theme.colors.primary.main}; + } + } +`,yf=cs.span` + margin-left: 10px; + text-transform: none; + font-size: 0.929em; + color: black; +`;var bf=Object.defineProperty,vf=Object.defineProperties,xf=Object.getOwnPropertyDescriptors,wf=Object.getOwnPropertySymbols,kf=Object.prototype.hasOwnProperty,Sf=Object.prototype.propertyIsEnumerable,Ef=(e,t,r)=>t in e?bf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Of=(e,t)=>{for(var r in t||(t={}))kf.call(t,r)&&Ef(e,r,t[r]);if(wf)for(var r of wf(t))Sf.call(t,r)&&Ef(e,r,t[r]);return e},_f=(e,t)=>vf(e,xf(t));class Pf{constructor(e,t,r){this.operations=[];const{resolv [...] + a { + text-decoration: ${e=>e.theme.typography.links.textDecoration}; + color: ${e=>e.theme.typography.links.color}; + + &:visited { + color: ${e=>e.theme.typography.links.visited}; + } + + &:hover { + color: ${e=>e.theme.typography.links.hover}; + text-decoration: ${e=>e.theme.typography.links.hoverTextDecoration}; + } + } +`,km=gs(wd)` + font-family: ${e=>e.theme.typography.fontFamily}; + font-weight: ${e=>e.theme.typography.fontWeightRegular}; + line-height: ${e=>e.theme.typography.lineHeight}; + + p { + &:last-child { + margin-bottom: 0; + } + } + + ${({$compact:e})=>e&&"\n p:first-child {\n margin-top: 0;\n }\n p:last-child {\n margin-bottom: 0;\n }\n "} + + ${({$inline:e})=>e&&" p {\n display: inline-block;\n }"} + + h1 { + ${hp(1)}; + color: ${e=>e.theme.colors.primary.main}; + margin-top: 0; + } + + h2 { + ${hp(2)}; + color: ${e=>e.theme.colors.text.primary}; + } + + code { + color: ${({theme:e})=>e.typography.code.color}; + background-color: ${({theme:e})=>e.typography.code.backgroundColor}; + + font-family: ${e=>e.theme.typography.code.fontFamily}; + border-radius: 2px; + border: 1px solid rgba(38, 50, 56, 0.1); + padding: 0 ${({theme:e})=>e.spacing.unit}px; + font-size: ${e=>e.theme.typography.code.fontSize}; + font-weight: ${({theme:e})=>e.typography.code.fontWeight}; + + word-break: break-word; + } + + pre { + font-family: ${e=>e.theme.typography.code.fontFamily}; + white-space: ${({theme:e})=>e.typography.code.wrap?"pre-wrap":"pre"}; + background-color: ${({theme:e})=>e.codeBlock.backgroundColor}; + color: white; + padding: ${e=>4*e.theme.spacing.unit}px; + overflow-x: auto; + line-height: normal; + border-radius: 0; + border: 1px solid rgba(38, 50, 56, 0.1); + + code { + background-color: transparent; + color: white; + padding: 0; + + &:before, + &:after { + content: none; + } + } + } + + blockquote { + margin: 0; + margin-bottom: 1em; + padding: 0 15px; + color: #777; + border-left: 4px solid #ddd; + } + + img { + max-width: 100%; + box-sizing: content-box; + } + + ul, + ol { + padding-left: 2em; + margin: 0; + margin-bottom: 1em; + + ul, + ol { + margin-bottom: 0; + margin-top: 0; + } + } + + table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + word-break: keep-all; + border-collapse: collapse; + border-spacing: 0; + margin-top: 1.5em; + margin-bottom: 1.5em; + } + + table tr { + background-color: #fff; + border-top: 1px solid #ccc; + + &:nth-child(2n) { + background-color: ${({theme:e})=>e.schema.nestedBackground}; + } + } + + table th, + table td { + padding: 6px 13px; + border: 1px solid #ddd; + } + + table th { + text-align: left; + font-weight: bold; + } + + ${Ep(".share-link")}; + + ${wm} + + ${ys("Markdown")}; +`;var Sm=Object.defineProperty,Em=Object.defineProperties,Om=Object.getOwnPropertyDescriptors,_m=Object.getOwnPropertySymbols,Pm=Object.prototype.hasOwnProperty,$m=Object.prototype.propertyIsEnumerable,Am=(e,t,r)=>t in e?Sm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const Cm=xm,jm=cs(km)` + display: inline; +`,Tm=(e,t)=>e?Cm.sanitize(t):t;function Nm(e){var t=e,{inline:n,compact:i}=t,o=((e,t)=>{var r={};for(var n in e)Pm.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&_m)for(var n of _m(e))t.indexOf(n)<0&&$m.call(e,n)&&(r[n]=e[n]);return r})(t,["inline","compact"]);const s=n?jm:km;return r.createElement(Ps,null,e=>r.createElement(s,((e,t)=>Em(e,Om(t)))(((e,t)=>{for(var r in t||(t={}))Pm.call(t,r)&&Am(e,r,t[r]);if(_m)for(var r of _m(t))$m.call(t,r)&&Am(e,r,t[r]);return e})({className:"redo [...] + position: relative; +`,Lm=gs.div` + position: absolute; + min-width: 80px; + max-width: 500px; + background: #fff; + bottom: 100%; + left: 50%; + margin-bottom: 10px; + transform: translateX(-50%); + + border-radius: 4px; + padding: 0.3em 0.6em; + text-align: center; + box-shadow: 0px 0px 5px 0px rgba(204, 204, 204, 1); +`,Dm=gs.div` + background: #fff; + color: #000; + display: inline; + font-size: 0.85em; + white-space: nowrap; +`,Mm=gs.div` + position: absolute; + width: 0; + height: 0; + bottom: -5px; + left: 50%; + margin-left: -5px; + border-left: solid transparent 5px; + border-right: solid transparent 5px; + border-top: solid #fff 5px; +`,zm=gs.div` + position: absolute; + width: 100%; + height: 20px; + bottom: -20px; +`;class Fm extends r.Component{render(){const{open:e,title:t,children:n}=this.props;return r.createElement(Rm,null,n,e&&r.createElement(Lm,null,r.createElement(Dm,null,t),r.createElement(Mm,null),r.createElement(zm,null)))}}const Bm="undefined"!=typeof document&&document.queryCommandSupported&&document.queryCommandSupported("copy");class Um{static isSupported(){return Bm}static selectElement(e){let t,r;document.body.createTextRange?(t=document.body.createTextRange(),t.moveToElementText(e [...] + .redoc-json code > .collapser { + display: none; + pointer-events: none; + } + + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: ${e=>e.theme.typography.code.fontSize}; + + white-space: ${({theme:e})=>e.typography.code.wrap?"pre-wrap":"pre"}; + contain: content; + overflow-x: auto; + + .callback-function { + color: gray; + } + + .collapser:after { + content: '-'; + cursor: pointer; + } + + .collapsed > .collapser:after { + content: '+'; + cursor: pointer; + } + + .ellipsis:after { + content: ' … '; + } + + .collapsible { + margin-left: 2em; + } + + .hoverable { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 2px; + padding-right: 2px; + border-radius: 2px; + } + + .hovered { + background-color: rgba(235, 238, 249, 1); + } + + .collapser { + background-color: transparent; + border: 0; + color: #fff; + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: ${e=>e.theme.typography.code.fontSize}; + padding-right: 6px; + padding-left: 6px; + padding-top: 0; + padding-bottom: 0; + display: flex; + align-items: center; + justify-content: center; + width: 15px; + height: 15px; + position: absolute; + top: 4px; + left: -1.5em; + cursor: default; + user-select: none; + -webkit-user-select: none; + padding: 2px; + &:focus { + outline-color: #fff; + outline-style: dotted; + outline-width: 1px; + } + } + + ul { + list-style-type: none; + padding: 0px; + margin: 0px 0px 0px 26px; + } + + li { + position: relative; + display: block; + } + + .hoverable { + display: inline-block; + } + + .selected { + outline-style: solid; + outline-width: 1px; + outline-style: dotted; + } + + .collapsed > .collapsible { + display: none; + } + + .ellipsis { + display: none; + } + + .collapsed > .ellipsis { + display: inherit; + } +`,Jm=gs.div` + &:hover > ${kd} { + opacity: 1; + } +`,Zm=gs(e=>{const[t,n]=r.useState(),i=({renderCopyButton:t})=>{const i=e.data&&Object.values(e.data).some(e=>"object"==typeof e&&null!==e);return r.createElement(Jm,null,r.createElement(kd,null,t(),i&&r.createElement(r.Fragment,null,r.createElement("button",{onClick:o}," Expand all "),r.createElement("button",{onClick:s}," Collapse all "))),r.createElement(Os.Consumer,null,t=>r.createElement(wd,{tabIndex:0,className:e.className,ref:e=>n(e),dangerouslySetInnerHTML:{__html:Wm(e.data,t.json [...] + ${Xm}; +`,eg=e=>{const{source:t,lang:n}=e;return r.createElement(Ed,{dangerouslySetInnerHTML:{__html:ka(t,n)}})},tg=e=>{const{source:t,lang:n}=e;return r.createElement(qm,{data:t},({renderCopyButton:e})=>r.createElement(Sd,null,r.createElement(kd,null,e()),r.createElement(eg,{lang:n,source:t})))};function rg({value:e,mimeType:t}){return ea(t)?r.createElement(Zm,{data:e}):("object"==typeof e&&(e=JSON.stringify(e,null,2)),r.createElement(tg,{lang:(n=t,-1!==n.search(/xml/i)?"xml":-1!==n.search(/csv [...] + padding: 0.9em; + background-color: ${({theme:e})=>Gn(.6,e.rightPanel.backgroundColor)}; + margin: 0 0 10px 0; + display: block; + font-family: ${({theme:e})=>e.typography.headings.fontFamily}; + font-size: 0.929em; + line-height: 1.5em; +`,sg=gs.span` + font-family: ${({theme:e})=>e.typography.headings.fontFamily}; + font-size: 12px; + position: absolute; + z-index: 1; + top: -11px; + left: 12px; + font-weight: ${({theme:e})=>e.typography.fontWeightBold}; + color: ${({theme:e})=>Gn(.3,e.rightPanel.textColor)}; +`,ag=gs.div` + position: relative; +`,lg=gs(mf)` + label { + color: ${({theme:e})=>e.rightPanel.textColor}; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + font-size: 1em; + text-transform: none; + border: none; + } + margin: 0 0 10px 0; + display: block; + background-color: ${({theme:e})=>Gn(.6,e.rightPanel.backgroundColor)}; + border: none; + padding: 0.9em 1.6em 0.9em 0.9em; + box-shadow: none; + &:hover, + &:focus-within { + border: none; + box-shadow: none; + background-color: ${({theme:e})=>Gn(.3,e.rightPanel.backgroundColor)}; + } +`,cg=gs.div` + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: 12px; + color: #ee807f; +`;class ug extends r.Component{constructor(){super(...arguments),this.state={activeIdx:0},this.switchMedia=({idx:e})=>{void 0!==e&&this.setState({activeIdx:e})}}render(){const{activeIdx:e}=this.state,t=this.props.mediaType.examples||{},n=this.props.mediaType.name,i=r.createElement(cg,null,"No sample"),o=Object.keys(t);if(0===o.length)return i;if(o.length>1){const i=o.map((e,r)=>({value:t[e].summary||e,idx:r})),s=t[o[e]],a=s.description;return r.createElement(pg,null,r.createElement(ag,nu [...] + margin-top: 15px; +`;if(!r.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!ir)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var dg=n(961);function fg(e){e()}function hg(e){return Ft(Yr(e,t));var t}var mg,gg,yg=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map} [...] + &.deprecated { + span.property-name { + ${Cp} + } + } + + button { + background-color: transparent; + border: 0; + outline: 0; + font-size: 13px; + font-family: ${e=>e.theme.typography.code.fontFamily}; + cursor: pointer; + padding: 0; + color: ${e=>e.theme.colors.text.primary}; + &:focus { + font-weight: ${({theme:e})=>e.typography.fontWeightBold}; + } + ${({kind:e})=>"patternProperties"===e&&ps` + display: inline-flex; + margin-right: 20px; + + > span.property-name { + white-space: break-spaces; + text-align: left; + + ::before, + ::after { + content: '/'; + filter: opacity(0.2); + } + } + + > svg { + align-self: center; + } + `} + } + ${$p} { + height: ${({theme:e})=>e.schema.arrow.size}; + width: ${({theme:e})=>e.schema.arrow.size}; + polygon { + fill: ${({theme:e})=>e.schema.arrow.color}; + } + } +`,Ug=gs.span` + vertical-align: middle; + font-size: ${({theme:e})=>e.typography.code.fontSize}; + line-height: 20px; +`,qg=gs(Ug)` + color: ${e=>Gn(.1,e.theme.schema.typeNameColor)}; +`,Vg=gs(Ug)` + color: ${e=>e.theme.schema.typeNameColor}; +`,Wg=gs(Ug)` + color: ${e=>e.theme.schema.typeTitleColor}; + word-break: break-word; +`,Hg=Vg,Gg=gs(Ug).attrs({as:"div"})` + color: ${e=>e.theme.schema.requireLabelColor}; + font-size: ${e=>e.theme.schema.labelsTextSize}; + font-weight: normal; + margin-left: 20px; + line-height: 1; +`,Yg=gs(Gg)` + color: ${e=>e.theme.colors.primary.light}; +`,Kg=gs(Ug)` + color: ${({theme:e})=>e.colors.warning.main}; + font-size: 13px; +`,Qg=gs(Ug)` + color: #0e7c86; + font-family: ${e=>e.theme.typography.code.fontFamily}; + font-size: 12px; + &::before, + &::after { + content: ' '; + } +`,Xg=gs(Ug)` + border-radius: 2px; + word-break: break-word; + ${({theme:e})=>`\n background-color: ${Gn(.95,e.colors.text.primary)};\n color: ${Gn(.1,e.colors.text.primary)};\n\n padding: 0 ${e.spacing.unit}px;\n border: 1px solid ${Gn(.9,e.colors.text.primary)};\n font-family: ${e.typography.code.fontFamily};\n}`}; + & + & { + margin-left: 0; + } + ${ys("ExampleValue")}; +`,Jg=gs(Xg)``,Zg=gs(Ug)` + border-radius: 2px; + ${({theme:e})=>`\n background-color: ${Gn(.95,e.colors.primary.light)};\n color: ${Gn(.1,e.colors.primary.main)};\n\n margin: 0 ${e.spacing.unit}px;\n padding: 0 ${e.spacing.unit}px;\n border: 1px solid ${Gn(.9,e.colors.primary.main)};\n}`}; + & + & { + margin-left: 0; + } + ${ys("ConstraintItem")}; +`,ey=gs.button` + background-color: transparent; + border: 0; + color: ${({theme:e})=>e.colors.text.secondary}; + margin-left: ${({theme:e})=>e.spacing.unit}px; + border-radius: 2px; + cursor: pointer; + outline-color: ${({theme:e})=>e.colors.text.secondary}; + font-size: 12px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;const ty=gs.div` + ${wm}; + ${({$compact:e})=>e?"":"margin: 1em 0"} +`;let ry=class extends r.Component{render(){const{externalDocs:e}=this.props;return e&&e.url?r.createElement(ty,{$compact:this.props.compact},r.createElement("a",{href:e.url},e.description||e.url)):null}};ry=((e,t)=>{for(var r,n=t,i=e.length-1;i>=0;i--)(r=e[i])&&(n=r(n)||n);return n})([Fg],ry);const ny=gs(km)` + table { + margin-bottom: 0.2em; + } +`;class iy extends r.PureComponent{constructor(e){super(e),this.state={collapsed:!0},this.toggle=this.toggle.bind(this)}toggle(){this.setState({collapsed:!this.state.collapsed})}render(){const{values:e,type:t}=this.props,{collapsed:n}=this.state,i=!Array.isArray(e),o=Array.isArray(e)&&e||Object.entries(e||{}).map(([e,t])=>({value:e,description:t})),{enumSkipQuotes:s,maxDisplayedEnumValues:a}=this.context;if(!o.length)return null;const l=this.state.collapsed&&a?o.slice(0,a):o,c=!!a&&o.len [...] + color: ${e=>e.theme.colors.primary.main}; + vertical-align: middle; + font-size: 13px; + line-height: 20px; + padding: 0 5px; + cursor: pointer; +`,sy=gs(km)` + margin: 2px 0; +`;class ay extends r.PureComponent{render(){const e=this.props.extensions;return r.createElement(Os.Consumer,null,t=>r.createElement(r.Fragment,null,t.showExtensions&&Object.keys(e).map(t=>r.createElement(sy,{key:t},r.createElement(Ug,null," ",t.substring(2),": ")," ",r.createElement(Jg,null,"string"==typeof e[t]?e[t]:JSON.stringify(e[t]))))))}}function ly({field:e}){return e.examples?r.createElement(r.Fragment,null,r.createElement(Ug,null," ",hi("examples"),": "),pi(e.examples)?e.exampl [...] + margin-top: 1em; + list-style-position: outside; +`;class uy extends r.PureComponent{render(){return 0===this.props.constraints.length?null:r.createElement("span",null," ",this.props.constraints.map(e=>r.createElement(Zg,{key:e}," ",e," ")))}}const py=r.memo(function({value:e,label:t,raw:n}){if(void 0===e)return null;const i=n?String(e):JSON.stringify(e);return r.createElement("div",null,r.createElement(Ug,null," ",t," ")," ",r.createElement(Xg,null,i))});function dy(e){const t=e.schema.pattern,{hideSchemaPattern:n}=r.useContext(Os),[i, [...] + margin: 0 5px; + vertical-align: text-top; +`;var my=Object.defineProperty,gy=Object.getOwnPropertySymbols,yy=Object.prototype.hasOwnProperty,by=Object.prototype.propertyIsEnumerable,vy=(e,t,r)=>t in e?my(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xy=(e,t)=>{for(var r in t||(t={}))yy.call(t,r)&&vy(e,r,t[r]);if(gy)for(var r of gy(t))by.call(t,r)&&vy(e,r,t[r]);return e};const wy=Fg(e=>{const{enumSkipQuotes:t,hideSchemaTitles:n}=r.useContext(Os),{showExamples:i,field:o,renderDiscriminatorSwitch:s}=e,{schema:a,des [...] + padding-left: ${({theme:e})=>2*e.spacing.unit}px; +`;class By extends r.PureComponent{render(){const e=this.props.schema,t=e.items,n=this.props.fieldParentsName,i=void 0===e.minItems&&void 0===e.maxItems?"":`(${ua(e)})`,o=n?[...n.slice(0,-1),n[n.length-1]+"[]"]:n;return e.fields?r.createElement(Cy,zy(My({},this.props),{level:this.props.level,fieldParentsName:o})):!e.displayType||t||i.length?r.createElement("div",null,r.createElement(Up,null," Array ",i),r.createElement(Fy,null,r.createElement(cb,zy(My({},this.props),{schema:t,fieldParent [...] + background: ${({theme:e})=>e.codeBlock.backgroundColor}; + & > div, + & > pre { + padding: ${e=>4*e.theme.spacing.unit}px; + margin: 0; + } + + & > div > pre { + padding: 0; + } +`,vb=(cs.div` + background-color: #e4e7eb; +`,cs.ul` + display: inline; + list-style: none; + padding: 0; + + li { + display: inherit; + + &:after { + content: ','; + } + &:last-child:after { + content: none; + } + } +`,cs.code` + font-size: ${e=>e.theme.typography.code.fontSize}; + font-family: ${e=>e.theme.typography.code.fontFamily}; + margin: 0 3px; + padding: 0.2em; + display: inline-block; + line-height: 1; + + &:after { + content: ','; + font-weight: normal; + } + + &:last-child:after { + content: none; + } +`),xb=cs.span` + &:after { + content: ' and '; + font-weight: normal; + } + + &:last-child:after { + content: none; + } + + ${wm}; +`,wb=cs.span` + ${e=>!e.$expanded&&"white-space: nowrap;"} + &:after { + content: ' or '; + ${e=>e.$expanded&&"content: ' or \\a';"} + white-space: pre; + } + + &:last-child:after, + &:only-child:after { + content: none; + } + + ${wm}; +`,kb=cs.div` + flex: 1 1 auto; + cursor: pointer; +`,Sb=cs.div` + width: ${e=>e.theme.schema.defaultDetailsWidth}; + text-overflow: ellipsis; + border-radius: 4px; + overflow: hidden; + ${e=>e.$expanded&&`background: ${e.theme.colors.gray[100]};\n padding: 8px 9.6px;\n margin: 20px 0;\n width: 100%;\n `}; + ${ms.lessThan("small")` + margin-top: 10px; + `} +`,Eb=cs(vp)` + display: inline-block; + margin: 0; +`,Ob=cs.div` + width: 100%; + display: flex; + margin: 1em 0; + flex-direction: ${e=>e.$expanded?"column":"row"}; + ${ms.lessThan("small")` + flex-direction: column; + `} +`,_b=cs.div` + margin: 0.5em 0; +`,Pb=cs.div` + border-bottom: 1px solid ${({theme:e})=>e.colors.border.dark}; + margin-bottom: 1.5em; + padding-bottom: 0.7em; + + h5 { + line-height: 1em; + margin: 0 0 0.6em; + font-size: ${({theme:e})=>e.typography.fontSize}; + } + + .redoc-markdown p:first-child { + display: inline; + } +`;function $b({children:e,height:t}){const n=r.createRef(),[i,o]=r.useState(!1),[s,a]=r.useState(!1);return r.useEffect(()=>{n.current&&n.current.clientHeight+20<n.current.scrollHeight&&a(!0)},[n]),r.createElement(r.Fragment,null,r.createElement(Ab,{ref:n,className:i?"":"container",style:{height:i?"auto":t}},e),r.createElement(Cb,{$dimmed:!i},s&&r.createElement(jb,{onClick:()=>{o(!i)}},i?"See less":"See more")))}const Ab=cs.div` + overflow-y: hidden; +`,Cb=cs.div` + text-align: center; + line-height: 1.5em; + ${({$dimmed:e})=>e&&"background-image: linear-gradient(to bottom, transparent,rgb(255 255 255));\n position: relative;\n top: -0.5em;\n padding-top: 0.5em;\n background-position-y: -1em;\n "} +`,jb=cs.a` + cursor: pointer; +`,Tb=r.memo(function(e){const{type:t,flow:n,RequiredScopes:i}=e,o=Object.keys((null==n?void 0:n.scopes)||{});return r.createElement(r.Fragment,null,r.createElement(_b,null,r.createElement("b",null,"Flow type: "),r.createElement("code",null,t," ")),("implicit"===t||"authorizationCode"===t)&&r.createElement(_b,null,r.createElement("strong",null," Authorization URL: "),r.createElement("code",null,r.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:n.authorizationUrl},n.autho [...] + margin-top: 0; + margin-bottom: 0.5em; + + ${ys("ApiHeader")}; +`,zb=gs.a` + border: 1px solid ${e=>e.theme.colors.primary.main}; + color: ${e=>e.theme.colors.primary.main}; + font-weight: normal; + margin-left: 0.5em; + padding: 4px 8px 4px; + display: inline-block; + text-decoration: none; + cursor: pointer; + + ${ys("DownloadButton")}; +`,Fb=gs.span` + &::before { + content: '|'; + display: inline-block; + opacity: 0.5; + width: ${15}px; + text-align: center; + } + + &:last-child::after { + display: none; + } +`,Bb=gs.div` + overflow: hidden; +`,Ub=gs.div` + display: flex; + flex-wrap: wrap; + // hide separator on new lines: idea from https://stackoverflow.com/a/31732902/1749888 + margin-left: -${15}px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let qb=class extends r.Component{render(){const{store:e}=this.props,{info:t,externalDocs:n}=e.spec,i=e.options.hideDownloadButtons,o=t.downloadUrls,s=t.downloadFileName,a=t.license&&r.createElement(Fb,null,"License:"," ",t.license.identifier?t.license.identifier:r.createElement("a",{href:t.license.url},t.license.name))||null,l=t.contact&&t.contact.url&&r.createElement(Fb,null,"URL: ",r.createElement("a",{href:t.contact.url},t.contac [...] + max-height: ${e=>e.theme.logo.maxHeight}; + max-width: ${e=>e.theme.logo.maxWidth}; + padding: ${e=>e.theme.logo.gutter}; + width: 100%; + display: block; +`,Wb=gs.div` + text-align: center; +`,Hb=gs.a` + display: inline-block; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Gb=class extends r.Component{render(){const{info:e}=this.props,t=e["x-logo"];if(!t||!t.url)return null;const n=t.href||e.contact&&e.contact.url,i=t.altText?t.altText:"logo",o=r.createElement(Vb,{src:t.url,alt:i});return r.createElement(Wb,{style:{backgroundColor:t.backgroundColor}},n?(s=n,e=>r.createElement(Hb,{href:s},e))(o):o);var s}};Gb=((e,t)=>{for(var r,n=t,i=e.length-1;i>=0;i--)(r=e[i])&&(n=r(n)||n);return n})([Fg],Gb);var [...] + width: 9ex; + display: inline-block; + height: ${e=>e.theme.typography.code.fontSize}; + line-height: ${e=>e.theme.typography.code.fontSize}; + background-color: ${e=>e.color||"#333"}; + border-radius: 3px; + background-repeat: no-repeat; + background-position: 6px 4px; + font-size: 7px; + font-family: Verdana, sans-serif; // web-safe + color: white; + text-transform: uppercase; + text-align: center; + font-weight: bold; + vertical-align: middle; + margin-right: 6px; + margin-top: 2px; + + &.get { + background-color: ${({theme:e})=>e.colors.http.get}; + } + + &.post { + background-color: ${({theme:e})=>e.colors.http.post}; + } + + &.put { + background-color: ${({theme:e})=>e.colors.http.put}; + } + + &.options { + background-color: ${({theme:e})=>e.colors.http.options}; + } + + &.patch { + background-color: ${({theme:e})=>e.colors.http.patch}; + } + + &.delete { + background-color: ${({theme:e})=>e.colors.http.delete}; + } + + &.basic { + background-color: ${({theme:e})=>e.colors.http.basic}; + } + + &.link { + background-color: ${({theme:e})=>e.colors.http.link}; + } + + &.head { + background-color: ${({theme:e})=>e.colors.http.head}; + } + + &.hook { + background-color: ${({theme:e})=>e.colors.primary.main}; + } + + &.schema { + background-color: ${({theme:e})=>e.colors.http.basic}; + } +`;function nv(e,{theme:t},r){return e>1?t.sidebar.level1Items[r]:1===e?t.sidebar.groupItems[r]:""}const iv=gs.ul` + margin: 0; + padding: 0; + + &:first-child { + padding-bottom: 32px; + } + + & & { + font-size: 0.929em; + } + + ${e=>e.$expanded?"":"display: none;"}; +`,ov=gs.li` + list-style: none inside none; + overflow: hidden; + text-overflow: ellipsis; + padding: 0; + ${e=>0===e.depth?"margin-top: 15px":""}; +`,sv={0:ps` + opacity: 0.7; + text-transform: ${({theme:e})=>e.sidebar.groupItems.textTransform}; + font-size: 0.8em; + padding-bottom: 0; + cursor: default; + `,1:ps` + font-size: 0.929em; + text-transform: ${({theme:e})=>e.sidebar.level1Items.textTransform}; + `},av=gs.label.attrs(e=>({className:tv("-depth"+e.$depth,{active:e.$active})}))` + cursor: pointer; + color: ${e=>e.$active?nv(e.$depth,e,"activeTextColor"):e.theme.sidebar.textColor}; + margin: 0; + padding: 12.5px ${e=>4*e.theme.spacing.unit}px; + ${({$depth:e,$type:t,theme:r})=>"section"===t&&e>1&&"padding-left: "+8*r.spacing.unit+"px;"||""} + display: flex; + justify-content: space-between; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + ${e=>sv[e.$depth]}; + background-color: ${e=>e.$active?nv(e.$depth,e,"activeBackgroundColor"):e.theme.sidebar.backgroundColor}; + + ${e=>e.$deprecated&&Cp||""}; + + &:hover { + color: ${e=>nv(e.$depth,e,"activeTextColor")}; + background-color: ${e=>nv(e.$depth,e,"activeBackgroundColor")}; + } + + ${$p} { + height: ${({theme:e})=>e.sidebar.arrow.size}; + width: ${({theme:e})=>e.sidebar.arrow.size}; + polygon { + fill: ${({theme:e})=>e.sidebar.arrow.color}; + } + } +`,lv=gs.span` + display: inline-block; + vertical-align: middle; + width: ${e=>e.width?e.width:"auto"}; + overflow: hidden; + text-overflow: ellipsis; +`,cv=gs.div` + ${({theme:e})=>ps` + font-size: 0.8em; + margin-top: ${2*e.spacing.unit}px; + text-align: center; + position: fixed; + width: ${e.sidebar.width}; + bottom: 0; + background: ${e.sidebar.backgroundColor}; + + a, + a:visited, + a:hover { + color: ${e.sidebar.textColor} !important; + padding: ${e.spacing.unit}px 0; + border-top: 1px solid ${Dn(.1,e.sidebar.backgroundColor)}; + text-decoration: none; + display: flex; + align-items: center; + justify-content: center; + } + `}; + img { + width: 15px; + margin-right: 5px; + } + + ${ms.lessThan("small")` + width: 100%; + `}; +`,uv=gs.button` + border: 0; + width: 100%; + text-align: left; + & > * { + vertical-align: middle; + } + + ${$p} { + polygon { + fill: ${({theme:e})=>Dn(e.colors.tonalOffset,e.colors.gray[100])}; + } + } +`,pv=gs.span` + text-decoration: ${e=>e.$deprecated?"line-through":"none"}; + margin-right: 8px; +`,dv=gs(rv)` + margin: 0 5px 0 0; +`,fv=gs(e=>{const{name:t,opened:n,className:i,onClick:o,httpVerb:s,deprecated:a}=e;return r.createElement(uv,{className:i,onClick:o||void 0},r.createElement(dv,{type:s},ba(s)),r.createElement($p,{size:"1.5em",direction:n?"down":"right",float:"left"}),r.createElement(pv,{$deprecated:a},t),a?r.createElement(Ap,{type:"warning"}," ",hi("deprecated")," "):null)})` + padding: 10px; + border-radius: 2px; + margin-bottom: 4px; + line-height: 1.5em; + background-color: ${({theme:e})=>e.colors.gray[100]}; + cursor: pointer; + outline-color: ${({theme:e})=>Dn(e.colors.tonalOffset,e.colors.gray[100])}; +`,hv=gs.div` + padding: 10px 25px; + background-color: ${({theme:e})=>e.colors.gray[50]}; + margin-bottom: 5px; + margin-top: 5px; +`;class mv extends r.PureComponent{constructor(){super(...arguments),this.selectElement=()=>{Um.selectElement(this.child)}}render(){const{children:e}=this.props;return r.createElement("div",{ref:e=>this.child=e,onClick:this.selectElement,onFocus:this.selectElement,tabIndex:0,role:"button"},e)}}const gv=gs.div` + cursor: pointer; + position: relative; + margin-bottom: 5px; +`,yv=gs.span` + font-family: ${e=>e.theme.typography.code.fontFamily}; + margin-left: 10px; + flex: 1; + overflow-x: hidden; + text-overflow: ellipsis; +`,bv=gs.button` + outline: 0; + color: inherit; + width: 100%; + text-align: left; + cursor: pointer; + padding: 10px 30px 10px ${e=>e.$inverted?"10px":"20px"}; + border-radius: ${e=>e.$inverted?"0":"4px 4px 0 0"}; + background-color: ${e=>e.$inverted?"transparent":e.theme.codeBlock.backgroundColor}; + display: flex; + white-space: nowrap; + align-items: center; + border: ${e=>e.$inverted?"0":"1px solid transparent"}; + border-bottom: ${e=>e.$inverted?"1px solid #ccc":"0"}; + transition: border-color 0.25s ease; + + ${e=>e.$expanded&&!e.$inverted&&`border-color: ${e.theme.colors.border.dark};`||""} + + .${yv} { + color: ${e=>e.$inverted?e.theme.colors.text.primary:"#ffffff"}; + } + &:focus { + box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(128, 128, 128, 0.25); + } +`,vv=gs.span.attrs(e=>({className:`http-verb ${e.type}`}))` + font-size: ${e=>e.$compact?"0.8em":"0.929em"}; + line-height: ${e=>e.$compact?"18px":"20px"}; + background-color: ${e=>e.theme.colors.http[e.type]||"#999999"}; + color: #ffffff; + padding: ${e=>e.$compact?"2px 8px":"3px 10px"}; + text-transform: uppercase; + font-family: ${e=>e.theme.typography.headings.fontFamily}; + margin: 0; +`,xv=gs.div` + position: absolute; + width: 100%; + z-index: 100; + background: ${e=>e.theme.rightPanel.servers.overlay.backgroundColor}; + color: ${e=>e.theme.rightPanel.servers.overlay.textColor}; + box-sizing: border-box; + box-shadow: 0 0 6px rgba(0, 0, 0, 0.33); + overflow: hidden; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + transition: all 0.25s ease; + visibility: hidden; + ${e=>e.$expanded?"visibility: visible;":"transform: translateY(-50%) scaleY(0);"} +`,wv=gs.div` + padding: 10px; +`,kv=gs.div` + padding: 5px; + border: 1px solid #ccc; + background: ${e=>e.theme.rightPanel.servers.url.backgroundColor}; + word-break: break-all; + color: ${e=>e.theme.colors.primary.main}; + > span { + color: ${e=>e.theme.colors.text.primary}; + } +`;class Sv extends r.Component{constructor(e){super(e),this.toggle=()=>{this.setState({expanded:!this.state.expanded})},this.state={expanded:!1}}render(){const{operation:e,inverted:t,hideHostname:n}=this.props,{expanded:i}=this.state;return r.createElement(Os.Consumer,null,o=>r.createElement(gv,null,r.createElement(bv,{onClick:this.toggle,$expanded:i,$inverted:t},r.createElement(vv,{type:e.httpVerb,$compact:this.props.compact},e.httpVerb),r.createElement(yv,null,e.path),r.createElement($ [...] + ${Lv} +`,Mv=gs("div")` + ${Lv} + color: ${({theme:e})=>e.colors.text.secondary}; + font-size: ${e=>e.theme.schema.labelsTextSize}; +`,zv=gs(r.memo(function({title:e,type:t,empty:n,code:i,opened:o,className:s,onClick:a}){return r.createElement("button",{className:s,onClick:!n&&a||void 0,"aria-expanded":o,disabled:n},!n&&r.createElement($p,{size:"1.5em",color:t,direction:o?"down":"right",float:"left"}),r.createElement(Uv,null,i," "),r.createElement(Im,{compact:!0,inline:!0,source:e}))}))` + display: block; + border: 0; + width: 100%; + text-align: left; + padding: 10px; + border-radius: 2px; + margin-bottom: 4px; + line-height: 1.5em; + cursor: pointer; + + color: ${e=>e.theme.colors.responses[e.type].color}; + background-color: ${e=>e.theme.colors.responses[e.type].backgroundColor}; + &:focus { + outline: auto ${e=>e.theme.colors.responses[e.type].color}; + } + ${e=>e.empty?'\ncursor: default;\n&::before {\n content: "—";\n font-weight: bold;\n width: 1.5em;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n}\n&:focus {\n outline: 0;\n}\n':""}; +`,Fv=gs.div` + padding: 10px; +`,Bv=gs(vp).attrs({as:"caption"})` + text-align: left; + margin-top: 1em; + caption-side: top; +`,Uv=gs.strong` + vertical-align: top; +`;class qv extends r.PureComponent{render(){const{headers:e}=this.props;return void 0===e||0===e.length?null:r.createElement(Mp,null,r.createElement(Bv,null," Response Headers "),r.createElement("tbody",null,ti(e,(e,t)=>r.createElement($y,{isLast:t,key:e.name,field:e,showExamples:!0}))))}}var Vv=Object.defineProperty,Wv=Object.getOwnPropertySymbols,Hv=Object.prototype.hasOwnProperty,Gv=Object.prototype.propertyIsEnumerable,Yv=(e,t,r)=>t in e?Vv(e,t,{enumerable:!0,configurable:!0,writable [...] + font-size: 1.3em; + padding: 0.2em 0; + margin: 3em 0 1.1em; + color: ${({theme:e})=>e.colors.text.primary}; + font-weight: normal; +`;class Jv extends r.PureComponent{render(){const{responses:e,isCallback:t}=this.props;return e&&0!==e.length?r.createElement("div",null,r.createElement(Xv,null,hi(t?"callbackResponses":"responses")),e.map(e=>r.createElement(Qv,{key:e.code,response:e}))):null}}function Zv(e){const{security:t,showSecuritySchemeType:n,expanded:i}=e,o=t.schemes.length>1;return 0===t.schemes.length?r.createElement(wb,{$expanded:i},"None"):r.createElement(wb,{$expanded:i},o&&"(",t.schemes.map(e=>r.createEleme [...] + margin-bottom: ${({theme:e})=>3*e.spacing.unit}px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let sx=class extends r.Component{constructor(){super(...arguments),this.toggle=()=>{this.props.callbackOperation.toggle()}}render(){const{name:e,expanded:t,httpVerb:n,deprecated:i}=this.props.callbackOperation;return r.createElement(r.Fragment,null,r.createElement(fv,{onClick:this.toggle,name:e,opened:t,httpVerb:n,deprecated:i}),t&&r.createElement(ix,{operation:this.props.callbackOperation}))}};sx=((e,t)=>{for(var r,n=t,i=e.length-1 [...] + font-size: 1.3em; + padding: 0.2em 0; + margin: 3em 0 1.1em; + color: ${({theme:e})=>e.colors.text.primary}; + font-weight: normal; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let cx=class extends r.Component{constructor(e){super(e),this.switchItem=({idx:e})=>{this.props.items&&void 0!==e&&this.setState({activeItemIdx:e})},this.state={activeItemIdx:0}}render(){const{items:e}=this.props;if(!e||!e.length)return null;const t=({children:e})=>this.props.label?r.createElement(ag,null,r.createElement(sg,null,this.props.label),e):e;return r.createElement(r.Fragment,null,r.createElement(t,null,this.props.renderDro [...] + margin-top: 15px; +`;var xx=Object.defineProperty,wx=Object.defineProperties,kx=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),Sx=Object.getOwnPropertySymbols,Ex=Object.prototype.hasOwnProperty,Ox=Object.prototype.propertyIsEnumerable,_x=(e,t,r)=>t in e?xx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;let Px=class extends r.Component{constructor(){super(...arguments),this.renderDropdown=e=>{return r.createElement(dh,(t=((e,t)=>{for(var r in t||(t={}))Ex.call(t,r)&&_x(e [...] + background: ${({theme:e})=>e.codeBlock.backgroundColor}; + padding: ${e=>4*e.theme.spacing.unit}px; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let Ax=class extends r.Component{render(){const{operation:e}=this.props,t=e.codeSamples,n=t.length>0,i=1===t.length&&this.context.hideSingleRequestSampleTab;return n&&r.createElement("div",null,r.createElement(bp,null," ",hi("requestSamples")," "),r.createElement(xd,{defaultIndex:0},r.createElement(pd,{hidden:i},t.map(e=>r.createElement(md,{key:e.lang+"_"+(e.label||"")},void 0!==e.label?e.label:e.lang))),t.map(e=>r.createElement(vd, [...] + margin-bottom: ${({theme:e})=>6*e.spacing.unit}px; +`,zx=Fg(({operation:e})=>{const{name:t,description:n,deprecated:i,externalDocs:o,isWebhook:s,httpVerb:a,badges:l}=e,c=!(!n&&!o),{showWebhookVerb:u}=r.useContext(Os),p=l.filter(({position:e})=>"before"===e),d=l.filter(({position:e})=>"after"===e);return r.createElement(Os.Consumer,null,l=>r.createElement(dp,((e,t)=>Tx(e,Nx(t)))(((e,t)=>{for(var r in t||(t={}))Rx.call(t,r)&&Dx(e,r,t[r]);if(Ix)for(var r of Ix(t))Lx.call(t,r)&&Dx(e,r,t[r]);return e})({},{[eh]:e.operationHash}),{id:e.operatio [...] + user-select: none; + width: 20px; + height: 20px; + align-self: center; + display: flex; + flex-direction: column; + color: ${e=>e.theme.colors.primary.main}; +`;Object.defineProperty,Object.getOwnPropertyDescriptor;let bw;Qn&&(bw=n(227));const vw=bw&&bw(),xw=gs.div` + width: ${e=>e.theme.sidebar.width}; + background-color: ${e=>e.theme.sidebar.backgroundColor}; + overflow: hidden; + display: flex; + flex-direction: column; + + backface-visibility: hidden; + /* contain: strict; TODO: breaks layout since Chrome 80*/ + + height: 100vh; + position: sticky; + position: -webkit-sticky; + top: 0; + + ${ms.lessThan("small")` + position: fixed; + z-index: 20; + width: 100%; + background: ${({theme:e})=>e.sidebar.backgroundColor}; + display: ${e=>e.$open?"flex":"none"}; + `}; + + @media print { + display: none; + } +`,ww=gs.div` + outline: none; + user-select: none; + background-color: ${({theme:e})=>e.fab.backgroundColor}; + color: ${e=>e.theme.colors.primary.main}; + display: none; + cursor: pointer; + position: fixed; + right: 20px; + z-index: 100; + border-radius: 50%; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); + ${ms.lessThan("small")` + display: flex; + `}; + + bottom: 44px; + + width: 60px; + height: 60px; + padding: 0 20px; + svg { + color: ${({theme:e})=>e.fab.color}; + } + + @media print { + display: none; + } +`;let kw=class extends r.Component{constructor(){super(...arguments),this.state={offsetTop:"0px"},this.toggleNavMenu=()=>{this.props.menu.toggleSidebar()}}componentDidMount(){vw&&vw.add(this.stickyElement),this.setState({offsetTop:this.getScrollYOffset(this.context)})}componentWillUnmount(){vw&&vw.remove(this.stickyElement)}getScrollYOffset(e){let t;return t=void 0!==this.props.scrollYOffset?_i.normalizeScrollYOffset(this.props.scrollYOffset)():e.scrollYOffset(),t+"px"}render(){const e=t [...] + ${({theme:e})=>`\n font-family: ${e.typography.fontFamily};\n font-size: ${e.typography.fontSize};\n font-weight: ${e.typography.fontWeightRegular};\n line-height: ${e.typography.lineHeight};\n color: ${e.colors.text.primary};\n display: flex;\n position: relative;\n text-align: left;\n\n -webkit-font-smoothing: ${e.typography.smoothing};\n font-smoothing: ${e.typography.smoothing};\n ${e.typography.optimizeSpeed?"text-rendering: optimizeSpeed !important":""};\n\n tap-highl [...] +`,Ew=gs.div` + z-index: 1; + position: relative; + overflow: hidden; + width: calc(100% - ${e=>e.theme.sidebar.width}); + ${ms.lessThan("small",!0)` + width: 100%; + `}; + + contain: layout; +`,Ow=gs.div` + background: ${({theme:e})=>e.rightPanel.backgroundColor}; + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: ${({theme:e})=>{if(e.rightPanel.width.endsWith("%")){const t=parseInt(e.rightPanel.width,10);return`calc((100% - ${e.sidebar.width}) * ${t/100})`}return e.rightPanel.width}}; + ${ms.lessThan("medium",!0)` + display: none; + `}; +`,_w=gs.div` + padding: 5px 0; +`,Pw=gs.input.attrs(()=>({className:"search-input"}))` + width: calc(100% - ${e=>8*e.theme.spacing.unit}px); + box-sizing: border-box; + margin: 0 ${e=>4*e.theme.spacing.unit}px; + padding: 5px ${e=>2*e.theme.spacing.unit}px 5px + ${e=>4*e.theme.spacing.unit}px; + border: 0; + border-bottom: 1px solid + ${({theme:e})=>(Fn(e.sidebar.backgroundColor)>.5?Dn:Un)(.1,e.sidebar.backgroundColor)}; + font-family: ${({theme:e})=>e.typography.fontFamily}; + font-weight: bold; + font-size: 13px; + color: ${e=>e.theme.sidebar.textColor}; + background-color: transparent; + outline: none; +`,$w=gs(e=>r.createElement("svg",{className:e.className,version:"1.1",viewBox:"0 0 1000 1000",x:"0px",xmlns:"http://www.w3.org/2000/svg",y:"0px"},r.createElement("path",{d:"M968.2,849.4L667.3,549c83.9-136.5,66.7-317.4-51.7-435.6C477.1-25,252.5-25,113.9,113.4c-138.5,138.3-138.5,362.6,0,501C219.2,730.1,413.2,743,547.6,666.5l301.9,301.4c43.6,43.6,76.9,14.9,104.2-12.4C981,928.3,1011.8,893,968.2,849.4z M524.5,522c-88.9,88.7-233,88.7-321.8,0c-88.9-88.7-88.9-232.6,0-321.3c88.9-88.7,233-88.7,321 [...] + position: absolute; + left: ${e=>4*e.theme.spacing.unit}px; + height: 1.8em; + width: 0.9em; + + path { + fill: ${e=>e.theme.sidebar.textColor}; + } +`,Aw=gs.div` + padding: ${e=>e.theme.spacing.unit}px 0; + background-color: ${({theme:e})=>Dn(.05,e.sidebar.backgroundColor)}}; + color: ${e=>e.theme.sidebar.textColor}; + min-height: 150px; + max-height: 250px; + border-top: ${({theme:e})=>Dn(.1,e.sidebar.backgroundColor)}}; + border-bottom: ${({theme:e})=>Dn(.1,e.sidebar.backgroundColor)}}; + margin-top: 10px; + line-height: 1.4; + font-size: 0.9em; + + li { + background-color: inherit; + } + + ${av} { + padding-top: 6px; + padding-bottom: 6px; + + &:hover, + &.active { + background-color: ${({theme:e})=>Dn(.1,e.sidebar.backgroundColor)}; + } + + > svg { + display: none; + } + } +`,Cw=gs.i` + position: absolute; + display: inline-block; + width: ${e=>2*e.theme.spacing.unit}px; + text-align: center; + right: ${e=>4*e.theme.spacing.unit}px; + line-height: 2em; + vertical-align: middle; + margin-right: 2px; + cursor: pointer; + font-style: normal; + color: '#666'; +`;var jw=Object.defineProperty,Tw=Object.getOwnPropertyDescriptor;class Nw extends r.PureComponent{constructor(e){super(e),this.activeItemRef=null,this.clear=()=>{this.setState({results:[],noResults:!1,term:"",activeItemIdx:-1}),this.props.marker.unmark()},this.handleKeyDown=e=>{if(27===e.keyCode&&this.clear(),40===e.keyCode&&(this.setState({activeItemIdx:Math.min(this.state.activeItemIdx+1,this.state.results.length-1)}),e.preventDefault()),38===e.keyCode&&(this.setState({activeItemIdx:M [...] +//# sourceMappingURL=redoc.standalone.js.map \ No newline at end of file diff --git a/tools/pytools/lib/execute/pulsar_build.py b/tools/pytools/lib/execute/pulsar_build.py index 24c1f6f90f6..918da610b27 100644 --- a/tools/pytools/lib/execute/pulsar_build.py +++ b/tools/pytools/lib/execute/pulsar_build.py @@ -51,7 +51,7 @@ def server_classpath_file(master: Path, build: BuildSystem) -> Path: def swagger_output_dir(master: Path, build: BuildSystem) -> Path: if build == BuildSystem.gradle: - return master / 'pulsar-broker' / 'build' / 'docs' + return master / 'pulsar-broker' / 'build' / 'openapi' return master / 'pulsar-broker' / 'target' / 'docs' diff --git a/tools/pytools/lib/execute/swagger_generator.py b/tools/pytools/lib/execute/swagger_generator.py index 6ec002bfd57..3ce7282cc03 100644 --- a/tools/pytools/lib/execute/swagger_generator.py +++ b/tools/pytools/lib/execute/swagger_generator.py @@ -17,7 +17,6 @@ import json import os -import sys from pathlib import Path from command import find_command, run @@ -29,21 +28,24 @@ def execute(master: Path, version: str): build = pulsar_build.detect(master) master_swaggers = pulsar_build.swagger_output_dir(master, build) - if not master_swaggers.exists(): - if build == pulsar_build.BuildSystem.maven: - mvn = find_command('mvn', msg="mvn is required") - run(mvn, '-pl', 'pulsar-broker', 'install', '-DskipTests', '-Pswagger', cwd=master) - else: - # Gradle build on apache/pulsar master does not yet have a task - # that regenerates the Swagger JSONs (the old `mvn -Pswagger` - # invocation has no Gradle equivalent). Skip rather than fail so - # the rest of the docs sync still produces useful output. - print( - f'[swagger_generator] Skipping Swagger generation: Gradle build at {master} ' - f'has no swagger task; expected output dir {master_swaggers} is missing.', - file=sys.stderr, - ) - return + if build == pulsar_build.BuildSystem.gradle: + # The Gradle equivalent of the Maven `swagger` profile: writes the + # JSONs flat into pulsar-broker/build/openapi (plus v2/ and v3/ + # copies, which the non-recursive glob below ignores). Run it + # unconditionally: the task is incremental (cheap when up to date) + # and its Sync output prunes stale files, so spec files added or + # removed in the build are always reflected. + gradlew = master / 'gradlew' + run( + str(gradlew.absolute()), + ':pulsar-broker:generateOpenApiSpecs', + '--no-configuration-cache', + '--no-daemon', + cwd=master, + ) + elif not master_swaggers.exists(): + mvn = find_command('mvn', msg="mvn is required") + run(mvn, '-pl', 'pulsar-broker', 'install', '-DskipTests', '-Pswagger', cwd=master) os.makedirs(site_path() / 'static' / 'swagger' / version, exist_ok=True) for f in master_swaggers.glob('*.json'):
