@redocly/realm 0.141.0-next.20 → 0.141.0-next.22

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/cli/build/libsql/copy-prebuilt-binary.js +1 -1
  3. package/dist/client/app/Sidebar/Sidebar.js +2 -3
  4. package/dist/client/app/hooks/catalog/useFetchCatalogEntities.d.ts +5 -0
  5. package/dist/client/app/hooks/catalog/useFetchCatalogEntities.js +1 -1
  6. package/dist/client/app/hooks/catalog/useFetchCatalogEntitiesRelations.d.ts +5 -0
  7. package/dist/client/app/hooks/catalog/useFetchCatalogEntitiesRelations.js +1 -1
  8. package/dist/client/app/hooks/markdown/useMarkdownText.js +1 -1
  9. package/dist/client/app/l10n/hooks/useL10n.d.ts +2 -4
  10. package/dist/client/app/markdoc/embedded-code-components.d.ts +8 -0
  11. package/dist/client/app/markdoc/embedded-code-components.js +1 -0
  12. package/dist/client/templates/api-docs/helpers.js +2 -2
  13. package/dist/markdoc/nodes/fence/index.js +1 -1
  14. package/dist/server/node-bundle-entry.js +1 -1
  15. package/dist/server/plugins/config-parser/loaders/utils/read-and-validate-config.js +1 -1
  16. package/dist/server/plugins/mcp/gateway-mcp/api-call-operations.d.ts +2 -2
  17. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/request-limiter/apply-edge-rate-limit.js +1 -1
  18. package/dist/server/plugins/mcp/types.d.ts +3 -1
  19. package/dist/server/plugins/mcp/utils/xmcp-utils.js +1 -1
  20. package/dist/server/providers/database/client.d.ts +3 -3
  21. package/dist/server/providers/database/client.js +1 -1
  22. package/dist/server/providers/database/database-connection-factory.js +1 -1
  23. package/dist/server/utils/sandbox-context.js +1 -1
  24. package/dist/server/web-server/dev-server.js +1 -1
  25. package/dist/server/web-server/node-asset-reader.d.ts +1 -1
  26. package/dist/utils/l10n/build-i18n-config.js +1 -1
  27. package/package.json +14 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,81 @@
1
1
  # @redocly/realm
2
2
 
3
+ ## 0.141.0-next.22
4
+
5
+ ### Minor Changes
6
+
7
+ - 07d0489aaaf: Added `isLoading`, `hasMore`, `isLoadingMore`, `loadMore` and `isPlaceholderData` to the catalog entity hook results and deprecated their `query` field for ejected catalog components.
8
+ - 189240aa3cb: Updated code snippets to use the page background color for the code, and the layer color for headers with a title or a language dropdown.
9
+ - 189240aa3cb: Added the `previewLines` code block attribute and the `codeSnippet.previewLines` option to shorten long code snippets with a **Show more** button.
10
+ - 32a0382dc0d: Aligned the navbar logo with sidebar items and added the `--navbar-logo-margin-start` CSS variable to control the space before the logo. This variable replaces the left side of `--navbar-logo-margin`.
11
+ - 32a0382dc0d: Added the `sidebar.chevronPosition` option to position group chevrons on the right.
12
+ - 1dad33f83d9: Added the `closeOnClick` option to the `Tooltip` component to keep the tooltip open when users click its trigger.
13
+ - 5c30a1c62ff: Added the `Trans` component to translate sentences that contain React elements in React pages, with numbered placeholders that let each language set its word order.
14
+ - 9cba16436c7: Added the `x-mcp.hide` option to hide a path or an operation from the MCP server. The `x-mcp.docs.hide` option is deprecated and works as before.
15
+
16
+ ### Patch Changes
17
+
18
+ - 076d410f086: Fixed an issue where the Markdown copy of a page, which AI agents and `llms.txt` read, left out OpenAPI code and response samples for webhooks and some other operations.
19
+ - 076d410f086: Fixed an issue where OpenAPI code samples in the Markdown copy of a page used the wrong HTTP method for `QUERY` operations.
20
+ - da6634c1866: Fixed security vulnerability `CVE-2026-128080` by upgrading `@opentelemetry/instrumentation-http` to version `0.223.2`.
21
+ - 3d7ea2b9eaf: Fixed security vulnerability `CVE-2026-63402` by upgrading `i18next` to version `26.7.2`.
22
+ - 36f1a64d4f5: Fixed an issue where the mock server used more memory and skipped some request validation after an API description changed.
23
+ - 4d059bf1fea: Fixed an issue where server-side code, such as MCP tools, couldn't make network requests when the project ran on Node.js 25 or later.
24
+ - baac2d6fd40: Fixed an issue where a line break from an input method editor went into a one-line field other than the URL in the **Try it** console and Replay.
25
+ - 1dad33f83d9: Fixed an issue in the **Try it** console where a click on an info icon, a status, or a shortened text hid its tooltip.
26
+ - a31ef11b510: Fixed Replay saving the values of inputs used in a request URL to the request history in the browser.
27
+ - baac2d6fd40: Updated one-line fields other than the URL in the **Try it** console and Replay to remove the line breaks from pasted multi-line text, as the URL field does. Before, each line break became a space.
28
+ - a31ef11b510: Fixed Replay sending the values of Secret inputs and of inputs kept only in memory in its telemetry.
29
+ - 2c10a682d6a: Fixed an issue in the **Try it** console and Replay where the close icon didn't close notifications.
30
+ - a31ef11b510: Fixed API reference code samples showing the values of Secret inputs and of inputs kept **Until Try it closes** after **Try it** closes.
31
+ - a0f5ffc3805: Fixed an issue in the **Try it** console and Replay where the value list of a field opened over the details of an `{$inputs.name}` expression.
32
+ - 32a0382dc0d: Aligned sidebar items, section titles, icons, and the back button with the navbar logo.
33
+ - 32a0382dc0d: Added spacing between sidebar sections.
34
+ - Updated dependencies [b9dada01e21]
35
+ - Updated dependencies [2b3e75566f7]
36
+ - Updated dependencies [2b3e75566f7]
37
+ - Updated dependencies [be639b1c90c]
38
+ - Updated dependencies [be639b1c90c]
39
+ - Updated dependencies [076d410f086]
40
+ - Updated dependencies [076d410f086]
41
+ - Updated dependencies [96181b2e0b8]
42
+ - Updated dependencies [df1d7e2c9e7]
43
+ - Updated dependencies [da6634c1866]
44
+ - Updated dependencies [07d0489aaaf]
45
+ - Updated dependencies [189240aa3cb]
46
+ - Updated dependencies [189240aa3cb]
47
+ - Updated dependencies [3d7ea2b9eaf]
48
+ - Updated dependencies [cea1b781e34]
49
+ - Updated dependencies [32a0382dc0d]
50
+ - Updated dependencies [32a0382dc0d]
51
+ - Updated dependencies [32a0382dc0d]
52
+ - Updated dependencies [3cae620b5f9]
53
+ - Updated dependencies [32a0382dc0d]
54
+ - Updated dependencies [1dad33f83d9]
55
+ - Updated dependencies [5c30a1c62ff]
56
+ - Updated dependencies [03bd33343ab]
57
+ - @redocly/api-docs@0.6.0-next.22
58
+ - @redocly/realm-asyncapi-sdk@0.18.0-next.4
59
+ - @redocly/theme@0.73.0-next.17
60
+ - @redocly/portal-plugin-mock-server@0.26.0-next.7
61
+
62
+ ## 0.141.0-next.21
63
+
64
+ ### Patch Changes
65
+
66
+ - ff3b15ef882: Deprecated `SearchAiDialog` in favor of `AiAssistantConversation`. If you ejected `SearchAiDialog`, move your customizations to an ejected `AiAssistantConversation` and update CSS selectors targeting `[data-component-name="Search/SearchAiDialog"]` to use `AiAssistant/AiAssistantConversation`. Ejected `SearchDialog` components require no changes.
67
+ - 37551193756: Removed the unused `externalSource` and `skipHighlight` properties and the `select` and `deselect` controls from code blocks.
68
+ Code blocks now accept only their declared properties, so a custom component that passes other properties, such as `aria-*` or `data-*` attributes, gets a type error.
69
+ - 37551193756: Fixed an issue where users could activate a disabled dropdown menu item with the keyboard.
70
+ - 020c5a580b3: Fixed an issue where a translation key with an empty value displayed the key instead of the default locale's translation or the default text.
71
+ - Updated dependencies [ff3b15ef882]
72
+ - Updated dependencies [c4a2398f11d]
73
+ - Updated dependencies [37551193756]
74
+ - Updated dependencies [f66657f75e9]
75
+ - Updated dependencies [37551193756]
76
+ - @redocly/theme@0.73.0-next.16
77
+ - @redocly/api-docs@0.6.0-next.21
78
+
3
79
  ## 0.141.0-next.20
4
80
 
5
81
  ### Minor Changes
