@redocly/realm 0.128.0-next.9 → 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 +108 -0
- package/README.md +1 -1
- package/dist/cli/prepare/analytics/collectors/get-config-stats-usage.js +1 -1
- package/dist/client/App.js +1 -1
- package/dist/client/TestProvider.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/index.d.ts +1 -0
- package/dist/client/app/hooks/index.js +1 -1
- package/dist/client/app/hooks/markdown/useMarkdownText.js +1 -1
- package/dist/client/app/hooks/useBanner.d.ts +8 -0
- package/dist/client/app/hooks/useBanner.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/app/hooks/utils/match-banner-target.d.ts +10 -0
- package/dist/client/app/hooks/utils/match-banner-target.js +1 -0
- package/dist/client/app/search/useAiSearch.d.ts +1 -1
- package/dist/client/app/search/useAiSearch.js +1 -1
- package/dist/client/app/search/useSearch.d.ts +1 -1
- package/dist/client/app/search/useSearch.js +1 -1
- package/dist/client/providers/theme/ThemeDataProvider.js +1 -1
- package/dist/client/utils/catalog/collect-filter-options.d.ts +1 -1
- package/dist/config/product-gates.d.ts +1 -0
- package/dist/config/product-gates.js +1 -1
- package/dist/constants/common.d.ts +1 -0
- package/dist/constants/common.js +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/config-parser/loaders/redocly-config-loader.js +1 -1
- package/dist/server/plugins/mcp/auth/auth-handlers.js +1 -1
- package/dist/types/entitlements.d.ts +1 -0
- package/package.json +14 -14
- 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,113 @@
|
|
|
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
|
+
|
|
21
|
+
## 0.128.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- 5cd6434fa4: Excluded pages from sitemaps if they are excluded from search.
|
|
26
|
+
- 898c2db9d1: Added support for `additionalOperations` in OpenAPI 3.2.0.
|
|
27
|
+
- 56a8a6aac2: Added a `banner` component to display announcements on project pages.
|
|
28
|
+
- b25647c63a: Added GraphQL overview section customization with the `graphql.info` configuration option.
|
|
29
|
+
- 237fb38fca: Added search and curation support for `React` pages.
|
|
30
|
+
- c79fd3ad50: Added support for downloading API description files up to 15MB.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 08277191f1: The **Connect to MCP** page action option does not display when the MCP server is not available.
|
|
35
|
+
- 6e7c28d09b: Fixed an issue where items from different versions appeared simultaneously in the sidebar when using `$ref` in `sidebars.yaml`.
|
|
36
|
+
- 39df6e65ff: Fixed an issue where the AI Search form unintentionally submitted during text entry in Japanese.
|
|
37
|
+
- 4849bbfbae: Fixed content flickering in the OpenAPI sidebar navigation for non-default layouts.
|
|
38
|
+
- 66df36d54c: Fixed incorrect application of `rel="noreferrer"` on internal links.
|
|
39
|
+
- 11e1e54493: Fixed an issue where the `Ask AI` button overlapped code examples.
|
|
40
|
+
- 64473dfcb8: Fixed scorecard badge linking to a non-existent page when multiple catalogs were defined.
|
|
41
|
+
- eaea96e6c9: Fixed where `oneOf` was incorrectly labeled as recursive on API documentation pages.
|
|
42
|
+
- a363284ccb: Fixed an issue where versioned API descriptions appeared multiple times in the classic catalog.
|
|
43
|
+
- 5e524bdcb5: Fixed an issue where an `index.yaml` OpenAPI file in the project root caused all pages to return a 500 error.
|
|
44
|
+
- f4ee4e345b: Fixed security vulnerability in CORS middleware by upgrading `hono` to v4.10.6.
|
|
45
|
+
- 06be686455: Fixed an issue where scorecard didn't work for projects with path prefix.
|
|
46
|
+
- 6e7c28d09b: Fixed an issue where switching versions at the project root redirected to the first sidebar page instead of the current one.
|
|
47
|
+
- Updated dependencies [08277191f1]
|
|
48
|
+
- Updated dependencies [39df6e65ff]
|
|
49
|
+
- Updated dependencies [e1eaa83a71]
|
|
50
|
+
- Updated dependencies [898c2db9d1]
|
|
51
|
+
- Updated dependencies [98f5cce261]
|
|
52
|
+
- Updated dependencies [56a8a6aac2]
|
|
53
|
+
- Updated dependencies [4849bbfbae]
|
|
54
|
+
- Updated dependencies [4c03b9e504]
|
|
55
|
+
- Updated dependencies [66df36d54c]
|
|
56
|
+
- Updated dependencies [38790e9d0d]
|
|
57
|
+
- Updated dependencies [18cb20de60]
|
|
58
|
+
- Updated dependencies [11e1e54493]
|
|
59
|
+
- Updated dependencies [eaea96e6c9]
|
|
60
|
+
- Updated dependencies [ca48d4ee2d]
|
|
61
|
+
- Updated dependencies [b25647c63a]
|
|
62
|
+
- Updated dependencies [5a5c4ecb7b]
|
|
63
|
+
- Updated dependencies [bc191c239c]
|
|
64
|
+
- @redocly/theme@0.60.0
|
|
65
|
+
- @redocly/portal-plugin-mock-server@0.13.0
|
|
66
|
+
- @redocly/openapi-docs@3.16.0
|
|
67
|
+
- @redocly/asyncapi-docs@1.5.0
|
|
68
|
+
- @redocly/graphql-docs@1.5.0
|
|
69
|
+
- @redocly/portal-legacy-ui@0.11.0
|
|
70
|
+
- @redocly/realm-asyncapi-sdk@0.6.0
|
|
71
|
+
|
|
72
|
+
## 0.128.0-next.12
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Updated dependencies [46b6ce6c79]
|
|
77
|
+
- @redocly/theme@0.60.0-next.8
|
|
78
|
+
- @redocly/asyncapi-docs@1.5.0-next.12
|
|
79
|
+
- @redocly/graphql-docs@1.5.0-next.1
|
|
80
|
+
- @redocly/openapi-docs@3.16.0-next.12
|
|
81
|
+
- @redocly/portal-plugin-mock-server@0.13.0-next.12
|
|
82
|
+
|
|
83
|
+
## 0.128.0-next.11
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- 6c86ae4655: Updated `@redocly/openapi-core` to version `2.12.3`.
|
|
88
|
+
- Updated dependencies [190f5656a7]
|
|
89
|
+
- Updated dependencies [6c86ae4655]
|
|
90
|
+
- @redocly/realm-asyncapi-sdk@0.6.0-next.2
|
|
91
|
+
- @redocly/openapi-docs@3.16.0-next.11
|
|
92
|
+
- @redocly/theme@0.60.0-next.7
|
|
93
|
+
- @redocly/asyncapi-docs@1.5.0-next.11
|
|
94
|
+
- @redocly/portal-plugin-mock-server@0.13.0-next.11
|
|
95
|
+
|
|
96
|
+
## 0.128.0-next.10
|
|
97
|
+
|
|
98
|
+
### Minor Changes
|
|
99
|
+
|
|
100
|
+
- 56a8a6aac2: Added a `banner` component to display announcements on project pages.
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- Updated dependencies [56a8a6aac2]
|
|
105
|
+
- @redocly/theme@0.60.0-next.7
|
|
106
|
+
- @redocly/asyncapi-docs@1.5.0-next.10
|
|
107
|
+
- @redocly/graphql-docs@1.5.0-next.1
|
|
108
|
+
- @redocly/openapi-docs@3.16.0-next.10
|
|
109
|
+
- @redocly/portal-plugin-mock-server@0.13.0-next.10
|
|
110
|
+
|
|
3
111
|
## 0.128.0-next.9
|
|
4
112
|
|
|
5
113
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loadConfig as r}from"@redocly/openapi-core";import a from"node:path";import{access as
|
|
1
|
+
import{loadConfig as r}from"@redocly/openapi-core";import a from"node:path";import{access as i}from"node:fs/promises";import{CONFIG_FILE_NAME as e}from"../../../../constants/common.js";import{getPortalConfigStats as c}from"../../../telemetry/get-portal-config-stats.js";const C=async({context:t})=>{const o=a.join(t.fs.cwd,e),n=await f(o);return{version:"2",name:"buildContext",value:c(n)}};async function f(t){try{await i(t)}catch{return{}}const o=await r({configPath:t});return o.document?.parsed||o.resolvedConfig}export{C as getConfigStatsUsage};
|
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 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{BrowserRouter as o}from"react-router-dom";import{ThemeDataContext as n,SearchSessionProvider as i}from"@redocly/theme/core/contexts";import u from"@redocly/theme/core/templates/Markdown";import{useBreadcrumbs as m,useBanner as d,useCatalogClassic as l,useCurrentProduct as c,useGlobalData as p,useI18n as g,useI18nConfig as h,useL10n as f,useL10nConfig as b,usePageData as T,usePageSharedData as C,usePageVersions as k,usePreloadHistory as v,useProducts as w,useUserMenu as P,useSubmitFeedback as S,useTranslate as D,useSidebarSiblingsData as y,usePageProps as $,useUserTeams as E,useMarkdownText as I,useCodeHighlight as L,useLoadAndNavigate as x,useCatalog as H,useCatalogSort as M,useCatalogSearch as F,useFetchCatalogEntities as A,useFetchCatalogEntitiesRelations as B,useTelemetry as r,useMcpData as R}from"./app/hooks";import{Link as G}from"./app/Link";import{useFacetQuery as O,useSearch as U,useAiSearch as N}from"./app/search";import{useSidebarItems as Q}from"./app/Sidebar/useSidebarItems";import{PageDataContext as V}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={useBreadcrumbs:m,useBanner:d,useCatalog:H,useCatalogSort:M,useCatalogSearch:F,useFetchCatalogEntities:A,useFetchCatalogEntitiesRelations:B,useCatalogClassic:l,useCurrentProduct:c,useGlobalData:p,useSearch:U,useAiSearch:N,useFacetQuery:O,useI18n:g,useI18nConfig:h,useL10n:f,useL10nConfig:b,usePageData:T,usePageSharedData:C,usePageVersions:k,usePreloadHistory:v,useProducts:w,useUserMenu:P,useSidebarItems:Q,useSidebarSiblingsData:y,useSubmitFeedback:S,useTranslate:D,useUserTeams:E,usePageProps:$,useMarkdownText:I,useCodeHighlight:L,useLoadAndNavigate:x,useTelemetry:r,useOtelTelemetry:r,useMcpData:R},q={LinkComponent:G},z={hooks:j,components:q,config:{}};function te({children:a,customPageData:t}){return e.createElement(o,null,e.createElement(i,null,e.createElement(V.Provider,{value:{...s,...t,props:{...s.props,...t?.props}}},e.createElement(n.Provider,{value:z},a))))}export{te as TestProvider};
|
|
@@ -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};
|
|
@@ -14,6 +14,7 @@ export { useUserMenu } from '../UserMenu/useUserMenu';
|
|
|
14
14
|
export { useSubmitFeedback } from '../Feedback/useSubmitFeedback';
|
|
15
15
|
export { usePreloadHistory } from '../usePreloadHistory';
|
|
16
16
|
export { useBreadcrumbs } from '../Sidebar/useBreadcrumbs';
|
|
17
|
+
export { useBanner } from './useBanner';
|
|
17
18
|
export { useCatalog } from './catalog/useCatalog';
|
|
18
19
|
export { useCatalogSort } from './catalog/useCatalogSort';
|
|
19
20
|
export { useCatalogSearch } from './catalog/useCatalogSearch';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"../../providers/page-data/hooks";import{usePageSharedData as t}from"../../providers/hooks";import{useLoginUrl as a}from"./useLoginUrl";import{useGlobalData as f}from"../useGlobalData";import{useL10n as p}from"../l10n/hooks";import{useL10nConfig as n}from"./useL10nConfig";import{useL10n as l}from"../l10n/hooks";import{useTranslate as C}from"../l10n/hooks";import{useL10nConfig as c}from"./useL10nConfig";export*from"./useCurrentUserTeams";export*from"./products";import{usePageVersions as S}from"../../providers/page-data/hooks";import{useUserMenu as U}from"../UserMenu/useUserMenu";import{useSubmitFeedback as F}from"../Feedback/useSubmitFeedback";import{usePreloadHistory as P}from"../usePreloadHistory";import{useBreadcrumbs as y}from"../Sidebar/useBreadcrumbs";import{useCatalog as
|
|
1
|
+
export*from"../../providers/page-data/hooks";import{usePageSharedData as t}from"../../providers/hooks";import{useLoginUrl as a}from"./useLoginUrl";import{useGlobalData as f}from"../useGlobalData";import{useL10n as p}from"../l10n/hooks";import{useL10nConfig as n}from"./useL10nConfig";import{useL10n as l}from"../l10n/hooks";import{useTranslate as C}from"../l10n/hooks";import{useL10nConfig as c}from"./useL10nConfig";export*from"./useCurrentUserTeams";export*from"./products";import{usePageVersions as S}from"../../providers/page-data/hooks";import{useUserMenu as U}from"../UserMenu/useUserMenu";import{useSubmitFeedback as F}from"../Feedback/useSubmitFeedback";import{usePreloadHistory as P}from"../usePreloadHistory";import{useBreadcrumbs as y}from"../Sidebar/useBreadcrumbs";import{useBanner as E}from"./useBanner";import{useCatalog as I}from"./catalog/useCatalog";import{useCatalogSort as w}from"./catalog/useCatalogSort";import{useCatalogSearch as G}from"./catalog/useCatalogSearch";import{useFetchCatalogEntities as R}from"./catalog/useFetchCatalogEntities";import{useFetchCatalogEntitiesRelations as j}from"./catalog/useFetchCatalogEntitiesRelations";import{useCatalogClassic as z}from"./catalog/useCatalogClassic";import{useTelemetry as K}from"./useTelemetry";import{useUserTeams as Q}from"./useUserTeams";import{useMarkdownText as X}from"./markdown/useMarkdownText";import{useCodeHighlight as Z}from"./codeHighlight/useCodeHighlight";import{useLoadAndNavigate as $}from"./useLoadAndNavigate";import{useUserClaims as oe}from"./useUserClaims";import{useMcpData as te}from"./useMcpData";export{E as useBanner,y as useBreadcrumbs,I as useCatalog,z as useCatalogClassic,G as useCatalogSearch,w as useCatalogSort,Z as useCodeHighlight,R as useFetchCatalogEntities,j as useFetchCatalogEntitiesRelations,f as useGlobalData,p as useI18n,n as useI18nConfig,l as useL10n,c as useL10nConfig,$ as useLoadAndNavigate,a as useLoginUrl,X as useMarkdownText,te as useMcpData,t as usePageSharedData,S as usePageVersions,P as usePreloadHistory,F as useSubmitFeedback,K as useTelemetry,C as useTranslate,oe as useUserClaims,U as useUserMenu,Q as useUserTeams};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m,{useMemo as h}from"react";import{parse as p,transform as u,renderers as b,Tag as g,nodes as d}from"@markdoc/markdoc";import{CodeBlock as k}from"@redocly/theme/components/CodeBlock/CodeBlock";import{tags as C,components as y}from"@redocly/theme/markdoc/default";const N=Object.fromEntries(Object.entries(y).filter(([,t])=>typeof t=="function")),T=t=>/\{%\s*(?:\/?\w+(?:-\w+)*|\/)(?:\s+[^%]+)?\s*(?:\/%|%\})/.test(t),w=(t,e)=>{try{const r=u(t,e);return Array.isArray(r)?r:[r]}catch(r){console.error("Error transforming node:",r)}return[]},l=(t,e,r,n)=>new g("CodeBlock",{...t,header:{title:n,controls:{copy:{}}},source:e,lang:r},[]),A=(t,e)=>{const r=t.transformAttributes(e),n=r["data-language"]||"markdoc",c=r["data-title"],o=t.attributes.content||"",a=l(r,o,n,c),s=[];if(!t.children||t.children.length<=1)return{codeNode:a,contentNodes:s};for(const i of t.children){if(!i)continue;const f=w(i,e);s.push(...f)}return{codeNode:a,contentNodes:s}},F=(t,e)=>{const r=t.transformAttributes(e),n=r["data-language"],c=r["data-title"],o=t.attributes.content||"";if(!T(o)||!t.children||t.children.length===0)return l(r,o,n,c);const a=t.children[0];if(!a||a.type!=="tag")return l(r,o,n,c);const{codeNode:s,contentNodes:i}=A(t,e);return new g("Fragment",{},[s,...i])},x=t=>h(()=>{if(!t)return null;const r=p(t),n=u(r,{tags:C,nodes:{document:{...d.document,render:"div"},fence:{...d.fence,attributes:{...d.fence.attributes,label:{type:String,render:"data-label"},title:{type:String,render:"data-title"},highlight:{type:String,render:"data-highlight"}},transform:F}}});return b.react(n,m,{components:{...N,CodeBlock:k,Fragment:m.Fragment}})},[t]);export{T as containsMarkdocTags,x as useMarkdownText};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BannerConfig } from '@redocly/config';
|
|
2
|
+
type BannerResult = {
|
|
3
|
+
banner: BannerConfig | undefined;
|
|
4
|
+
dismissBanner: (content: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function useBanner(): BannerResult;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=useBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as g,useState as f,useEffect as l}from"react";import{useLocation as p}from"react-router-dom";import{useThemeConfig as y}from"@redocly/theme/core/hooks";import{usePageData as A}from"../../providers/page-data/hooks";import{getBannerForSlug as w}from"./utils/match-banner-target.js";const c="redocly-dismissed-banners",u="redocly-dismissed-banners-per-slug";function N(){const{banner:s}=y()||{},t=A()?.props?.frontmatter?.banner,S=p(),[o,d]=f(new Set),[i,m]=f(new Set);l(()=>{const r=localStorage.getItem(c),n=localStorage.getItem(u);if(r){const e=JSON.parse(r);Array.isArray(e)&&d(new Set(e))}if(n){const e=JSON.parse(n);Array.isArray(e)&&m(new Set(e))}},[]);const a=S.pathname;return{banner:g(()=>{if(t&&Array.isArray(t)&&t.length){if(i.has(a))return;for(const r of t)if(!o.has(r.content))return r;return}if(!(!s||!Array.isArray(s)||s.length===0)&&!i.has(a))return w(s,a,o)},[s,t,a,o,i]),dismissBanner:r=>{const n=new Set(o);n.add(r),d(n);const e=new Set(i);e.add(a),m(e),localStorage.setItem(c,JSON.stringify(Array.from(n))),localStorage.setItem(u,JSON.stringify(Array.from(e)))}}}export{N as useBanner};
|
|
@@ -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};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BannerConfig } from '@redocly/config';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a slug matches a target pattern
|
|
4
|
+
*/
|
|
5
|
+
export declare function matchesBannerTarget(slug: string, target: string | undefined): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the first matching banner for a slug, or undefined if none match
|
|
8
|
+
*/
|
|
9
|
+
export declare function getBannerForSlug(banners: BannerConfig[], slug: string, dismissedBanners?: Set<string>): BannerConfig | undefined;
|
|
10
|
+
//# sourceMappingURL=match-banner-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"picomatch";import{removeTrailingSlash as s}from"../../../../utils/url/remove-trailing-slash";import{normalizeRouteSlug as f}from"../../../../utils/path/normalize-route-slug";const u={};function c(t){if(!t)return!0;const r=t.trim();return r===""||r==="**"||r==="/**"}function l(t){const r=t.trim();if(c(r))return"**";let e=r.toLowerCase();return e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&!e.endsWith("*/")&&(e=e.slice(0,-1)),e}function m(t){return u[t]||(u[t]=a(t,{nocase:!0})),u[t]}function h(t,r){if(c(r)||!r)return!0;const e=s(f(t)).toLowerCase(),n=e.startsWith("/")?e.slice(1):e,i=l(r);if(!i.includes("*")){const o=i.startsWith("/")?i.slice(1):i;return n===s(o)}if(i.endsWith("**")){const o=s(i.slice(0,-2));if(n===o)return!0}return m(i)(n)}function S(t,r,e=new Set){if(!(!t||t.length===0)){for(const n of t)if(!e.has(n.content)&&h(r,n.target))return n}}export{S as getBannerForSlug,h as matchesBannerTarget};
|
|
@@ -3,7 +3,7 @@ import { AiSearchError } from '@redocly/theme/core/constants';
|
|
|
3
3
|
type AiSearchOptions = {
|
|
4
4
|
filter?: SearchFilterItem[];
|
|
5
5
|
};
|
|
6
|
-
export declare function useAiSearch(options?: AiSearchOptions
|
|
6
|
+
export declare function useAiSearch(options?: AiSearchOptions): {
|
|
7
7
|
askQuestion: (question: string, history?: AiSearchConversationItem[]) => Promise<void>;
|
|
8
8
|
isGeneratingResponse: boolean;
|
|
9
9
|
response: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as w,useState as o}from"react";import{AiSearchError as c}from"@redocly/theme/core/constants";import{withPathPrefix as K}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../../../constants/common";import{useI18nConfig as
|
|
1
|
+
import{useCallback as w,useState as o}from"react";import{AiSearchError as c}from"@redocly/theme/core/constants";import{withPathPrefix as K}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../../../constants/common";import{useSearchSession as U}from"@redocly/theme/core/contexts";import{useI18nConfig as _,useCurrentProduct as j,usePageVersions as B}from"../hooks";import{telemetry as W}from"../telemetry/index.js";function re(k){const{searchSessionId:x}=U(),[E,m]=o(),[b,g]=o([]),[M,P]=o(""),[O,i]=o([]),[Q,n]=o(!1),[v,e]=o(null),[I,l]=o(null),{currentLocale:F}=_(),J=j(),{versions:N=[]}=B()||{},h=N.find(t=>t?.active),S=w(()=>{m(""),g([]),n(!1),e(null)},[m,g,e]),G=w(()=>{S(),i([])},[S,i]);return{askQuestion:async(t,H)=>{if(!t)return;I&&I.abort();const A=new AbortController;l(A),S(),n(!0),P(t);let u="";fetch(K(L.ASK_AI),{method:"POST",body:JSON.stringify({text:t,history:H||[],locale:F,product:J?.name,filter:k?.filter,version:h&&{folder:h.folderId,label:h.label}}),signal:A.signal}).then(r=>{if(!r.ok){n(!1),r.status===401?e(c.Unauthorized):r.status===403?e(c.Forbidden):e(c.HttpRequestFailed);return}let f="";const y=r.body;if(!y)return;const T=y.getReader(),C=()=>{T.read().then(({value:d,done:V})=>{if(V){n(!1),l(null),f||e(c.EmptyResponse),t.trim().length>0&&u&&W.sendSearchAIQueryMessage({question:t,answer:f,resources:JSON.stringify(b),searchSessionId:x,messageId:u});return}const z=new TextDecoder().decode(d),D=/data: (.*)/g;let p;for(;(p=D.exec(z))!==null;){if(!p[1])continue;const a=JSON.parse(p[1]);if(a.messageId)u=a.messageId,i(s=>{if(s.length===0)return s;const R=s[s.length-1];return R.role==="assistant"&&!R.messageId?[...s.slice(0,-1),{...R,messageId:u}]:s});else if(a.answer)f+=a.answer,m(f);else if(a.sources){const s=Math.floor(Math.random()*3)+4;g(a.sources.slice(0,s))}}C()}).catch(d=>{d.name!=="AbortError"&&(console.error(d),n(!1),l(null),e(c.ErrorProcessingResponse))})};C()}).catch(r=>{r.name!=="AbortError"&&(console.error(r),n(!1),l(null),e(c.HttpRequestFailed))})},isGeneratingResponse:Q,response:E,resources:b,question:M,error:v,clearConversation:G,conversation:O,setConversation:i}}export{re as useAiSearch};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SearchItemData, SearchFilterItem, SearchFacet } from '@redocly/theme/core/types';
|
|
2
|
-
export declare function useSearch(product?: string, disableAutoSearch?: boolean
|
|
2
|
+
export declare function useSearch(product?: string, disableAutoSearch?: boolean): {
|
|
3
3
|
query: string;
|
|
4
4
|
setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
5
5
|
filter: SearchFilterItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as I,useEffect as y,useState as F,useRef as T}from"react";import{SEARCH_DEBOUNCE_TIME_MS as G}from"@redocly/theme/core/constants";import{withPathPrefix as _}from"@redocly/theme/core/utils";import{SEARCH_GROUP_FACET_FIELD as b,SEARCH_PRODUCT_FIELD as N,SEARCH_VERSION_FIELD as k,ServerRoutes as O}from"../../../constants/common";import{debounce as M}from"../../../utils/time/debounce.js";import{useSearchSession as Q}from"@redocly/theme/core/contexts";import{useGlobalData as U,useI18nConfig as P}from"../hooks";import{usePageVersions as x}from"../../providers/page-data/hooks";import{useFacets as J}from"./useFacets";import{telemetry as B}from"../telemetry/index.js";const K=(s,n,e,r,a,c,i,f)=>{const{searchSessionId:d}=Q(),{currentLocale:m}=P(),l=T(""),p=I(M(async(t,h,u,S)=>{if(!t.trim().length&&!h.length){e({}),r({}),a(!1);return}const R={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:t,filter:A(h,S,c),locale:u})};try{const o=await fetch(_(O.SEARCH),R);if(l.current===t){const E=await o.json();r(E.facets),e(E.documents),t.trim().length>1&&B.sendSearchQueryMessage({query:t,resultCount:Object.keys(E.documents).length.toString(),searchSessionId:d})}a(!1)}catch(o){e({}),console.log(o)}},G),[c?.version,c?.folderId,i]);return y(()=>{f||(a(!0),p(s,n,m,i),l.current=s)},[f,n,m,i,s,p,a]),{}},z=(s,n,e,r,a,c,i,f)=>{const{currentLocale:d}=P();y(()=>{m(e,s,n,d,r,a,f)},[r,f]);const m=I(async(l,p,t,h,u,S,R)=>{if(u){const{groupKey:o}=u;i(!0);const v={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:p,filter:(()=>{const g=S.find(C=>C.field===b);return g&&!t.find(L=>L.field===g?.field)?[...t,{field:g.field,values:[o]}]:A(t,R)})(),loadMore:u,locale:h})},D=await(await fetch(_(O.SEARCH),v)).json(),H=l[o]||[],j=D.documents[o],w={...l,[o]:[...H,...j]};c(w),i(!1)}},[]);return{}};function ne(s,n){const{searchFeatures:e}=U(),[r,a]=F(""),[c,i]=F([]),[f,d]=F({}),[m,l]=F({}),[p,t]=F(),[h,u]=F(!1),{facets:S}=J(m),{versions:R=[]}=x()||{},o=R.find(E=>E?.active);return K(r,c,d,l,u,o,s,n),z(r,c,f,p,S,d,u,s),{query:r,setQuery:a,filter:c,setFilter:i,items:f,isSearchLoading:h,facets:S,groupField:b,setLoadMore:t,advancedSearch:e?.advanced?.enabled,askAi:e?.ai?.enabled}}function A(s,n,e){return[...s,...n?[{field:N,values:[n]}]:[],...e?[{field:k,values:[...e.default?["default"]:[e.folderId,e.version]]}]:[]]}export{ne as useSearch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{ThemeDataContext as m,SearchSessionProvider as l}from"@redocly/theme/core/contexts";import{useBreadcrumbs as d,useBanner as g,useCatalogClassic as p,useCurrentProduct as f,useGlobalData as o,useI18n as b,useI18nConfig as C,useL10n as S,useL10nConfig as h,usePageData as r,usePageSharedData as P,usePageVersions as T,usePreloadHistory as D,useProducts as k,useUserMenu as v,useSubmitFeedback as F,useTranslate as L,useSidebarSiblingsData as M,usePageProps as E,useUserTeams as O,useMarkdownText as R,useCodeHighlight as w,useLoadAndNavigate as x,useCatalog as y,useCatalogSort as A,useCatalogSearch as I,useFetchCatalogEntities as j,useFetchCatalogEntitiesRelations as B,useTelemetry as s,useMcpData as H}from"../../app/hooks";import{Link as N}from"../../app/Link";import{useFacetQuery as U,useSearch as _,useAiSearch as G}from"../../app/search";import{useSidebarItems as Q}from"../../app/Sidebar/useSidebarItems";import{deepMerge as V}from"../../../utils/object/deep-merge";import{allowlistObject as W}from"../../../utils/object/allowlist-object";const q=["title","description","seo","sidebar","excludeFromSearch","template","redirects","rbac","metadata","slug","codeSnippet","breadcrumbs","markdown","seo","navbar","footer","colorMode","feedback","navigation","banner"],z={useBreadcrumbs:d,useBanner:g,useCatalog:y,useCatalogSort:A,useCatalogSearch:I,useFetchCatalogEntities:j,useFetchCatalogEntitiesRelations:B,useCatalogClassic:p,useCurrentProduct:f,useGlobalData:o,useSearch:_,useAiSearch:G,useFacetQuery:U,useI18n:b,useI18nConfig:C,useL10n:S,useL10nConfig:h,usePageData:r,usePageSharedData:P,usePageVersions:T,usePreloadHistory:D,useProducts:k,useUserMenu:v,useSidebarItems:Q,useSidebarSiblingsData:M,useSubmitFeedback:F,useTranslate:L,useUserTeams:O,usePageProps:E,useMarkdownText:R,useCodeHighlight:w,useLoadAndNavigate:x,useTelemetry:s,useOtelTelemetry:s,useMcpData:H},J={LinkComponent:N};function oe({children:n}){const{props:t}=r()||{},a=o()||{},u=e.useMemo(()=>{const c=W(t?.frontmatter||{},q);return V(a,c)},[a,t?.frontmatter]),i={hooks:z,components:J,config:u};return e.createElement(l,null,e.createElement(m.Provider,{value:i},n))}export{oe as ThemeDataProvider};
|
|
@@ -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
|
-
const e="@redocly/realm",r="Realm",t={apiFunctions:!0,asyncapi:!0,soap:!0,reactPages:!0,catalog:!0,catalogClassic:!0,lint:!1,scorecard:!0,l10n:!0,openapi:!0,graphql:!0,markdown:!0,devOnboarding:!0,seo:!0,redirects:!0,customPlugins:!0,themeEjecting:!0,products:!0,breadcrumbs:!0,mockServer:!0,codeWalkthrough:!0,scorecards:!0};export{e as PACKAGE_NAME,t as PRODUCT_GATES,r as PRODUCT_NAME};
|
|
1
|
+
const e="@redocly/realm",r="Realm",t={apiFunctions:!0,asyncapi:!0,soap:!0,reactPages:!0,catalog:!0,catalogClassic:!0,lint:!1,scorecard:!0,l10n:!0,openapi:!0,graphql:!0,markdown:!0,devOnboarding:!0,seo:!0,redirects:!0,customPlugins:!0,themeEjecting:!0,products:!0,breadcrumbs:!0,mockServer:!0,codeWalkthrough:!0,scorecards:!0,banner:!0};export{e as PACKAGE_NAME,t as PRODUCT_GATES,r as PRODUCT_NAME};
|
package/dist/constants/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AuthProviderType as e}from"@redocly/config";import{withPathPrefix as r}from"@redocly/theme/core/utils";const i="openapi_docs",L="asyncapi_docs",R="graphql_docs",I="/_spec-gql",C="markdoc",S="tags",n="*",l={[n]:"read"},d=["openid","email"],P=1440*60,N="anonymous",u="authenticated",D="**",h="Reunite",x="translations.yaml",m="redocly.yaml",U="@redocly/theme",g="@theme",M="/app-data.json",G="/eject-component",
|
|
1
|
+
import{AuthProviderType as e}from"@redocly/config";import{withPathPrefix as r}from"@redocly/theme/core/utils";const i="openapi_docs",L="asyncapi_docs",R="graphql_docs",I="/_spec-gql",C="markdoc",S="tags",n="*",l={[n]:"read"},d=["openid","email"],P=1440*60,N="anonymous",u="authenticated",D="**",h="Reunite",x="translations.yaml",m="redocly.yaml",U="@redocly/theme",g="@theme",M="/app-data.json",G="/eject-component",a=process.env.SERVER_EDITOR_APP_URL||"http://127.0.0.1:3000",b=process.env.REDOCLY_CORS_ORIGINS?process.env.REDOCLY_CORS_ORIGINS.split(",").map(o=>o.trim()).filter(Boolean).concat(a):[a];var _;(function(o){o.BUILD="build",o.DEVELOP="develop",o.PREPARE="prepare"})(_||(_={}));var c;(function(o){o.RATING="rating",o.SENTIMENT="sentiment",o.COMMENT="comment",o.MOOD="mood",o.PROBLEM="problem",o.SCALE="scale"})(c||(c={}));const t="entityKey",A="entityRelationId",s={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:"/_auth/oidc",SAML_CALLBACK:"/_auth/saml2",REDOCLY_CALLBACK:"/_auth/redocly",REPLAY_OAUTH2_CALLBACK:"/_auth/replay-oauth2",REDOCLY_LOGIN_CALLBACK:"/_auth/redocly/redocly-login",REDOCLY_TOKEN_LOGIN:"/_auth/redocly-token-login",SEARCH:"/_search",SEARCH_FACETS:"/_search-facets",LOGOUT:"/logout",LOGIN:"/login",IDP_LOGIN:"/_auth/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",CATALOG_ENTITIES:`/catalog-entities/:${t}?`,CATALOG_ENTITIES_RELATIONS:`/catalog-entities-relations/:${A}?`,BFF_CATALOG_ENTITIES:`/bff/catalog-entities/:${t}?`,BFF_CATALOG_RELATED_ENTITIES:`/bff/catalog-related-entities/:${t}`,BFF_CATALOG_REVISIONS:`/bff/catalog-revisions/:${t}`,MCP_OAUTH_AUTHORIZATION_SERVER:"/.well-known/oauth-authorization-server",MCP_OAUTH_PROTECTED_RESOURCE:"/.well-known/oauth-protected-resource/mcp",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"},v={[e.SAML2]:r(s.IDP_LOGIN),[e.OIDC]:r(s.IDP_LOGIN)};var E;(function(o){o.AI_SEARCH="aiSearch"})(E||(E={}));const F="/login",y="/invite",H={AUTH0_PASS:"/auth/auth0-pass"},B={NotExist:"ENOENT"},f="default_locale",k="sidebar-",V="PUBLIC_",K=["BROKEN_LINK","MARKDOC","RESOLVE"],Y=["logo","navbar","products","footer","sidebar","scripts","links","feedback","search","aiAssistant","colorMode","navigation","codeSnippet","markdown","openapi","graphql","analytics","userMenu","versionPicker","breadcrumbs","catalog","entitiesCatalog","scorecard","scorecards","scorecardClassic","mcp","banner"],O="redocly_category",w="redocly_product",j="redocly_version",q="redocly_teams",$=O,Q={asyncapi:"asyncapi",apiFunctions:"apiFunctions",reactPages:"reactPages",catalog:"catalog",catalogClassic:"catalogClassic",lint:"lint",scorecard:"scorecard",scorecards:"scorecards",l10n:"l10n",openapi:"openapi",graphql:"graphql",markdown:"markdown",devOnboarding:"devOnboarding",seo:"seo",redirects:"redirects",customPlugins:"customPlugins",themeEjecting:"themeEjecting",products:"products",breadcrumbs:"breadcrumbs",mockServer:"mockServer",sso:"sso",rbac:"rbac",analytics:"analytics",removeAttribution:"removeAttribution",advancedSearch:"advancedSearch",soap:"soap",ssoDirect:"ssoDirect",codeWalkthrough:"codeWalkthrough",aiSearchLimit:"aiSearchLimit",mcp:"mcp",banner:"banner"};export{b as ALLOWED_CORS_ORIGINS,L as ASYNC_API_DOCS_TEMPLATE_ID,t as CATALOG_ENTITY_KEY,A as CATALOG_ENTITY_RELATION_ID,m as CONFIG_FILE_NAME,C as CUSTOM_MARKDOC_OPTIONS_PATH,S as CUSTOM_MARKDOC_TAGS_PATH,N as DEFAULT_ANONYMOUS_VISITOR_TEAM,u as DEFAULT_AUTHENTICATED_TEAM,P as DEFAULT_COOKIE_EXPIRATION,f as DEFAULT_LOCALE_PLACEHOLDER,v as DEFAULT_PROVIDERS_LOGIN_URLS,D as DEFAULT_RBAC_SCOPE,h as DEFAULT_SSO_IDP_TITLE,U as DEFAULT_THEME_NAME,F as DEV_LOGIN_SLUG,G as EJECT_COMPONENT_URL,H as ExternalRoutes,Q as FEATURE,c as FEEDBACK_TYPES,B as FsErrors,M as GLOBAL_DATA_URL,I as GRAPHQL_SPEC_SLUG,R as GRAPHQL_TEMPLATE_ID,y as INVITE_SLUG,K as MARKDOC_ERROR_TYPES,i as OPENAPI_DOCS_TEMPLATE_ID,V as PUBLIC_ENV_PREFIX,l as PUBLIC_RBAC_SCOPE_ITEM,n as RBAC_ALL_OTHER_TEAMS,d as REQUIRED_OIDC_SCOPES,E as RbacFeatures,O as SEARCH_CATEGORY_FIELD,$ as SEARCH_GROUP_FACET_FIELD,w as SEARCH_PRODUCT_FIELD,q as SEARCH_RBAC_FIELD,j as SEARCH_VERSION_FIELD,a as SERVER_EDITOR_APP_URL,k as SIDEBAR_PREFIX,s as ServerRoutes,x as TRANSLATIONS_FILE_NAME,Y as UI_ACCESSIBLE_CONFIG_PROPS,g as USER_THEME_ALIAS,_ as cliCommandNames};
|
|
@@ -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{redocConfigSchema as m,rootRedoclyConfigSchema as t}from"@redocly/config";import p from"is-glob";import{I18N_DIR_NAME as d,L10N_DIR_NAME as u}from"../../../constants/common.js";import{CONFIG_FILE_NAME as f}from"../../../../constants/common.js";import{DEFAULT_SEARCH_ENGINE as A}from"../../../constants/plugins/search.js";import{deepMerge as F}from"../../../../utils/object/deep-merge.js";import{logger as
|
|
1
|
+
import{redocConfigSchema as m,rootRedoclyConfigSchema as t}from"@redocly/config";import p from"is-glob";import{I18N_DIR_NAME as d,L10N_DIR_NAME as u}from"../../../constants/common.js";import{CONFIG_FILE_NAME as f}from"../../../../constants/common.js";import{DEFAULT_SEARCH_ENGINE as A}from"../../../constants/plugins/search.js";import{deepMerge as F}from"../../../../utils/object/deep-merge.js";import{logger as b}from"../../../tools/notifiers/logger.js";import{EntitlementsProvider as C}from"../../../entitlements/entitlements-provider.js";import{readAndValidateConfig as h}from"./utils/read-and-validate-config.js";import{resolvePlugins as v}from"../../../config/external-plugins.js";import{getPathForAllLocales as l}from"../../../fs/utils/get-path-for-all-locales.js";import{parseRbacConfig as y}from"../../../utils/rbac.js";import{RbacConfigLocation as g,validateRbacConfig as S}from"../../validate-rbac-config.js";const z=async(e,{fs:r},a)=>{const n=await h(e,r,a,async c=>e===f?E(r.cwd,c?.plugins||[]):void 0);n?.rbac&&(n.rbac=await y(n.rbac),S(n.rbac,e===f?g.RootRedoclyYaml:void 0)),(n?.l10n||n?.i18n)&&(n.l10n=L(n),n.i18n=void 0);const s=F(n||{},{markdown:{partialsFolders:(n?.markdown?.partialsFolders||[]).flatMap(c=>l(c,r))}});return R({...s,configPath:e,ignore:I(n?.ignore,r)})};async function E(e,r){const a=await v(e,r),n=a.map(i=>i.config.schema?i.lifecyclePlugin.id:""),s={};for(const i of a){const o=i.lifecyclePlugin?.id;i.config.schema&&o&&t.properties&&(s[o]=i.config.schema)}return{...t,properties:{...s,...t.properties,openapi:m},$id:t.$id+n.join("")}}function R(e){const r=C.instance();return r.canAccessFeature("apiFunctions")||(e.apiFunctions=void 0),r.canAccessFeature("products")||(e.products=void 0),r.canAccessFeature("breadcrumbs")||(e.breadcrumbs={hide:!0}),r.canAccessFeature("seo")||(e.seo=void 0),r.canAccessFeature("redirects")||(e.redirects={}),r.canAccessFeature("l10n")||(e.l10n=void 0),r.canAccessFeature("rbac")||(e.rbac=void 0),r.canAccessFeature("sso")||(e.sso=void 0),r.canAccessFeature("ssoDirect")||(e.ssoDirect=void 0),r.canAccessFeature("catalogClassic")||(e.catalog=void 0,e.catalogClassic=void 0),r.canAccessFeature("scorecard")||(e.scorecard=void 0,e.scorecardClassic=void 0),r.canAccessFeature("scorecards")||(e.scorecards=void 0),r.canAccessFeature("devOnboarding")||(e.developerOnboarding=void 0),r.canAccessFeature("analytics")||(e.analytics=void 0),r.canAccessFeature("removeAttribution")||(e.removeAttribution=void 0),r.canAccessFeature("mockServer")||(e.mockServer={off:!0}),r.canAccessFeature("advancedSearch")||e.search&&(e.search.engine=A),r.canAccessFeature("banner")||(e.banner=void 0),e}function I(e=[],r){return["static",...e].flatMap(a=>p(a)&&(a.startsWith("*")||a.startsWith(u)||a.startsWith("/"+u)||a.startsWith(d)||a.startsWith("/"+d))?a:l(a,r))}function L(e){return e.i18n&&b.warn("The `i18n` configuration is deprecated. Please use `l10n` instead."),e.l10n||e.i18n||{}}export{z as redoclyConfigLoader};
|
|
@@ -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",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"os-browserify": "0.3.0",
|
|
71
71
|
"path-browserify": "1.0.1",
|
|
72
72
|
"picomatch": "2.3.1",
|
|
73
|
-
"react": "^19.1
|
|
73
|
+
"react": "^19.2.1",
|
|
74
74
|
"react-calendar": "5.1.0",
|
|
75
75
|
"react-date-picker": "11.0.0",
|
|
76
|
-
"react-dom": "^19.1
|
|
76
|
+
"react-dom": "^19.2.1",
|
|
77
77
|
"react-router-dom": "^6.21.1",
|
|
78
78
|
"react-select": "5.10.1",
|
|
79
79
|
"reactjs-popup": "2.0.6",
|
|
@@ -92,18 +92,18 @@
|
|
|
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.
|
|
96
|
-
"@redocly/config": "0.
|
|
97
|
-
"@redocly/graphql-docs": "1.
|
|
98
|
-
"@redocly/openapi-docs": "3.
|
|
99
|
-
"@redocly/portal-legacy-ui": "0.
|
|
100
|
-
"@redocly/portal-plugin-mock-server": "0.
|
|
101
|
-
"@redocly/realm-asyncapi-sdk": "0.
|
|
102
|
-
"@redocly/theme": "0.
|
|
95
|
+
"@redocly/asyncapi-docs": "1.6.0-next.0",
|
|
96
|
+
"@redocly/config": "0.41.0",
|
|
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
|
-
"react": "^19.1
|
|
106
|
-
"react-dom": "^19.1
|
|
105
|
+
"react": "^19.2.1",
|
|
106
|
+
"react-dom": "^19.2.1"
|
|
107
107
|
},
|
|
108
108
|
"nx": {
|
|
109
109
|
"implicitDependencies": [
|
|
@@ -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
|