@redocly/realm 0.136.0-next.10 → 0.136.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/client/App.js +1 -1
- package/dist/client/ScriptLoader.js +1 -1
- package/dist/client/TestProvider.js +1 -1
- package/dist/client/app/Link.js +1 -1
- package/dist/client/app/Sidebar/useBreadcrumbs.js +1 -1
- package/dist/client/app/Sidebar/useSidebarItems.js +1 -1
- package/dist/client/app/Sidebar/utils.d.ts +1 -1
- package/dist/client/app/hooks/catalog/useCatalogClassic.js +1 -1
- package/dist/client/app/hooks/catalog/useCatalogFilter.js +1 -1
- package/dist/client/app/hooks/catalog/useCatalogSearch.js +1 -1
- package/dist/client/app/hooks/catalog/useCatalogSort.js +1 -1
- package/dist/client/app/hooks/products/useCurrentProduct.js +1 -1
- package/dist/client/app/hooks/useAutoScroll.js +1 -1
- package/dist/client/app/hooks/useBanner.js +1 -1
- package/dist/client/app/hooks/useL10nConfig.js +1 -1
- package/dist/client/app/hooks/useLoginUrl.js +1 -1
- package/dist/client/app/hooks/usePageTimeTracker.js +1 -1
- package/dist/client/app/hooks/useRouteChangeTracker.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.js +1 -1
- package/dist/client/app/pages/DevLogin/DevLogin.js +1 -1
- package/dist/client/app/seo/hooks/useHreflangLinks.js +1 -1
- package/dist/client/app/useMobileMenu.js +1 -1
- package/dist/client/app/usePreloadHistory.d.ts +1 -1
- package/dist/client/app/usePreloadHistory.js +1 -1
- package/dist/client/app/utils/loadAndNavigate.d.ts +1 -1
- package/dist/client/browser-entry.js +2 -2
- package/dist/client/providers/hooks.d.ts +1 -1
- package/dist/client/providers/hooks.js +1 -1
- package/dist/client/providers/page-data/hooks.js +1 -1
- package/dist/client/providers/post-message/PostMessageProvider.js +1 -1
- package/dist/constants/api.d.ts +1 -0
- package/dist/constants/api.js +1 -1
- package/dist/server/constants/common.d.ts +1 -0
- package/dist/server/constants/common.js +1 -1
- package/dist/server/esbuild/esbuild.js +1 -1
- package/dist/server/esbuild/plugins/themes-resolver.js +4 -2
- package/dist/server/plugins/dev-onboarding/template/App.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/AppsList.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/ApiKeyItem.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/ApiLogDetails.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/ApiLogs.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/CreateApiKey.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/DeleteAppDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditApis.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditAppDescriptionDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditAppDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditCallbackUrlDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/RevokeAPIKey.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/RollAPIKey.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/UpdateApiKey.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/index.js +1 -1
- package/dist/server/plugins/mcp/codemode/constants.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/manage-credentials.d.ts +19 -0
- package/dist/server/plugins/mcp/codemode/tools/manage-credentials.js +2 -0
- package/dist/server/plugins/mcp/constants.d.ts +1 -0
- package/dist/server/plugins/mcp/constants.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/elicitation.d.ts +35 -15
- package/dist/server/plugins/mcp/gateway-mcp/elicitation.js +3 -2
- package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/secret-store.d.ts +3 -0
- package/dist/server/plugins/mcp/gateway-mcp/secret-store.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.d.ts +1 -0
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.js +1 -1
- package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.js +43 -24
- package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
- package/dist/server/plugins/mcp/servers/mcp-server.js +3 -1
- package/dist/server/plugins/scorecard-classic/template/ApiDetailsPage.js +1 -1
- package/dist/server/plugins/scorecard-classic/template/RuleDetailsPage.js +1 -1
- package/dist/server/plugins/scorecard-classic/template/index.js +1 -1
- package/dist/server/plugins/scorecard-classic/template/utils.d.ts +1 -1
- package/dist/server/plugins/scorecard-classic/template/views.js +1 -1
- package/dist/server/ssr/render.js +1 -1
- package/dist/server/types/plugin-hooks.d.ts +1 -1
- package/dist/server/web-server/routes/ask-ai.d.ts +6 -0
- package/dist/server/web-server/routes/ask-ai.js +1 -1
- package/dist/server/web-server/routes/index.js +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fromJsonSchema as
|
|
1
|
+
import{fromJsonSchema as C}from"@modelcontextprotocol/server";import{logger as A}from"../../../tools/notifiers/logger.js";import{mcpToolWorkers as b,MCP_TOOL_IS_AVAILABLE_KEY as g}from"../../../workers/mcp-tool-worker-pool.js";import{CREATE_ANONYMOUS_SESSION_TOOL_NAME as M}from"../constants.js";import{isAnonymousSessionToolAvailable as T}from"../docs-mcp/tools/core/create-anonymous-session.js";import{isManageApiCredentialsToolAvailable as v,manageApiCredentials as L,manageApiCredentialsSchema as D}from"../codemode/tools/manage-credentials.js";import{EXECUTE_TOOL_SCHEMA as y}from"../codemode/tools/execute-schema.js";import{EXECUTE_TOOL_NAME as h,DESCRIBE_TOOLS_TOOL_NAME as I,CODE_MODE_TOOL_NAMES as N,FETCH_TOOL_NAME as H}from"../codemode/constants.js";import{buildCodeModeInstructions as k,buildExecuteDescription as w,DESCRIBE_TOOLS_DESCRIPTION as x}from"../codemode/prompts.js";import{composeExecuteAnnotations as F,getActiveCapabilities as R}from"../codemode/capabilities/index.js";import{describeToolsSchema as P,describeTools as B}from"../codemode/tools/describe-tools.js";import{mcpJsonSchemaValidator as U}from"../utils/json-schema-validator.js";import{connectMcpServer as z,createMcpServer as J,createToolDispatch as V,extractSerializableContext as X}from"./mcp-server.js";function Y(s){const t=y.schema;if(T(s))return t;const{sessionHandle:i,...c}=t.properties;return{...t,properties:c}}function $(s,t){const i=t.schema;if(T(s))return i;const{sessionHandle:c,...l}=i.properties;return{...i,properties:l}}async function se({name:s,tools:t,context:i,skills:c=[],getKv:l}){const m=i.mcpMode==="code",p=m?R(i):[],u=p.some(e=>e.id===H),O=m&&v(i),{server:r,transport:_}=J(s,m?k(u):void 0),a=e=>C(e,U),d=X(i),E={getClientCapabilities:()=>r.server.getClientCapabilities(),getKv:l},f=V(d,E),S=async e=>{try{return await b.exec(g,[{toolName:e,context:d}],{timeout:1e4})}catch(o){return A.error(`Failed to check MCP tool availability for "${e}": ${o instanceof Error?o.message:String(o)}`),!1}};if(m){const e=t.filter(n=>!N.has(n.name));r.registerTool(h,{description:w(u),inputSchema:a(Y(i)),annotations:F(p)},f(h)),r.registerTool(I,{description:x,inputSchema:a(P(e,p))},B(e,S,p,i));const o=t.find(n=>n.name===M);if(o&&T(i)&&r.registerTool(o.name,{description:o.description,inputSchema:a(o.schema),annotations:o.annotations??{title:o.name}},f(o.name)),O){const n=D(i);r.registerTool(n.name,{description:n.description,inputSchema:a($(i,n)),annotations:n.annotations??{title:n.name}},L(d,E))}}else await Promise.all(t.map(async e=>{const o=r.registerTool(e.name,{description:e.description,inputSchema:a(e.schema),annotations:e.annotations||{title:e.name}},f(e.name));await S(e.name)||o.disable()}));for(const e of c)r.registerResource(e.slug,e.uri,{title:e.name,description:e.description,mimeType:"text/markdown"},async()=>({contents:[{uri:e.uri,mimeType:"text/markdown",text:e.content}]}));return z(r,_)}export{se as createDocsMcpServer};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{McpServer as
|
|
1
|
+
import{McpServer as T,WebStandardStreamableHTTPServerTransport as q}from"@modelcontextprotocol/server";import{logger as b}from"../../../tools/notifiers/logger.js";import{mcpToolWorkers as v,MCP_TOOL_WORKER_KEY as I}from"../../../workers/mcp-tool-worker-pool.js";import{SSE_KEEPALIVE_INTERVAL_MS as R}from"../constants.js";import{secretStore as _}from"../gateway-mcp/secret-store.js";import{readAuthRequiredMeta as A,stripAuthRequiredMeta as h}from"../gateway-mcp/upstream-auth.js";import{buildCredentialsToolHint as O,buildUpstreamCredentialFallback as w,buildUpstreamCredentialInputRequired as U,isCredentialElicitationDeclined as D,targetOf as C}from"../gateway-mcp/elicitation.js";import{resolveUpstreamAuthScheme as K}from"../gateway-mcp/upstream-auth-scheme.js";import{MISSING_SESSION_HANDLE_MESSAGE as P,resolveSecretSubject as j}from"../gateway-mcp/subject.js";const L=6e4,g=new Map;function x(e,t){const r=g.get(e);if(r)return r;const n=t().finally(()=>{g.delete(e)});return g.set(e,n),n}function z(e,t){const r=new T({name:e,version:new Date().toISOString().slice(0,10)},{capabilities:{logging:{}},...t?{instructions:t}:{}}),n=new q({keepAliveMs:R,sessionIdGenerator:void 0});return{server:r,transport:n}}async function ee(e,t){return await e.connect(t),{server:e,transport:t,cleanup:async()=>{t.close()}}}function te(e,t){return r=>async(n,a)=>{b.info(`MCP tool called: ${r}`);const i=e.elicitationEnabled??!1,u=a.mcpReq.envelope!==void 0,o=i?j(e.user,n.sessionHandle):{kind:"anonymous"},s=o.kind==="resolved"?o.subject:void 0;if(o.kind==="invalid")return{content:[{type:"text",text:o.message}],isError:!0};const d=async()=>{if(!(!i||!s||!t?.getKv))try{const c=await t.getKv();return await _.getSecretsForSubject(c,s)}catch(c){b.warn(`gateway mcp secret store error, continuing unauthenticated: ${String(c)}`);return}};let m;const S=async()=>{m=await d();const c={toolName:r,args:n,context:{...e,upstreamSecrets:m},extra:$(a)};return await v.exec(I,[c],{timeout:L})};let p=await S();const l=A(p);if(l.length>0&&i&&!s)return h({...p,content:[{type:"text",text:P}],isError:!0});if(l.length>0&&i&&s&&t?.getKv){const c=await t.getKv(),E=new Set(Object.keys(m??{})),f=u?await H(e,a,l,s,c,E,t):await N(e,l,s,c,E);switch(f.kind){case"inputRequired":return f.result;case"retry":p=await S();break;case"appendText":p={...p,content:[...p.content,{type:"text",text:f.text}]};break;case"none":break}}return h(p)}}function F(e){return!!e?.getClientCapabilities()?.elicitation?.url}function k(e,t){return e.status===401&&!t.has(e.api)}function y(e){return e.map(O).join(`
|
|
2
|
+
|
|
3
|
+
`)}async function M(e,t,r,n){const[a,...i]=t;return{subject:r,baseUrl:e.baseUrl??"",target:C(a),auth:await K(e,a.api),kv:n,hasExistingSecret:!1,reason:{kind:"authFailure",status:a.status,otherApiNames:i.map(u=>u.name)}}}async function H(e,t,r,n,a,i,u){if(D(t.mcpReq.inputResponses))return{kind:"none"};const o=r.filter(d=>k(d,i));if(o.length===0)return{kind:"appendText",text:y(r)};const s=await M(e,o,n,a);return F(u)?{kind:"inputRequired",result:await U(s)}:{kind:"appendText",text:await w(s)}}async function N(e,t,r,n,a){const i=t.filter(s=>k(s,a));if(i.length===0)return{kind:"appendText",text:y(t)};const u=await M(e,i,r,n);return{kind:"appendText",text:await x(`${r}:${i[0].api}`,()=>w(u))}}function $(e){return{sessionId:e.sessionId,authInfo:e.http?.authInfo,requestId:e.mcpReq.id,_meta:e.mcpReq._meta}}function re(e){return{user:e.user,config:e.config,outdir:e.outdir,baseUrl:e.baseUrl,params:e.params,query:e.query,cookies:e.cookies,apiDescriptionsMap:e.apiDescriptionsMap,graphqlDescriptions:e.graphqlDescriptions,products:e.products,accessToken:e.accessToken,metadata:e.metadata,upstreamAuthorization:e.upstreamAuthorization,mcpMode:e.mcpMode,elicitationEnabled:e.elicitationEnabled,gatewayFetchBudgetPerExec:e.gatewayFetchBudgetPerExec,clientIp:e.clientIp,upstreamSecrets:e.upstreamSecrets}}export{ee as connectMcpServer,z as createMcpServer,te as createToolDispatch,re as extractSerializableContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import{useParams as p}from"react-router
|
|
1
|
+
import*as t from"react";import{useParams as p}from"react-router";import{useMemo as u}from"react";import{ApiPage as s}from"./views";import{useData as c}from"./useData";function I(r){const{apiSlug:e}=p(),{apis:o,scorecardInfo:n,teamLabel:i,catalogConfig:l}=c(r),a=u(()=>e?o.find(m=>m.api.link===`/${decodeURIComponent(e)}`):void 0,[o,e]);return a?t.createElement(s,{catalogSlug:l.slug,slug:`/${decodeURIComponent(e||"")}`,api:a,teamLabel:i,rulesPerLevel:n.rulesPerLevel}):t.createElement("div",null,"API not found")}export{I as ApiDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useParams as n}from"react-router
|
|
1
|
+
import{useParams as n}from"react-router";import{useMemo as f}from"react";import*as l from"react";import{useData as d}from"./useData";import{RuleView as c}from"./views";function R(o){const{problemsByRule:a,hasTeam:r,hasPublishedAt:u,teamLabel:m,catalogConfig:s}=d(o),{ruleId:e}=n(),t=f(()=>e?a.find(i=>i.ruleId===e):void 0,[a,e]);return!e||!t?l.createElement("div",null,"Rule not found"):l.createElement(c,{catalogSlug:s.slug,slug:e,data:t,hasTeam:r,hasPublishedAt:u,teamLabel:m})}export{R as RuleDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Routes as a,Route as r}from"react-router
|
|
1
|
+
import{Routes as a,Route as r}from"react-router";import*as e from"react";import"react-date-picker/dist/DatePicker.css";import"react-calendar/dist/Calendar.css";import{ApiDetailPage as o}from"./ApiDetailsPage";import{RuleDetailPage as m}from"./RuleDetailsPage";import{ScorecardDashboard as p}from"./ScorecardDashboard";function l(t){return e.createElement(a,null,e.createElement(r,{path:"/",element:e.createElement(p,{pageProps:t.pageProps})}),e.createElement(r,{path:"/apis/:apiSlug",element:e.createElement(o,{pageProps:t.pageProps})}),e.createElement(r,{path:"/rules/:ruleId",element:e.createElement(m,{pageProps:t.pageProps})}),";")}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useCallback as H,useMemo as b,useState as G,useEffect as _}from"react";import{useLocation as T}from"react-router
|
|
1
|
+
import*as e from"react";import{useCallback as H,useMemo as b,useState as G,useEffect as _}from"react";import{useLocation as T}from"react-router";import{Flex as U}from"@redocly/portal-legacy-ui";import{Button as x}from"@redocly/theme/components/Button/Button";import{AddIcon as I}from"@redocly/theme/icons/AddIcon/AddIcon";import{SubtractIcon as D}from"@redocly/theme/icons/SubtractIcon/SubtractIcon";import{ArrowLeftIcon as K}from"@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon";import{getScorecardColorVariable as z,withoutPathPrefix as O}from"@redocly/theme/core/utils";import{Link as P}from"../../../../client/app/Link";import N from"../../../../client/app/CircularProgress";import{isDefined as R}from"../../../../utils/guards/is-defined.js";import{removeLeadingSlash as Z}from"../../../../utils/url/remove-leading-slash.js";import{StatusByLevelWidget as J}from"./StatusByLevelWidget";import{OTHER_TEAMS_LABEL as Q,NON_CONFORMANT as X}from"./utils";import{LevelIndicator as Y}from"./LevelIndicator";import{AppPageWrapper as V,CardValue as v,CardsWrapper as j,CatalogDescription as ee,ModeSwitcherTab as te,ModeSwitcherTabs as re,CardRow as B,ProblemsByStatusCardBody as W,ScoreCardStatusCardBody as F,TableWrap as ne,LevelComplianceCardTitle as le,ContentWithDotWrap as C,ScorecardCard as S,ScorecardCardTitle as w}from"./index.styles";import{ApiLevel as M,InstanceStatus as k,LevelStatus as $,RuleStatus as q}from"./components";import{Grid as A}from"./Grid/Grid";import{useDetailedScorecard as ae}from"./useDetailedScorecard";import{Gauge as se,GaugeValue as ce}from"./Gauge";function Te(p){const u=T(),{data:d,levelNames:i,hasPublishedAt:n,hasTeam:s,teamLabel:l}=p,f=H((a,c,E)=>{const g=a.getValue(E)?new Date(a.getValue(E)).getTime():0,t=c.getValue(E)?new Date(c.getValue(E)).getTime():0;return g>t?1:-1},[]),m=b(()=>[{id:"title",header:"API",accessorKey:"api.title",size:200,cell:({getValue:a,row:c})=>e.createElement(P,{to:O(u.pathname)+"/apis/"+encodeURIComponent(Z(c.original.api.link))},a())},n?{header:"Published at",accessorKey:"api.publishedAt",sortingFn:f,cell:({getValue:a})=>{const c=a();return c?new Date(c).toLocaleDateString():"-"}}:void 0,s?{header:l,accessorKey:"api.team"}:void 0,{id:"level",header:"Level",accessorKey:"scorecard.scorecardLevel",cell:({getValue:a,row:c})=>e.createElement(M,{level:a(),colorVariable:z(c.original?.scorecard.scorecardLevelIdx,i.length+1)})},...i.map(a=>({id:a,header:`${a}`,accessorKey:"scorecard.levels",cell:({getValue:c,row:E})=>{const g=c(),t=E.original.api.link;return g?.[a]?e.createElement(Y,{key:t,uniqueErrors:g[a].uniqueErrors,uniqueWarnings:g[a].uniqueWarnings,id:t}):null}}))].filter(R),[f,i,u.pathname,n,s,l]);return e.createElement(A,{columns:m,data:d,sortBy:[{id:"title",desc:!1}]})}function Ie(p){const u=T(),{data:d}=p,i=b(()=>[{header:"Rules",accessorKey:"ruleId",cell:({getValue:n})=>e.createElement(P,{to:O(u.pathname)+"/rules/"+encodeURIComponent(n())},n())},{id:"status",header:"Status",accessorKey:"status",size:200,cell:({row:n})=>e.createElement(q,{errors:n.original.errorApisCount,warnings:n.original.warningApisCount})},{header:"Problem APIs",size:200,accessorKey:"apis",cell:({getValue:n})=>n().length,sortDescFirst:!0},{header:"Problem count",size:200,accessorKey:"count",sortDescFirst:!0}],[u.pathname]);return e.createElement(A,{columns:i,data:d,sortBy:[{id:"status",desc:!0}]})}function De(p){const{data:u,levelNames:d,filters:i,setActiveTab:n,teamLabel:s,teamProperty:l}=p,f=b(()=>[{id:"team",header:`API ${s}`,accessorKey:"team",size:200,cell:({getValue:m})=>e.createElement("a",{href:"#",onClick:a=>{a.preventDefault(),n("apis"),i.find(c=>c.property===l)?.selectOption(m())}},m())},...[X,...d].map(m=>({id:m,header:`${m}`,accessorFn:a=>a.levels[m]?.apis}))],[i,d,n,s,l]);return e.createElement(A,{columns:f,data:u,sortBy:[{id:"team",desc:!1}],groupHeaderTitle:"APIs by level"})}function oe(p){const{data:u,title:d}=p,i=b(()=>[{id:"expand",maxSize:40,size:40,header:()=>null,enableSorting:!1,cell:({row:n})=>n.getCanExpand()?e.createElement(x,{onClick:n.getToggleExpandedHandler(),variant:"text",size:"medium",icon:n.getIsExpanded()?e.createElement(D,null):e.createElement(I,null)}):null},{header:"Rules",accessorKey:"ruleId",cell:({getValue:n,row:s})=>s.getCanExpand()?e.createElement("span",{onClick:s.getToggleExpandedHandler()},n()):null},{header:"Status",accessorKey:"status",size:200,cell:({getValue:n})=>{const s=n();return e.createElement(q,{errors:s?.errorsCount,warnings:s?.warningsCount})},enableSorting:!1},{header:"Problem count",accessorKey:"problemsCount",size:200,sortDescFirst:!0}],[]);return e.createElement(A,{columns:i,data:u,sortBy:[{id:"ruleId",desc:!1}],empty:e.createElement(e.Fragment,null,"\u2705 This API is compliant with ",e.createElement("strong",null,d)," level rules"),subRowKey:"problems"})}function Ke(p){const{catalogSlug:u,slug:d,data:i,hasTeam:n,hasPublishedAt:s,teamLabel:l}=p,{apis:f,apisCount:m,warningApisCount:a,errorApisCount:c,levels:E,count:g}=i,t=f.length===0,h=t?void 0:{id:"expand",maxSize:40,size:40,header:()=>null,enableSorting:!1,cell:({row:r})=>r.getCanExpand()?e.createElement(x,{onClick:r.getToggleExpandedHandler(),variant:"text",size:"medium",icon:r.getIsExpanded()?e.createElement(D,null):e.createElement(I,null)}):null},L=b(()=>[h,{header:"API",accessorKey:"title"},s?{header:"Published at",accessorKey:"publishedAt",cell:({getValue:r})=>{const o=r();return o?new Date(o).toLocaleDateString():"-"}}:void 0,n?{header:l,accessorKey:"team",cell:({getValue:r})=>r()||Q}:void 0,{header:"Problem count",size:200,accessorKey:"count",cell:({getValue:r})=>r()||0,sortDescFirst:!0}].filter(R),[n,s,l,t]),y=b(()=>Object.entries(i.teams).sort((r,o)=>o[1]-r[1]),[i.teams]);return e.createElement(V,null,e.createElement(x,{icon:e.createElement(K,null),iconPosition:"left",variant:"ghost",size:"large",to:`${u}scorecard`},"Back to dashboard"),e.createElement("h1",null,"Rule ",d),e.createElement(j,null,e.createElement(S,null,e.createElement(w,null,"Rule status"),e.createElement(F,null,e.createElement("div",null,e.createElement(v,null,m),e.createElement("br",null),"APIs"),e.createElement("div",null,e.createElement(C,null,e.createElement(v,{style:{textAlign:"right"}},m-a-c),e.createElement(k,{severity:"Pass"})),e.createElement(C,null,e.createElement(v,{style:{textAlign:"right"}},a),e.createElement(k,{severity:"Warn"})),e.createElement(C,null,e.createElement(v,{style:{textAlign:"right"}},c),e.createElement(k,{severity:"Error"}))))),e.createElement(S,null,e.createElement(w,null,"Problems by level"),e.createElement(W,null,Object.entries(E).map(([r,o])=>e.createElement(B,{key:r},e.createElement("span",null,r),e.createElement(se,{chunks:[{share:o.errors/g*100,colorVariable:"--scorecard-color-error"},{share:o.warnings/g*100,colorVariable:"--scorecard-color-warning"}]}),e.createElement(ce,null,o.errors+o.warnings))))),e.createElement(S,null,e.createElement(w,null,`Problems by ${l}`),e.createElement(W,null,y.slice(0,4).map(([r,o])=>e.createElement(B,{key:r},e.createElement("span",{style:{flex:1,textAlign:"left"}},r),e.createElement(v,null,o)))))),e.createElement(A,{columns:L,data:f,sortBy:[{id:"title",desc:!1}],subRowKey:"problems",slug:d}))}function ze(p){const{slug:u,api:d,teamLabel:i,catalogSlug:n}=p,{api:s}=d||{},{scorecard:l,isLoading:f}=ae(`/${u}`),m=l?.levels||{},[a,c]=G(Object.keys(m)[0]),E=b(()=>s?.publishedAt instanceof Date?s?.publishedAt.toLocaleDateString():s?.publishedAt,[s]);_(()=>{if(l){const t=l.levels||{};c(Object.keys(t)[0])}},[l]);const g=b(()=>{if(!l?.levels)return{};const t={};for(const h of Object.keys(l.levels)){const L=l.levels[h].problems.reduce((y,r)=>(y[r.ruleId]||(y[r.ruleId]=[]),y[r.ruleId].push(r),y),{});t[h]=Object.entries(L).map(([y,r])=>({ruleId:y,problems:[...r.filter(o=>o.severity==="error"),...r.filter(o=>o.severity==="warn")],problemsCount:r.length,status:{errorsCount:r.filter(o=>o.severity==="error").length,warningsCount:r.filter(o=>o.severity==="warn").length}}))}return t},[l?.levels]);return f?e.createElement(U,{justifyContent:"center",mt:"2em"},e.createElement(N,null)):l?e.createElement(V,null,e.createElement(x,{icon:e.createElement(K,null),iconPosition:"left",variant:"ghost",size:"large",to:`${n}scorecard`},"Back to dashboard"),e.createElement("h1",null,s?.title||u),e.createElement(ee,null,E&&e.createElement(e.Fragment,null,"Published at: ",new Date().toLocaleString(void 0,{timeZoneName:"short"}),e.createElement("br",null)),e.createElement(P,{to:u,external:!0},"Documentation")),e.createElement(j,null,e.createElement(S,null,e.createElement(le,null,e.createElement("span",null,"Scorecard level"),e.createElement(M,{level:l.scorecardLevel,colorVariable:z(l.scorecardLevelIdx,Object.keys(m).length)})),e.createElement(F,null,e.createElement("div",null,"Compliance by level"),e.createElement("div",null,Object.entries(l.levels).map(([t,h])=>e.createElement(C,{key:t},e.createElement(v,{style:{width:"100px",textAlign:"right"}},t),e.createElement($,{errors:h.errors,warnings:h.warnings})))))),e.createElement(J,{title:"Rules compliance",levels:Object.entries(l.levels).map(([t,h])=>({errors:h.uniqueErrors,warnings:h.uniqueWarnings,total:p.rulesPerLevel[t].length,name:t}))}),e.createElement(S,null,e.createElement(w,null,i),e.createElement(v,{style:{fontWeight:"normal"}},s?.team))),e.createElement(re,{style:{justifyContent:"flex-start"},"data-component-name":"Scorecard/ModeSwitcherTabs"},Object.keys(l.levels).map(t=>e.createElement(te,{"data-component-name":"Scorecard/ModeSwitcherTab",key:t,isActive:a===t,onClick:()=>c(t)},e.createElement(C,null,e.createElement("span",null,t)," ",e.createElement($,{errors:l.levels[t].errors,warnings:l.levels[t].warnings}))))),Object.keys(m).map(t=>e.createElement(ne,{key:t,isActive:a===t},e.createElement(oe,{title:t,data:g[t]})))):e.createElement("div",null,"Scorecard not found")}export{Te as ApiListView,ze as ApiPage,oe as ApiView,Ke as RuleView,Ie as RulesView,De as TeamsView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pathToFileURL as z}from"url";import{HelmetProvider as G}from"@dr.pogodin/react-helmet";import{renderToString as l}from"react-dom/server";import{StaticRouterProvider as J,createStaticHandler as K,createStaticRouter as Q}from"react-router
|
|
1
|
+
import{pathToFileURL as z}from"url";import{HelmetProvider as G}from"@dr.pogodin/react-helmet";import{renderToString as l}from"react-dom/server";import{StaticRouterProvider as J,createStaticHandler as K,createStaticRouter as Q}from"react-router";import r from"react";import{readFile as V}from"fs/promises";import{join as W}from"path";import{withPathPrefix as m,getLocaleFromPathname as X,withoutPathPrefix as Y,removeTrailingSlash as Z}from"@redocly/theme/core/utils";import{RUNTIME_RESOURCES_DIR as T}from"../constants/common.js";import{slash as tt}from"../../utils/path/slash.js";import{reporter as et}from"../tools/notifiers/reporter.js";import{envConfig as p}from"../config/env-config.js";import{slug as rt}from"../../utils/slugger.js";import{shouldForwardProp as ot}from"../../utils/should-forward-prop.js";import{htmlTemplate as st}from"./template.js";import{detectColorSchemaScript as nt,generatePreloadPageData as at,generatePreloadSharedData as it}from"./utils.js";import"./hijack-console.js";import{getSitemapLinkTag as ct}from"./get-sitemap-link-tag.js";let g="";async function lt(t){return p.isRuntimeMode?await import("../../client/server-entry.js"):await import(z(`${tt(t)}/server-entry.js`)+"?"+new Date)}async function Bt(t){if(!p.isRuntimeMode){const e=et.getCompilationProblems();if(e.length>0){const{renderCompilationError:n}=await import("./render-compilation-error.js");return n(e)}}const{Loader:u,App:R,routes:w,ServerStyleSheet:E,StyleSheetManager:P,ErrorDetails:C,initL10n:D}=await lt(t.serverOutDir),{page:h,store:{globalData:S,hasSitemap:y},sharedData:v,ssrHref:b}=t,d=S?.l10n,i=X(Y(h.slug),d?.defaultLocale,d?.locales),f=t.page.request?.url||"http://localhost/";await u.prepare({...h,slug:Z(new URL(f).pathname)},v,S,i),await D(i);const c=new E,{query:M,dataRoutes:x}=K([{Component:R,path:m("*"),children:w}]),s=await M(new Request(f));if(s instanceof Response)throw s;const B=Q(x,s);try{globalThis.SSR_HOSTNAME=b,globalThis.SSR_USER_AGENT=t.userAgent,globalThis.SSR_OMIT_SUSPENSE=t.omitSuspense;const e={},n=l(r.createElement(G,{context:e},r.createElement(P,{sheet:c.instance,shouldForwardProp:ot},r.createElement(J,{router:B,context:s})))),L=y?ct():"",a=e.helmet,j=a?.title.toString()||"",k=t.store.globalData?.logo?.favicon,o=t.store.config,_=`<link rel="preload" as="fetch" crossorigin="anonymous" href="${m("/app-data.json")}" />`,F=at(t.page.slug),H=it(t.page.sharedDataIds),U=nt(o),A=t.page.product?.name?`product-${rt(t.page.product.name)}`:"",$=t.store.ssr.headTags.join(""),I=t.store.ssr.postBodyTags.join(""),N=t.store.ssr.preBodyTags.join(""),O=`<link rel="stylesheet" href="${m(T)}/browser-entry.css" />`;!p.isDevelopMode&&!g&&(g=`<style>${await V(W(t.outdir,T,"browser-entry.css"),"utf-8")}</style>`);const q={bodyHtml:n,linkTags:o.linkTags+c.getStyleTags()+(a?.link.toString()||""),title:j,favicon:k,headScriptTags:L+U+o.headScriptTags+$+(a?.script.toString()||"")+(a?.meta.toString()||""),preload:[_,F,...H],postBodyScriptTags:o.postBodyScriptTags+I,preBodyScriptTags:o.preBodyScriptTags||""+N,lang:i,productClass:A,runtimeCss:g||O};return{html:st(q),statusCode:200}}catch(e){return t.telemetry.sendSsrErrorCaughtMessage([{id:"ssr",object:"error",uri:"urn:redocly:realm:cli:error:ssr",message:e.message}]),{html:l(r.createElement(C,{error:e})),statusCode:500,error:e}}finally{c.seal(),u.clear()}}function Lt(t){return l(r.createElement(r.Fragment,null,...t))}export{Bt as render,Lt as renderComponents};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UiAccessibleConfig } from '@redocly/config';
|
|
2
|
-
import type { Location } from 'react-router
|
|
2
|
+
import type { Location } from 'react-router';
|
|
3
3
|
type ContextLocation = Omit<Location, 'state'>;
|
|
4
4
|
export type OnRouteChangeHook = (context: {
|
|
5
5
|
location: ContextLocation;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { Handler } from 'hono';
|
|
2
2
|
import type { Store } from '../../store';
|
|
3
3
|
export declare function askAiHandler(store: Store): Handler;
|
|
4
|
+
/**
|
|
5
|
+
* Ticket submissions from the embedded assistant. Proxied for the portal's own org/project so the
|
|
6
|
+
* embedding page never needs those ids, and gated exactly like `/_ask-ai`: escalation is reachable
|
|
7
|
+
* only by portal users who can use AI search.
|
|
8
|
+
*/
|
|
9
|
+
export declare function aiAssistantEscalationsHandler(store: Store): Handler;
|
|
4
10
|
//# sourceMappingURL=ask-ai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RbacFeatures as
|
|
1
|
+
import{RbacFeatures as a}from"../../../constants/common.js";import{ASK_AI_API_URL as c,AI_ASSISTANT_ESCALATIONS_API_URL as u}from"../../constants/common.js";import{fetchWithClient as p}from"../../utils/fetch-with-client.js";import{canAccessFeature as A}from"../../utils/rbac.js";import{handleUnauthorizedApiRequest as h}from"../utils.js";import{isAiSearchEnabled as f}from"../../plugins/search/utils.js";function l(e,t){const o=t.getConfig();return f(o)?A(a.AI_SEARCH,e.get("auth"),o.access?.rbac,o.access?.requiresLogin)?null:h(e):e.newResponse(null,403,{})}function d(e){const t=e.get("auth"),o={"Content-Type":"application/json"},n=[];t.claims?.authCookie&&n.push(`authorization=${t.claims.authCookie}`),t.idpAccessToken&&n.push(`accessToken=${t.idpAccessToken}`),n.length>0&&(o.Cookie=n.join("; "));const s=e.req.header("Authorization");return s&&(o.Authorization=s),o}function i({store:e,apiUrl:t,successContentType:o="application/json"}){return async n=>{if(!t)return n.newResponse(null,404);const s=l(n,e);if(s)return s;const r=await p(t,{method:"POST",body:JSON.stringify(await n.req.json()),headers:d(n)});return n.newResponse(r.body,r.status,{"Content-Type":r.ok?o:"application/json"})}}function y(e){return i({store:e,apiUrl:c,successContentType:"text/event-stream"})}function R(e){return i({store:e,apiUrl:u})}export{R as aiAssistantEscalationsHandler,y as askAiHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{serveStatic as
|
|
1
|
+
import{serveStatic as R}from"hono/serve-static";import{withPathPrefix as i,withoutPathPrefix as c}from"@redocly/theme/core/utils";import{ServerRoutes as l}from"../../../constants/api.js";import{PUBLIC_STATIC_FOLDER as H}from"../../constants/common.js";import{envConfig as L}from"../../config/env-config.js";import{authMiddleware as C}from"../middleware/authMiddleware.js";import{ensureSearchData as g}from"../middleware/ensureSearchData.js";import{dynamicMiddleware as I}from"../middleware/dynamic-middleware/dynamic-middleware.js";import{installRoutes as h}from"../../plugins/dev-onboarding/api/routes/index.js";import{installSkillsRoutes as D}from"./skills/skills-routes.js";import{authorizeHandler as P,oidcCallbackHandler as N,logoutHandler as s,postLogoutHandler as w,idpLoginHandler as M,redoclyLoginCallbackHandler as v,samlCallbackHandler as B,redoclyTokenLoginHandler as G,inviteHandler as F}from"./auth.js";import{appDataHandler as U}from"./app-data.js";import{searchFacetsHandler as y,searchHandler as Y}from"./search.js";import{dynamicRouteHandler as k}from"./dynamic-route.js";import{pageDataHandler as K,sharedPageDataHandler as b}from"./page-data.js";import{pathPrefixRedirectHandler as V}from"./path-prefix-redirect.js";import{getRoutesByLineHandler as f,resolvePathHandler as r,resolvePathsHandler as x,resolveSlugHandler as E}from"./resolve-route.js";import{feedbackHandler as q}from"./feedback.js";import{loggerMiddleware as X}from"../middleware/loggerMiddleware.js";import{responseHeadersMiddleware as $}from"../middleware/responseHeadersMiddleware.js";import{idleTimeoutMiddleware as j}from"../middleware/idleTimeoutMiddleware.js";import{otelTracesHandler as u}from"./otel/otel.js";import{healthCheckHandler as z}from"./health.js";import{askAiHandler as W,aiAssistantEscalationsHandler as Z}from"./ask-ai.js";import{semanticSearchHandler as J}from"./semantic-search.js";import{replayOauth2RedirectCallbackHandler as Q}from"./replay-oauth2-redirect.js";import{corsProxyHandler as O}from"./cors-proxy.js";import{corsMiddleware as m}from"../middleware/corsMiddleware.js";import{installApiRoutes as aa}from"./api-routes/api-routes.js";import{cookieMiddleware as ea}from"../middleware/cookieMiddleware.js";import{staticContentHandler as ia}from"../routes/static-content.js";import{infoHandler as _}from"./info.js";import{catalogHandler as la}from"./catalog/catalog.js";import{catalogRelationsHandler as ta}from"./catalog/catalog-relations.js";import{bffCatalogHandler as ma}from"./catalog/bff-catalog.js";import{bffCatalogRevisionsHandler as oa}from"./catalog/bff-catalog-revisions.js";import{bffCatalogRelatedEntitiesHandler as da}from"./catalog/bff-catalog-related-entities.js";import{catalogAuthMiddleware as t}from"../middleware/catalogAuthMiddleware.js";import{telemetryMiddleware as na}from"../middleware/telemetry-middleware.js";import{errorHandler as pa}from"./error.js";import{installMcpRoutes as Aa}from"./mcp-routes/mcp-routes.js";import{jsonValidatorMiddleware as T}from"../middleware/jsonValidatorMiddleware.js";import{searchFacetsRequestSchema as sa}from"../../../api-schemas/search-facets.js";import{searchRequestSchema as fa}from"../../../api-schemas/search.js";function te(a,e,o){const{resolveRouteData:n,readStaticAsset:p}=o;a.use("*",j()),a.use("*",ea()),a.use("*",I(e)),a.use("*",C(e)),a.use("*",X()),a.use("*",$(e)),a.use("*",na()),a.use(i("*"),R({root:`./${H}`,getContent:(d,S)=>ia(d,S,e,p),rewriteRequestPath:d=>c(d)})),a.use(i(l.FEEDBACK),m({allowMethods:["POST"]})),a.use(i(l.ASK_AI),m({allowMethods:["POST"]})),a.use(i(l.AI_ASSISTANT_ESCALATIONS),m({allowMethods:["POST"]})),a.use(i(l.SEMANTIC_SEARCH),m({allowMethods:["POST"]})),a.use("*",ra(e));const A=g(e);a.use(i(l.INFO),_()),L.NEW_CATALOG_ENABLED&&(a.use(i(l.CATALOG_ENTITIES),t({serverOutDir:e.serverOutDir}),la(e)),a.use(i(l.CATALOG_ENTITIES_RELATIONS),t({serverOutDir:e.serverOutDir}),ta(e)),a.get(i(l.BFF_CATALOG_ENTITIES),t({serverOutDir:e.serverOutDir,protectReadMethods:!1}),ma(e)),a.get(i(l.BFF_CATALOG_RELATED_ENTITIES),t({serverOutDir:e.serverOutDir,protectReadMethods:!1}),da(e)),a.get(i(l.BFF_CATALOG_REVISIONS),t({serverOutDir:e.serverOutDir,protectReadMethods:!1}),oa(e))),a.get(i(l.SHARED_PAGE_DATA),b(e)),a.get(i(l.PAGE_DATA),K(e,n)),a.get(i(l.APP_DATA),U(e)),a.post(i(l.SEARCH),A,T(fa),Y(e)),a.post(i(l.SEARCH_FACETS),A,T(sa),y(e)),a.post(i(l.AUTHORIZATION),P),a.post(i(l.LOGOUT),s(e)),a.get(i(l.LOGOUT),s(e)),a.get(i(l.POST_LOGOUT),w(e)),a.get(i(l.OIDC_CALLBACK),N(e)),a.get(i(l.REDOCLY_TOKEN_LOGIN),G(e)),a.get(i(l.REDOCLY_LOGIN_CALLBACK),v()),a.get(i(l.IDP_LOGIN),M(e)),a.post(i(l.SAML_CALLBACK),B(e)),a.get(i(l.INVITE),F(e)),a.get(i(l.HEALTH),z),Aa(a,e),h(a,e),D(a,e),a.all(i(l.CORS_PROXY),O(e)),a.all(i(`${l.CORS_PROXY}/*`),O(e)),aa(a,e),a.post(i(l.FEEDBACK),q(e)),a.post(i(l.RESOLVE_ROUTE_BY_PATH),r(e)),a.post(i(l.RESOLVE_ROUTES_BY_PATHS),x(e)),a.post(i(l.RESOLVE_ROUTE_BY_SLUG),E(e)),a.post(i(l.ASK_AI),W(e)),a.post(i(l.AI_ASSISTANT_ESCALATIONS),Z(e)),a.post(i(l.SEMANTIC_SEARCH),J(e)),a.get(i(l.GET_ROUTES_BY_LINE),f(e)),a.post(i(l.OTEL_TRACES),u),a.get(i(l.REPLAY_OAUTH2_CALLBACK),Q),a.all(i("/*"),k(e,n,p)),a.get("*",V),a.onError(pa)}function ra(a){return async(e,o)=>{await a.waitForPluginsLifecycle(),await o()}}function me(a,e){a.get(i(l.INFO),_()),a.post(i(l.RESOLVE_ROUTE_BY_PATH),r(e)),a.post(i(l.RESOLVE_ROUTE_BY_SLUG),E(e)),a.get(i(l.GET_ROUTES_BY_LINE),f(e))}export{me as installDevRoutes,te as installProdRoutes,ra as waitForPluginsLifecycle};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/realm",
|
|
3
|
-
"version": "0.136.0-next.
|
|
3
|
+
"version": "0.136.0-next.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"realm": "bin.js"
|
|
8
8
|
},
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=22.
|
|
10
|
+
"node": ">=22.22.0",
|
|
11
11
|
"npm": ">=10"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [],
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@opentelemetry/sdk-trace-web": "2.8.0",
|
|
34
34
|
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
35
35
|
"@redocly/ajv": "8.18.0",
|
|
36
|
-
"@redocly/openapi-core": "2.
|
|
36
|
+
"@redocly/openapi-core": "2.45.0",
|
|
37
37
|
"@shikijs/transformers": "3.21.0",
|
|
38
38
|
"@tanstack/react-query": "5.62.3",
|
|
39
39
|
"@tanstack/react-table": "8.21.3",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"path-browserify": "1.0.1",
|
|
70
70
|
"picomatch": "2.3.2",
|
|
71
71
|
"quickjs-emscripten-core": "0.32.0",
|
|
72
|
-
"react": "^19.2.
|
|
72
|
+
"react": "^19.2.7",
|
|
73
73
|
"react-calendar": "5.1.0",
|
|
74
74
|
"react-date-picker": "11.0.0",
|
|
75
|
-
"react-dom": "^19.2.
|
|
76
|
-
"react-router
|
|
75
|
+
"react-dom": "^19.2.7",
|
|
76
|
+
"react-router": "^8.3.0",
|
|
77
77
|
"react-select": "5.10.1",
|
|
78
78
|
"reactjs-popup": "2.0.6",
|
|
79
79
|
"semver": "7.7.3",
|
|
@@ -93,19 +93,19 @@
|
|
|
93
93
|
"xpath": "0.0.34",
|
|
94
94
|
"yaml-ast-parser": "0.0.43",
|
|
95
95
|
"zod": "^3.25.76",
|
|
96
|
-
"@redocly/api-docs": "0.1.0-next.
|
|
97
|
-
"@redocly/asyncapi-docs": "1.13.0-next.
|
|
96
|
+
"@redocly/api-docs": "0.1.0-next.4",
|
|
97
|
+
"@redocly/asyncapi-docs": "1.13.0-next.10",
|
|
98
98
|
"@redocly/config": "0.53.1",
|
|
99
|
-
"@redocly/graphql-docs": "1.13.0-next.
|
|
100
|
-
"@redocly/openapi-docs": "3.24.0-next.
|
|
101
|
-
"@redocly/portal-legacy-ui": "0.
|
|
102
|
-
"@redocly/portal-plugin-mock-server": "0.21.0-next.
|
|
99
|
+
"@redocly/graphql-docs": "1.13.0-next.10",
|
|
100
|
+
"@redocly/openapi-docs": "3.24.0-next.10",
|
|
101
|
+
"@redocly/portal-legacy-ui": "0.19.0-next.0",
|
|
102
|
+
"@redocly/portal-plugin-mock-server": "0.21.0-next.10",
|
|
103
103
|
"@redocly/realm-asyncapi-sdk": "0.14.0-next.3",
|
|
104
|
-
"@redocly/theme": "0.68.0-next.
|
|
104
|
+
"@redocly/theme": "0.68.0-next.7"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"react": "^19.2.
|
|
108
|
-
"react-dom": "^19.2.
|
|
107
|
+
"react": "^19.2.7",
|
|
108
|
+
"react-dom": "^19.2.7"
|
|
109
109
|
},
|
|
110
110
|
"nx": {
|
|
111
111
|
"implicitDependencies": [
|