@@ -1 +1 @@
1
- import n from"node:path";import{createRequire as c}from"node:module";import{cpSync as m}from"node:fs";import{currentPlatform as a}from"./get-current-platform.js";const r=c(import.meta.url);function f(i){const l=a(),t=r.resolve("@libsql/client"),e=r.resolve("libsql",{paths:[t]}),o=r.resolve(`@libsql/${l}`,{paths:[e]}),s=n.dirname(o);m(s,`${i}/node_modules/@libsql/${l}`,{recursive:!0})}export{f as copyLibsqlPrebuiltBinary};
1
+ import n from"node:path";import{createRequire as a}from"node:module";import{cpSync as m}from"node:fs";import{hasProjectDatabase as c}from"../../../server/providers/database/has-project-database.js";import{currentPlatform as b}from"./get-current-platform.js";const r=a(import.meta.url);function h(e){if(!c())return;const t=b(),i=r.resolve("@libsql/client"),l=r.resolve("libsql",{paths:[i]}),o=r.resolve(`@libsql/${t}`,{paths:[l]}),s=n.dirname(o);m(s,`${e}/node_modules/@libsql/${t}`,{recursive:!0})}export{h as copyLibsqlPrebuiltBinary};
@@ -1,11 +1,10 @@
1
- import e,{useEffect as w,useState as b}from"react";import h from"styled-components";import{Menu as B}from"@redocly/theme/components/Menu/Menu";import{SidebarActions as A}from"@redocly/theme/components/SidebarActions/SidebarActions";import{Sidebar as D}from"@redocly/theme/components/Sidebar/Sidebar";import{VersionPicker as I}from"@redocly/theme/components/VersionPicker/VersionPicker";import{Button as L}from"@redocly/theme/components/Button/Button";import{CatalogEntityHistoryButton as P}from"@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton";import{ArrowLeftIcon as C}from"@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon";import{withPathPrefix as x,getBaseDataAttributes as T,generateBeforeAfterContext as M}from"@redocly/theme/core/utils";import{telemetry as v}from"../telemetry/index.js";import{usePreloadHistory as R}from"../usePreloadHistory";import{useTranslate as V}from"../hooks";import{useGlobalData as H}from"../useGlobalData";import{usePageSharedData as q,usePageVersions as F}from"../../providers/page-data/hooks";import{useSidebarItems as j}from"./useSidebarItems";import{renderAdmonition as z,RequestAccessButton as G}from"./RequestAccessButton";import{PoweredByRedocly as K,SidebarFooterControls as O}from"./PoweredByRedocly";function de({layoutControls:l}){const{versions:r=[]}=F()||{},m=r.find(t=>t?.active),{translate:a}=V(),{removeAttribution:g}=H(),{currentItems:c,backLink:n,versionLabel:i,pushDrilldownState:k,popDrilldownState:S}=j(m),[d,E]=b(),{collapsedSidebar:o}=l,u=q("apiDocsStore")?.apiId,y=R(),[p,s]=b(void 0);return w(()=>{const t=setTimeout(()=>s(void 0),350);return()=>clearTimeout(t)},[p]),!c.length&&r.length<2?null:e.createElement(e.Fragment,null,e.createElement(D,{collapsed:o,menuItemsAnimation:p,versions:e.createElement(I,{versions:r,onChange:t=>{v.sendVersionPickerChangedMessage([...M("versionPicker","dropdown",{version:m?.version||""},{version:t?.version||""})]);const f=location.hash?t?.link+location.hash:t?.link;f&&y.push(x(f))}}),menu:e.createElement(B,{items:c,onDrilldownOpen:t=>{s("slideInRight"),k(t)}}),footer:e.createElement("div",{style:{width:"100%"}},!o&&z(d),e.createElement(O,{$collapsed:o},!g&&!o&&e.createElement(K,null),e.createElement(A,{...l,requestAccessButton:u?e.createElement(G,{apiId:u,status:d,setStatus:E}):null}))),header:(n||i)&&e.createElement($,null,n&&e.createElement(J,{icon:e.createElement(C,null),iconPosition:"left",variant:"ghost",size:"medium","data-component-name":"Sidebar/BackButton",to:n.slug,onClick:()=>{s("slideInLeft"),S(),v.sendSidebarDrilldownBackClickedMessage([T("sidebarDrilldownBack","button")])}},o?"":n.label?e.createElement("div",{"data-translation-key":"sidebar.menu.backToLabel"},a("sidebar.menu.backToLabel",{value:a(n.labelTranslationKey,n.label)})):e.createElement("div",{"data-translation-key":"sidebar.menu.backLabel"},a("sidebar.menu.backLabel"))),i&&!o&&e.createElement(P,{version:i}))}))}const $=h.div`
1
+ import e,{useEffect as w,useState as b}from"react";import h from"styled-components";import{Menu as B}from"@redocly/theme/components/Menu/Menu";import{SidebarActions as A}from"@redocly/theme/components/SidebarActions/SidebarActions";import{Sidebar as D}from"@redocly/theme/components/Sidebar/Sidebar";import{VersionPicker as I}from"@redocly/theme/components/VersionPicker/VersionPicker";import{Button as L}from"@redocly/theme/components/Button/Button";import{CatalogEntityHistoryButton as P}from"@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton";import{ArrowLeftIcon as C}from"@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon";import{withPathPrefix as x,getBaseDataAttributes as T,generateBeforeAfterContext as M}from"@redocly/theme/core/utils";import{telemetry as k}from"../telemetry/index.js";import{usePreloadHistory as R}from"../usePreloadHistory";import{useTranslate as V}from"../hooks";import{useGlobalData as H}from"../useGlobalData";import{usePageSharedData as q,usePageVersions as F}from"../../providers/page-data/hooks";import{useSidebarItems as j}from"./useSidebarItems";import{renderAdmonition as z,RequestAccessButton as G}from"./RequestAccessButton";import{PoweredByRedocly as K,SidebarFooterControls as O}from"./PoweredByRedocly";function de({layoutControls:l}){const{versions:r=[]}=F()||{},m=r.find(t=>t?.active),{translate:a}=V(),{removeAttribution:g}=H(),{currentItems:c,backLink:n,versionLabel:i,pushDrilldownState:v,popDrilldownState:S}=j(m),[d,E]=b(),{collapsedSidebar:o}=l,u=q("apiDocsStore")?.apiId,y=R(),[p,s]=b(void 0);return w(()=>{const t=setTimeout(()=>s(void 0),350);return()=>clearTimeout(t)},[p]),!c.length&&r.length<2?null:e.createElement(e.Fragment,null,e.createElement(D,{collapsed:o,menuItemsAnimation:p,versions:e.createElement(I,{versions:r,onChange:t=>{k.sendVersionPickerChangedMessage([...M("versionPicker","dropdown",{version:m?.version||""},{version:t?.version||""})]);const f=location.hash?t?.link+location.hash:t?.link;f&&y.push(x(f))}}),menu:e.createElement(B,{items:c,onDrilldownOpen:t=>{s("slideInRight"),v(t)}}),footer:e.createElement("div",{style:{width:"100%"}},!o&&z(d),e.createElement(O,{$collapsed:o},!g&&!o&&e.createElement(K,null),e.createElement(A,{...l,requestAccessButton:u?e.createElement(G,{apiId:u,status:d,setStatus:E}):null}))),header:(n||i)&&e.createElement($,null,n&&e.createElement(J,{icon:e.createElement(C,null),iconPosition:"left",variant:"ghost",size:"medium","data-component-name":"Sidebar/BackButton",to:n.slug,onClick:()=>{s("slideInLeft"),S(),k.sendSidebarDrilldownBackClickedMessage([T("sidebarDrilldownBack","button")])}},o?"":n.label?e.createElement("div",{"data-translation-key":"sidebar.menu.backToLabel"},a("sidebar.menu.backToLabel",{value:a(n.labelTranslationKey,n.label)})):e.createElement("div",{"data-translation-key":"sidebar.menu.backLabel"},a("sidebar.menu.backLabel"))),i&&!o&&e.createElement(P,{version:i}))}))}const $=h.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: var(--menu-header-container-gap);
5
5
  width: 100%;
6
6
  `,J=h(L)`
7
- padding: var(--menu-item-padding-vertical) 0;
8
- height: calc(var(--line-height-base) + var(--menu-item-padding-vertical) * 2);
7
+ padding: 0;
9
8
  justify-content: flex-start;
10
9
  width: 100%;
11
10
  `;export{de as Sidebar};
@@ -3,5 +3,10 @@ export declare function useFetchCatalogEntities({ limit, filter, sort, search }?
3
3
  query: import("@tanstack/react-query").DefinedUseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<BffCatalogEntityList, unknown>, Error>;
4
4
  items: import("@redocly/theme").BffCatalogEntity[];
5
5
  total: number;
6
+ isLoading: false;
7
+ hasMore: boolean;
8
+ isLoadingMore: boolean;
9
+ loadMore: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BffCatalogEntityList, unknown>, Error>>;
10
+ isPlaceholderData: boolean;
6
11
  };
7
12
  //# sourceMappingURL=useFetchCatalogEntities.d.ts.map
