PageSourceSearch

https://behonest.com.br/system/assets/SwaggerPage-Bfq0GGq0.js

js behonest.com.br collected 2026-09-24 11:04:48 UTC 8,264 bytes, 1 lines download raw bytes

1import{c as j,r as b,j as s,g as $,p as E,b as R}from"./index-ZDIuofZ7.js";import{d as T}from"./download-Blsl72zW.js";const N="https://behonest.com.br",L=e=>e?new Date(e*1e3).toLocaleDateString("pt-BR"):"—";function _(){const e=j.c(6);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];const[l,t]=b.useState(o),[a,r]=b.useState(null);let n,u;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{fetch(`${N}/api/manuais`,{headers:{Authorization:`Bearer ${$()}`}}).then(async c=>{if(!c.ok){c.status!==403&&r("Não foi possível carregar os manuais");return}t((await c.json()).rows||[])}).catch(()=>r("Não foi possível carregar os manuais"))},u=[],e[1]=n,e[2]=u):(n=e[1],u=e[2]),b.useEffect(n,u);let d;return e[3]!==a||e[4]!==l?(d={rows:l,erro:a,setErro:r},e[3]=a,e[4]=l,e[5]=d):d=e[5],d}function P(){const e=j.c(18),{rows:o,erro:l,setErro:t}=_(),[a,r]=b.useState(!1),[n,u]=b.useState(null),d=b.useRef(null);let c,m;e[0]!==a?(c=()=>{if(!a)return;const i=y=>{d.current?.contains(y.target)||r(!1)},w=y=>{y.key==="Escape"&&r(!1)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",w)}},m=[a],e[0]=a,e[1]=c,e[2]=m):(c=e[1],m=e[2]),b.useEffect(c,m);let p;e[3]!==t?(p=async(i,w)=>{u(`${i.slug}:${w}`);const y=`${N}${w==="pdf"?i.download_pdf:i.download_md}`;await T(y,`${i.slug}.${w}`)||t(`Falha ao baixar o ${w.toUpperCase()} de "${i.titulo}"`),u(null)},e[3]=t,e[4]=p):p=e[4];const f=p;if(!o.length&&!l)return null;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>r(B),e[5]=h):h=e[5];const v=o.length?` (${o.length})`:"";let g;e[6]!==a||e[7]!==v?(g=s.jsxs("button",{type:"button",className:"bh-api-chip","aria-expanded":a,"aria-haspopup":"true",onClick:h,children:["📄 Manuais",v]}),e[6]=a,e[7]=v,e[8]=g):g=e[8];let x;e[9]!==a||e[10]!==n||e[11]!==f||e[12]!==l||e[13]!==o?(x=a&&s.jsxs("div",{className:"bh-api-manuais-lista",role:"menu",children:[l&&s.jsx("div",{className:"bh-api-manuais-erro",children:l}),o.map(i=>s.jsxs("div",{className:"bh-api-manual",children:[s.jsx("strong",{children:i.titulo}),s.jsx("span",{children:i.descricao}),s.jsxs("small",{children:[i.publico_alvo," · atualizado em ",L(i.atualizado_em)]}),s.jsxs("div",{className:"bh-api-manual-acoes",children:[s.jsx("button",{type:"button",className:"bh-api-btn",disabled:!i.disponivel||!!n,onClick:()=>{f(i,"pdf")},children:n===`${i.slug}:pdf`?"Gerando…":"PDF"}),s.jsx("button",{type:"button",className:"bh-api-btn bh-api-btn-ghost",disabled:!i.disponivel||!!n,onClick:()=>{f(i,"md")},children:n===`${i.slug}:md`?"Baixando…":"Markdown"})]})]},i.slug))]}),e[9]=a,e[10]=n,e[11]=f,e[12]=l,e[13]=o,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==x?(S=s.jsxs("div",{className:"bh-api-manuais",ref:d,children:[g,x]}),e[15]=g,e[16]=x,e[17]=S):S=e[17],S}function B(e){return!e}const A="https://cdn.redoc.ly/redoc/v2.5.4/bundles/redoc.standalone.js",k="'Poppins', system-ui, -apple-system, sans-serif",F="'JetBrains Mono', 'Fira Code', ui-monospace, monospace",M={get:"#16a34a",post:"#2563eb",put:"#d97706",patch:"#7c3aed",delete:"#dc2626",options:"#64748b",head:"#64748b",basic:"#64748b",link:"#0891b2"},z={dark:{pagina:"#0a0f1a",lateral:"#0b1530",painel:"#08101f",texto:"#eef1f6",textoSuave:"rgba(238,241,246,0.66)",ouro:"#edb125",borda:"rgba(237,177,37,0.18)",ativo:"rgba(237,177,37,0.12)",codigo:"rgba(237,177,37,0.10)"},light:{pagina:"#f7f8fa",lateral:"#ffffff",painel:"#0E2050",texto:"#0f1720",textoSuave:"#5b6675",ouro:"#9c7210",borda:"#e3e6ea",ativo:"rgba(237,177,37,0.16)",codigo:"rgba(14,32,80,0.06)"}};function H(e){const o=z[e];return{scrollYOffset:72,hideDownloadButton:!0,hideHostname:!1,expandResponses:"200,201",jsonSampleExpandLevel:2,requiredPropsFirst:!0,sortPropsAlphabetically:!1,pathInMiddlePanel:!0,nativeScrollbars:!1,menuToggle:!0,theme:{spacing:{unit:5,sectionHorizontal:40,sectionVertical:28},breakpoints:{small:"50rem",medium:"75rem",large:"105rem"},colors:{tonalOffset:.2,primary:{main:o.ouro},success:{main:"#16a34a"},warning:{main:"#d97706"},error:{main:"#dc2626"},text:{primary:o.texto,secondary:o.textoSuave},border:{dark:o.borda,light:o.borda},http:M,responses:{success:{color:"#16a34a",backgroundColor:"rgba(22,163,74,0.08)",tabTextColor:"#16a34a"},error:{color:"#dc2626",backgroundColor:"rgba(220,38,38,0.07)",tabTextColor:"#dc2626"},redirect:{color:"#d97706",backgroundColor:"rgba(217,119,6,0.08)",tabTextColor:"#d97706"},info:{color:"#2563eb",backgroundColor:"rgba(37,99,235,0.08)",tabTextColor:"#2563eb"}}}
1,schema:{nestedBackground:e==="dark"?"rgba(255,255,255,0.03)":"#f3f4f6",typeNameColor:o.textoSuave,typeTitleColor:o.textoSuave,requireLabelColor:"#dc2626",linesColor:o.borda},typography:{fontSize:"14.5px",lineHeight:"1.6em",fontFamily:k,smoothing:"antialiased",headings:{fontFamily:k,fontWeight:"700",lineHeight:"1.3em"},code:{fontFamily:F,fontSize:"13px",color:o.ouro,backgroundColor:o.codigo,wrap:!0},links:{color:o.ouro,visited:o.ouro,hover:o.ouro}},sidebar:{width:"290px",backgroundColor:o.lateral,textColor:o.texto,activeTextColor:o.ouro,groupItems:{textTransform:"uppercase"},level1Items:{textTransform:"none"},arrow:{size:"1.3em",color:o.textoSuave}},logo:{gutter:"0"},rightPanel:{backgroundColor:o.painel,width:"40%",textColor:"#eef1f6"},codeBlock:{backgroundColor:e==="dark"?"#050a14":"#0a1640"},fab:{backgroundColor:o.ouro,color:"#0E2050"}}}}let C=null;function I(){const e=window.Redoc;return e?Promise.resolve(e):(C??=new Promise((o,l)=>{const t=document.createElement("script");t.src=A,t.async=!0,t.onload=()=>{const a=window.Redoc;a?o(a):l(new Error("Redoc não expôs o global"))},t.onerror=()=>{C=null,l(new Error("Falha ao baixar o Redoc"))},document.head.appendChild(t)}),C)}function O(){const e=j.c(3);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=E(),e[0]=o):o=e[0];const[l,t]=b.useState(o);let a,r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const n=()=>t(E());return window.addEventListener("hrm-theme-changed",n),window.addEventListener("storage",n),()=>{window.removeEventListener("hrm-theme-changed",n),window.removeEventListener("storage",n)}},r=[],e[1]=a,e[2]=r):(a=e[1],r=e[2]),b.useEffect(a,r),l}function D(e,o,l){const t=j.c(8),[a,r]=b.useState(!1),[n,u]=b.useState(null);let d,c;t[0]!==e||t[1]!==o||t[2]!==l?(d=()=>{let p=!0;return r(!1),I().then(f=>{!p||!e.current||(e.current.innerHTML="",f.init(o,H(l),e.current,h=>{p&&(h&&u("Não foi possível montar a documentação"),r(!0))}))}).catch(f=>{p&&(u(f.message),r(!0))}),()=>{p=!1}},c=[e,o,l],t[0]=e,t[1]=o,t[2]=l,t[3]=d,t[4]=c):(d=t[3],c=t[4]),b.useEffect(d,c);let m;return t[5]!==a||t[6]!==n?(m={carregado:a,erro:n},t[5]=a,t[6]=n,t[7]=m):m=t[7],m}const q="https://behonest.com.br",G=`${q}/api/swagger.json`;function V(){const e=j.c(16),o=b.useRef(null),{user:l}=R(),t=O(),{carregado:a,erro:r}=D(o,G,t),n=l?.role==="admin"||l?.role==="manager";let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("img",{src:"/system/behonest-logo.svg",alt:"Be Honest"}),e[0]=u):u=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs("div",{className:"bh-api-marca",children:[u,s.jsxs("div",{children:[s.jsxs("h1",{children:["API ",s.jsx("span",{children:"Be Honest"})]}),s.jsx("p",{children:"Todas as rotas da plataforma, separadas por repositório"})]})]}),e[1]=d):d=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(P,{}),e[2]=c):c=e[2];const m=`bh-api-chip bh-api-chip-acesso ${n?"admin":"leitura"}`,p=n?"🔓 Gestor":"🔒 Somente leitura";let f;e[3]!==m||e[4]!==p?(f=s.jsxs("header",{className:"bh-api-topo",children:[d,s.jsxs("div",{className:"bh-api-acoes",children:[c,s.jsx("span",{className:m,children:p})]})]}),e[3]=m,e[4]=p,e[5]=f):f=e[5];let h;e[6]!==a||e[7]!==r?(h=!a&&!r&&s.jsx("div",{className:"bh-api-aviso",children:"Carregando a documentação…"}),e[6]=a,e[7]=r,e[8]=h):h=e[8];let v;e[9]!==r?(v=r&&s.jsx("div",{className:"bh-api-aviso erro",children:r}),e[9]=r,e[10]=v):v=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{ref:o}),e[11]=g):g=e[11];let x;return e[12]!==f||e[13]!==h||e[14]!==v?(x=s.jsxs("div",{className:"bh-api",children:[f,h,v,g]}),e[12]=f,e[13]=h,e[14]=v,e[15]=x):x=e[15],x}export{V as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.