@redocly/realm 0.128.0 → 0.129.0-next.0
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 +18 -0
- package/README.md +1 -1
- package/dist/client/App.js +1 -1
- package/dist/client/app/hooks/catalog/useCatalog.d.ts +3 -4
- package/dist/client/app/hooks/catalog/useCatalog.js +1 -1
- package/dist/client/app/hooks/catalog/useCatalogFilter.d.ts +2 -2
- package/dist/client/app/hooks/catalog/useCatalogSearch.d.ts +1 -1
- package/dist/client/app/hooks/catalog/useCatalogSearch.js +1 -1
- package/dist/client/app/hooks/catalog/useCatalogViewMode.js +1 -1
- package/dist/client/app/hooks/catalog/useFetchCatalogEntities.js +1 -1
- package/dist/client/app/hooks/catalog/useFetchCatalogEntitiesRelations.js +1 -1
- package/dist/client/app/hooks/catalog/useSearchTracker.d.ts +12 -0
- package/dist/client/app/hooks/catalog/useSearchTracker.js +1 -0
- package/dist/client/app/hooks/usePageTimeTracker.d.ts +2 -0
- package/dist/client/app/hooks/usePageTimeTracker.js +1 -0
- package/dist/client/utils/catalog/collect-filter-options.d.ts +1 -1
- package/dist/server/persistence/kv/repositories/kv-remote-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts +7 -7
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.d.ts +4 -4
- package/dist/server/plugins/catalog-entities/get-server-props.d.ts +1 -1
- package/dist/server/plugins/mcp/auth/auth-handlers.js +1 -1
- package/package.json +9 -9
- package/dist/client/app/hooks/utils/useDebounceValue.d.ts +0 -2
- package/dist/client/app/hooks/utils/useDebounceValue.js +0 -1
- package/dist/types/catalog-entities.d.ts +0 -6
- package/dist/types/catalog-entities.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @redocly/realm
|
|
2
2
|
|
|
3
|
+
## 0.129.0-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3cd8b8cf00: Updated `@redocly/openapi-core` to version `2.12.5`.
|
|
8
|
+
- e2ce1da8b5: Enter prerelease mode.
|
|
9
|
+
- 1245fefad6: Fixed an issue where Docs MCP required authentication for publicly available docs with no RBAC configuration provided.
|
|
10
|
+
- Updated dependencies [3cd8b8cf00]
|
|
11
|
+
- Updated dependencies [e2ce1da8b5]
|
|
12
|
+
- Updated dependencies [9f686fedb3]
|
|
13
|
+
- @redocly/openapi-docs@3.17.0-next.0
|
|
14
|
+
- @redocly/portal-plugin-mock-server@0.14.0-next.0
|
|
15
|
+
- @redocly/realm-asyncapi-sdk@0.7.0-next.0
|
|
16
|
+
- @redocly/portal-legacy-ui@0.12.0-next.0
|
|
17
|
+
- @redocly/asyncapi-docs@1.6.0-next.0
|
|
18
|
+
- @redocly/graphql-docs@1.6.0-next.0
|
|
19
|
+
- @redocly/theme@0.61.0-next.0
|
|
20
|
+
|
|
3
21
|
## 0.128.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/README.md
CHANGED
package/dist/client/App.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"react";import{useEffect as l}from"react";import{Outlet as f,useLocation as g,useNavigate as d}from"react-router-dom";import{components as
|
|
1
|
+
import*as o from"react";import{useEffect as l}from"react";import{Outlet as f,useLocation as g,useNavigate as d}from"react-router-dom";import{components as P}from"@redocly-markdoc/components";import h from"@markdoc/markdoc/dist/react";import{withoutPathPrefix as T}from"@redocly/theme/core/utils";import{InternalServerErrorLayout as D}from"@redocly/theme/layouts/InternalServerErrorLayout";import{RootLayout as S}from"@redocly/theme/layouts/RootLayout";import{PageLayout as L}from"@redocly/theme/layouts/PageLayout";import{components as i}from"@redocly/theme/markdoc/default";import{Sidebar as _}from"./app/Sidebar/Sidebar";import{loadAndNavigate as v}from"./app/utils/loadAndNavigate";import{useActions as C}from"./app/Sidebar/useActions";import{useScrollTracker as A}from"./app/hooks/useScrollTracker";import{useAutoScroll as N}from"./app/hooks/useAutoScroll";import{OPENAPI_DOCS_TEMPLATE_ID as O,ASYNC_API_DOCS_TEMPLATE_ID as y,GRAPHQL_TEMPLATE_ID as R}from"../constants/common";import{removeTrailingSlash as I}from"../utils/url/remove-trailing-slash";import{removeLeadingSlash as b}from"../utils/url/remove-leading-slash";import*as k from"../server/plugins/markdown/markdoc/custom-components/index";import{ErrorBubble as x}from"./app/ErrorBubble";import{DefaultStyles as M}from"./styling/default-styles";import{ThemeDataProvider as V}from"./providers/theme/ThemeDataProvider";import{PageDataContext as B}from"./providers/page-data/PageDataContext";import{SeoTags as G}from"./app/seo/SeoTags";import{useRouterForLocalLinks as $,useRunningEnvironmentCheck as w}from"./providers/hooks";import{usePageData as F,usePageDataLoader as H}from"./providers/page-data/hooks";import{ErrorBoundary as Q}from"./ErrorBoundary";import{ErrorDetails as c,Loader as U}from"./server-entry";import"@styles";import{useRouteChangeTracker as Y}from"./app/hooks/useRouteChangeTracker";import{isInIframe as j}from"./utils";import{useL10n as q}from"./app/l10n";import{PostMessageProvider as z}from"./providers/post-message/PostMessageProvider";import{ScriptLoader as J}from"./ScriptLoader";import{clientRoutes as K}from"./runtime/generated/routes.js";import{PageCounter as W}from"./app/PageCounter";import{usePageTimeTracker as X}from"./app/hooks/usePageTimeTracker";globalThis.__LOADER.markdocComponents={...k,...i};function Me(){const e=H(),[t,a]=o.useState(e),r=g(),m=d();q(),l(()=>{e?a(e):v({navigate:m,to:r.pathname+r.search+r.hash}).then(()=>a(U.loadSync(r.pathname)))},[r,m]),$();const n=w();return n?(console.log(n),o.createElement(c,{error:{message:n,name:""}})):t?o.createElement(Q,null,o.createElement(M,null),o.createElement(B.Provider,{value:e||t},o.createElement(V,null,o.createElement(z,{enabled:process.env.NODE_ENV==="development"||j()},o.createElement(f,null))))):null}function u(){Y(),X(),A(),N();const e=F(),t=C(),{layout:a}=t,r={layout:a},m=process.env.NODE_ENV!=="production",n=globalThis.SSR_OMIT_SUSPENSE,s=e?.props.ast&&e.props.ast.$$mdtype==="Tag"?h(e.props.ast,o,{components:{...globalThis.__LOADER.markdocComponents,...i,...P}}):null,E=I(e?.slug||"");if(l(()=>{document.documentElement.classList.add("ready")},[]),e?.props.pagePropGetterError?.message)return m?o.createElement(c,{error:{...e?.props?.pagePropGetterError}}):o.createElement(D,null);if(!!e?.props?.compilationErrors?.length)return e?.Template?o.createElement(e.Template,{pageProps:e?.props,children:s}):null;const p=()=>o.createElement(S,null,o.createElement(L,{sidebar:o.createElement(_,{layoutControls:t})},o.createElement(G,{seo:e?.props.seo,slug:E}),e?.Template?o.createElement(e.Template,{pageProps:[O,y,R].includes(e.templateId)?{...e.props,apiOptions:r}:e?.props,children:s}):null),process.env.NODE_ENV!=="production"&&o.createElement(x,null),process.env.NODE_ENV!=="production"&&o.createElement(W,null),o.createElement(J,null));return n?p():o.createElement(o.Suspense,null,p())}const Ve=[...K.map(e=>({Component:u,path:b(T(e).substring(1)+"/*")})),{Component:u,path:"*"}];export{Me as App,u as Page,Ve as routes};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare function useCatalog(config?: CatalogEntityConfig, serverFilters?: CatalogFiltersWithCounts, entitiesCounterInitial?: number, initialViewMode?: CatalogViewMode): UseCatalogResponse;
|
|
1
|
+
import type { UseCatalogResponse } from '@redocly/theme/core/types';
|
|
2
|
+
import type { UseCatalogProps } from '@redocly/theme/core/types';
|
|
3
|
+
export declare function useCatalog(props?: UseCatalogProps): UseCatalogResponse;
|
|
5
4
|
//# sourceMappingURL=useCatalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as
|
|
1
|
+
import{useState as M}from"react";import{useActions as V}from"../../Sidebar/useActions";import{useCatalogFilter as k}from"./useCatalogFilter";import{useCatalogSort as Q}from"./useCatalogSort";import{useCatalogSearch as b}from"./useCatalogSearch";import{useCatalogViewMode as v}from"./useCatalogViewMode";function j(e){const{config:t,serverFilters:o,entitiesCounterInitial:i,initialViewMode:r}=e??{},{filters:s,filterQuery:n}=k(t,o),{sortOption:a,setSortOption:l,handleSortClick:c,isColumnSorted:u}=Q(),{searchQuery:C,setSearchQuery:m}=b(),{viewMode:p,setViewMode:f}=v(r),{onChangeViewClick:d,onChangeCollapseSidebarClick:S,layout:g,collapsedSidebar:h}=V(),[w,y]=M(i||0);return{filters:s,filterQuery:n,searchQuery:C,setSearchQuery:m,sortOption:a,setSortOption:l,handleSortClick:c,isColumnSorted:u,viewMode:p,setViewMode:f,entitiesCounter:w,setEntitiesCounter:y,onChangeViewClick:d,onChangeCollapseSidebarClick:S,layout:g,collapsedSidebar:h}}export{j as useCatalog};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CatalogEntityConfig } from '@redocly/config';
|
|
2
|
-
import type { CatalogFiltersWithCounts } from '
|
|
2
|
+
import type { CatalogFiltersWithCounts } from '@redocly/theme/core/types';
|
|
3
3
|
import type { FilterState } from '../../../types';
|
|
4
4
|
export declare function useCatalogFilter(config?: CatalogEntityConfig, serverFilters?: CatalogFiltersWithCounts): {
|
|
5
5
|
filters: {
|
|
@@ -18,7 +18,7 @@ export declare function useCatalogFilter(config?: CatalogEntityConfig, serverFil
|
|
|
18
18
|
valuesMapping?: Record<string, string> | undefined;
|
|
19
19
|
missingCategoryName?: string | undefined;
|
|
20
20
|
missingCategoryNameTranslationKey?: string | undefined;
|
|
21
|
-
options: import("
|
|
21
|
+
options: import("@redocly/theme").FilterResult[];
|
|
22
22
|
}[];
|
|
23
23
|
filterQuery: string;
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as o,useState as
|
|
1
|
+
import{useEffect as o,useMemo as h,useState as n}from"react";import{useSearchParams as m}from"react-router-dom";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{useState as
|
|
1
|
+
import{useState as i}from"react";import{telemetry as n}from"../../telemetry/index.js";const s="catalog-view-mode",w="table";function u(o){const[r,a]=i(o??w);return{viewMode:r,setViewMode:t=>{if(a(t),!(typeof window>"u")){try{localStorage.setItem(s,t)}catch(e){console.warn("Failed to save view mode preference to localStorage",e)}try{const e=new URL(window.location.href);e.searchParams.set("viewMode",t),window.history.replaceState({},"",e.toString()),n.sendCatalogEntitiesViewModeChangedMessage({mode:t,id:t,object:"view_mode",uri:window.location.href})}catch(e){console.warn("Failed to update viewMode query parameter",e)}}}}}export{u as useCatalogViewMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useInfiniteQuery as R}from"@tanstack/react-query";import{useMemo as
|
|
1
|
+
import{useInfiniteQuery as R}from"@tanstack/react-query";import{useMemo as d,useRef as S}from"react";import{getNextPageParam as w}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as F}from"./useSearchTracker";function _({limit:o=20,filter:s,sort:i="type",search:n}={},r){const l=r?r.items.map(e=>e.key).join("-"):[],c=S(!0),m=c.current&&r;c.current&&(c.current=!1);const a=R({queryFn:async e=>{const t=new URLSearchParams;s&&t.append("filter",s),i&&t.append("sort",i),o&&t.append("limit",o.toString()),n&&t.append("search",n),e.pageParam&&Object.entries(e.pageParam).forEach(([y,f])=>{f!=null&&t.append(y,f.toString())});const h=process.env.REDOCLY_PREFIX_PATHS?`/${process.env.REDOCLY_PREFIX_PATHS}`:"",p=new URL(`${h}/bff/catalog-entities`,window.location.origin);p.search=t.toString();const u=await fetch(p.toString());if(!u.ok)throw new Error(`Failed to fetch catalog entities from ${p.pathname}`);return u.json()},queryKey:["bff/catalog-entities",{limit:o,filter:s,sort:i,search:n,initialDataKeys:l}],initialData:m?{pages:[r],pageParams:[null]}:void 0,initialPageParam:null,getNextPageParam:w,refetchOnMount:!0,placeholderData:e=>e}),P=d(()=>{const e=a.data?.pages||[];return e[e.length-1]?.page.total},[a.data?.pages]),g=d(()=>(a.data?.pages||[]).flatMap(e=>e.items||[]),[a.data?.pages]);return F({isLoading:a.isLoading||a.isFetching,items:g,apiResource:"entities",searchQuery:n??""}),{query:a,items:g,total:P}}export{_ as useFetchCatalogEntities};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useInfiniteQuery as
|
|
1
|
+
import{useInfiniteQuery as S}from"@tanstack/react-query";import{useMemo as l,useRef as w}from"react";import{getNextPageParam as E}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as F}from"./useSearchTracker";function $({entityKey:g,limit:o=20,filter:s,sort:i="title",search:n},r){const m=r?r.items.map(e=>e.key).join("-"):[],c=w(!0),P=c.current&&r;c.current&&(c.current=!1);const t=S({queryFn:async e=>{const a=new URLSearchParams;s&&a.append("filter",s),i&&a.append("sort",i),o&&a.append("limit",o.toString()),n&&a.append("search",n),e.pageParam&&Object.entries(e.pageParam).forEach(([R,f])=>{f!=null&&a.append(R,f.toString())});const y=process.env.REDOCLY_PREFIX_PATHS?`/${process.env.REDOCLY_PREFIX_PATHS}`:"",p=new URL(`${y}/bff/catalog-related-entities/${g}`,window.location.origin);p.search=a.toString();const d=await fetch(p.toString());if(!d.ok)throw new Error(`Failed to fetch catalog entity relations from ${p.pathname}`);return d.json()},queryKey:["bff/catalog-entities-relations",{limit:o,filter:s,sort:i,search:n,entityKey:g,initialDataKeys:m}],initialPageParam:null,initialData:P?{pages:[r],pageParams:[null]}:void 0,refetchOnMount:!0,getNextPageParam:E}),h=l(()=>{const e=t.data?.pages||[];return e[e.length-1]?.page?.total},[t.data?.pages]),u=l(()=>(t.data?.pages||[]).flatMap(e=>e.items||[]),[t.data?.pages]);return F({isLoading:t.isLoading||t.isFetching,items:u,apiResource:"related_entities",searchQuery:n??""}),{query:t,items:u,total:h}}export{$ as useFetchCatalogEntitiesRelations};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
2
|
+
type BaseEntity = Pick<BffCatalogEntity, 'id' | 'key' | 'type'>;
|
|
3
|
+
type ApiResource = 'entities' | 'related_entities';
|
|
4
|
+
type SearchTrackerProps<T extends BaseEntity> = {
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
items: T[];
|
|
7
|
+
apiResource: ApiResource;
|
|
8
|
+
searchQuery: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function useSearchTracker<T extends BaseEntity>({ isLoading, items, apiResource, searchQuery, }: SearchTrackerProps<T>): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useSearchTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as g,useEffect as m,useRef as f}from"react";import{useCatalogEntityDetails as d}from"@redocly/theme/core/hooks";import{usePageProps as p}from"../../../providers/hooks.js";import{telemetry as c}from"../../telemetry/index.js";const l={id:"redocly-unknown",object:"catalog_entity",uri:"redocly-unknown"},C={entities:"catalog_entity",related_entities:"catalog_entity"},E={entities:({items:e,searchQuery:n})=>{const t=e[0]??l;c.sendCatalogEntitiesListSearchQueryMessage({query:n,...t})},related_entities:({items:e,searchQuery:n})=>{const t=e[0]??l;c.sendCatalogEntitiesRelatedEntitiesListSearchQueryMessage({query:n,...t})}};function j({isLoading:e,items:n,apiResource:t,searchQuery:i}){const{catalogConfig:u,entitiesCatalogConfig:y}=p(),o=f(i),{getEntityDetailsLink:s}=d({catalogConfig:u,entitiesCatalogConfig:y}),a=g(r=>({id:r.id,object:C[t],uri:s(r)}),[s,t]);m(()=>{if(e)return;const r=i?.trim();!r||r===o.current||(o.current=i,E[t]({items:n.map(a),searchQuery:i}))},[n,e,i,t,a])}export{j as useSearchTracker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as r}from"react";import{useLocation as d}from"react-router-dom";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,5 +1,5 @@
|
|
|
1
1
|
import type { CatalogConfigEntityFilter } from '@redocly/config';
|
|
2
|
-
import type { FilterResult, CatalogFiltersWithCounts } from '
|
|
2
|
+
import type { FilterResult, CatalogFiltersWithCounts } from '@redocly/theme/core/types';
|
|
3
3
|
export type FilterWithOptions = Omit<CatalogConfigEntityFilter, 'options'> & {
|
|
4
4
|
options: FilterResult[];
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eq as C,and as
|
|
1
|
+
import{eq as C,and as K,gte as p,gt as k,lt as g,asc as D,desc as M,or as v,isNull as E,sql as y,inArray as B,count as q}from"drizzle-orm";import{logger as d}from"../../../tools/notifiers/logger.js";import{kvTable as r}from"../../../providers/database/databases/sqld-sqlite/schemas/kv-table.js";import{BaseRepository as I}from"../../../providers/database/base-repository.js";import{DatabaseConnectionFactory as N}from"../../../providers/database/database-connection-factory.js";import{createKvReadRecord as x}from"../mappers/create-kv-read-record.js";import{createKvDbRecord as S,encodeKvKey as i}from"../mappers/create-kv-db-record.js";const $="";class l extends I{static#e;constructor(e){super(e)}static async getInstance(e){if(!l.#e)try{const t=await N.create("sqld-remote",e);if(!t)return l.#e=null,null;l.#e=new l(t)}catch(t){return d.error("Error creating kv remote repository",t),l.#e=null,null}return l.#e}async get(e){try{const t=i(e),n=await this.databaseClient.client.select().from(r).where(K(C(r.encodedKey,t),v(E(r.expiresAt),p(y`datetime(${r.expiresAt})`,y`datetime('now')`)))).get();return n?x(n):null}catch(t){return d.error("Error getting kv entry by key",t),null}}async getMany(e){try{if(e.length===0)return[];const t=e.map(o=>i(o)),n=await this.databaseClient.client.select().from(r).where(B(r.encodedKey,t)).all(),a=new Map(n.map(o=>[o.encodedKey,o]));return e.map((o,h)=>{const f=t[h],u=a.get(f);return!u||this.#t(u.expiresAt)?null:x(u)})}catch(t){return d.error("Error getting multiple kv entries",t),[]}}async list(e,t){try{const n=t?.limit??100,a=t?.reverse??!1,s=[],o=v(E(r.expiresAt),p(y`datetime(${r.expiresAt})`,y`datetime('now')`));if(s.push(o),"prefix"in e){const c=i(e.prefix),w="start"in e?i(e.start):c,A="end"in e?i(e.end):c+$;s.push(p(r.encodedKey,w)),s.push(g(r.encodedKey,A))}else if("start"in e&&"end"in e){const c=i(e.start),w=i(e.end);s.push(p(r.encodedKey,c)),s.push(g(r.encodedKey,w))}if(t?.cursor){const c=a?g(r.encodedKey,t.cursor):k(r.encodedKey,t.cursor);s.push(c)}const h=this.databaseClient.client.select().from(r),f=s.length>0?h.where(K(...s)):h,u=this.databaseClient.client.select({count:q()}).from(r),b=(await(s.length>0?u.where(K(...s)):u).get())?.count??0,m=await f.orderBy(a?M(r.encodedKey):D(r.encodedKey)).limit(n).all();return{items:m.map(c=>x(c)),total:b,cursor:b>m.length?m[m.length-1]?.encodedKey??null:null}}catch(n){return d.error("Error listing kv entries",n),{items:[],total:0,cursor:null}}}async set(e,t,n){try{const a=S({key:e,value:t,ttlInSeconds:n?.ttlInSeconds});return await this.databaseClient.client.insert(r).values(a).onConflictDoUpdate({target:[r.encodedKey],set:{value:a.value,expiresAt:a.expiresAt,updatedAt:a.updatedAt}}),a.encodedKey}catch(a){return d.error("Error saving kv entry",a),null}}async delete(e){try{const t=i(e);return await this.databaseClient.client.delete(r).where(C(r.encodedKey,t)),!0}catch(t){return d.error("Error deleting kv entry by key",t),!1}}async clearExpired(){try{await this.databaseClient.client.delete(r).where(g(y`datetime(${r.expiresAt})`,y`datetime('now')`))}catch(e){d.error("Error clearing expired kv entries",e)}}async transaction(e){return this.databaseClient.transactionsManager.transaction(async()=>e({get:async n=>this.get(n),getMany:async n=>this.getMany(n),set:async(n,a,s)=>this.set(n,a,s),delete:async n=>this.delete(n)}))}#t(e){return e?new Date(e)<new Date:!1}}export{$ as KV_KEY_END_BOUNDARY,l as KvRemoteRepository};
|
|
@@ -83,10 +83,11 @@ export declare class CatalogEntitiesService {
|
|
|
83
83
|
}>>;
|
|
84
84
|
createEntityRelation(relation: EntityRelationDtoSchema): Promise<{
|
|
85
85
|
id: string;
|
|
86
|
-
createdAt: string;
|
|
87
|
-
updatedAt: string;
|
|
88
86
|
organizationId: string;
|
|
89
87
|
projectId: string;
|
|
88
|
+
sourceFile: string | null;
|
|
89
|
+
createdAt: string;
|
|
90
|
+
updatedAt: string;
|
|
90
91
|
sourceKey: string;
|
|
91
92
|
targetKey: string;
|
|
92
93
|
sourceId: string | null;
|
|
@@ -95,7 +96,6 @@ export declare class CatalogEntitiesService {
|
|
|
95
96
|
sourceRevision: string | null;
|
|
96
97
|
targetVersion: string | null;
|
|
97
98
|
targetRevision: string | null;
|
|
98
|
-
sourceFile: string | null;
|
|
99
99
|
fileHash: string | null;
|
|
100
100
|
sourceToTargetRelation: string;
|
|
101
101
|
targetToSourceRelation: string;
|
|
@@ -103,10 +103,11 @@ export declare class CatalogEntitiesService {
|
|
|
103
103
|
createEntitiesRelations(entities: EntityRelationDtoSchema[]): Promise<BulkSyncResult<DatabaseEntityRelation>>;
|
|
104
104
|
updateEntityRelation(id: string, relation: EntityRelationDtoSchema): Promise<{
|
|
105
105
|
id: string;
|
|
106
|
-
createdAt: string;
|
|
107
|
-
updatedAt: string;
|
|
108
106
|
organizationId: string;
|
|
109
107
|
projectId: string;
|
|
108
|
+
sourceFile: string | null;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
updatedAt: string;
|
|
110
111
|
sourceKey: string;
|
|
111
112
|
targetKey: string;
|
|
112
113
|
sourceId: string | null;
|
|
@@ -115,7 +116,6 @@ export declare class CatalogEntitiesService {
|
|
|
115
116
|
sourceRevision: string | null;
|
|
116
117
|
targetVersion: string | null;
|
|
117
118
|
targetRevision: string | null;
|
|
118
|
-
sourceFile: string | null;
|
|
119
119
|
fileHash: string | null;
|
|
120
120
|
sourceToTargetRelation: string;
|
|
121
121
|
targetToSourceRelation: string;
|
|
@@ -129,7 +129,7 @@ export declare class CatalogEntitiesService {
|
|
|
129
129
|
getEntitiesWithRelations(paginationParams?: PaginationParams): Promise<BffCatalogEntityList>;
|
|
130
130
|
getEntityWithRelationsByKey(entityKey: string, paginationParams?: PaginationParams): Promise<BffCatalogEntity | null>;
|
|
131
131
|
getRelatedEntities(entityKey: string, paginationParams?: PaginationParams): Promise<BffCatalogRelatedEntityList>;
|
|
132
|
-
listEntityRevisions(entityKey: string, version?: string | null): Promise<Pick<EntityReadModelSchema, "version" | "isDefaultVersion" | "
|
|
132
|
+
listEntityRevisions(entityKey: string, version?: string | null): Promise<Pick<EntityReadModelSchema, "version" | "isDefaultVersion" | "revision" | "isCurrent" | "createdAt" | "updatedAt">[]>;
|
|
133
133
|
updateEntityScorecardsStatus(entityId: string, status: ScorecardsStatus): Promise<boolean>;
|
|
134
134
|
updateEntityScorecardsStatusIfCalculating(entityId: string, status: Extract<ScorecardsStatus, 'UP_TO_DATE' | 'OUTDATED'>): Promise<boolean>;
|
|
135
135
|
getOutdatedEntity(): Promise<EntityReadModelSchema | null>;
|
|
@@ -58,10 +58,11 @@ export declare class CatalogEntitiesLocalRepository extends BaseRepository {
|
|
|
58
58
|
createEntities(createEntitiesParams: CreateEntityParams[]): Promise<void>;
|
|
59
59
|
createEntityRelation(entityRelation: EntityRelationDtoSchema): Promise<{
|
|
60
60
|
id: string;
|
|
61
|
-
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
61
|
organizationId: string;
|
|
64
62
|
projectId: string;
|
|
63
|
+
sourceFile: string | null;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
updatedAt: string;
|
|
65
66
|
sourceKey: string;
|
|
66
67
|
targetKey: string;
|
|
67
68
|
sourceId: string | null;
|
|
@@ -70,7 +71,6 @@ export declare class CatalogEntitiesLocalRepository extends BaseRepository {
|
|
|
70
71
|
sourceRevision: string | null;
|
|
71
72
|
targetVersion: string | null;
|
|
72
73
|
targetRevision: string | null;
|
|
73
|
-
sourceFile: string | null;
|
|
74
74
|
fileHash: string | null;
|
|
75
75
|
sourceToTargetRelation: string;
|
|
76
76
|
targetToSourceRelation: string;
|
|
@@ -81,7 +81,7 @@ export declare class CatalogEntitiesLocalRepository extends BaseRepository {
|
|
|
81
81
|
deleteEntityRelation(id: string): Promise<string | null>;
|
|
82
82
|
deleteEntityRelations(filter: Filter): Promise<boolean>;
|
|
83
83
|
getCatalogFilters(params: CatalogFiltersParams): Promise<Record<string, import("./catalog-entities-local-read-repository.js").FilterOption[]>>;
|
|
84
|
-
listEntityRevisions(entityKey: string, version?: string | null): Promise<Pick<import("../../../schemas/read-model-schemas.js").EntityReadModelSchema, "version" | "isDefaultVersion" | "
|
|
84
|
+
listEntityRevisions(entityKey: string, version?: string | null): Promise<Pick<import("../../../schemas/read-model-schemas.js").EntityReadModelSchema, "version" | "isDefaultVersion" | "revision" | "isCurrent" | "createdAt" | "updatedAt">[]>;
|
|
85
85
|
updateEntityScorecardsStatus(entityId: string, status: ScorecardsStatus): Promise<boolean>;
|
|
86
86
|
updateEntityScorecardsStatusIfCalculating(entityId: string, status: Extract<ScorecardsStatus, 'UP_TO_DATE' | 'OUTDATED'>): Promise<boolean>;
|
|
87
87
|
getOneOutdatedEntity(): Promise<import("../../../schemas/read-model-schemas.js").EntityReadModelSchema | null>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BffCatalogEntity, BffCatalogEntityList, BffCatalogRelatedEntity, BffCatalogRelatedEntityList, CatalogSwitcherItem, CatalogViewMode } from '@redocly/theme/core/types';
|
|
2
2
|
import type { EntitiesCatalogConfig, CatalogEntityConfig } from '@redocly/config';
|
|
3
3
|
import type { GetServerPropsFn } from '../../types/plugins/common';
|
|
4
|
-
import type { CatalogFiltersWithCounts } from '
|
|
4
|
+
import type { CatalogFiltersWithCounts } from '@redocly/theme/core/types';
|
|
5
5
|
export type ServerSideProps = {
|
|
6
6
|
status: 'success';
|
|
7
7
|
entitiesTypes: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extractTokenFromAuthHeader as
|
|
1
|
+
import{extractTokenFromAuthHeader as u}from"../utils/jwt.js";import{getUserParamsFromCookies as d}from"../../../web-server/auth.js";import{DEFAULT_ANONYMOUS_VISITOR_TEAM as s,RBAC_ALL_OTHER_TEAMS as a}from"../../../../constants/common.js";function c(e){return!e||typeof e!="object"||Object.keys(e).length===0?!1:!(e[s]&&e[s]!=="none"||e[a]&&e[a]!=="none")}function p(e){const o=!!e?.config?.requiresLogin,r=e?.config?.rbac;if(!r||Object.keys(r).length===0)return o;const t=r.content;if(t&&Object.keys(t).length>0&&Object.values(t).some(c))return!0;const i=r.teamFoldersBaseRoles;return c(i)?!0:o}async function g(e,o){const r=e.headers.get("Authorization");if(!r)return{isAuthenticated:!1};const t=u(r),i=o?.config?.ssoDirect||{},n=t?await d(i,{authorization:t,idp_access_token:t}):{};return t&&n&&n.isAuthenticated?{isAuthenticated:!0,isTokenValid:!0,currentUser:{teams:n.teams||[],email:n.email||"",claims:n,isAuthenticated:!0,idpAccessToken:n.idpAccessToken||void 0,idpId:n.idpId||void 0}}:{isAuthenticated:!1,isTokenValid:!1}}function m(e){return new Response(JSON.stringify({error:"unauthorized",message:"Authentication required"}),{status:401,headers:{"Content-Type":"application/json","WWW-Authenticate":`Bearer realm="${e}/.well-known/oauth-protected-resource/mcp"`,"Access-Control-Allow-Origin":"*"}})}function k(){return new Response(JSON.stringify({error:"invalid_token",message:"Invalid or expired token"}),{status:401,headers:{"Content-Type":"application/json","WWW-Authenticate":'Bearer error="invalid_token", error_description="Invalid or expired token"',"Access-Control-Allow-Origin":"*"}})}export{k as constructInvalidTokenResponse,m as constructUnauthorizedResponse,g as handleMcpAuth,p as shouldHandleMcpAuth};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/realm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0-next.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@opentelemetry/sdk-trace-web": "2.0.1",
|
|
33
33
|
"@opentelemetry/semantic-conventions": "1.34.0",
|
|
34
34
|
"@redocly/ajv": "8.17.1",
|
|
35
|
-
"@redocly/openapi-core": "2.12.
|
|
35
|
+
"@redocly/openapi-core": "2.12.5",
|
|
36
36
|
"@shikijs/transformers": "^1.22.2",
|
|
37
37
|
"@tanstack/react-query": "5.62.3",
|
|
38
38
|
"@tanstack/react-table": "8.21.3",
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
"xml-crypto": "6.0.1",
|
|
93
93
|
"xpath": "0.0.34",
|
|
94
94
|
"yaml-ast-parser": "0.0.43",
|
|
95
|
-
"@redocly/asyncapi-docs": "1.
|
|
95
|
+
"@redocly/asyncapi-docs": "1.6.0-next.0",
|
|
96
96
|
"@redocly/config": "0.41.0",
|
|
97
|
-
"@redocly/
|
|
98
|
-
"@redocly/
|
|
99
|
-
"@redocly/
|
|
100
|
-
"@redocly/portal-
|
|
101
|
-
"@redocly/
|
|
102
|
-
"@redocly/
|
|
97
|
+
"@redocly/graphql-docs": "1.6.0-next.0",
|
|
98
|
+
"@redocly/openapi-docs": "3.17.0-next.0",
|
|
99
|
+
"@redocly/portal-legacy-ui": "0.12.0-next.0",
|
|
100
|
+
"@redocly/portal-plugin-mock-server": "0.14.0-next.0",
|
|
101
|
+
"@redocly/realm-asyncapi-sdk": "0.7.0-next.0",
|
|
102
|
+
"@redocly/theme": "0.61.0-next.0"
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": {
|
|
105
105
|
"react": "^19.2.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useEffect as r,useState as c}from"react";function i(e,t){const[u,o]=c(e);return r(()=>{const n=setTimeout(()=>o(e),t||500);return()=>{clearTimeout(n)}},[e,t]),u}export{i as useDebounceValue};
|
|
File without changes
|