@@ -1 +1 @@
1
- import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as u,useRef as w}from"react";import{withPathPrefix as R}from"@redocly/theme/core/utils";import{getNextPageParam as S}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as F}from"./useSearchTracker";function x({limit:o=20,filter:i,sort:s="updated_at",search:n}={},r){const d=r?r.items.map(e=>e.key).join("-"):[],c=w(!0),m=c.current&&r;c.current&&(c.current=!1);const a=y({queryFn:async e=>{const t=new URLSearchParams;i&&t.append("filter",i),s&&t.append("sort",s),o&&t.append("limit",o.toString()),n&&t.append("search",n),e.pageParam&&Object.entries(e.pageParam).forEach(([P,f])=>{f!=null&&t.append(P,f.toString())});const p=new URL(R("/bff/catalog-entities"),window.location.origin);p.search=t.toString();const g=await fetch(p.toString());if(!g.ok)throw new Error(`Failed to fetch catalog entities from ${p.pathname}`);return g.json()},queryKey:["bff/catalog-entities",{limit:o,filter:i,sort:s,search:n,initialDataKeys:d}],initialData:m?{pages:[r],pageParams:[null]}:void 0,initialPageParam:null,getNextPageParam:S,refetchOnMount:!0,placeholderData:e=>e}),l=u(()=>{const e=a.data?.pages||[];return e[e.length-1]?.page.total},[a.data?.pages]),h=u(()=>(a.data?.pages||[]).flatMap(e=>e.items||[]),[a.data?.pages]);return F({isLoading:a.isLoading||a.isFetching,apiResource:"entities",searchQuery:n??""}),{query:a,items:h,total:l}}export{x as useFetchCatalogEntities};
1
+ import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as d,useRef as w}from"react";import{withPathPrefix as x}from"@redocly/theme/core/utils";import{getNextPageParam as D}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as F}from"./useSearchTracker";function j({limit:o=20,filter:i,sort:s="updated_at",search:n}={},r){const u=r?r.items.map(a=>a.key).join("-"):[],c=w(!0),l=c.current&&r;c.current&&(c.current=!1);const e=y({queryFn:async a=>{const t=new URLSearchParams;i&&t.append("filter",i),s&&t.append("sort",s),o&&t.append("limit",o.toString()),n&&t.append("search",n),a.pageParam&&Object.entries(a.pageParam).forEach(([P,p])=>{p!=null&&t.append(P,p.toString())});const g=new URL(x("/bff/catalog-entities"),window.location.origin);g.search=t.toString();const f=await fetch(g.toString());if(!f.ok)throw new Error(`Failed to fetch catalog entities from ${g.pathname}`);return f.json()},queryKey:["bff/catalog-entities",{limit:o,filter:i,sort:s,search:n,initialDataKeys:u}],initialData:l?{pages:[r],pageParams:[null]}:void 0,initialPageParam:null,getNextPageParam:D,refetchOnMount:!0,placeholderData:a=>a}),h=d(()=>{const a=e.data?.pages||[];return a[a.length-1]?.page.total},[e.data?.pages]),m=d(()=>(e.data?.pages||[]).flatMap(a=>a.items||[]),[e.data?.pages]);return F({isLoading:e.isLoading||e.isFetching,apiResource:"entities",searchQuery:n??""}),{query:e,items:m,total:h,isLoading:e.isPending,hasMore:e.hasNextPage,isLoadingMore:e.isFetchingNextPage,loadMore:e.fetchNextPage,isPlaceholderData:e.isPlaceholderData}}export{j as useFetchCatalogEntities};
@@ -5,5 +5,10 @@ export declare function useFetchCatalogEntitiesRelations({ entityKey, limit, fil
5
5
  query: import("@tanstack/react-query").DefinedUseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<BffCatalogRelatedEntityList, unknown>, Error>;
6
6
  items: import("@redocly/theme").BffCatalogRelatedEntity[];
7
7
  total: number;
8
+ isLoading: false;
9
+ hasMore: boolean;
10
+ isLoadingMore: boolean;
11
+ loadMore: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BffCatalogRelatedEntityList, unknown>, Error>>;
12
+ isPlaceholderData: boolean;
8
13
  };
9
14
  //# sourceMappingURL=useFetchCatalogEntitiesRelations.d.ts.map
@@ -1 +1 @@
1
- import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as d,useRef as S}from"react";import{withPathPrefix as F}from"@redocly/theme/core/utils";import{getNextPageParam as R}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as b}from"./useSearchTracker";function E({entityKey:g,limit:o=20,filter:i,sort:s="updated_at",search:r},n){const m=n?n.items.map(e=>e.key).join("-"):[],c=S(!0),l=c.current&&n;c.current&&(c.current=!1);const t=y({queryFn:async e=>{const a=new URLSearchParams;i&&a.append("filter",i),s&&a.append("sort",s),o&&a.append("limit",o.toString()),r&&a.append("search",r),e.pageParam&&Object.entries(e.pageParam).forEach(([w,f])=>{f!=null&&a.append(w,f.toString())});const p=new URL(F(`/bff/catalog-related-entities/${g}`),window.location.origin);p.search=a.toString();const u=await fetch(p.toString());if(!u.ok)throw new Error(`Failed to fetch catalog entity relations from ${p.pathname}`);return u.json()},queryKey:["bff/catalog-entities-relations",{limit:o,filter:i,sort:s,search:r,entityKey:g,initialDataKeys:m}],initialPageParam:null,initialData:l?{pages:[n],pageParams:[null]}:void 0,refetchOnMount:!0,getNextPageParam:R}),h=d(()=>{const e=t.data?.pages||[];return e[e.length-1]?.page?.total},[t.data?.pages]),P=d(()=>(t.data?.pages||[]).flatMap(e=>e.items||[]),[t.data?.pages]);return b({isLoading:t.isLoading||t.isFetching,apiResource:"related_entities",searchQuery:r??""}),{query:t,items:P,total:h}}export{E as useFetchCatalogEntitiesRelations};
1
+ import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as u,useRef as x}from"react";import{withPathPrefix as F}from"@redocly/theme/core/utils";import{getNextPageParam as M}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as S}from"./useSearchTracker";function k({entityKey:p,limit:o=20,filter:i,sort:s="updated_at",search:r},n){const l=n?n.items.map(a=>a.key).join("-"):[],c=x(!0),m=c.current&&n;c.current&&(c.current=!1);const e=y({queryFn:async a=>{const t=new URLSearchParams;i&&t.append("filter",i),s&&t.append("sort",s),o&&t.append("limit",o.toString()),r&&t.append("search",r),a.pageParam&&Object.entries(a.pageParam).forEach(([w,f])=>{f!=null&&t.append(w,f.toString())});const g=new URL(F(`/bff/catalog-related-entities/${p}`),window.location.origin);g.search=t.toString();const d=await fetch(g.toString());if(!d.ok)throw new Error(`Failed to fetch catalog entity relations from ${g.pathname}`);return d.json()},queryKey:["bff/catalog-entities-relations",{limit:o,filter:i,sort:s,search:r,entityKey:p,initialDataKeys:l}],initialPageParam:null,initialData:m?{pages:[n],pageParams:[null]}:void 0,refetchOnMount:!0,getNextPageParam:M}),h=u(()=>{const a=e.data?.pages||[];return a[a.length-1]?.page?.total},[e.data?.pages]),P=u(()=>(e.data?.pages||[]).flatMap(a=>a.items||[]),[e.data?.pages]);return S({isLoading:e.isLoading||e.isFetching,apiResource:"related_entities",searchQuery:r??""}),{query:e,items:P,total:h,isLoading:e.isPending,hasMore:e.hasNextPage,isLoadingMore:e.isFetchingNextPage,loadMore:e.fetchNextPage,isPlaceholderData:e.isPlaceholderData}}export{k as useFetchCatalogEntitiesRelations};
@@ -1 +1 @@
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"@redocly/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[^%]*)?(?:\/%|%\})/.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};
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"@redocly/markdoc";import{CodeBlock as C}from"@redocly/theme/components/CodeBlock/CodeBlock";import{tags as k,components as y}from"@redocly/theme/markdoc/default";import{withEmbeddedCodeComponents as w}from"../../../app/markdoc/embedded-code-components.js";const N=Object.fromEntries(Object.entries(y).filter(([,t])=>typeof t=="function")),T=t=>/\{%\s*(?:\/?\w+(?:-\w+)*|\/)(?:\s[^%]*)?(?:\/%|%\})/.test(t),A=(t,r)=>{try{const e=u(t,r);return Array.isArray(e)?e:[e]}catch(e){console.error("Error transforming node:",e)}return[]},l=(t,r,e,n)=>new g("CodeBlock",{...t,header:{title:n,controls:{copy:{}}},source:r,lang:e},[]),F=(t,r)=>{const e=t.transformAttributes(r),n=e["data-language"]||"markdoc",c=e["data-title"],o=t.attributes.content||"",a=l(e,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=A(i,r);s.push(...f)}return{codeNode:a,contentNodes:s}},M=(t,r)=>{const e=t.transformAttributes(r),n=e["data-language"],c=e["data-title"],o=t.attributes.content||"";if(!T(o)||!t.children||t.children.length===0)return l(e,o,n,c);const a=t.children[0];if(!a||a.type!=="tag")return l(e,o,n,c);const{codeNode:s,contentNodes:i}=F(t,r);return new g("Fragment",{},[s,...i])},O=t=>h(()=>{if(!t)return null;const e=p(t),n=u(e,{tags:k,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:M}}});return b.react(n,m,{components:{...w(N),CodeBlock:C,Fragment:m.Fragment}})},[t]);export{T as containsMarkdocTags,O as useMarkdownText};
@@ -1,5 +1,3 @@
1
- export declare const useL10n: () => {
2
- changeLanguage: (lng?: string, callback?: import("i18next").Callback) => Promise<import("i18next").TFunction>;
3
- lang: string;
4
- };
1
+ import type { ThemeHooks } from '@redocly/theme/core/types';
2
+ export declare const useL10n: ThemeHooks['useL10n'];
5
3
  //# sourceMappingURL=useL10n.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @returns The component map for Markdown rendered outside a page's content (API descriptions,
