@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @redocly/realm
|
|
2
2
|
|
|
3
|
+
## 0.136.0-next.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 931df5a101b: Fixed an issue where API docs callbacks failed to render when expanded.
|
|
8
|
+
|
|
9
|
+
Fixed an issue where deep links to callbacks navigated users to the operation instead.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [931df5a101b]
|
|
12
|
+
- @redocly/api-docs@0.1.0-next.4
|
|
13
|
+
|
|
14
|
+
## 0.136.0-next.11
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 8d13293a7b7: Fixed security vulnerability `GHSA-qwww-vcr4-c8h2` by changing `react-router-dom` to `react-router` version `^8.3.0`.
|
|
19
|
+
- 78b5d267967: Added `manageApiCredentials` tool to update or remove stored API credentials. Prevented the credentials prompt from repeating after rejected calls.
|
|
20
|
+
- 40452890e12: Updated `@redocly/openapi-core` to version `2.45.0`.
|
|
21
|
+
- Updated dependencies [8d13293a7b7]
|
|
22
|
+
- Updated dependencies [40452890e12]
|
|
23
|
+
- @redocly/theme@0.68.0-next.7
|
|
24
|
+
- @redocly/graphql-docs@1.13.0-next.10
|
|
25
|
+
- @redocly/openapi-docs@3.24.0-next.10
|
|
26
|
+
- @redocly/asyncapi-docs@1.13.0-next.10
|
|
27
|
+
- @redocly/portal-legacy-ui@0.19.0-next.0
|
|
28
|
+
- @redocly/api-docs@0.1.0-next.3
|
|
29
|
+
- @redocly/portal-plugin-mock-server@0.21.0-next.10
|
|
30
|
+
|
|
3
31
|
## 0.136.0-next.10
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/client/App.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import{
|
|
1
|
+
import*as t from"react";import{Outlet as g,useLocation as h,useNavigate as P}from"react-router";import{useEffect as c,useMemo as u,useState as S,Suspense as D}from"react";import{withoutPathPrefix as T}from"@redocly/theme/core/utils";import{useThemeConfig as v}from"@redocly/theme/core/hooks";import{InternalServerErrorLayout as L}from"@redocly/theme/layouts/InternalServerErrorLayout";import{RootLayout as C}from"@redocly/theme/layouts/RootLayout";import{PageLayout as y}from"@redocly/theme/layouts/PageLayout";import{components as R}from"@redocly/theme/markdoc/default";import{Sidebar as _}from"./app/Sidebar/Sidebar";import{loadAndNavigate as I}from"./app/utils/loadAndNavigate";import{useActions as N}from"./app/Sidebar/useActions";import{useScrollTracker as O}from"./app/hooks/useScrollTracker";import{useAutoScroll as A}from"./app/hooks/useAutoScroll";import{API_DOCS_TEMPLATE_ID as f}from"../constants/common";import{removeTrailingSlash as k}from"../utils/url/remove-trailing-slash";import{removeLeadingSlash as M}from"../utils/url/remove-leading-slash";import*as b from"./app/markdoc/custom-components/index";import{DefaultStyles as x}from"./styling/default-styles";import{ThemeDataProvider as B}from"./providers/theme/ThemeDataProvider";import{PageDataContext as G}from"./providers/page-data/PageDataContext";import{SeoTags as V}from"./app/seo/SeoTags";import{useRouterForLocalLinks as F,useRunningEnvironmentCheck as w}from"./providers/hooks";import{usePageData as U,usePageDataLoader as j}from"./providers/page-data/hooks";import{ErrorBoundary as q}from"./ErrorBoundary";import{ErrorDetails as E,Loader as z}from"./server-entry";import"@styles";import{useRouteChangeTracker as H}from"./app/hooks/useRouteChangeTracker";import{isInIframe as J}from"./utils";import{useL10n as K}from"./app/l10n";import{PostMessageProvider as Q}from"./providers/post-message/PostMessageProvider";import{ScriptLoader as W}from"./ScriptLoader";import{clientRoutes as X}from"./runtime/generated/routes.js";import{DevModeFloatingBar as Y}from"./app/DevModeFloatingBar";import{usePageTimeTracker as Z}from"./app/hooks/usePageTimeTracker";import{useMarkdocRenderer as $}from"./app/hooks/markdown/useMarkdocRenderer";globalThis.__LOADER.markdocComponents={...b,...R};function Be(){const e=j(),[n,a]=S(e),o=h(),m=P();K();const l=t.useMemo(()=>function(){const{palette:s}=v();return t.createElement(x,{palette:s})},[]);c(()=>{e?a(e):I({navigate:m,to:o.pathname+o.search+o.hash}).then(()=>a(z.loadSync(o.pathname)))},[o,m]),F();const r=w();return r?(console.log(r),t.createElement(E,{error:{message:r,name:""}})):n?t.createElement(q,null,t.createElement(G.Provider,{value:e||n},t.createElement(B,null,t.createElement(l,null),t.createElement(Q,{enabled:process.env.NODE_ENV==="development"||J()},t.createElement(g,null))))):null}function ee(){return A(),null}function d(){H(),Z(),O();const e=U(),n=N(),{layout:a}=n,o=u(()=>({layout:a}),[a]),m=process.env.NODE_ENV!=="production",l=globalThis.SSR_OMIT_SUSPENSE,r=$(e?.props?.ast),p=k(e?.slug||"");c(()=>{document.documentElement.classList.add("ready")},[]);const s=u(()=>[f].includes(e?.templateId??"")?{...e?.props,apiOptions:o}:e?.props,[e?.props,e?.templateId,o]);if(e?.props.pagePropGetterError?.message)return m?t.createElement(E,{error:{...e?.props?.pagePropGetterError}}):t.createElement(L,null);if(!!e?.props?.compilationErrors?.length)return e?.Template?t.createElement(e.Template,{pageProps:e?.props,children:r}):null;const i=()=>t.createElement(C,null,e?.templateId!==f&&t.createElement(ee,null),t.createElement(y,{sidebar:t.createElement(_,{layoutControls:n})},t.createElement(V,{seo:e?.props.seo,slug:p}),e?.Template&&s?t.createElement(e.Template,{pageProps:s,children:r}):null),process.env.NODE_ENV!=="production"&&t.createElement(Y,null),t.createElement(W,null));return l?i():t.createElement(D,null,i())}const Ge=[...X.map(e=>({Component:d,path:M(T(e).substring(1)+"/*")})),{Component:d,path:"*"}];export{Be as App,d as Page,Ge as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as f}from"react";import{useLocation as m}from"react-router
|
|
1
|
+
import{useEffect as f}from"react";import{useLocation as m}from"react-router";let i=[],c=[];const s=new Map;let p=null;function E(t,e=!1,n){e?i.push({content:t,attributes:n}):i.push({src:t,attributes:n})}function P(t,e){t&&c.push({src:t,attributes:e})}function x(){return p||Promise.resolve()}function A(){const t=m();return f(()=>{p=new Promise(e=>{y(i).then(()=>{const n=h(c);return c=[],n}).then(()=>{e()}),i=[]})},[t.pathname]),null}function a(t,e){const n=s.get(t);if(n)return n;const o=new Promise((u,d)=>{const r=document.createElement("script");r.src=t,l(r,e),r.addEventListener("load",()=>u()),r.addEventListener("error",()=>d(`Error loading script: ${t}`)),document.body.appendChild(r)});return s.set(t,o),o}function S(t,e){return new Promise(n=>{const o=document.createElement("script");o.textContent=t,l(o,e),document.body.appendChild(o),n()})}async function y(t){for(const e of t)"src"in e?await a(e.src,e.attributes):"content"in e&&await S(e.content,e.attributes)}async function h(t){return Promise.allSettled(t.map(({src:e,attributes:n})=>a(e,n)))}function l(t,e){e&&Object.entries(e).forEach(([n,o])=>{typeof o=="boolean"?o&&t.setAttribute(n,""):t.setAttribute(n,o)})}export{A as ScriptLoader,P as loadScriptFromReactAsync,E as loadScriptFromReactSync,x as waitForContentScripts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{BrowserRouter as o}from"react-router
|
|
1
|
+
import e from"react";import{BrowserRouter as o}from"react-router";import{ThemeDataContext as n,SearchSessionProvider as i}from"@redocly/theme/core/contexts";import u from"@redocly/theme/core/templates/Markdown";import{useAnchorPositioning as m,useBreadcrumbs as d,useBanner as l,useCatalogClassic as c,useCurrentProduct as p,useGlobalData as g,useI18n as h,useI18nConfig as f,useL10n as T,useL10nConfig as b,usePageData as C,usePageSharedData as k,usePageVersions as v,usePreloadHistory as P,useProducts as w,useUserMenu as y,useSubmitFeedback as S,useTranslate as D,useTranslationKeys as $,useSidebarSiblingsData as E,usePageProps as I,useUserTeams as L,useMarkdownText as M,useMarkdocRenderer as x,useCodeHighlight as F,useLoadAndNavigate as H,useCatalog as R,useCatalogSort as A,useCatalogSearch as B,useFetchCatalogEntities as G,useFetchCatalogEntitiesRelations as O,useTelemetry as r,useMcpData as U,useFetchCatalogEntityRevisions as K}from"./app/hooks";import{Link as N}from"./app/Link";import{useFacetQuery as Q,useSearch as V,useAiSearch as j}from"./app/search";import{useSidebarItems as q}from"./app/Sidebar/useSidebarItems";import{PageDataContext as z}from"./providers/page-data/PageDataContext";const s={Template:({pageProps:a,children:t})=>e.createElement(u,{pageProps:{...a,metadata:{...a.metadata,markdoc:{tagList:[]}}}},t),templateId:"markdown",isPublic:!0,props:{seo:{title:"Test"},ast:{$$mdtype:"Tag",name:"div",children:[{$$mdtype:"Tag",name:"Heading",attributes:{id:"github-flavored-markdown",level:1},children:["GitHub-flavored markdown"]},{$$mdtype:"Tag",name:"p",attributes:{},children:["These exercises assume you have",{$$mdtype:"Tag",name:"a",attributes:{href:"https://docs.redoc.ly/"},children:["basic markdown knowledge"]},"."]},{$$mdtype:"Tag",name:"Heading",attributes:{id:"create-a-new-plain-markdown-page",level:2},children:["Create a new plain markdown page"]}]},lastModified:new Date("2022-01-01").toISOString()},slug:"",userData:{isAuthenticated:!1,name:"test name",picture:""},sidebar:null,sharedData:{},sharedDataIds:{}},J={useAnchorPositioning:m,useBreadcrumbs:d,useBanner:l,useCatalog:R,useCatalogSort:A,useCatalogSearch:B,useFetchCatalogEntities:G,useFetchCatalogEntitiesRelations:O,useFetchCatalogEntityRevisions:K,useCatalogClassic:c,useCurrentProduct:p,useGlobalData:g,useSearch:V,useAiSearch:j,useFacetQuery:Q,useI18n:h,useI18nConfig:f,useL10n:T,useL10nConfig:b,usePageData:C,usePageSharedData:k,usePageVersions:v,usePreloadHistory:P,useProducts:w,useUserMenu:y,useSidebarItems:q,useSidebarSiblingsData:E,useSubmitFeedback:S,useTranslate:D,useTranslationKeys:$,useUserTeams:L,usePageProps:I,useMarkdownText:M,useMarkdocRenderer:x,useCodeHighlight:F,useLoadAndNavigate:H,useTelemetry:r,useOtelTelemetry:r,useMcpData:U},W={LinkComponent:N},X={hooks:J,components:W,config:{}};function ne({children:a,customPageData:t}){return e.createElement(o,null,e.createElement(i,null,e.createElement(z.Provider,{value:{...s,...t,props:{...s.props,...t?.props}}},e.createElement(n.Provider,{value:X},a))))}export{ne as TestProvider};
|
package/dist/client/app/Link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as s from"react";import u from"path";import{Link as U,useNavigate as z,useLocation as F}from"react-router
|
|
1
|
+
import*as s from"react";import u from"path";import{Link as U,useNavigate as z,useLocation as F}from"react-router";import{getPathnameForLocale as M,withPathPrefix as W}from"@redocly/theme/core/utils";import{removeTrailingSlash as I}from"../../utils/url/remove-trailing-slash";import{normalizeRouteSlug as h}from"../../utils/path/normalize-route-slug";import{isAbsoluteUrl as V}from"../../utils/url/is-absolute-url";import{isAssetsLink as j}from"../../utils/path/is-assets-link";import{useL10nConfig as q}from"./hooks/index.js";import{loadAndNavigate as B}from"./utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as G}from"../utils/utils.js";async function g(o,t){if(V(o))return;await(typeof window<"u"?window:global).__LOADER.tryLoad(o,void 0,t)}function oe(o){const{to:t,children:l,className:v,style:a,innerRef:i,target:L,external:c,languageInsensitive:w,onClick:m,active:H,rel:y,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,..._}=o,x=L||(c?"_blank":"_self"),A=c||t.match(/^(https?:\/\/|mailto:)/),f=y||(A?"noreferrer":void 0),n={className:v,children:l,target:x,...f&&{rel:f},onClick:m,..._},{defaultLocale:D,locales:S,currentLocale:b}=q(),O=F();let e=t;e.startsWith(".")&&(e=u.resolve(u.dirname(h(O.pathname)),h(t))),e=e.startsWith("#")?e:W(w?e:M(e,D,b,S));const r=e!=="/"?I(e):e,T=z(),d=typeof window<"u"?new URL(r,window.location.origin+window.location.pathname).search:void 0;return typeof t=="string"&&t.match(/^(https?:\/\/|mailto:)/)?s.createElement("a",{...n,ref:i,style:a,href:t,onMouseOver:async()=>g(t,d)}):j(r)?s.createElement("a",{...n,ref:i,style:a,href:r}):s.createElement(U,{...n,ref:i,style:a,to:r,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,onClick:p=>{m?.(),!G(p,n.target)&&(p.preventDefault(),B({navigate:T,to:r}))},onMouseOver:async()=>g(r,d)})}export{oe as Link};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as k}from"react";import{useLocation as T}from"react-router
|
|
1
|
+
import{useMemo as k}from"react";import{useLocation as T}from"react-router";import{useThemeConfig as y}from"@redocly/theme/core/hooks";import{withoutPathPrefix as K}from"@redocly/theme/core/utils";import{usePageVersions as g,useTranslate as v,usePageSharedData as d}from"../hooks";import{useSidebarItems as x}from"./useSidebarItems";function D(){const a=d("sidebar")?.relatedNavbarItem,n=d("current-catalog-info"),r=y(),{translate:l}=v(),{versions:e=[]}=g()||{},c=e.find(m=>m?.active),{allSidebarItems:i}=x(c),t=T().pathname,o=n?.item,s=n?.catalog,b=r.breadcrumbs?.prefixItems,f=r.breadcrumbs?.hide;return k(()=>{const m=B({allSidebarItems:i,pathname:K(t),catalogItemInfo:o,relatedNavbarItem:a,catalogInfo:s,prefixItems:b,hide:f,translate:l}),p=S(i,m);return{breadcrumbs:m,currentItemSiblings:p}},[t,a,i,o,s,b,f,l])}const B=({allSidebarItems:a=[],pathname:n,catalogItemInfo:r,relatedNavbarItem:l,catalogInfo:e,prefixItems:c,hide:i,translate:u})=>{if(i===!0)return[];const t=h(a);if(t.length===0)return[];if(r){const o=t[t.length-1];o&&o.label!==r.label&&t.unshift({label:r.label,link:r.link})}if(l&&l.label!==t[0].label&&t.unshift(l),e&&t.unshift({label:u(e.labelTranslationKey,e.label),labelTranslationKey:e.labelTranslationKey,link:e.link,icon:e.icon}),c?.length){const o=c.map(s=>({label:u(s.labelTranslationKey,s.label),labelTranslationKey:s.labelTranslationKey,link:s.link,icon:s.icon}));t.unshift(...o)}return t.length===1&&(!t[0]?.link||t[0]?.link===n)?[]:t},S=(a,n)=>{if(n.length===0)return[];const r=(e,c)=>{for(const i of e){if(i.active)return{item:i,parent:c};if(i.items?.length){const u=r(i.items,i);if(u)return u}}},l=r(a);return l?.parent?l.parent.items?.filter(e=>!!(e.link&&e.link!==l.item.link&&e.label)).map(e=>({label:e.label,labelTranslationKey:e.labelTranslationKey,link:e.link,icon:e.icon}))||[]:[]},h=a=>{const n=a.find(({active:l,hasActiveSubItem:e})=>l||e);if(!n?.label)return[];const r={label:n.label,labelTranslationKey:n.labelTranslationKey,link:n.link,icon:n.icon};return n.type==="group"&&n.selectFirstItemOnExpand&&n.items?.[0]?.link&&(r.link=n.items[0].link),n.items?.length||(r.link=void 0),[r,...h(n.items||[])]};export{B as generateBreadcrumbs,S as generateSiblings,D as useBreadcrumbs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as _}from"react-router
|
|
1
|
+
import{useLocation as _}from"react-router";import{useEffect as k,useMemo as S,useState as b}from"react";import{useActiveSectionId as D}from"@redocly/theme/core/hooks";import{getMenuItemType as v}from"@redocly/theme/core/utils";import{MenuItemType as C}from"@redocly/theme/core/constants";import{CATALOG_BASE_SLUG as T,CATALOG_SLUGS as h}from"../../../constants/catalog-entities";import{usePageSharedData as y,useSidebarItemsData as G,useSidebarConnectedCatalogConfig as E,useSidebarConnectedCatalogEntity as O}from"../../providers/page-data/hooks";import{mapItemsPropsToState as g}from"./utils";import{injectCatalogItems as K}from"../../utils/catalog/inject-catalog-items";import{filterOutVersionedItems as B}from"./helpers/filter-out-versioned-items";const M="catalog.backToAllLabel",P=`${T}/${h.ALL}`;function U(n){const e=G();return S(()=>B(e,n),[e,n])}function J(n){const e=_(),t=D(e,!0),a=O(),p=E(),s=U(n),c=a?K(s,a.key,p?.slug,e.search):s,[u,I]=b(null),r=S(()=>g(c,e,t),[t,e,c]),l=y("current-catalog-info"),L=S(()=>f(r),[c]),[o,m]=b(L),i=o.length>0?o[o.length-1]:void 0,A=i&&g([...i.item.link?[{...i.item,items:[],menuStyle:void 0,separatorLine:!1}]:[],...i.item.items],e,t);k(()=>{if(!u||u!==t){const d=f(r);m(d),I(t)}},[s,e,t,u]);const w=i?{slug:i.previousLink,event:"sidebar_drilldown_back_button.clicked"}:a?{label:"Back to Catalog",labelTranslationKey:M,slug:P,event:"back_to_catalog_button.clicked"}:l?{label:l.catalog.label,labelTranslationKey:l.catalog.labelTranslationKey,slug:l.catalog.link,event:"back_to_catalog_button.clicked"}:void 0;return{currentItems:A||r,allSidebarItems:r,popDrilldownState:()=>{o.length>0&&m(o.slice(0,o.length-1))},pushDrilldownState:d=>{m([...o,d])},backLink:w,versionLabel:a?.version??null}}function f(n,e=[]){for(const t of n){if(!t.active&&!t.hasActiveSubItem)continue;if(v(t)===C.DrillDown&&e.push({item:t}),t.active)return e;if(t.hasActiveSubItem)return f(t.items,e)}return e}export{U as useRawSidebarItems,J as useSidebarItems};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Location } from 'react-router
|
|
1
|
+
import type { Location } from 'react-router';
|
|
2
2
|
import type { SidebarNavItem, ItemState } from '@redocly/theme/core/types';
|
|
3
3
|
export declare function mapItemsPropsToState(items: SidebarNavItem[], location: Location, activeSectionId?: string): ItemState[];
|
|
4
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as h from"react";import{useLocation as $,useNavigate as R}from"react-router
|
|
1
|
+
import*as h from"react";import{useLocation as $,useNavigate as R}from"react-router";import{usePageData as V,usePageSharedData as K}from"../../hooks";import{withoutHash as D,getBaseDataAttributes as w}from"@redocly/theme/core/utils";import{telemetry as A}from"../../telemetry/index.js";import{toStringIfDefined as v}from"../../../../utils/string/to-string-if-defined.js";import{findDeepFirst as _}from"../../../../utils/tree/find-deep-first.js";function re(e,o){const r=$(),i=R(),a=V(),t=G(r),s=K("catalog"),[n,p]=h.useState(()=>(e.filters??[]).map(l=>{if(l.type==="date-range"){const[c,u]=t.get(l.property)?.split("--")??[];return!c&&!u?{}:{from:c,to:u}}return new Set(t.getAll(l.property))})),[d,g]=h.useState(()=>t.get("filter")||"");o||(o=[...s]);const S=h.useMemo(()=>L(o??[],e.filters),[o,e.filters]),I=a?.props?.customFields,C=h.useMemo(()=>H(o??[],e,I||{}),[o,e,I]),b=h.useCallback((l,c)=>{p(u=>{const F=u[l]?u[l]:new Set;return F instanceof Set?(F.has(c)?u.forEach((f,m)=>{f instanceof Set&&f.has(c)&&f.delete(c)}):F.add(c),[...u.slice(0,l),F,...u.slice(l+1)]):u}),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"toggle"}]),window.scrollTo(0,0)},[]),P=h.useCallback((l,c)=>{p(u=>{const F=u[l]instanceof Set?new Set(c?[c]:[]):{from:c?.from,to:c?.to},f=S[l];return u.map((m,y)=>y===l?F:S[y].parentFilter===f.property?new Set:m)}),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[S]),N=()=>{const l=new URLSearchParams(Array.from(t.entries()));d?t.set("filter",d):t.delete("filter"),n.forEach((u,F)=>{const f=e.filters?.[F];if(!f)return;const m=Q(u);Z(f.property,m,l)});const c=l.toString();c!==r.search.substring(1)&&i({search:c})};h.useEffect(()=>{N()},[e.filters,n,d,i,r]);const k=h.useMemo(()=>J(e.filters),[e.filters]);return h.useMemo(()=>{const l=S.map((f,m)=>({...f,toggleOption:y=>b(m,y),selectOption:y=>P(m,y),selectedOptions:n[m]??new Set,isFilterUsed:(n[m]?.size??0)>0||!!n[m]?.from})),c=T(C,l,d),u=l.map((f,m)=>{const y=l.findIndex(O=>O.property===f.parentFilter),j=f.parentFilter?(n[y]?.size??0)>0||!!n[y].from:!0,z=l.filter((O,M)=>M!==m&&!k[m]?.has(M)),B=T(C,z,d),U=L(B.map(O=>({metadata:O})),e.filters);return{...f,parentUsed:j,filteredOptions:U[m].options}});return{groups:e.groupByFirstFilter&&u.length>0?q(u,c):[{title:"APIs",items:c}],filters:u,setFilterTerm:f=>{g(f),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"term"}])},filterTerm:d}},[S,C,d,e.groupByFirstFilter,e.filters,n,b,P,k])}function q(e,o){return e[0].options.map(r=>({title:r.value,items:o.filter(i=>{const a=i?.[e[0].property]||e[0].missingCategoryName||"Others";return Array.isArray(a)?a.includes(r.value):a===r.value})})).filter(r=>r.items.length>0)}function G(e){return h.useMemo(()=>new URLSearchParams(e.search),[e.search])}function H(e,o,r){let i;if(o.separateVersions)i=e.map(a);else{const t={};for(const s of e){if(!s.versionFolderId){const p=s.link||s.fsPath||JSON.stringify(s);t[p]=[s];continue}let n=s.versionFolderId;if(t[n]?.find(p=>p.version===s.version)){const p=s.fsPath?.replace(/\/@.*?\//,"/@version/")??"";n=`${n}-${p}`}t[n]||(t[n]=[]),t[n].push(s)}i=Object.values(t).map(s=>{s.sort((d,g)=>(d.version||"").localeCompare(g.version||""));const n=s.map(a);return{...a(s.find(d=>d.isDefault)||s[s.length-1]),versions:n}})}return i.sort((t,s)=>t.title.localeCompare(s.title)),i;function a(t){const s=t.metadata||{},n=r[t.fsPath||""]||{},p=t.link||_(t.items||[],g=>"link"in g&&!!g.link)?.link,d=t.sidebar?.[0];return{...s,...n,publishedAt:s.publishedAt||s.createdAt,title:v(s?.title)||t.label||"Untitled",description:v(s?.description),link:D(p)??"#",docsLink:D(d?.link),image:v(s?.image),version:t.version,versionFolderId:t.versionFolderId}}}function J(e){if(!e)return[];const o=[];for(let r=0;r<e.length;r++){const i=e[r];if(i.parentFilter){const a=e.findIndex(t=>t.property===i.parentFilter);o[a]=o[a]||new Set,o[a].add(r)}}return o}function L(e,o){return(o??[]).map(r=>{const i=r.options?Object.fromEntries(r.options.map(n=>[n,0])):void 0,a=i??{};let t=0;for(const n of e){const p=Array.isArray(n.metadata?.[r.property])?n.metadata?.[r.property]:[n.metadata?.[r.property]];for(const d of p){const g=E(String(d),r.valuesMapping);if(i){g in i&&(a[g]=a[g]+1);continue}d?a[g]=(a[g]??0)+1:t++}}const s=Object.entries(a).map(([n,p])=>({value:n,count:p}));return i||s.sort((n,p)=>n.value.localeCompare(p.value)),t&&s.push({value:r.missingCategoryNameTranslationKey||r.missingCategoryName||"Others",count:t}),{...r,options:s}})}function T(e,o,r){const i=e.filter(a=>o.every(t=>{if(t.selectedOptions&&!(t.selectedOptions instanceof Set))try{const n=new Date(a[t.property]).toISOString().split("T")[0];return n>=(t.selectedOptions.from??"")&&n<=(t.selectedOptions.to??"Z")}catch{return!0}if(t.selectedOptions.size===0)return!0;const s=E(a?.[t.property]||t.missingCategoryName||"Others",t.valuesMapping);return Array.isArray(s)?s.some(n=>t.selectedOptions.has(n)):t.selectedOptions.has(s)}));return r?(r=r.toLowerCase(),i.filter(a=>Object.values(a).some(t=>Array.isArray(t)?t.some(s=>String(s).toLowerCase().includes(r)):String(t).toLowerCase().includes(r)))):i}function E(e,o){return o?Array.isArray(e)?e.map(r=>o[String(r)]||r):o[String(e)]||e:e}function Z(e,o,r){r.delete(e),o.forEach(i=>{r.append(e,i)})}function Q(e){const o=new Set;return e instanceof Set?e.forEach(r=>o.add(r)):(e.from||e.to)&&o.add(`${e.from||""}--${e.to||""}`),o}export{Z as fillSearchParams,Q as getFilterValues,re as useCatalogClassic};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as h,useEffect as w,useMemo as y,useState as P}from"react";import{useSearchParams as Q}from"react-router
|
|
1
|
+
import{useCallback as h,useEffect as w,useMemo as y,useState as P}from"react";import{useSearchParams as Q}from"react-router";import{telemetry as b}from"../../telemetry/index.js";import{parseFilterQuery as g,formatFilterQuery as C,collectFilterOptions as U}from"../../../utils";import{getBaseDataAttributes as I}from"@redocly/theme/core/utils";function O(r){return r instanceof Set?r.size>0:!!(r?.from||r?.to)}function x(r,m){const[u,d]=Q(),o=u.get("filter")||"",[i,f]=P(()=>g(o,r?.filters||[])),p=y(()=>U(r?.filters,m),[r?.filters,m]);w(()=>{const t=r?.filters||[];if(t.length>0&&i.length!==t.length){const e=g(o,t);f(e)}},[r?.filters,i.length,o]);const F=h((t,e)=>{f(l=>l.map((s,c)=>{if(c!==t||!(s instanceof Set))return s;const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n})),window.scrollTo(0,0)},[]),S=h((t,e)=>{f(l=>l.map((a,s)=>s!==t?a:a instanceof Set?e&&typeof e=="string"?new Set([e]):new Set:{from:typeof e=="object"?e?.from:void 0,to:typeof e=="object"?e?.to:void 0})),b.sendCatalogFilterChangedMessage([{...I("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[]);return w(()=>{const t=new URLSearchParams(u),e=C(i,r?.filters||[]);e?t.set("filter",e):t.delete("filter"),d(t,{replace:!0})},[r?.filters,i,u,d]),y(()=>{const t=p.map((l,a)=>{const s=i[a],c=O(s);return{...l,toggleOption:n=>F(a,n),selectOption:n=>S(a,n),selectedOptions:s??new Set,isFilterUsed:c}});return{filters:t.map(l=>{const a=t.findIndex(n=>n.property===l.parentFilter),s=i[a],c=l.parentFilter?O(s):!0;return{...l,parentUsed:c}}),filterQuery:o}},[p,i,F,S,o])}export{x as useCatalogFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as o,useMemo as h,useState as n}from"react";import{useSearchParams as m}from"react-router
|
|
1
|
+
import{useEffect as o,useMemo as h,useState as n}from"react";import{useSearchParams as m}from"react-router";import{debounce as S}from"../../../../utils/time/debounce";function l(){const[a,s]=m(),c=a.get("search")||"",[r,t]=n(c);o(()=>{const e=new URLSearchParams(a);r?e.set("search",r):e.delete("search"),s(e,{replace:!0})},[r,a,s]);const u=h(()=>S(e=>{t(e)},500),[t]);return{searchQuery:r,setSearchQuery:u}}export{l as useCatalogSearch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as c,useEffect as m,useState as p}from"react";import{useSearchParams as f}from"react-router
|
|
1
|
+
import{useCallback as c,useEffect as m,useState as p}from"react";import{useSearchParams as f}from"react-router";function O(l){const[s,a]=f(),u=s.get("sort")||null,[e,r]=p(u??l??null);m(()=>{const t=new URLSearchParams(s);e?t.set("sort",e):t.delete("sort"),a(t,{replace:!0})},[e,s,a]);const i=c((t,n)=>{const o=n==="desc"?t:`-${t}`;r(e===o?null:o)},[e,r]),S=c((t,n)=>{if(!t||!e)return!1;const o=n==="desc"?t:`-${t}`;return e===o},[e]);return{sortOption:e,setSortOption:r,handleSortClick:i,isColumnSorted:S}}export{O as useCatalogSort};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as c}from"react-router
|
|
1
|
+
import{useLocation as c}from"react-router";import{getPathnameForLocale as u,withoutPathPrefix as s}from"@redocly/theme/core/utils";import{addTrailingSlash as i}from"../../../../utils/url/add-trailing-slash.js";import{useL10nConfig as m}from"../useL10nConfig";import{useProducts as l}from"./useProducts";const x=()=>{const t=l(),o=c(),{locales:r,defaultLocale:e,currentLocale:n}=m();return t.find(a=>i(u(s(o.pathname),e,n,r)).startsWith(a.slug))};export{x as useCurrentProduct};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as s,useNavigate as p}from"react-router
|
|
1
|
+
import{useLocation as s,useNavigate as p}from"react-router";import{useEffect as u,useRef as l}from"react";import{useActiveSectionId as h}from"@redocly/theme/core/hooks";import{isBrowser as m}from"../../../utils/env/is-browser";import{pathnameMatchesActiveSection as f}from"./utils/pathname-matches-active-section.js";import{usePageData as d}from"./usePageData";let c=!0;function b(){const t=s(),o=p(),e=h(t,!1,!1),r=!!d("props")?.props?.disableAutoScroll,a=l(null);u(()=>{if(r){a.current=e;return}if(e&&c){c=!1,a.current=e;return}const n=a.current!==e,i=f(window.location.pathname,e);m()&&e&&!t.hash&&n&&!i&&o({pathname:t.pathname,search:t.search,hash:`#${e}`},{replace:!0}),a.current=e},[e,r,t.pathname,t.search,t.hash,o])}export{b as useAutoScroll};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as S,useMemo as c,useState as f}from"react";import{useLocation as A}from"react-router
|
|
1
|
+
import{useEffect as S,useMemo as c,useState as f}from"react";import{useLocation as A}from"react-router";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{usePageData as B}from"../../providers/page-data/hooks";import{getBannerForSlug as D,getNextBannerTransition as T,isBannerWithinTimeRange as h}from"./utils/match-banner-target.js";const u="redocly-dismissed-banners",x=2**31-1;function E(){if(typeof window>"u")return new Set;const n=localStorage.getItem(u);if(n){const a=JSON.parse(n);if(Array.isArray(a))return new Set(a)}return new Set}function C(){const{banner:n}=w()||{},t=B()?.props?.frontmatter?.banner,d=A(),[o,g]=f(E()),[s,p]=f(()=>Date.now()),i=d.pathname,m=c(()=>{const r=Array.isArray(n)?n:[],e=Array.isArray(t)?t:[];return[...r,...e]},[n,t]);return S(()=>{const r=T(m,s);if(r===void 0)return;const e=r-Date.now(),y=Math.min(Math.max(0,e),x),l=setTimeout(()=>p(Date.now()),y);return()=>clearTimeout(l)},[m,s]),{banner:c(()=>{const r=(Array.isArray(t)?t:[]).find(e=>!o.has(e.hash)&&h(e,s));if(r)return r;if(!(!n||!Array.isArray(n)||n.length===0))return D(n,i,o,s)},[n,t,i,o,s]),dismissBanner:r=>{const e=new Set(o);e.add(r),g(e),localStorage.setItem(u,JSON.stringify(Array.from(e)))}}}export{u as STORAGE_KEY,E as getDismissedBannersFromStorage,C as useBanner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as r}from"react";import{useLocation as l}from"react-router
|
|
1
|
+
import{useMemo as r}from"react";import{useLocation as l}from"react-router";import{getLocaleFromPathname as c,withoutPathPrefix as n}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as m}from"../../../constants/common";import{useGlobalData as s}from"../useGlobalData";const E=()=>{const a=l(),{l10n:o}=s(),t=r(()=>o?.locales||[],[o?.locales]),e=o?.defaultLocale||m;return{currentLocale:r(()=>c(n(a.pathname),e,t),[a,t,e]),defaultLocale:e,locales:t}};export{E as useL10nConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as u}from"react-router
|
|
1
|
+
import{useLocation as u}from"react-router";import{useThemeConfig as d}from"@redocly/theme/core/hooks";import{getPathnameForLocale as e}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as i}from"../../../constants/common";import{buildLoginUrl as p}from"../../../utils/auth/build-login-url";import{useL10nConfig as a}from"./useL10nConfig";function F(c={}){const f=d(),{auth:o}=f,{defaultLocale:n,locales:t,currentLocale:r}=a(),m=u().pathname,s=()=>{if(o?.idpsInfo?.length){if(o.idpsInfo.length===1){const l=o.idpsInfo[0];return p(l.idpId,e("",n,r,t),m,c)}return e(i,n,r,t)}};return o?.devLogin?e(i,n,r,t):s()}export{F as useLoginUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as r}from"react";import{useLocation as d}from"react-router
|
|
1
|
+
import{useEffect as r}from"react";import{useLocation as d}from"react-router";import{telemetry as s}from"../telemetry";const g=()=>{const t=d();r(()=>{const i=()=>{if(!e)return;const a=new Date().getTime()-e;s.sendPageTimeMessage([{id:`${window.origin}${t.pathname}`,object:"page",uri:`${window.origin}${t.pathname}`,durationMs:a}]),e=void 0},n=()=>{if(document.visibilityState==="visible"){e=e||new Date().getTime();return}i()},o=()=>{i()};let e=new Date().getTime();return document.addEventListener("visibilitychange",n),window.addEventListener("beforeunload",o),()=>{i(),window.removeEventListener("beforeunload",o),document.removeEventListener("visibilitychange",n)}},[t.pathname])};export{g as usePageTimeTracker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as f,useNavigate as d,useNavigationType as l}from"react-router
|
|
1
|
+
import{useLocation as f,useNavigate as d,useNavigationType as l}from"react-router";import{useEffect as v,useState as P}from"react";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{normalizeRouteSlug as E}from"../../../utils/path/normalize-route-slug";import{getBaseDataAttributes as M}from"@redocly/theme/core/utils";import{onRouteChange as y}from"../../runtime/generated/browser-plugins.js";import{resolveRouteBySlug as b}from"../utils/resolveRouteBySlug.js";import{usePageData as C}from"./usePageData.js";import{usePostMessage as R}from"../../providers/post-message/use-post-message.js";import{isInIframe as D}from"../../utils/utils.js";import{waitForContentScripts as I}from"../../ScriptLoader.js";import{telemetry as N}from"../telemetry/index.js";const _=()=>{const e=f(),r=d(),a=l(),n=C(),[t,i]=P(),m=w(),{sendMessage:h}=R();v(()=>{if(e?.pathname.endsWith("/")&&e?.pathname!=="/"){r({pathname:E(e.pathname),search:e.search,hash:e.hash},{replace:!0,state:e.state});return}I().then(()=>{if(e.pathname!==t?.pathname||e.search!==t.search){y({location:e,prevLocation:t},m);const o=`${window.origin}${e.pathname+e.search+e.hash}`,s=t?`${window.origin}${t.pathname+t.search+t.hash}`:void 0;N.sendPageViewedMessage([{...M(o,"page",o),referrer:s||document.referrer||void 0}])}});const p=!!t;i(e);const{pathname:c,hash:g,state:u}=e;(process.env.NODE_ENV==="development"||D())&&p&&b(c+g,n?.templateId).then(o=>{const s=a==="POP"?"browser":u?.origin;s&&h({type:"route-updated",origin:s,...o})}).catch(o=>console.log("Resolve route by slug failed with error: ",o.message))},[e,a])};export{_ as useRouteChangeTracker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"react";import{useLocation as g}from"react-router
|
|
1
|
+
import o from"react";import{useLocation as g}from"react-router";import{EmbeddedReplay as k,StoreProvider as I,buildReplayPredefinedEnvValues as P,mergeEnvData as b,useOpenApiDefinition as h,withReplayPrefetch as R,markdocParser as w}from"@redocly/api-docs";import{Admonition as V}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{ErrorMessage as C,OpenApiComponentWrap as D}from"../styled.elements.js";import{useStore as v}from"../../hooks/use-store.js";import{getMockServerDocsConfig as E}from"../../../../templates/openapi-docs/mock-server-config.js";import{buildReplayOperationSourceMap as $}from"../../utils/build-replay-operation-source-map.js";import{findApiItem as x}from"../../utils/find-api-item.js";const q=R(function({descriptionFile:p,operationId:r,pointer:n,exampleKey:a,mimeType:e,requestBody:u,parameters:c,environment:s,environments:i,hideOtherSecuritySchemes:d}){const f=g(),{store:t,baseSlug:S}=v(p),m=h(),O=o.useMemo(()=>{if(!m)return{};const M=E(t?.options?.mockServer,S??""),A=P(m,M);return b(A,i??{})},[m,t?.options?.mockServer,S,i]),y=o.useMemo(()=>t?.items?$(t.items,{pointer:n,sourceId:r},{mimeType:e,exampleKey:a},t.store?.exampleStore??{}):new Map,[t?.items,t?.store?.exampleStore,n,r,e,a]);return!m||!t?null:o.createElement(k,{key:`${f.pathname}-${p}-${r||n}`,activeOperationId:r,fullOpenApi:m,pointer:n,operationSourceMap:y,hideOtherSecuritySchemes:d,predefinedEnvValues:O,allowedEnvironments:s?[s]:void 0,requestValues:{body:u,...c},activeMimeName:e})}),J=l=>{const{descriptionFile:p,operationId:r,pointer:n,options:a}=l,{store:e,error:u,baseSlug:c}=v(p),s=o.useMemo(()=>({...e?.options,...a}),[a,e?.options]),i=o.useMemo(()=>e?.items?.length?x(e.items,{pointer:n,sourceId:r}):void 0,[e?.items,n,r]);if(!e)return o.createElement(C,null,u);if(!i?.content?.meta?.pointer)return o.createElement(V,{type:"danger"},"Cannot find OpenAPI operation by operationId or pointer in ",p);const d=i.content.meta.pointer,f=i.content.meta.sourceId??"";return o.createElement(D,{"data-testid":"replay-openapi"},o.createElement(I,{apiStore:e.store,options:{specType:"openapi",...s,mockServer:E(s.mockServer,c??""),basePath:c,markdownParser:w}},o.createElement(q,{...l,pointer:d,operationId:f})))};export{J as ReplayOpenApi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{useEffect as g,useState as s}from"react";import{useNavigate as h}from"react-router
|
|
1
|
+
import t,{useEffect as g,useState as s}from"react";import{useNavigate as h}from"react-router";import{Button as y}from"@redocly/theme/components/Button/Button";import{H3 as v}from"@redocly/theme/components/Typography/H3";import{H4 as S}from"@redocly/theme/components/Typography/H4";import{Admonition as w}from"@redocly/theme/components/Admonition/Admonition";import{getBaseDataAttributes as P,getPathnameForLocale as E,withPathPrefix as L}from"@redocly/theme/core/utils";import{ServerRoutes as b}from"../../../../constants/api";import{telemetry as k}from"../../telemetry/index.js";import{buildLoginUrl as O}from"../../../../utils/auth/build-login-url";import{usePageProps as T}from"../../../providers/page-data/hooks";import{Wrapper as C,HeadingSection as R}from"./styled";import{DevLoginForm as A}from"./DevLoginForm";import{useL10nConfig as F}from"../../hooks";async function x(r){try{const{status:o}=await fetch(L(b.AUTHORIZATION),{method:"POST",body:JSON.stringify(r)});return o}catch(o){console.error(o)}}function K(){const{defaultLocale:r,locales:o,currentLocale:c}=F(),l=h(),[a,d]=s({values:{teams:[],email:"example@example.com"}}),[i,u]=s();g(()=>{const e=new URLSearchParams(window.location.search);u(e.get("redirectTo")||void 0)},[]);const n=T(),m=n?.authIdps,p=(n.rbac?.teams||[]).filter(e=>e!=="*"),f=async()=>{await x(a.values)===200&&(l(i||"/"),window.location.reload())};return t.createElement(C,null,t.createElement(R,null,t.createElement(v,{"data-cy":"login-title"},"Dev-mode login"),t.createElement(w,{type:"warning",name:"This is dev mode login simulator."},"Any email works and password is not checked.")),t.createElement(t.Fragment,null,t.createElement(A,{teams:p,formState:a,setFormState:d,onSubmit:f}),Object.keys(m||{}).length>0&&t.createElement(S,null,"Use SSO:"),Object.values(m||{}).map(e=>t.createElement("div",{key:e.idpId},t.createElement(y,{fullWidth:!0,size:"large","data-cy":"idp-login",to:O(e.idpId,E("",r,c,o),i),onClick:()=>k.sendLoginProviderClickedMessage([{...P("loginProvider","button"),provider:e.type}])},e.title||e.type)))))}export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as h}from"react";import{useLocation as l}from"react-router
|
|
1
|
+
import{useMemo as h}from"react";import{useLocation as l}from"react-router";import{combineUrls as i,getPathnameForLocale as m,withPathPrefix as c,withoutPathPrefix as u}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as p}from"../../../../constants/common";import{useL10nConfig as L}from"../../hooks/useL10nConfig";function x(e){const n=l(),{locales:o,defaultLocale:t}=L();return h(()=>{if(!e)return{localeAlternates:[]};const f=u(n.pathname),a=o.filter(r=>r.code!==p).map(r=>({hrefLang:r.code.replaceAll("_","-"),href:i(e,c(m(f,t,r.code,o)))}));return a.length>0&&a.push({hrefLang:"x-default",href:i(e,c(m(f,t,t,o)))}),{localeAlternates:a}},[t,o,n.pathname,e])}export{x as useHreflangLinks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as s,useState as a}from"react";import{useLocation as f}from"react-router
|
|
1
|
+
import{useEffect as s,useState as a}from"react";import{useLocation as f}from"react-router";function u(t=!1){const o=f(),[n,e]=a(t);return s(()=>e(!1),[o.pathname]),[n,e]}export{u as useMobileMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as s,useCallback as n}from"react";import{useLocation as r,useNavigate as i}from"react-router
|
|
1
|
+
import{useMemo as s,useCallback as n}from"react";import{useLocation as r,useNavigate as i}from"react-router";function m(){const o=i(),a=n(async e=>{await window.__LOADER.load(e),await o(e)},[o]),t=r();return s(()=>({push:a,location:t}),[t,a])}export{m as usePreloadHistory};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NavigateFunction, NavigateOptions } from 'react-router
|
|
1
|
+
import type { NavigateFunction, NavigateOptions } from 'react-router';
|
|
2
2
|
export type HistoryOrigin = 'pm' | 'browser';
|
|
3
3
|
export declare function loadAndNavigate({ navigate, to, origin, options, }: {
|
|
4
4
|
navigate: NavigateFunction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{telemetry as p}from"./app/telemetry/index.js";p.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${P}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(e(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!_});import o from"react";import{hydrateRoot as s}from"react-dom/client";import{
|
|
1
|
+
import{telemetry as p}from"./app/telemetry/index.js";p.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${P}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(e(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!_});import o from"react";import{hydrateRoot as s}from"react-dom/client";import{createBrowserRouter as m}from"react-router";import{RouterProvider as d}from"react-router/dom";import{HelmetProvider as f}from"@dr.pogodin/react-helmet";import{StyleSheetManager as E}from"styled-components";import{getLocaleFromPathname as u,withoutPathPrefix as R,withPathPrefix as e}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../constants/api";import{DEFAULT_LOCALE_PLACEHOLDER as O}from"../constants/common";import{CLIENT_TELEMETRY_ENABLED as _}from"./constants/common.js";import{shouldForwardProp as D}from"../utils/should-forward-prop.js";import"./polyfills";import{PACKAGE_NAME as P,PRODUCT_NAME as h}from"../config/product-gates";import{App as g,routes as A}from"./App";import{Loader as x,useRefresh as N,globalData as t}from"./runtime/loader";import{initL10n as b}from"./app/l10n/initL10n";function v(){return N(),o.createElement(f,{context:{}},o.createElement(E,{shouldForwardProp:D},o.createElement(g,null)))}function T(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
|
|
2
2
|
%c Version: ${process.env.REDOCLY_PORTAL_VERSION} %c
|
|
3
3
|
`,"background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 3px; color: #0044D4","background:transparent"):process.env.REDOCLY_PORTAL_VERSION&&console.log(`
|
|
4
4
|
%c Redocly ${h} %c ${process.env.REDOCLY_PORTAL_VERSION} %c
|
|
5
5
|
|
|
6
6
|
%chttps://redocly.com
|
|
7
|
-
`,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await x.load(window.location.pathname,void 0,window.location.search),T();const r=t?.l10n,n=r?.locales||[],i=r?.defaultLocale||O,a=u(R(location.pathname),i,n);await b(r,a);const c=
|
|
7
|
+
`,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await x.load(window.location.pathname,void 0,window.location.search),T();const r=t?.l10n,n=r?.locales||[],i=r?.defaultLocale||O,a=u(R(location.pathname),i,n);await b(r,a);const c=m([{Component:v,path:e("/*"),children:A}]);s(document.getElementById("app_root"),o.createElement(d,{router:c}))}C();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './page-data/hooks.js';
|
|
2
2
|
/**
|
|
3
3
|
* Catches click events on <a /> elements and if it's a local link,
|
|
4
|
-
* uses react-router
|
|
4
|
+
* uses react-router to navigate
|
|
5
5
|
* @returns ref used to identify the root object
|
|
6
6
|
*/
|
|
7
7
|
export declare function useRouterForLocalLinks(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as c,useState as s}from"react";import{useNavigate as l}from"react-router
|
|
1
|
+
import{useEffect as c,useState as s}from"react";import{useNavigate as l}from"react-router";import{isLocalLink as u}from"../../utils/path/is-local-link.js";import{isJsProtocolLink as a}from"../../utils/path/is-js-protocol-link.js";import{isAssetsLink as m}from"../../utils/path/is-assets-link.js";import{isHostnameOnDomain as f}from"../app/utils/isHostnameOnDomain.js";import{loadAndNavigate as d}from"../app/utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as p}from"../utils/utils.js";export*from"./page-data/hooks.js";function E(){const o=l();c(()=>{const r=t=>{if(t.defaultPrevented)return;const i=t.target;if(i.tagName!=="A"||p(t,i.getAttribute("target")||""))return;const n=i.getAttribute("href");!u(n)||m(n)||a(n)||(t.preventDefault(),d({navigate:o,to:n||""}))};return document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}},[o])}function b(){const[o,r]=s(null);return c(()=>{if(process.env.NODE_ENV==="development"&&typeof window<"u"&&!e("localhost")&&!e("127.0.0.1")&&!e("")&&!e("redocly-local.com")&&!e("editor.redocly.xyz")&&!e("apps.codespaces.githubusercontent.com")&&!e("blueharvest.cloud")&&!e("bhstage.cloud")&&!e("cloud.redocly.com")&&!e("cloud.eu.redocly.com")&&!e("cba.au.redocly.com"))return r("Development mode is only allowed in localhost")},[typeof window]),o}function e(o){return f(window.location.hostname,o)}export{E as useRouterForLocalLinks,b as useRunningEnvironmentCheck};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i,{useContext as a}from"react";import{useLocation as p}from"react-router
|
|
1
|
+
import i,{useContext as a}from"react";import{useLocation as p}from"react-router";import{removeLeadingSlash as m,removeTrailingSlash as f}from"@redocly/theme/core/utils";import{findDeepFirst as g}from"../../../utils/tree/find-deep-first.js";import{getSiblingPages as y}from"../../utils";import{PageDataContext as s}from"./PageDataContext.js";import{Loader as b}from"../../runtime/loader";import{useRawSidebarItems as v}from"../../app/Sidebar/useSidebarItems";import{usePageSharedData as u}from"./use-page-shared-data";export*from"./use-page-shared-data";function d(){return a(s)}function F(){return a(s)?.props||{}}function C(){const t=k(),{versions:n=[]}=a(s)||{};return{versions:i.useMemo(()=>n.map(e=>{const r=!!g(t,o=>o.version===e.version&&typeof o.link=="string"&&m(f(o.link))===m(f(e.link))),l=g(t,o=>o.version===e.version&&!!o.link);return{...e,link:(r?e.link:l?.link)||e.link}}),[n,t])}}function k(){const t=u("sidebar")?.items;return i.useMemo(()=>t||[],[t])}function R(){const t=u("sidebar")?.catalogEntity,n=d()?.props.entity;return t?{key:t.key,version:t.version}:n?.key?{key:n.key,version:n.version}:void 0}function w(){const t=u("sidebar")?.catalogEntity;return d()?.props?.catalogConfig||t?.catalogConfig}function T(){const t=p(),{versions:n=[]}=C()||{},c=n.find(r=>r?.active),e=v(c);return i.useMemo(()=>{if(e)return y(e,t.pathname)},[t.pathname,e])}function V(){const t=p();return b.loadSync(t.pathname)}export{d as usePageData,V as usePageDataLoader,F as usePageProps,C as usePageVersions,w as useSidebarConnectedCatalogConfig,R as useSidebarConnectedCatalogEntity,k as useSidebarItemsData,T as useSidebarSiblingsData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n,{createContext as v,useEffect as P}from"react";import{useLocation as S,useNavigate as C}from"react-router
|
|
1
|
+
import n,{createContext as v,useEffect as P}from"react";import{useLocation as S,useNavigate as C}from"react-router";import{useColorSwitcher as M}from"@redocly/theme/core/hooks";import{withPathPrefix as E}from"@redocly/theme/core/utils";import{ServerRoutes as U}from"../../../constants/api";import{removeTrailingSlash as L}from"../../../utils/url/remove-trailing-slash";import{loadAndNavigate as x}from"../../app/utils/loadAndNavigate";import{resolveRouteBySlug as O}from"../../app/utils/resolveRouteBySlug";import{isSameResolvedRoute as T}from"../../app/utils/same-resolved-route";import{syncScrollWithEditor as D}from"../../app/utils/syncScrollWithEditor";import{PostMessageConnection as I}from"./PostMessageConnection";import{isHostnameOnDomain as c}from"../../app/utils/isHostnameOnDomain";import{usePageData as N}from"../../app/hooks/usePageData";const z=v({sendMessage:()=>{}});function Z({children:l,enabled:t}){const R=C(),i=S(),s=n.useRef(null),{switchColorMode:h}=M(),p=N()?.templateId,u=n.useCallback(e=>{s.current?.send(e)},[]),f=n.useCallback(async e=>{console.info("[PM] connection initialized."),s.current=new I(e.source,e.origin);const a=await O(i.pathname+i.hash,p).catch(o=>{console.error("Initial route resolve failed with error: ",o.message)});u({type:"initialized",initialRoute:a})},[u,i.pathname,i.hash,p]),w=n.useCallback(async e=>{const{path:a="/",line:o=1,url:d}=e;let r=d;if(!d)try{const m=await fetch(E(U.RESOLVE_ROUTE_BY_PATH),{method:"POST",body:JSON.stringify(a+(o?`:${o}`:""))}),{route:y}=await m.json();r=y?.slug??y?.url??void 0}catch(m){console.error(m)}if(!r)return;r=r==="/"?"/":L(r),T(r,i,!!d)||(console.info("[PM] Update route to: ",r),await x({navigate:R,to:r,origin:"pm"}))},[i]),g=n.useCallback(async e=>{const{action:a}=e;switch(a){case"back":window.history.back();break;case"forward":window.history.forward();break;case"reload":window.location.reload();break}},[]),b=n.useCallback(e=>{window.scrollTo({top:e.position.absolute,behavior:"instant"})},[]),k=n.useCallback(e=>{h(e.colorSchema)},[h]);return P(()=>{if(!t)return;const e=async a=>{if(!A(a.origin))return;const o=a.data;switch(o.type){case"initialize":f(a);break;case"route-update":if(!s.current)return;w(o);break;case"location-update":if(!s.current)return;g(o);break;case"scroll-update":if(!s.current)return;b(o);break;case"editor-scroll-update":if(!s.current)return;D(o.percentScrolled,o.sequenceNumber);break;case"color-schema-update":if(!s.current)return;k(o);break}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t,f,w,g,b,k]),n.createElement(z.Provider,{value:{sendMessage:u}},l)}function A(l){const t=new URL(l);return c(t.hostname,"localhost")||c(t.hostname,"127.0.0.1")||c(t.hostname,"blueharvest.cloud")||c(t.hostname,"bhstage.cloud")||c(t.hostname,"cloud.redocly.com")||c(t.hostname,"cloud.eu.redocly.com")||c(t.hostname,"cba.au.redocly.com")}export{z as PostMessageContext,Z as PostMessageProvider};
|
package/dist/constants/api.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare const ServerRoutes: {
|
|
|
33
33
|
readonly OTEL_TRACES: '/_otel/v1/traces';
|
|
34
34
|
readonly HEALTH: '/_health';
|
|
35
35
|
readonly ASK_AI: '/_ask-ai';
|
|
36
|
+
readonly AI_ASSISTANT_ESCALATIONS: '/_ai-assistant-escalations';
|
|
36
37
|
readonly CATALOG_ENTITIES: "/catalog-entities/:entityId?";
|
|
37
38
|
readonly CATALOG_ENTITIES_RELATIONS: "/catalog-entities-relations/:entityRelationId?";
|
|
38
39
|
readonly BFF_CATALOG_ENTITIES: "/bff/catalog-entities/:entityKey?";
|
package/dist/constants/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _="_auth",e="entityKey",t="entityId",A="entityRelationId",T={CORS_PROXY:"/_api/cors",INFO:"/_info",EJECT_COMPONENT:"/eject-component/:componentName",SHARED_PAGE_DATA:"/page-data/shared/*",PAGE_DATA:"/page-data/*",APP_DATA:"/app-data.json",AUTHORIZATION:"/authorize",OIDC_CALLBACK:`/${_}/oidc`,SAML_CALLBACK:`/${_}/saml2`,REDOCLY_CALLBACK:`/${_}/redocly`,REPLAY_OAUTH2_CALLBACK:`/${_}/replay-oauth2`,REDOCLY_LOGIN_CALLBACK:`/${_}/redocly/redocly-login`,REDOCLY_TOKEN_LOGIN:`/${_}/redocly-token-login`,SEARCH:"/_search",SEARCH_FACETS:"/_search-facets",SEMANTIC_SEARCH:"/_semantic-search",LOGOUT:"/logout",POST_LOGOUT:"/post-logout",LOGIN:"/login",IDP_LOGIN:`/${_}/idp-login`,INVITE:"/invite/:code",RESOLVE_ROUTE_BY_PATH:"/resolve-route-by-path",RESOLVE_ROUTES_BY_PATHS:"/resolve-routes-by-paths",RESOLVE_ROUTE_BY_SLUG:"/resolve-route-by-slug",GET_ROUTES_BY_LINE:"/get-routes-by-line",FEEDBACK:"/feedback",TELEMETRY:"/_events",OTEL_TRACES:"/_otel/v1/traces",HEALTH:"/_health",ASK_AI:"/_ask-ai",AI_ASSISTANT_ESCALATIONS:"/_ai-assistant-escalations",CATALOG_ENTITIES:`/catalog-entities/:${t}?`,CATALOG_ENTITIES_RELATIONS:`/catalog-entities-relations/:${A}?`,BFF_CATALOG_ENTITIES:`/bff/catalog-entities/:${e}?`,BFF_CATALOG_RELATED_ENTITIES:`/bff/catalog-related-entities/:${e}`,BFF_CATALOG_REVISIONS:"/bff/catalog-revisions",MCP_OAUTH_AUTHORIZATION_SERVER:"/.well-known/oauth-authorization-server",MCP_OAUTH_PROTECTED_RESOURCE:"/.well-known/oauth-protected-resource",MCP_DYNAMIC_CLIENT_REGISTRATION:"/_mcp/register",MCP_AUTHORIZATION:"/_mcp/oauth2/auth",MCP_TOKEN_PORTAL:"/_mcp/oauth2/token-portal",MCP_CALLBACK:"/_mcp/oauth/callback",SCORECARDS:"/scorecards"};export{_ as AUTH_SEGMENT,t as CATALOG_ENTITY_ID,e as CATALOG_ENTITY_KEY,A as CATALOG_ENTITY_RELATION_ID,T as ServerRoutes};
|
|
@@ -31,6 +31,7 @@ export declare const BH_API_PROJECTS_URL_V2: string | undefined;
|
|
|
31
31
|
export declare const ENTITLEMENTS_JWKS_URL: string;
|
|
32
32
|
export declare const FEEDBACK_API_URL: string;
|
|
33
33
|
export declare const ASK_AI_API_URL: string;
|
|
34
|
+
export declare const AI_ASSISTANT_ESCALATIONS_API_URL: string;
|
|
34
35
|
export declare const SEMANTIC_SEARCH_API_URL: string;
|
|
35
36
|
export declare const CACHE_CONTROL_NO_STORE_HEADER_VALUE = "no-store";
|
|
36
37
|
export declare const DEFAULT_IMMUTABLE_CACHE_MAX_AGE: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ServerRoutes as I}from"../../constants/api.js";import{USER_THEME_ALIAS as
|
|
1
|
+
import{ServerRoutes as I}from"../../constants/api.js";import{USER_THEME_ALIAS as L}from"../../constants/common.js";import{envConfig as _}from"../config/env-config.js";const N="runtime",x="/assets",U="/_spec",a="/_bundle",M="static",P="redocly:::linkOriginal",l="@",i="default",m=new RegExp("((?!@i18n\\/|@l10n\\/)\\/?@.*?(?=\\/))","g"),F="@redocly/theme/plugin.js",H="styles.css",u=["@theme/plugin.js","@theme/plugin.cjs","@theme/plugin.mjs"],d=_.JWT_SECRET_KEY||"test_secret_key",G=3600,K=1440*60,c="@i18n",S="@l10n",Y=[L,c,S],B="https://redocly.com/auth/aud",g="catalog.json",h="scorecard.json",J="page-count.json",W="sitemap.xml",f="llms.txt",o=_.PROJECT_ID,R=_.PROJECT_SLUG,e=_.ORGANIZATION_ID,n=_.ORG_SLUG,E=_.BH_API_URL,s=E&&n&&R?`${E}/orgs/${n}/projects/${R}`:void 0,t=E&&e&&o?`${E}/orgs/${e}/projects/${o}`:void 0,p=E?`${E}/entitlements/.well-known/jwks`:"https://app.cloud.redocly.com/api/entitlements/.well-known/jwks",j=_.ENTITLEMENTS_JWKS_CDN_URL||p,k=s?`${s}/feedback`:"",w=t?`${t}/ai-agentic-conversations`:"",$=t?`${t}/ai-assistant-escalations`:"",V=t?`${t}/semantic-search`:"",X="no-store",v=365*24*60*60,y="X-Redocly-Cache-Control",b="no-cache",Z="public, s-maxage=86400, max-age=10, must-revalidate",q=_.AUTH_URL,z="Developer Documentation",T=_.REDOCLY_SSR_RENDER_MODE==="worker"?"worker":"main",Q=T==="main"?0:_.REDOCLY_SSR_WORKERS_MIN!=null?Number(_.REDOCLY_SSR_WORKERS_MIN):2,__=T==="main"?1:_.REDOCLY_SSR_WORKERS_MAX!=null?Number(_.REDOCLY_SSR_WORKERS_MAX):5,E_="-----BEGIN CERTIFICATE-----",t_="-----END CERTIFICATE-----",o_=!_.isDevelopMode&&_.REDOCLY_TELEMETRY!=="off"||_.REDOCLY_TELEMETRY==="on",R_="http://localhost:4318/v1/traces",e_=[I.HEALTH],A=_.SERVER_EDITOR_APP_URL||"http://127.0.0.1:3000",n_=_.REDOCLY_CORS_ORIGINS?_.REDOCLY_CORS_ORIGINS.split(",").map(r=>r.trim()).filter(Boolean).concat(A):[A],s_="markdown/partials",T_="markdown/partials-deps";export{$ as AI_ASSISTANT_ESCALATIONS_API_URL,n_ as ALLOWED_CORS_ORIGINS,B as ALTERNATIVE_AUD_CLAIM_NAME,w as ASK_AI_API_URL,q as AUTH_URL,E_ as BEGIN_CERTIFICATE_DELIMITER,s as BH_API_PROJECTS_URL,t as BH_API_PROJECTS_URL_V2,X as CACHE_CONTROL_NO_STORE_HEADER_VALUE,b as CACHE_CONTROL_PUBLIC_HTML,g as CATALOG_OUTPUT_FILE_NAME,v as DEFAULT_IMMUTABLE_CACHE_MAX_AGE,u as DEFAULT_PROJECT_PLUGIN_PATHS,F as DEFAULT_THEME_PLUGIN_PATH,z as DEFAULT_TITLE,i as DEFAULT_VERSION_NAME,U as DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER,t_ as END_CERTIFICATE_DELIMITER,j as ENTITLEMENTS_JWKS_URL,k as FEEDBACK_API_URL,c as I18N_DIR_NAME,d as JWT_SECRET_KEY,S as L10N_DIR_NAME,P as LINK_ORIGINAL_ATTR_NAME,f as LLMS_TXT_FILE_NAME,s_ as MARKDOC_PARTIALS_DATA_KEY,T_ as MARKDOC_PARTIALS_DEPS_KEY,G as MCP_ACCESS_TOKEN_TTL_SEC,K as MCP_REFRESH_SESSION_LIFETIME_SEC,e as ORG_ID,n as ORG_SLUG,e_ as OTEL_EXCLUDED_ROUTES,R_ as OTEL_TRACES_DEV_URL,J as PAGE_COUNT_OUTPUT_FILE_NAME,o as PROJECT_ID,R as PROJECT_SLUG,a as PUBLIC_API_DEFINITIONS_FOLDER,x as PUBLIC_ASSETS_FOLDER,M as PUBLIC_STATIC_FOLDER,Y as RESERVED_DIR_NAMES,N as RUNTIME_RESOURCES_DIR,h as SCORECARD_OUTPUT_FILE_NAME,V as SEMANTIC_SEARCH_API_URL,A as SERVER_EDITOR_APP_URL,W as SITEMAP_FILE_NAME,T as SSR_RENDER_MODE,__ as SSR_WORKERS_MAX,Q as SSR_WORKERS_MIN,H as STYLES_FILE,o_ as TELEMETRY_ENABLED,m as VERSIONED_FOLDER_REGEXP_MATCH,l as VERSION_SEPARATOR,y as X_REDOCLY_CACHE_CONTROL_HEADER,Z as X_REDOCLY_CACHE_CONTROL_PUBLIC_HTML};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{context as m}from"esbuild";import{mkdirSync as M,writeFileSync as Y,existsSync as k}from"node:fs";import*as a from"node:path";import{RUNTIME_RESOURCES_DIR as V,TELEMETRY_ENABLED as $}from"../constants/common.js";import{fromCurrentDir as r}from"../utils/paths.js";import{NodeBrowserPlugin as P}from"./plugins/node-browser.js";import{PortalImport as l}from"./plugins/portal-import.js";import{ThemesResolver as u}from"./plugins/themes-resolver.js";import{AssetsResolver as E}from"./plugins/assets-resolver.js";import{EsbuildErrorCollector as d}from"./plugins/esbuild-compile-resolver.js";import{OpenapiDocsModuleReplacer as R}from"./plugins/openapi-docs-module-replacer/index.js";import{ApiDocsModuleReplacer as _}from"./plugins/api-docs-module-replacer/index.js";import{ServerPropsResolver as f}from"./plugins/server-props-resolver.js";import{StyledComponentsSSR as v}from"./plugins/styled-components-ssr.js";import{DependencyResolver as D}from"./plugins/dependency-resolver.js";import{YamlLoader as N}from"./plugins/yaml-loader.js";import{ApiRequestHandlersResolver as S}from"./plugins/api-request-handlers-resolver.js";import{McpToolHandlersResolver as T}from"./plugins/mcp-tool-handlers-resolver.js";import{MiddlewareResolver as I}from"./plugins/middleware-resolver.js";import{OnRebuild as L}from"./plugins/on-rebuild.js";import{getPublicEnvVariables as q}from"../utils/envs/get-public-env-variables.js";import{PORTAL_VERSION as w}from"../version.js";import{AsyncApiPatch as y}from"./plugins/async-api-patch.js";import{telemetryTraceStep as g}from"../../cli/telemetry/helpers/trace-step.js";import{initServerRebuildTrigger as x}from"./generate.js";const O={bundle:!0,format:"esm",chunkNames:"chunks/[name]-[hash]"};function C(e){const o=a.join(e,"tsconfig.json");return k(o)?o:void 0}const c=new Set;async function ue(){await Promise.all([...c].map(e=>e.dispose())),c.clear()}async function Ee(e,o,t="production",n){return await g("com.redocly.build.createClientCompiler",async()=>{const p=q(),i={};Object.entries(p).map(([j,b])=>i[`process.env.${j}`]=JSON.stringify(b));const s=[...n?[L(n)]:[],P({path:"path-browserify",fs:"{}",tty:"tty-browserify",os:"os-browserify",http:"stream-http",https:"stream-http",readline:"{}",crypto:"{}",stream:"{}",zlib:"{}","https-proxy-agent":"{}"}),u(e,e.contentDir),E(e,e.contentDir),d(e,e.contentDir),f(e),D(),l(),N(),y(),v(),R(),_()],h=[r(import.meta.url,"../../client/browser-entry.js"),r(import.meta.url,"../../client/user-tags-entry.js")],A=await m({...O,entryPoints:h,outdir:a.join(o,V),sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",plugins:s,tsconfig:C(e.contentDir),mainFields:["browser","module","main"],metafile:t!=="production",minify:t==="production",splitting:!0,external:["constants","zlib","stream","https","vm","module","worker_threads","child_process","@swc/core"],inject:[process.env.INSPECT_MODE==="true"?r(import.meta.url,"../../client/inspect-mode-hooks.js"):"",r(import.meta.url,"./web-shim.js")].filter(Boolean),define:{...i,"process.env.NODE_ENV":`"${t}"`,...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"process.env.SERVER_EDITOR_APP_URL":`"${process.env.SERVER_EDITOR_APP_URL}"`,"process.env.ENABLE_COMMENTS":`"${process.env.ENABLE_COMMENTS}"`,"process.env.REDOCLY_TELEMETRY":$?'"on"':'"off"',"process.env.REDOCLY_PORTAL_VERSION":`"${w}"`,"process.env":`{"NODE_ENV": "${t}"}`,"process.platform":'"browser"',"process.browser":"true","module.hot":"false",global:"{}",...process.env.REDOCLY_PREFIX_PATHS&&{"process.env.REDOCLY_PREFIX_PATHS":`"${process.env.REDOCLY_PREFIX_PATHS}"`},...process.env.INSPECT_MODE==="true"&&{"process.env.INSPECT_MODE":`${process.env.INSPECT_MODE}`},...process.env.MAIN_API_URL&&{"process.env.MAIN_API_URL":`"${process.env.MAIN_API_URL}"`}},logLevel:"silent"});return c.add(A),A})}async function de(e,o,t="development",n){M(o,{recursive:!0}),x(o),Y(a.join(o,"package.json"),JSON.stringify({name:"@redocly/portal/server-cache",type:"module"}));const p=[...n?[L(n)]:[],u(e,e.contentDir),E(e,e.contentDir),d(e,e.contentDir),f(e),S(e),T(e),I(e),D(),l(),N(),y(),v(),R(),_()],i=[{in:r(import.meta.url,"../../client/server-entry.js"),out:"server-entry"},{in:r(import.meta.url,"../../client/user-tags-entry.js"),out:"user-tags-entry"},{in:r(import.meta.url,"../../client/server-props-entry.js"),out:"server-props-entry"},{in:r(import.meta.url,"../../client/api-request-handlers-entry.js"),out:"api-request-handlers-entry"},{in:r(import.meta.url,"../../client/api-docs-builder-entry.js"),out:"api-docs-builder-entry"},{in:r(import.meta.url,"../workers/mcp-tool-worker.js"),out:"mcp-tool-worker"},{in:r(import.meta.url,"../../client/middleware-entry.js"),out:"middleware-entry"}],s=await m({...O,entryPoints:i,outdir:o,plugins:p,sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",minify:t==="production",tsconfig:C(e.contentDir),mainFields:["module","main"],splitting:!0,external:["react","react-router
|
|
1
|
+
import{context as m}from"esbuild";import{mkdirSync as M,writeFileSync as Y,existsSync as k}from"node:fs";import*as a from"node:path";import{RUNTIME_RESOURCES_DIR as V,TELEMETRY_ENABLED as $}from"../constants/common.js";import{fromCurrentDir as r}from"../utils/paths.js";import{NodeBrowserPlugin as P}from"./plugins/node-browser.js";import{PortalImport as l}from"./plugins/portal-import.js";import{ThemesResolver as u}from"./plugins/themes-resolver.js";import{AssetsResolver as E}from"./plugins/assets-resolver.js";import{EsbuildErrorCollector as d}from"./plugins/esbuild-compile-resolver.js";import{OpenapiDocsModuleReplacer as R}from"./plugins/openapi-docs-module-replacer/index.js";import{ApiDocsModuleReplacer as _}from"./plugins/api-docs-module-replacer/index.js";import{ServerPropsResolver as f}from"./plugins/server-props-resolver.js";import{StyledComponentsSSR as v}from"./plugins/styled-components-ssr.js";import{DependencyResolver as D}from"./plugins/dependency-resolver.js";import{YamlLoader as N}from"./plugins/yaml-loader.js";import{ApiRequestHandlersResolver as S}from"./plugins/api-request-handlers-resolver.js";import{McpToolHandlersResolver as T}from"./plugins/mcp-tool-handlers-resolver.js";import{MiddlewareResolver as I}from"./plugins/middleware-resolver.js";import{OnRebuild as L}from"./plugins/on-rebuild.js";import{getPublicEnvVariables as q}from"../utils/envs/get-public-env-variables.js";import{PORTAL_VERSION as w}from"../version.js";import{AsyncApiPatch as y}from"./plugins/async-api-patch.js";import{telemetryTraceStep as g}from"../../cli/telemetry/helpers/trace-step.js";import{initServerRebuildTrigger as x}from"./generate.js";const O={bundle:!0,format:"esm",chunkNames:"chunks/[name]-[hash]"};function C(e){const o=a.join(e,"tsconfig.json");return k(o)?o:void 0}const c=new Set;async function ue(){await Promise.all([...c].map(e=>e.dispose())),c.clear()}async function Ee(e,o,t="production",n){return await g("com.redocly.build.createClientCompiler",async()=>{const p=q(),i={};Object.entries(p).map(([j,b])=>i[`process.env.${j}`]=JSON.stringify(b));const s=[...n?[L(n)]:[],P({path:"path-browserify",fs:"{}",tty:"tty-browserify",os:"os-browserify",http:"stream-http",https:"stream-http",readline:"{}",crypto:"{}",stream:"{}",zlib:"{}","https-proxy-agent":"{}"}),u(e,e.contentDir),E(e,e.contentDir),d(e,e.contentDir),f(e),D(),l(),N(),y(),v(),R(),_()],h=[r(import.meta.url,"../../client/browser-entry.js"),r(import.meta.url,"../../client/user-tags-entry.js")],A=await m({...O,entryPoints:h,outdir:a.join(o,V),sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",plugins:s,tsconfig:C(e.contentDir),mainFields:["browser","module","main"],metafile:t!=="production",minify:t==="production",splitting:!0,external:["constants","zlib","stream","https","vm","module","worker_threads","child_process","@swc/core"],inject:[process.env.INSPECT_MODE==="true"?r(import.meta.url,"../../client/inspect-mode-hooks.js"):"",r(import.meta.url,"./web-shim.js")].filter(Boolean),define:{...i,"process.env.NODE_ENV":`"${t}"`,...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"process.env.SERVER_EDITOR_APP_URL":`"${process.env.SERVER_EDITOR_APP_URL}"`,"process.env.ENABLE_COMMENTS":`"${process.env.ENABLE_COMMENTS}"`,"process.env.REDOCLY_TELEMETRY":$?'"on"':'"off"',"process.env.REDOCLY_PORTAL_VERSION":`"${w}"`,"process.env":`{"NODE_ENV": "${t}"}`,"process.platform":'"browser"',"process.browser":"true","module.hot":"false",global:"{}",...process.env.REDOCLY_PREFIX_PATHS&&{"process.env.REDOCLY_PREFIX_PATHS":`"${process.env.REDOCLY_PREFIX_PATHS}"`},...process.env.INSPECT_MODE==="true"&&{"process.env.INSPECT_MODE":`${process.env.INSPECT_MODE}`},...process.env.MAIN_API_URL&&{"process.env.MAIN_API_URL":`"${process.env.MAIN_API_URL}"`}},logLevel:"silent"});return c.add(A),A})}async function de(e,o,t="development",n){M(o,{recursive:!0}),x(o),Y(a.join(o,"package.json"),JSON.stringify({name:"@redocly/portal/server-cache",type:"module"}));const p=[...n?[L(n)]:[],u(e,e.contentDir),E(e,e.contentDir),d(e,e.contentDir),f(e),S(e),T(e),I(e),D(),l(),N(),y(),v(),R(),_()],i=[{in:r(import.meta.url,"../../client/server-entry.js"),out:"server-entry"},{in:r(import.meta.url,"../../client/user-tags-entry.js"),out:"user-tags-entry"},{in:r(import.meta.url,"../../client/server-props-entry.js"),out:"server-props-entry"},{in:r(import.meta.url,"../../client/api-request-handlers-entry.js"),out:"api-request-handlers-entry"},{in:r(import.meta.url,"../../client/api-docs-builder-entry.js"),out:"api-docs-builder-entry"},{in:r(import.meta.url,"../workers/mcp-tool-worker.js"),out:"mcp-tool-worker"},{in:r(import.meta.url,"../../client/middleware-entry.js"),out:"middleware-entry"}],s=await m({...O,entryPoints:i,outdir:o,plugins:p,sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",minify:t==="production",tsconfig:C(e.contentDir),mainFields:["module","main"],splitting:!0,external:["react","react-router","@dr.pogodin/react-helmet","@swc/core","pnpapi","canvas"],banner:{js:`import { createRequire as topLevelCreateRequire } from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);`},platform:"node",define:{"process.env.NODE_ENV":`"${t}"`,...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"module.hot":"false"},logLevel:"silent"});return c.add(s),s}async function Re(e,o,t="production",n){return await g("com.redocly.build.createServerCompiler",async()=>{const p=[...n?[L(n)]:[],P({"node-fetch":"{}",webpack:"{}",swagger2openapi:"{}"}),u(e,e.contentDir),E(e,e.contentDir),d(e,e.contentDir),f(e),S(e),T(e),I(e),D(),l(),N(),y(),v(),R(),_()],i=[{in:r(import.meta.url,"../node-bundle-entry.js"),out:"index"},{in:r(import.meta.url,"../../client/user-tags-entry.js"),out:"user-tags-entry"},{in:r(import.meta.url,"../../client/api-docs-builder-entry.js"),out:"api-docs-builder-entry"},{in:r(import.meta.url,"../workers/api-routes-worker.js"),out:"api-routes-worker"},{in:r(import.meta.url,"../workers/scorecards-worker.js"),out:"scorecards-worker"},{in:r(import.meta.url,"../workers/mcp-tool-worker.js"),out:"mcp-tool-worker"}],s=await m({...O,entryPoints:i,outExtension:{".js":".mjs"},outdir:o,platform:"node",plugins:p,tsconfig:C(e.contentDir),mainFields:["module","main"],metafile:t!=="production",minify:t==="production",splitting:!1,define:{"process.env.NODE_ENV":`"${t}"`,...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"process.env.REDOCLY_EXECUTION_MODE":'"runtime"',"process.env.REDOCLY_PORTAL_VERSION":`"${w}"`,"module.hot":"false",...process.env.REDOCLY_PREFIX_PATHS&&{"process.env.REDOCLY_PREFIX_PATHS":`"${process.env.REDOCLY_PREFIX_PATHS}"`}},banner:{js:`import { createRequire as topLevelCreateRequire } from 'module';
|
|
3
3
|
const require = topLevelCreateRequire(import.meta.url);`},logLevel:"silent"});return c.add(s),s})}export{Ee as createClientCompiler,Re as createNodeBundleCompiler,de as createServerCompiler,ue as stopAllCompilers};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import*as c from"node:path";import{CONFIG_FILE_NAME as
|
|
2
|
-
`),loader:"css",resolveDir:
|
|
1
|
+
import*as c from"node:path";import{CONFIG_FILE_NAME as x}from"../../../constants/common.js";import{DEFAULT_THEME_NAME as $,USER_THEME_ALIAS as y}from"../../../constants/common.js";import{isDefined as g}from"../../../utils/guards/is-defined.js";import{slash as D}from"../../../utils/path/slash.js";import{resolveExternalPlugins as p}from"../../external-plugins/resolve-external-plugins.js";import{generateMarkdocComponentsEntry as L,generateMarkdocSchemasEntry as M}from"./codegen/index.js";const d=new Map,N=(a,o)=>{const h=c.resolve(o,y),i=c.resolve(o,x),k=["components","core","layouts","markdoc","icons","config","ext"],R="@redocly\\/theme\\/",w=k.map(s=>`${R}${s}`).join("|"),E=new RegExp(`^(@redocly/theme$|${w})`);return{name:"esbuild-redocly-custom-themes-resolver",setup:s=>{s.onResolve({filter:/@redocly-markdoc\/schema/},async e=>{const r=(await p(o,a.config.plugins)).flatMap(n=>n.markdoc?.schemaFile).filter(g);return{namespace:"markdoc-schema-ns",path:e.path,watchFiles:[...r,i],watchDirs:[c.resolve(h,"markdoc")],pluginData:{schemaFiles:r}}}),s.onLoad({filter:/@redocly-markdoc\/schema/,namespace:"markdoc-schema-ns"},({pluginData:e})=>({contents:M(e),resolveDir:"/",loader:"ts"})),s.onResolve({filter:/@redocly-markdoc\/components/},async e=>{const r=[...(await p(o,a.config.plugins)).map(n=>n.markdoc?.componentsFile).filter(g)];return{namespace:"markdoc-schema-ns",path:e.path,watchFiles:[...r,i],pluginData:{componentsFiles:r},watchDirs:[c.resolve(h,"markdoc")]}}),s.onLoad({filter:/@redocly-markdoc\/components/,namespace:"markdoc-schema-ns"},({pluginData:e})=>({contents:L(e),resolveDir:"/",loader:"ts"})),s.onResolve({filter:/@styles/},async e=>{const r=(await p(o,a.config.plugins)).map(n=>n.stylesFile).filter(Boolean);return{namespace:"user-styles-ns",path:e.path,watchFiles:[...r,i],pluginData:{styleFiles:r},watchDirs:[h]}}),s.onLoad({filter:/@styles/,namespace:"user-styles-ns"},async({pluginData:e})=>{const{styleFiles:t}=e;return{contents:t.map(n=>`@import url("${D(c.relative(o,n))}");`).join(`
|
|
2
|
+
`),loader:"css",resolveDir:o}}),s.onResolve({filter:/(^|\/)styles\.css$/},async({path:e,...t})=>{if(t.pluginData==="missing-styles-ns")return;const r=await s.resolve(e,{...t,pluginData:"missing-styles-ns"});return r.errors.length&&r.errors.some(n=>n.text.match(/^Could not resolve .*?\bstyles.css\b/))?{namespace:"missing-styles-ns",path:e}:r}),s.onLoad({filter:/(^|\/)styles\.css$/,namespace:"missing-styles-ns"},async()=>({contents:"",loader:"css"})),s.onResolve({filter:/^react-router-dom$/},()=>({namespace:"react-router-dom-ns",path:"react-router-dom"})),s.onLoad({filter:/^react-router-dom$/,namespace:"react-router-dom-ns"},async()=>{const e=await s.resolve("@redocly/theme/package.json",{resolveDir:o,kind:"require-resolve"});return{contents:`import * as ReactRouter from 'react-router';
|
|
3
|
+
export const useLocation = ReactRouter.useLocation;
|
|
4
|
+
export const useInRouterContext = ReactRouter.useInRouterContext;`,loader:"js",resolveDir:e.errors.length?o:c.dirname(e.path)}}),s.onResolve({filter:E},async e=>{if(e.resolveDir==="")return;const t=`${e.path}:${e.importer}`;if(d.has(t))return d.get(t);const{path:r,...n}=e,l=await p(o,a.config.plugins),u=e.path.replace($,"")||"index";for(let m=l.length-1;m>=0;m--){const F=l[m].isNpmPackage?[c.join(l[m].name,"src",u),{...n,resolveDir:o}]:[`./${u}`,{...n,resolveDir:l[m].pluginDirAbsolutePath}],f=C(await s.resolve(...F));if("path"in f&&f.path!==e.importer){const v={...f,watchFiles:[i,c.join(o,y,u+".tsx")]};return l[m].name===y||d.set(t,v),v}}})}}};function C(a){return a.errors.length?{errors:a.errors}:a}export{N as ThemesResolver,d as resolveCache};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import a from"styled-components";import{useQuery as f}from"@tanstack/react-query";import{useParams as b}from"react-router
|
|
1
|
+
import*as e from"react";import a from"styled-components";import{useQuery as f}from"@tanstack/react-query";import{useParams as b}from"react-router";import{Box as h,Flex as v}from"@redocly/portal-legacy-ui";import{Admonition as y}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as E}from"../../../../client/app/hooks";import x from"../../../../client/app/CircularProgress";import{Container as A}from"./components/Container";import w from"./components/AppOverview";import T from"./components/ApiKeys";import C from"./components/ApiLogs";import k from"./components/CreateApiKey";import{Description as I}from"./components/Description";import{CallbackUrl as _}from"./components/CallbackUrl";const B="app-tab-actions-portal",m="api_keys",P="logs";function L(D){const{id:s}=b(),{isLoading:p,error:l,data:t}=f({queryKey:["APP:"+s],queryFn:()=>fetch(`/api/api-keys/apps/${s}`).then(n=>n.json())}),{translate:c}=E(),d=n=>o.findIndex(r=>r.id===n),o=[{id:m,name:c("dev.main.tab.appKeys","API keys"),content:e.createElement(e.Fragment,null,e.createElement(T,{credentials:t?.credentials,attributes:t?.attributes}),e.createElement(I,{text:t?.description}),t?.callbackUrl!==void 0&&e.createElement(_,{text:t.callbackUrl})),show:!0},{id:P,name:c("dev.main.tab.logs","Logs"),content:e.createElement(C,null),show:!!t?.supportsLogs}].filter(n=>n.show),[i,g]=e.useState(0),u=t?.canCreateKey&&i===d(m);return e.createElement(h,{my:"2rem"},e.createElement(A,null,p?e.createElement(v,{justifyContent:"center",mt:"2em"},e.createElement(x,null)):l?e.createElement(y,{type:"danger"},l?.message??"Something went wrong"):t?e.createElement(e.Fragment,null,e.createElement(w,{app:t}),e.createElement(K,null,e.createElement(S,null,o.map(({name:n},r)=>e.createElement("span",{key:n,className:i===r?"active":"",onClick:()=>g(r)},n))),e.createElement("div",{id:B}),u&&e.createElement(k,{initialEnabledApis:(t.credentials||[]).flatMap(n=>n.apiProductIds||[])})),e.createElement(z,null,o[i].content)):null))}const W=a.i`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
width: 12px;
|
|
4
4
|
height: 12px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import{useQuery as u}from"@tanstack/react-query";import a from"styled-components";import{Outlet as g,useLocation as h,useNavigate as v,useParams as y}from"react-router
|
|
1
|
+
import*as e from"react";import{useQuery as u}from"@tanstack/react-query";import a from"styled-components";import{Outlet as g,useLocation as h,useNavigate as v,useParams as y}from"react-router";import{Flex as x}from"@redocly/portal-legacy-ui";import{Button as w}from"@redocly/theme/components/Button/Button";import{Sidebar as E}from"@redocly/theme/components/Sidebar/Sidebar";import{Admonition as b}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{MenuItem as P}from"@redocly/theme/components/Menu/MenuItem";import{AddIcon as A}from"@redocly/theme/icons/AddIcon/AddIcon";import{useTranslate as C}from"../../../../client/app/hooks";import k from"../../../../client/app/CircularProgress";import{loadAndNavigate as p}from"../../../../client/app/utils/loadAndNavigate";import S from"./components/icons/PlaceholderIcon";import{ButtonWithLoading as L}from"./components/ButtonWithLoading";import{CreateAppDialog as I}from"./CreateAppDialog";function j(){const{id:n}=y(),s=v(),f=h(),i=e.useRef(null),{translate:o}=C(),{data:r,isLoading:m,isRefetching:l,error:c}=u({refetchOnWindowFocus:!1,queryKey:["APPS"],queryFn:()=>fetch("/api/api-keys/apps").then(t=>t.json().then(d=>t.ok?Promise.resolve(d):Promise.reject(d)))});return e.useEffect(()=>{const t=m||l;!n&&r?.length&&!t?p({navigate:s,to:"apps/"+r[0].id+f.search,origin:"browser",options:{replace:!0}}):n&&!t&&!r?.length&&p({navigate:s,to:"apps/"})},[n,r,l]),e.createElement(e.Fragment,null,m||l?e.createElement(x,{justifyContent:"center",mt:"2em"},e.createElement(k,null)):c?e.createElement(b,{type:"danger"},c?.message??"Something went wrong"):r?e.createElement(z,{"data-component-name":"Layout/PageLayout"},n&&e.createElement(E,{growContent:!1,menu:r?.map(t=>e.createElement(P,{key:t.id,item:{label:t.name,link:"apps/"+t.id,items:[],active:n===t.id,hasActiveSubItem:!1}})),header:e.createElement(D,{"data-translation-key":"dev.sidebar.header"},o("dev.sidebar.header","My apps")),footer:e.createElement(w,{variant:"outlined",fullWidth:!0,onClick:()=>i.current.open(),icon:e.createElement(A,null),iconPosition:"right",size:"small","data-translation-key":"dev.sidebar.footer.text"},o("dev.sidebar.footer.text","New application")),versions:null}),!n&&!r.length?e.createElement(N,null,e.createElement(R,null,e.createElement(S,null),e.createElement(W,{"data-translation-key":"dev.newApp.text"},o("dev.newApp.text","Create your first app")),e.createElement(L,{variant:"primary",onClick:()=>i.current.open(),"data-translation-key":"dev.newApp"},o("dev.newApp","New application")))):e.createElement(F,null,e.createElement(g,null)),e.createElement(I,{ref:i})):null)}const z=a.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
min-height: calc(100vh - var(--navbar-height));
|