3
+ * `useMarkdownText`): the theme's code block and code group, ejected or not, are wrapped so that
4
+ * they do not take `codeSnippet.previewLines` from the configuration. A project's own components
5
+ * are kept.
6
+ */
7
+ export declare function withEmbeddedCodeComponents<T extends Record<string, unknown>>(components: T): T;
8
+ //# sourceMappingURL=embedded-code-components.d.ts.map
@@ -0,0 +1 @@
1
+ import t from"react";import{normalizePreviewLines as i}from"@redocly/theme/core/utils";import{CodeBlock as d}from"@redocly/theme/markdoc/components/CodeBlock/CodeBlock";import{CodeGroup as m}from"@redocly/theme/markdoc/components/CodeGroup/CodeGroup";import{components as c}from"@redocly/theme/markdoc/default";function s(e){return t.createElement(d,{...e,previewLines:i(e.previewLines)??0})}function f(e){return t.createElement(m,{...e,defaultPreviewLines:0})}const p={CodeBlock:s,CodeGroup:f};function E(e){const r=c,n=Object.entries(p).filter(([o])=>o in e&&e[o]===r[o]);return{...e,...Object.fromEntries(n)}}export{E as withEmbeddedCodeComponents};
@@ -1,5 +1,5 @@
1
- import{useMemo as a,useRef as m}from"react";import{components as c}from"@redocly-markdoc/components";import{schema as s}from"@redocly-markdoc/schema";import{ITEM_ROUTE_PATH_KEYS as u}from"@redocly/api-docs/lib/utils/previous-route-slug.js";import{withPathPrefix as p}from"@redocly/theme/core/utils";import{tags as f,components as l}from"@redocly/theme/markdoc/default";import*as d from"../../app/markdoc/custom-components/index.js";import{parsePartials as g}from"../../../markdoc/helpers/parse-partials.js";import*as w from"../../../markdoc/nodes/index.js";import h from"../../../markdoc/tags/index.js";import{normalizeCustomTags as y}from"../../../markdoc/helpers/normalize-custom-tags.js";import{deepEqual as T}from"../../../utils/object/deep-equal.js";function _(r){return r.map(o=>{const t={...o};for(const n of u){const e=t[n];typeof e=="string"&&(t[n]=p(e))}return Array.isArray(t.items)&&(t.items=_(t.items)),t})}function i(r){const o=m(r);return T(o.current,r)||(o.current=r),o.current}function S(r,o){const t=i(r),n=i(o);return a(()=>{const e=globalThis.__LOADER?.markdocComponents??{};return{...n,...t,tags:{...n?.tags??{},...h,...f,...y(s?.tags??{})},nodes:{...n?.nodes??{},...w,...s?.nodes??{}},functions:{...s?.functions??{}},components:{...n?.components??{},...d,...l,...c,...e},partials:g(t?.partials)}},[t,n])}function $(r){if(typeof window>"u")return null;if(typeof r=="function")return r;if(typeof r!="string")return null;try{const o=r.trim();if(!o.match(/^(\([^)]*\)\s*=>\s*\S.*|[a-zA-Z_$][\w$]*\s*=>\s*\S.*)$/))throw new Error("Invalid function format. Only arrow functions allowed.");if(["eval","Function","constructor","prototype","__proto__","import","require","process","global","window","document"].some(e=>o.includes(e)))throw new Error("Function contains prohibited keywords");return new Function("event",`
1
+ import{useMemo as m,useRef as a}from"react";import{components as c}from"@redocly-markdoc/components";import{schema as s}from"@redocly-markdoc/schema";import{ITEM_ROUTE_PATH_KEYS as u}from"@redocly/api-docs/lib/utils/previous-route-slug.js";import{withPathPrefix as p}from"@redocly/theme/core/utils";import{tags as f,components as l}from"@redocly/theme/markdoc/default";import*as d from"../../app/markdoc/custom-components/index.js";import{withEmbeddedCodeComponents as g}from"../../app/markdoc/embedded-code-components.js";import{parsePartials as w}from"../../../markdoc/helpers/parse-partials.js";import*as h from"../../../markdoc/nodes/index.js";import y from"../../../markdoc/tags/index.js";import{normalizeCustomTags as T}from"../../../markdoc/helpers/normalize-custom-tags.js";import{deepEqual as _}from"../../../utils/object/deep-equal.js";function b(r){return r.map(o=>{const t={...o};for(const n of u){const e=t[n];typeof e=="string"&&(t[n]=p(e))}return Array.isArray(t.items)&&(t.items=b(t.items)),t})}function i(r){const o=a(r);return _(o.current,r)||(o.current=r),o.current}function v(r,o){const t=i(r),n=i(o);return m(()=>{const e=globalThis.__LOADER?.markdocComponents??{};return{...n,...t,tags:{...n?.tags??{},...y,...f,...T(s?.tags??{})},nodes:{...n?.nodes??{},...h,...s?.nodes??{}},functions:{...s?.functions??{}},components:g({...n?.components??{},...d,...l,...c,...e}),partials:w(t?.partials)}},[t,n])}function R(r){if(typeof window>"u")return null;if(typeof r=="function")return r;if(typeof r!="string")return null;try{const o=r.trim();if(!o.match(/^(\([^)]*\)\s*=>\s*\S.*|[a-zA-Z_$][\w$]*\s*=>\s*\S.*)$/))throw new Error("Invalid function format. Only arrow functions allowed.");if(["eval","Function","constructor","prototype","__proto__","import","require","process","global","window","document"].some(e=>o.includes(e)))throw new Error("Function contains prohibited keywords");return new Function("event",`
2
2
  'use strict';
3
3
  const userFn = ${o};
4
4
  return userFn(event);
5
- `)}catch(o){return console.error("Function parsing error:",o),null}}export{_ as applyPathPrefixToApiItems,$ as safeParseFunction,S as useCollectMarkdocOptions};
5
+ `)}catch(o){return console.error("Function parsing error:",o),null}}export{b as applyPathPrefixToApiItems,R as safeParseFunction,v as useCollectMarkdocOptions};
@@ -1 +1 @@
1
- import a from"@redocly/markdoc";import{EXAMPLE_CONTENT_ATTRIBUTE as m}from"@redocly/theme/core/constants";import{isPrimitive as f}from"../../../utils/guards/is-primitive.js";import{isStringNode as s}from"../../helpers/guards/is-string-node.js";import{isTag as p}from"../../helpers/guards/is-tag.js";const g=a.nodes.fence,y={...g,attributes:{...g.attributes,label:{type:String,render:"data-label"},title:{type:String,render:"data-title"},highlight:{type:String,render:"data-highlight"},align:{type:String,matches:["left","center","right"]},width:{type:String},terminal:{type:Boolean},[m]:{type:Object,render:!1}},transform(e,o){const r=e.transformAttributes(o);let t=e.transformChildren(o);const n=r["data-language"],l=r["data-title"];switch(e.attributes.process===!1&&(t=[e.attributes.content]),n){case"mermaid":case"excalidraw":case"plantuml":return s(t[0])?new a.Tag("Diagram",{...r,diagramType:n,diagramSource:t[0]},t):new a.Tag(e.tag,r,t);default:{const c=t.map(i=>f(i)?i.toString():p(i)?i?.attributes?.rawtag:"").join("");return s(t[0])?new a.Tag("CodeBlock",{...r,header:{title:l,controls:{copy:{}}},source:c,lang:n},[]):new a.Tag(e.tag,r,t)}}}};export{y as fence};
1
+ import a from"@redocly/markdoc";import{EXAMPLE_CONTENT_ATTRIBUTE as c}from"@redocly/theme/core/constants";import{isPrimitive as p}from"../../../utils/guards/is-primitive.js";import{isStringNode as o}from"../../helpers/guards/is-string-node.js";import{isTag as u}from"../../helpers/guards/is-tag.js";const g=a.nodes.fence,y={...g,attributes:{...g.attributes,label:{type:String,render:"data-label"},title:{type:String,render:"data-title"},highlight:{type:String,render:"data-highlight"},align:{type:String,matches:["left","center","right"]},width:{type:String},terminal:{type:Boolean},previewLines:{type:Number},[c]:{type:Object,render:!1}},transform(e,s){const r=e.transformAttributes(s);let t=e.transformChildren(s);const n=r["data-language"],l=r["data-title"];switch(e.attributes.process===!1&&(t=[e.attributes.content]),n){case"mermaid":case"excalidraw":case"plantuml":return o(t[0])?new a.Tag("Diagram",{...r,diagramType:n,diagramSource:t[0]},t):new a.Tag(e.tag,r,t);default:{const m=t.map(i=>p(i)?i.toString():u(i)?i?.attributes?.rawtag:"").join("");return o(t[0])?new a.Tag("CodeBlock",{...r,header:{title:l,controls:{copy:{}}},source:m,lang:n},[]):new a.Tag(e.tag,r,t)}}}};export{y as fence};
@@ -1 +1 @@
1
- import{resolve as c,dirname as p}from"node:path";import{fileURLToPath as f}from"node:url";import{createReadStream as l}from"fs";import{envConfig as u}from"./config/env-config.js";import{telemetry as d}from"./telemetry/index.js";import{createRouter as v}from"./web-server/router.js";import{installProdRoutes as g}from"./web-server/routes/index.js";import{Store as S}from"./store.js";import{loadEnvVariables as R}from"./utils/envs/load-env-variables.js";import{startHttpServer as x}from"./web-server/http.js";import{readStaticData as D}from"./utils/static-data.js";import{startIdleTimeout as P}from"./web-server/middleware/idleTimeoutMiddleware.js";import{reporter as w}from"./tools/notifiers/reporter.js";import{logger as E}from"./tools/notifiers/logger.js";import{EntitlementsProvider as y}from"./entitlements/entitlements-provider.js";import{DatabasePreconnectService as b}from"./providers/database/database-preconnect-service.js";import{KvService as h}from"./persistence/kv/services/kv-service.js";import{runScorecardsWorker as I}from"./plugins/scorecards/workers/run-scorecards-worker.js";import{isScorecardsEnabled as O}from"./utils/is-scorecards-enabled.js";import{isRealmOrReef as T}from"./utils/is-realm-or-reef.js";import{renderPage as rr}from"./ssr/index.js";const k=new URL(import.meta.url),A=k.searchParams.get("only-exports")==="true";if(!A){let s=function(){const r=process.argv.findIndex(i=>i==="--port"||i==="-p");if(r===-1)return null;const t=process.argv[r+1];if(t.startsWith("-"))return null;const o=parseInt(t,10);return isNaN(o)?null:o};const e=p(f(import.meta.url));await R(e);const n=await S.fromServerFiles({outdir:c(e,"../client"),serverOutDir:e,serverMode:!0,contentDir:""});if(await y.instance().init({ignoreTokenExpiration:!0}),T()){await b.init(e);const r=await h.getInstance({baseDbDir:e});setInterval(()=>{r.clearExpired().catch(t=>{E.error("Failed to clear expired KV entries",t)})},300*1e3)}m(n).catch(r=>{console.error(r)});async function m(r){d.initialize();const t=v();g(t,r,{readStaticAsset:async a=>l(a),resolveRouteData:async a=>D(a.slug,r.outdir)}),w.printErrors();const o=s(),i=u.PORT;return await x(t,o??i??4e3),P(),O(r.config)&&I(r.serverOutDir,r.config.scorecards),t}}export{rr as renderPage};
1
+ import{resolve as c,dirname as p}from"node:path";import{fileURLToPath as f}from"node:url";import{createReadStream as l}from"fs";import{envConfig as u}from"./config/env-config.js";import{telemetry as d}from"./telemetry/index.js";import{createRouter as v}from"./web-server/router.js";import{installProdRoutes as g}from"./web-server/routes/index.js";import{Store as S}from"./store.js";import{loadEnvVariables as D}from"./utils/envs/load-env-variables.js";import{startHttpServer as P}from"./web-server/http.js";import{readStaticData as x}from"./utils/static-data.js";import{startIdleTimeout as w}from"./web-server/middleware/idleTimeoutMiddleware.js";import{reporter as E}from"./tools/notifiers/reporter.js";import{logger as R}from"./tools/notifiers/logger.js";import{EntitlementsProvider as b}from"./entitlements/entitlements-provider.js";import{DatabasePreconnectService as h}from"./providers/database/database-preconnect-service.js";import{KvService as y}from"./persistence/kv/services/kv-service.js";import{runScorecardsWorker as I}from"./plugins/scorecards/workers/run-scorecards-worker.js";import{isScorecardsEnabled as T}from"./utils/is-scorecards-enabled.js";import{hasProjectDatabase as k}from"./providers/database/has-project-database.js";import{renderPage as rr}from"./ssr/index.js";const A=new URL(import.meta.url),F=A.searchParams.get("only-exports")==="true";if(!F){let m=function(){const r=process.argv.findIndex(i=>i==="--port"||i==="-p");if(r===-1)return null;const t=process.argv[r+1];if(t.startsWith("-"))return null;const o=parseInt(t,10);return isNaN(o)?null:o};const e=p(f(import.meta.url));await D(e);const n=await S.fromServerFiles({outdir:c(e,"../client"),serverOutDir:e,serverMode:!0,contentDir:""});if(await b.instance().init({ignoreTokenExpiration:!0}),k()){await h.init(e);const r=await y.getInstance({baseDbDir:e});setInterval(()=>{r.clearExpired().catch(t=>{R.error("Failed to clear expired KV entries",t)})},300*1e3)}s(n).catch(r=>{console.error(r)});async function s(r){d.initialize();const t=v();g(t,r,{readStaticAsset:async a=>l(a),resolveRouteData:async a=>x(a.slug,r.outdir)}),E.printErrors();const o=m(),i=u.PORT;return await P(t,o??i??4e3),w(),T(r.config)&&I(r.serverOutDir,r.config.scorecards),t}}export{rr as renderPage};
@@ -1 +1 @@
1
- import C from"path";import{lintConfig as E,loadConfig as L,createConfigTypes as S}from"@redocly/openapi-core";import{findEmptyAgentSection as q,rbacConfigSchema as x,rootRedoclyConfigSchema as B,withPlatformSection as k}from"@redocly/config";import{deepMerge as I}from"../../../../../utils/object/deep-merge.js";import{isPlainObject as v}from"../../../../../utils/guards/is-plain-object.js";import{logger as d}from"../../../../tools/notifiers/logger.js";import{BRANCH_ENV_PREFIX as M}from"../../../../../constants/common.js";import{sanitizeBranchName as N}from"../../../../utils/envs/sanitize-branch-name.js";import{envConfig as A}from"../../../../config/env-config.js";import{ajv as _,safeParsePartial as D}from"../../safe-parse.js";import{formatConfigProblem as F}from"../../format-error.js";import{ExternalResolver as G}from"../../../../fs/utils/external-ref-resolver.js";import{resolveMutuallyExclusiveProps as z}from"../../resolve-mutual-exclusion.js";function y(e,s,t,n){s in e&&e[s]&&typeof e[s]=="string"&&(/^https?:\/\/.*/.test(e[s])||n(new Error(`Invalid ${t} URL: "${e[s]}". ${t} must start with "http://" or "https://".`)))}function V(e,s){if("access"in e&&e.access&&typeof e.access=="object"){const t=e.access;y(t,"logoutReturnUrl","access.logoutReturnUrl",s),y(t,"residency","access.residency",s);const n=["requiresLogin","logoutReturnUrl","residency","sso","rbac"];for(const r of n)r in t&&t[r]!==void 0&&r in e&&e[r]!==void 0&&s(new Error(`Property '${r}' is defined both at root level and in 'access' object. Please use 'access.${r}' to define this configuration.`))}}function Y(e){return _.compile(B.properties.graphql.properties.servers.items.properties.url)(e)}function $(e,s,t){if(v(e)&&Array.isArray(e.servers))for(const n of e.servers){const r=v(n)?n.url:void 0;if(typeof r=="string"&&!Y(r)){const a=e.servers.indexOf(n),c=`${s}.servers[${a}].url`;t(new Error(`Invalid ${c}: "${r}". It must be an absolute http:// or https:// URL.`))}}}function H(e,s){if($(e.graphql,"graphql",s),!!v(e.apis))for(const[t,n]of Object.entries(e.apis))v(n)&&$(n.graphql,`apis.${t}.graphql`,s)}function K(e,s){const t=[["",e],...Object.entries(e.env??{}).map(([n,r])=>[`env.${n}.`,r])];for(const[n,r]of t){const a=q(r);a&&s(new Error(`Invalid ${n}${a}.agent: it must set at least one option.`))}}async function he(e,s,t,n){const a=s.getFileInfo(e)?.realRelativePath||e;async function c(){const f=new G(s),m=C.join(s.cwd,a),l=await L({configPath:m,externalRefResolver:f}),h=await n(l.resolvedConfig);if(h===void 0)return l.resolvedConfig;const g=l.document?.source,j=[...g?await E({config:l,externalConfigTypes:S(h,l)}):[],...g?z(l.resolvedConfig,g):[]];for(const P of j){const R=F(P,s.cwd);P.severity==="warn"?d.warn(R):t(new Error(R))}return l.resolvedConfig}const o=s.exists(e)?await c():{},u=Z(o),w=await n(o);y(o,"residency","Residency",t),y(o,"logoutReturnUrl","Logout return URL",t),V(o,t),H(o,t),K(o,t);let p=w?D(w,o):o;p=X(p),p=Q(p,t);const{env:b}=p;if(b){const f=A.REDOCLY_ENV,m=b[f]||{},l=A.PUBLIC_REDOCLY_BRANCH_NAME||"",h=l?N(l):"",g=h&&b[`${M}${h}`]||{};p=I(p,g,m)}const i=ee(p,u);if(i.imports&&i.imports.length>0){d.warn("The 'imports' property is deprecated. Please use 'plugins' property instead.");const f=new Set([...i.plugins||[],...i.imports.map(m=>C.posix.join(m,"plugin.js"))]);i.plugins=Array.from(f),delete i.imports}if(i.catalog&&(d.warn("The 'catalog' property is deprecated. Please use 'catalogClassic' property instead."),i.catalogClassic={...i.catalog},delete i.catalog),i.scorecard&&(d.warn("The 'scorecard' property is deprecated. Please use 'scorecardClassic' property instead."),i.scorecardClassic=i.scorecard,delete i.scorecard),i.search?.ai){d.warn("The 'search.ai' property is deprecated. Please use 'aiAssistant' property instead.");const f={...i.search?.ai,...i.aiAssistant,suggestions:i.aiAssistant?.suggestions?.length?i.aiAssistant.suggestions:i.search?.ai.suggestions||[]};i.aiAssistant=f,delete i.search.ai}return W(i)}function W(e){const s={...e},n={..."access"in e&&e.access&&typeof e.access=="object"?e.access:{}},r=["requiresLogin","logoutReturnUrl","residency","sso","idps","rbac"],a=[];for(const c of r){const o=s[c];o!==void 0&&(a.push(c),c==="requiresLogin"&&n.requiresLogin===void 0&&(n.requiresLogin=o),c==="logoutReturnUrl"&&n.logoutReturnUrl===void 0&&(n.logoutReturnUrl=o),c==="residency"&&n.residency===void 0&&(n.residency=o),c==="sso"&&n.sso===void 0&&(n.sso=o),c==="idps"&&n.idps===void 0&&(n.idps=o),c==="rbac"&&n.rbac===void 0&&(n.rbac=o),delete s[c])}return a.length>0&&d.warn(`The following properties at root level are deprecated: ${a.join(", ")}. Please move them to the 'access' object.`),Object.keys(n).length>0&&(s.access=n),s}function X(e){const s=Object.entries(e.env??{});[e,...s.map(([,r])=>r)].some(r=>r?.mcp?.docs)&&d.warn("The 'mcp.docs' property is deprecated. Please use the 'mcp' properties instead.");const t=e.mcp?{...e,mcp:O(e.mcp)}:e;if(!e.env)return t;const n=s.map(([r,a])=>[r,a?.mcp?{...a,mcp:O(a.mcp)}:a]);return{...t,env:Object.fromEntries(n)}}function O(e){const s=e.docs??{},t={};(e.hide??s.hide)!==void 0&&(t.hide=e.hide===!0||s.hide===!0);const n=e.name??s.name;n!==void 0&&(t.name=n);const r=e.ignore??s.ignore;r!==void 0&&(t.ignore=r);const a=e.publicEndpoint??s.publicEndpoint;return a!==void 0&&(t.publicEndpoint=a),{...e,...t,docs:{...s,...t}}}function J(e){if(!v(e)||e.platform===void 0)return!1;const s=Object.keys(e).filter(t=>t!=="platform");return s.length>0&&s.every(t=>!Object.hasOwn(x.properties,t))}function Q(e,s){const t=Object.entries(e.env??{}),n=new Set;let r=!1;for(const o of[e,...t.map(([,u])=>u)])o?.reunite!==void 0&&o?.platform!==void 0&&n.add("Both 'platform' and 'reunite' are set. 'reunite' is ignored, so remove it."),[o?.rbac,o?.access?.rbac].some(J)&&(r=!0);for(const o of n)d.warn(o);r&&s(new Error("You are using an incorrect format of 'rbac:' configuration. See: https://redocly.com/docs/realm/access"));const a=T(e);if(!e.env)return a;const c=t.map(([o,u])=>[o,u&&T(u)]);return{...a,env:Object.fromEntries(c)}}function T(e){const s=k(e),t=e.rbac?{...s,rbac:U(e.rbac)}:s;return e.access?.rbac?{...t,access:{...e.access,rbac:U(e.access.rbac)}}:t}function U(e){const{reunite:s,...t}=e;return s===void 0?t:{...t,platform:e.platform??s}}function Z(e){if(!e.theme)return[];d.warn("The 'theme' property in redocly.yaml is deprecated. Please move all of the properties from 'theme' to the root of the config.");const s=[];for(const t of Object.keys(e.theme))e[t]==null?s.push(t):d.warn(`Detected both '${t}' and 'theme.${t}' properties in redocly.yaml. The 'theme.${t}' property will be ignored and needs to be removed or merged into the '${t}'.`);return s}function ee(e,s){if(!e.theme||s.length===0)return e;const t={...e};for(const n of s)t[n]=e.theme[n];return delete t.theme,t}export{W as ensureAccessBackwardsCompatibility,he as readAndValidateConfig};
1
+ import C from"path";import{lintConfig as O,loadConfig as T,createConfigTypes as L}from"@redocly/openapi-core";import{findEmptyAgentSection as x,findUnknownDutyMcpServers as q,rbacConfigSchema as k,rootRedoclyConfigSchema as B,withPlatformSection as M}from"@redocly/config";import{deepMerge as I}from"../../../../../utils/object/deep-merge.js";import{isPlainObject as v}from"../../../../../utils/guards/is-plain-object.js";import{logger as d}from"../../../../tools/notifiers/logger.js";import{BRANCH_ENV_PREFIX as D}from"../../../../../constants/common.js";import{sanitizeBranchName as N}from"../../../../utils/envs/sanitize-branch-name.js";import{envConfig as $}from"../../../../config/env-config.js";import{ajv as _,safeParsePartial as F}from"../../safe-parse.js";import{formatConfigProblem as G}from"../../format-error.js";import{ExternalResolver as z}from"../../../../fs/utils/external-ref-resolver.js";import{resolveMutuallyExclusiveProps as V}from"../../resolve-mutual-exclusion.js";function y(e,n,t,s){n in e&&e[n]&&typeof e[n]=="string"&&(/^https?:\/\/.*/.test(e[n])||s(new Error(`Invalid ${t} URL: "${e[n]}". ${t} must start with "http://" or "https://".`)))}function Y(e,n){if("access"in e&&e.access&&typeof e.access=="object"){const t=e.access;y(t,"logoutReturnUrl","access.logoutReturnUrl",n),y(t,"residency","access.residency",n);const s=["requiresLogin","logoutReturnUrl","residency","sso","rbac"];for(const r of s)r in t&&t[r]!==void 0&&r in e&&e[r]!==void 0&&n(new Error(`Property '${r}' is defined both at root level and in 'access' object. Please use 'access.${r}' to define this configuration.`))}}function H(e){return _.compile(B.properties.graphql.properties.servers.items.properties.url)(e)}function A(e,n,t){if(v(e)&&Array.isArray(e.servers))for(const s of e.servers){const r=v(s)?s.url:void 0;if(typeof r=="string"&&!H(r)){const a=e.servers.indexOf(s),c=`${n}.servers[${a}].url`;t(new Error(`Invalid ${c}: "${r}". It must be an absolute http:// or https:// URL.`))}}}function K(e,n){if(A(e.graphql,"graphql",n),!!v(e.apis))for(const[t,s]of Object.entries(e.apis))v(s)&&A(s.graphql,`apis.${t}.graphql`,n)}function W(e,n){const t=[["",e],...Object.entries(e.env??{}).map(([s,r])=>[`env.${s}.`,r])];for(const[s,r]of t){const a=x(r);a&&n(new Error(`Invalid ${s}${a}.agent: it must set at least one option.`))}}function X(e,n){for(const{list:t,index:s,names:r}of q(e.platform?.agent))n(new Error(`Invalid platform.agent.${t}[${s}].mcpServers: unknown MCP servers: ${r.join(", ")}. Each name must be a key of platform.agent.mcpServers.`))}async function ve(e,n,t,s){const a=n.getFileInfo(e)?.realRelativePath||e;async function c(){const f=new z(n),m=C.join(n.cwd,a),l=await T({configPath:m,externalRefResolver:f}),h=await s(l.resolvedConfig);if(h===void 0)return l.resolvedConfig;const g=l.document?.source,E=[...g?await O({config:l,externalConfigTypes:L(h,l)}):[],...g?V(l.resolvedConfig,g):[]];for(const P of E){const R=G(P,n.cwd);P.severity==="warn"?d.warn(R):t(new Error(R))}return l.resolvedConfig}const o=n.exists(e)?await c():{},u=te(o),w=await s(o);y(o,"residency","Residency",t),y(o,"logoutReturnUrl","Logout return URL",t),Y(o,t),K(o,t),W(o,t);let p=w?F(w,o):o;p=Q(p),p=ee(p,t);const{env:b}=p;if(b){const f=$.REDOCLY_ENV,m=b[f]||{},l=$.PUBLIC_REDOCLY_BRANCH_NAME||"",h=l?N(l):"",g=h&&b[`${D}${h}`]||{};p=I(p,g,m)}X(p,t);const i=ne(p,u);if(i.imports&&i.imports.length>0){d.warn("The 'imports' property is deprecated. Please use 'plugins' property instead.");const f=new Set([...i.plugins||[],...i.imports.map(m=>C.posix.join(m,"plugin.js"))]);i.plugins=Array.from(f),delete i.imports}if(i.catalog&&(d.warn("The 'catalog' property is deprecated. Please use 'catalogClassic' property instead."),i.catalogClassic={...i.catalog},delete i.catalog),i.scorecard&&(d.warn("The 'scorecard' property is deprecated. Please use 'scorecardClassic' property instead."),i.scorecardClassic=i.scorecard,delete i.scorecard),i.search?.ai){d.warn("The 'search.ai' property is deprecated. Please use 'aiAssistant' property instead.");const f={...i.search?.ai,...i.aiAssistant,suggestions:i.aiAssistant?.suggestions?.length?i.aiAssistant.suggestions:i.search?.ai.suggestions||[]};i.aiAssistant=f,delete i.search.ai}return J(i)}function J(e){const n={...e},s={..."access"in e&&e.access&&typeof e.access=="object"?e.access:{}},r=["requiresLogin","logoutReturnUrl","residency","sso","idps","rbac"],a=[];for(const c of r){const o=n[c];o!==void 0&&(a.push(c),c==="requiresLogin"&&s.requiresLogin===void 0&&(s.requiresLogin=o),c==="logoutReturnUrl"&&s.logoutReturnUrl===void 0&&(s.logoutReturnUrl=o),c==="residency"&&s.residency===void 0&&(s.residency=o),c==="sso"&&s.sso===void 0&&(s.sso=o),c==="idps"&&s.idps===void 0&&(s.idps=o),c==="rbac"&&s.rbac===void 0&&(s.rbac=o),delete n[c])}return a.length>0&&d.warn(`The following properties at root level are deprecated: ${a.join(", ")}. Please move them to the 'access' object.`),Object.keys(s).length>0&&(n.access=s),n}function Q(e){const n=Object.entries(e.env??{});[e,...n.map(([,r])=>r)].some(r=>r?.mcp?.docs)&&d.warn("The 'mcp.docs' property is deprecated. Please use the 'mcp' properties instead.");const t=e.mcp?{...e,mcp:S(e.mcp)}:e;if(!e.env)return t;const s=n.map(([r,a])=>[r,a?.mcp?{...a,mcp:S(a.mcp)}:a]);return{...t,env:Object.fromEntries(s)}}function S(e){const n=e.docs??{},t={};(e.hide??n.hide)!==void 0&&(t.hide=e.hide===!0||n.hide===!0);const s=e.name??n.name;s!==void 0&&(t.name=s);const r=e.ignore??n.ignore;r!==void 0&&(t.ignore=r);const a=e.publicEndpoint??n.publicEndpoint;return a!==void 0&&(t.publicEndpoint=a),{...e,...t,docs:{...n,...t}}}function Z(e){if(!v(e)||e.platform===void 0)return!1;const n=Object.keys(e).filter(t=>t!=="platform");return n.length>0&&n.every(t=>!Object.hasOwn(k.properties,t))}function ee(e,n){const t=Object.entries(e.env??{}),s=new Set;let r=!1;for(const o of[e,...t.map(([,u])=>u)])o?.reunite!==void 0&&o?.platform!==void 0&&s.add("Both 'platform' and 'reunite' are set. 'reunite' is ignored, so remove it."),[o?.rbac,o?.access?.rbac].some(Z)&&(r=!0);for(const o of s)d.warn(o);r&&n(new Error("You are using an incorrect format of 'rbac:' configuration. See: https://redocly.com/docs/realm/access"));const a=U(e);if(!e.env)return a;const c=t.map(([o,u])=>[o,u&&U(u)]);return{...a,env:Object.fromEntries(c)}}function U(e){const n=M(e),t=e.rbac?{...n,rbac:j(e.rbac)}:n;return e.access?.rbac?{...t,access:{...e.access,rbac:j(e.access.rbac)}}:t}function j(e){const{reunite:n,...t}=e;return n===void 0?t:{...t,platform:e.platform??n}}function te(e){if(!e.theme)return[];d.warn("The 'theme' property in redocly.yaml is deprecated. Please move all of the properties from 'theme' to the root of the config.");const n=[];for(const t of Object.keys(e.theme))e[t]==null?n.push(t):d.warn(`Detected both '${t}' and 'theme.${t}' properties in redocly.yaml. The 'theme.${t}' property will be ignored and needs to be removed or merged into the '${t}'.`);return n}function ne(e,n){if(!e.theme||n.length===0)return e;const t={...e};for(const s of n)t[s]=e.theme[s];return delete t.theme,t}export{J as ensureAccessBackwardsCompatibility,ve as readAndValidateConfig};
@@ -4,8 +4,8 @@ export type ApiCallOperation = {
4
4
  /** Upper case. */
5
5
  method: string;
6
6
  /**
7
- * False when `x-mcp.apiCalls.hide` or `x-mcp.docs.hide` on the path item or operation, or an
8
- * `mcp.apiCalls.excludeOperations` entry, excludes it.
7
+ * False when `x-mcp.hide`, `x-mcp.docs.hide`, or `x-mcp.apiCalls.hide` on the path item or
8
+ * operation, or an `mcp.apiCalls.excludeOperations` entry, excludes it.
9
9
  */
10
10
  callable: boolean;
11
11
  /**
@@ -1 +1 @@
1
- import{envConfig as o}from"../../../../../config/env-config.js";import{isRealmOrReef as s}from"../../../../../utils/is-realm-or-reef.js";import{KvRepository as m}from"../../../../../persistence/kv/repositories/kv-repository.js";import{logger as p}from"../../../../../tools/notifiers/logger.js";import{ipRateLimitKey as f}from"../utils/ip-key.js";import{checkEdgeRateLimit as c}from"./edge-limiter.js";import{resolveMcpRequestLimits as d}from"./request-limits.js";import{reportMcpRateLimited as l}from"./rate-limit-telemetry.js";async function w(n,a){if(!s())return;const i=f(n);if(!i)return;let e,r;try{const t=await m.create({baseDbDir:a.serverOutDir,sqldRemoteDatabaseUrl:o.SQLD_REMOTE_DATABASE_URL,sqldRemoteDatabaseAuthToken:o.SQLD_REMOTE_DATABASE_AUTH_TOKEN});r=d(),e=await c({kv:t,ip:i,limits:r,now:Date.now()})}catch(t){p.warn(`gateway rate-limit init error, failing open: ${String(t)}`);return}if(!e.allowed)return l({scope:e.scope,retryAfterSeconds:e.retryAfterSeconds,limit:e.scope==="rate"?r.ratePerMin:r.quotaPerDay}),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32029,message:`Rate limit exceeded (${e.scope}); retry after ${e.retryAfterSeconds}s`},id:null}),{status:429,headers:{"Content-Type":"application/json","Retry-After":String(e.retryAfterSeconds)}})}export{w as applyEdgeRateLimit};
1
+ import{envConfig as o}from"../../../../../config/env-config.js";import{hasProjectDatabase as s}from"../../../../../providers/database/has-project-database.js";import{KvRepository as m}from"../../../../../persistence/kv/repositories/kv-repository.js";import{logger as p}from"../../../../../tools/notifiers/logger.js";import{ipRateLimitKey as c}from"../utils/ip-key.js";import{checkEdgeRateLimit as f}from"./edge-limiter.js";import{resolveMcpRequestLimits as d}from"./request-limits.js";import{reportMcpRateLimited as l}from"./rate-limit-telemetry.js";async function w(n,a){if(!s())return;const i=c(n);if(!i)return;let e,r;try{const t=await m.create({baseDbDir:a.serverOutDir,sqldRemoteDatabaseUrl:o.SQLD_REMOTE_DATABASE_URL,sqldRemoteDatabaseAuthToken:o.SQLD_REMOTE_DATABASE_AUTH_TOKEN});r=d(),e=await f({kv:t,ip:i,limits:r,now:Date.now()})}catch(t){p.warn(`gateway rate-limit init error, failing open: ${String(t)}`);return}if(!e.allowed)return l({scope:e.scope,retryAfterSeconds:e.retryAfterSeconds,limit:e.scope==="rate"?r.ratePerMin:r.quotaPerDay}),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32029,message:`Rate limit exceeded (${e.scope}); retry after ${e.retryAfterSeconds}s`},id:null}),{status:429,headers:{"Content-Type":"application/json","Retry-After":String(e.retryAfterSeconds)}})}export{w as applyEdgeRateLimit};
@@ -60,6 +60,8 @@ export type McpPath = {
60
60
  'x-mcp'?: XMcpConfig;
61
61
  } & OpenAPIPath;
62
62
  export type XMcpConfig = {
63
+ hide?: boolean;
64
+ /** @deprecated Use `hide`. */
63
65
  docs?: {
64
66
  hide?: boolean;
65
67
  };
@@ -67,7 +69,7 @@ export type XMcpConfig = {
67
69
  hide?: boolean;
68
70
  };
69
71
  };
70
- export type XMcpSection = keyof XMcpConfig;
72
+ export type XMcpSection = 'docs' | 'apiCalls';
71
73
  export type McpEndpoint = OpenAPIOperation & {
72
74
  'x-mcp'?: XMcpConfig;
73
75
  };
@@ -1 +1 @@
1
- function e(i,n){return i?.["x-mcp"]?.[n]?.hide===!0}function t(i,n){return i?.["x-mcp"]?.[n]?.hide===!0}export{t as isDefinitionHidden,e as isEndpointHidden};
1
+ function t(i,n){return e(i?.["x-mcp"],n)}function r(i,n){return e(i?.["x-mcp"],n)}function e(i,n){return n==="apiCalls"?i?.apiCalls?.hide===!0:i?.hide===!0||i?.docs?.hide===!0}export{r as isDefinitionHidden,t as isEndpointHidden};
@@ -1,6 +1,6 @@
1
- import { drizzle } from 'drizzle-orm/libsql';
1
+ import type { drizzle } from 'drizzle-orm/libsql';
2
2
  import type { DrizzleConfig } from 'drizzle-orm';
3
- import type { Client, Config } from '@libsql/client';
3
+ import type { Config } from '@libsql/client';
4
4
  import type { DrizzleTransaction } from './transactions-manager.js';
5
5
  import { TransactionsManager } from './transactions-manager.js';
6
6
  export type DrizzleClient = ReturnType<typeof drizzle>;
@@ -11,7 +11,7 @@ type DatabaseClientInitOptions = {
11
11
  export declare class DatabaseClient {
12
12
  #private;
13
13
  readonly dbClient: DrizzleClient;
14
- constructor(config: Config, createClient: (c: Config) => Client);
14
+ constructor(dbClient: DrizzleClient);
15
15
  get transactionsManager(): TransactionsManager;
16
16
  get client(): DrizzleClient | DrizzleTransaction;
17
17
  static init(config: Config, options?: DatabaseClientInitOptions): Promise<DatabaseClient>;
@@ -1 +1 @@
1
- import o from"node:path";import{sql as c}from"drizzle-orm";import{drizzle as l}from"drizzle-orm/libsql";import{migrate as m}from"drizzle-orm/libsql/migrator";import{logger as d}from"../../tools/notifiers/logger.js";import{TransactionsManager as h}from"./transactions-manager.js";class n{dbClient;#t;constructor(t,r){this.dbClient=l(r(t)),this.#t=new h(this.dbClient)}get transactionsManager(){return this.#t}get client(){return this.#t.tx??this.dbClient}static async init(t,r){const{createClient:a}=await import("@libsql/client"),i=new n(t,a);if(r?.runWithPragmaWalWriteOptimization)try{await i.dbClient.run(c.raw("PRAGMA journal_mode = WAL;"))}catch(s){throw await i.closeAfterFailure(),s}return i}async migrate(t,r=""){await m(this.dbClient,{migrationsFolder:o.join(t,"migrations",r)})}async close(){this.dbClient.$client.close()}async closeAfterFailure(){try{await this.close()}catch(t){d.warn("Failed to close the database client: %s",t)}}async sync(){try{await this.dbClient.$client.sync()}catch(t){if(u(t))return;throw t}}}function u(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("syncnotsupported")&&(t.includes('("file")')||t.includes('"file"'))}export{n as DatabaseClient};
1
+ import c from"node:path";import{sql as l}from"drizzle-orm";import{migrate as m}from"drizzle-orm/libsql/migrator";import{logger as d}from"../../tools/notifiers/logger.js";import{TransactionsManager as h}from"./transactions-manager.js";class n{dbClient;#t;constructor(t){this.dbClient=t,this.#t=new h(this.dbClient)}get transactionsManager(){return this.#t}get client(){return this.#t.tx??this.dbClient}static async init(t,r){const[{createClient:a},{drizzle:s}]=await Promise.all([import("@libsql/client"),import("drizzle-orm/libsql")]),i=new n(s(a(t)));if(r?.runWithPragmaWalWriteOptimization)try{await i.dbClient.run(l.raw("PRAGMA journal_mode = WAL;"))}catch(o){throw await i.closeAfterFailure(),o}return i}async migrate(t,r=""){await m(this.dbClient,{migrationsFolder:c.join(t,"migrations",r)})}async close(){this.dbClient.$client.close()}async closeAfterFailure(){try{await this.close()}catch(t){d.warn("Failed to close the database client: %s",t)}}async sync(){try{await this.dbClient.$client.sync()}catch(t){if(u(t))return;throw t}}}function u(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("syncnotsupported")&&(t.includes('("file")')||t.includes('"file"'))}export{n as DatabaseClient};
@@ -1 +1 @@
1
- import{logger as n}from"../../tools/notifiers/logger.js";import{envConfig as r}from"../../config/env-config.js";import{SQLITE_DATABASE_MIGRATIONS_FOLDER as o,SQLITE_LOCAL_DATABASE_FOLDER as c,SQLITE_REMOTE_DATABASE_FOLDER as l,SQLITE_DATABASE_NAME as i}from"./constants.js";import{DatabaseConnectionsManager as s}from"./database-connections-manager.js";import{SQLD_REMOTE_DATABASE_URL_NO_DEPLOYMENT_YET_VAR as T}from"../../constants/plugins/catalog-entities.js";class u{static async create(e){return this.#r(e)==="local"?await this.#t(e):await this.#a(e)}static async#t(e){return await s.getLocalConnection({...e,databaseName:i,additionalFolder:c,migrationsFolder:o})}static async#a(e){try{const{syncUrl:t,authToken:a}=this.#e(e);return!t||!a?(r.isDevelopMode||n.warn("Your remote database is not initialized yet, please wait for production deployment."),null):await s.getRemoteConnection({...e,databaseName:i,additionalFolder:l,migrationsFolder:o,syncUrl:t,authToken:a})}catch(t){return n.error("Remote database connection initialization failed",t),null}}static#r(e){if(e.databaseType)return e.databaseType;const{syncUrl:t,authToken:a}=this.#e(e);return t&&a?"remote":"local"}static#e(e){const t=r.SQLD_REMOTE_DATABASE_URL||e.sqldRemoteDatabaseUrl,a=r.SQLD_REMOTE_DATABASE_AUTH_TOKEN||e.sqldRemoteDatabaseAuthToken;return{syncUrl:this.#n(t),authToken:a}}static#n(e){return e===T?void 0:e}}export{u as DatabaseConnectionFactory};
1
+ import{logger as n}from"../../tools/notifiers/logger.js";import{envConfig as r}from"../../config/env-config.js";import{SQLITE_DATABASE_MIGRATIONS_FOLDER as o,SQLITE_LOCAL_DATABASE_FOLDER as c,SQLITE_REMOTE_DATABASE_FOLDER as l,SQLITE_DATABASE_NAME as i}from"./constants.js";import{DatabaseConnectionsManager as s}from"./database-connections-manager.js";import{hasProjectDatabase as T}from"./has-project-database.js";import{SQLD_REMOTE_DATABASE_URL_NO_DEPLOYMENT_YET_VAR as A}from"../../constants/plugins/catalog-entities.js";class R{static async create(t){return T()?this.#r(t)==="local"?await this.#e(t):await this.#a(t):null}static async#e(t){return await s.getLocalConnection({...t,databaseName:i,additionalFolder:c,migrationsFolder:o})}static async#a(t){try{const{syncUrl:e,authToken:a}=this.#t(t);return!e||!a?(r.isDevelopMode||n.warn("Your remote database is not initialized yet, please wait for production deployment."),null):await s.getRemoteConnection({...t,databaseName:i,additionalFolder:l,migrationsFolder:o,syncUrl:e,authToken:a})}catch(e){return n.error("Remote database connection initialization failed",e),null}}static#r(t){if(t.databaseType)return t.databaseType;const{syncUrl:e,authToken:a}=this.#t(t);return e&&a?"remote":"local"}static#t(t){const e=r.SQLD_REMOTE_DATABASE_URL||t.sqldRemoteDatabaseUrl,a=r.SQLD_REMOTE_DATABASE_AUTH_TOKEN||t.sqldRemoteDatabaseAuthToken;return{syncUrl:this.#n(e),authToken:a}}static#n(t){return t===A?void 0:t}}export{R as DatabaseConnectionFactory};
@@ -1 +1 @@
1
- import{existsSync as a}from"node:fs";import{dirname as l,join as m}from"node:path";const c=Symbol.for("redocly.realm.sandboxContext"),d=globalThis;class s{serverOutDir;static register(t){d[c]=t}static resolve(t){const e=d[c];return e?new s(e.serverOutDir,e.readRoots):new s(t)}#t;constructor(t,e=[]){this.serverOutDir=t,this.#t=s.#o(t,e)}get tmpDir(){return`${this.serverOutDir}/.data/tmp`}get execArgv(){return["--permission",...this.#t.map(t=>`--allow-fs-read=${t}/*`),`--allow-fs-write=${this.serverOutDir}/.data/*`,"--allow-addons"]}get env(){return{TMPDIR:this.tmpDir,TMP:this.tmpDir,TEMP:this.tmpDir}}static#e(t){if(!t)return t;const r=t.indexOf("/node_modules/");return r!==-1?t.slice(0,r):s.#r(t)??s.#s(t)??t}static#r(t){let e=t;for(;;){if(a(m(e,"node_modules",".pnpm")))return e;const r=l(e);if(r===e)return;e=r}}static#s(t){let e=t;for(;;){if(a(m(e,"node_modules")))return e;const r=l(e);if(r===e)return;e=r}}static#o(t,e){const r=[s.#e(t),...e].filter(Boolean).map(o=>o.replace(/(?<!\/)\/+$/,"")).filter(Boolean),i=[...new Set(r)];return i.filter(o=>!i.some(n=>n!==o&&o.startsWith(`${n}/`)))}}export{c as REGISTRATION_KEY,s as SandboxContext};
1
+ import{existsSync as a}from"node:fs";import{dirname as l,join as d}from"node:path";const m=Symbol.for("redocly.realm.sandboxContext"),c=globalThis;class s{serverOutDir;static register(t){c[m]=t}static resolve(t){const e=c[m];return e?new s(e.serverOutDir,e.readRoots):new s(t)}#e;constructor(t,e=[]){this.serverOutDir=t,this.#e=s.#n(t,e)}get tmpDir(){return`${this.serverOutDir}/.data/tmp`}get execArgv(){return["--permission",...process.allowedNodeEnvironmentFlags.has("--allow-net")?["--allow-net","--disable-warning=ExperimentalWarning"]:[],...this.#e.map(e=>`--allow-fs-read=${e}/*`),`--allow-fs-write=${this.serverOutDir}/.data/*`,"--allow-addons"]}get env(){return{TMPDIR:this.tmpDir,TMP:this.tmpDir,TEMP:this.tmpDir}}static#t(t){if(!t)return t;const r=t.indexOf("/node_modules/");return r!==-1?t.slice(0,r):s.#r(t)??s.#s(t)??t}static#r(t){let e=t;for(;;){if(a(d(e,"node_modules",".pnpm")))return e;const r=l(e);if(r===e)return;e=r}}static#s(t){let e=t;for(;;){if(a(d(e,"node_modules")))return e;const r=l(e);if(r===e)return;e=r}}static#n(t,e){const r=[s.#t(t),...e].filter(Boolean).map(n=>n.replace(/(?<!\/)\/+$/,"")).filter(Boolean),o=[...new Set(r)];return o.filter(n=>!o.some(i=>i!==n&&n.startsWith(`${i}/`)))}}export{m as REGISTRATION_KEY,s as SandboxContext};
@@ -1 +1 @@
1
- import{ServerRoutes as n}from"../../constants/api.js";import{reporter as s}from"../tools/notifiers/reporter.js";import{logger as p}from"../tools/notifiers/logger.js";import{telemetry as f}from"../telemetry/index.js";import{installDevRoutes as l,installProdRoutes as v}from"./routes/index.js";import{createRouter as u}from"./router.js";import{readStaticAsset as d}from"./node-asset-reader.js";import{createLlmsTxtGenerator as S}from"../plugins/search/llmstxt/create-llms-txt-generator.js";import{startHttpServer as D}from"./http.js";import{listenStore as R}from"./store-ws.js";import{ejectComponentDataHandler as w}from"./routes/eject.js";import{attachWsServer as g}from"./ws.js";import{DatabasePreconnectService as O}from"../providers/database/database-preconnect-service.js";import{KvService as x}from"../persistence/kv/services/kv-service.js";import{runScorecardsWorker as E}from"../plugins/scorecards/workers/run-scorecards-worker.js";import{isScorecardsEnabled as b}from"../utils/is-scorecards-enabled.js";import{isRealmOrReef as y}from"../utils/is-realm-or-reef.js";async function M(r,i,a){f.initialize(!0);const{port:m=4e3,maxPortRetries:c}=a,t=u();if(t.get(n.EJECT_COMPONENT,w(r)),l(t,r),v(t,r,{readStaticAsset:d,resolveRouteData:e=>r.resolveRouteStaticData(e,i),llmsTxtGenerator:S(r,i)}),y()){await O.init(r.serverOutDir);const e=await x.getInstance({baseDbDir:r.serverOutDir});setInterval(()=>{e.clearExpired().catch(o=>{p.error("Failed to clear expired KV entries",o)})},300*1e3)}try{await r.userCodeReady;const e=await D(t,m,{maxPortRetries:c}),o=g(e);R(r,o),b(r.config)&&await E(r.serverOutDir,r.config.scorecards)}catch(e){await s.panic(e)}}export{M as startDevServer};
1
+ import{ServerRoutes as s}from"../../constants/api.js";import{reporter as n}from"../tools/notifiers/reporter.js";import{logger as p}from"../tools/notifiers/logger.js";import{telemetry as f}from"../telemetry/index.js";import{installDevRoutes as l,installProdRoutes as v}from"./routes/index.js";import{createRouter as u}from"./router.js";import{readStaticAsset as d}from"./node-asset-reader.js";import{createLlmsTxtGenerator as D}from"../plugins/search/llmstxt/create-llms-txt-generator.js";import{startHttpServer as S}from"./http.js";import{listenStore as R}from"./store-ws.js";import{ejectComponentDataHandler as w}from"./routes/eject.js";import{attachWsServer as g}from"./ws.js";import{DatabasePreconnectService as b}from"../providers/database/database-preconnect-service.js";import{KvService as x}from"../persistence/kv/services/kv-service.js";import{runScorecardsWorker as E}from"../plugins/scorecards/workers/run-scorecards-worker.js";import{isScorecardsEnabled as O}from"../utils/is-scorecards-enabled.js";import{hasProjectDatabase as P}from"../providers/database/has-project-database.js";async function M(r,a,i){f.initialize(!0);const{port:m=4e3,maxPortRetries:c}=i,t=u();if(t.get(s.EJECT_COMPONENT,w(r)),l(t,r),v(t,r,{readStaticAsset:d,resolveRouteData:e=>r.resolveRouteStaticData(e,a),llmsTxtGenerator:D(r,a)}),P()){await b.init(r.serverOutDir);const e=await x.getInstance({baseDbDir:r.serverOutDir});setInterval(()=>{e.clearExpired().catch(o=>{p.error("Failed to clear expired KV entries",o)})},300*1e3)}try{await r.userCodeReady;const e=await S(t,m,{maxPortRetries:c}),o=g(e);R(r,o),O(r.config)&&await E(r.serverOutDir,r.config.scorecards)}catch(e){await n.panic(e)}}export{M as startDevServer};
@@ -1,2 +1,2 @@
1
- export declare function readStaticAsset(assetPath: string): Promise<import("fs").ReadStream>;
1
+ export declare function readStaticAsset(assetPath: string): Promise<import("node:fs").ReadStream>;
2
2
  //# sourceMappingURL=node-asset-reader.d.ts.map
@@ -1 +1 @@
1
- import{DEFAULT_LOCALE_PLACEHOLDER as u}from"../../constants/common.js";import{defaultTranslationImports as c}from"../../constants/l10n/default-translations.js";async function L(s,r){const a=s?.defaultLocale||u,e=s?.translations??{},i=s?.locales?[...new Set(s.locales.flatMap(t=>[t.code,t.code.split("-")[0]]))]:[a],l={};for(const t of i){const n=await c[t]?.()||{};l[t]={translation:{...n,...e[t]?.translation}}}return{load:"currentOnly",lng:r,nonExplicitSupportedLngs:!0,fallbackLng:t=>{if(!t)return[a];const n=t.split("-")[0];if(t===a)return n!==t?[n,a]:[a];const o=[t];return n!==t&&o.push(n),o.push(a),o},interpolation:{escapeValue:!1},debug:!1,resources:{...l}}}export{L as buildI18nConfig};
1
+ import{DEFAULT_LOCALE_PLACEHOLDER as u}from"../../constants/common.js";import{defaultTranslationImports as f}from"../../constants/l10n/default-translations.js";async function L(s,o){const a=s?.defaultLocale||u,e=s?.translations??{},i=s?.locales?[...new Set(s.locales.flatMap(t=>[t.code,t.code.split("-")[0]]))]:[a],r={};for(const t of i){const n=await f[t]?.()||{};r[t]={translation:{...n,...e[t]?.translation}}}return{load:"currentOnly",lng:o,nonExplicitSupportedLngs:!0,fallbackLng:t=>{if(!t)return[a];const n=t.split("-")[0];if(t===a)return n!==t?[n,a]:[a];const l=[t];return n!==t&&l.push(n),l.push(a),l},interpolation:{escapeValue:!1},returnEmptyString:!1,returnNull:!1,debug:!1,resources:{...r}}}export{L as buildI18nConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/realm",
3
- "version": "0.141.0-next.20",
3
+ "version": "0.141.0-next.22",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,23 +24,22 @@
24
24
  "@modelcontextprotocol/server": "2.3.1",
25
25
  "@opentelemetry/api": "1.9.1",
26
26
  "@opentelemetry/context-zone": "2.0.1",
27
- "@opentelemetry/core": "2.8.0",
28
- "@opentelemetry/exporter-trace-otlp-http": "0.219.0",
29
- "@opentelemetry/instrumentation": "0.219.0",
30
- "@opentelemetry/instrumentation-http": "0.219.0",
31
- "@opentelemetry/resources": "2.8.0",
32
- "@opentelemetry/sdk-trace-node": "2.8.0",
33
- "@opentelemetry/sdk-trace-web": "2.8.0",
27
+ "@opentelemetry/core": "2.12.1",
28
+ "@opentelemetry/exporter-trace-otlp-http": "0.223.2",
29
+ "@opentelemetry/instrumentation": "0.223.2",
30
+ "@opentelemetry/resources": "2.12.1",
31
+ "@opentelemetry/sdk-trace-node": "2.12.1",
32
+ "@opentelemetry/sdk-trace-web": "2.12.1",
34
33
  "@opentelemetry/semantic-conventions": "1.40.0",
35
34
  "@redocly/ajv": "8.18.0",
36
- "@redocly/api-docs": "0.6.0-next.20",
37
- "@redocly/config": "0.77.0",
35
+ "@redocly/api-docs": "0.6.0-next.22",
36
+ "@redocly/config": "0.79.0",
38
37
  "@redocly/markdoc": "0.7.1",
39
38
  "@redocly/openapi-core": "2.81.0",
40
39
  "@redocly/portal-legacy-ui": "0.19.0",
41
- "@redocly/portal-plugin-mock-server": "0.26.0-next.6",
42
- "@redocly/realm-asyncapi-sdk": "0.18.0-next.3",
43
- "@redocly/theme": "0.73.0-next.15",
40
+ "@redocly/portal-plugin-mock-server": "0.26.0-next.7",
41
+ "@redocly/realm-asyncapi-sdk": "0.18.0-next.4",
42
+ "@redocly/theme": "0.73.0-next.17",
44
43
  "@shikijs/transformers": "3.21.0",
45
44
  "@tanstack/react-query": "5.62.3",
46
45
  "@tanstack/react-table": "8.21.3",
@@ -63,7 +62,7 @@
63
62
  "flexsearch": "0.7.43",
64
63
  "graphql": "16.14.2",
65
64
  "hono": "4.13.18",
66
- "i18next": "22.4.15",
65
+ "i18next": "26.7.2",
67
66
  "is-glob": "4.0.3",
68
67
  "js-yaml": "4.3.2",
69
68
  "lru-cache": "11.1.0",
@@ -91,7 +90,7 @@
91
90
  "tty-browserify": "0.0.1",
92
91
  "typesense": "2.1.0",
93
92
  "ulid": "^3.0.2",
94
- "undici": "^6.29.1",
93
+ "undici": "^7.30.2",
95
94
  "web-vitals": "3.3.1",
96
95
  "workerpool": "9.2.0",
97
96
  "ws": "^8.21.0",