@redocly/realm 0.134.0 → 0.135.0-next.1

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 (88) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/client/app/Link.d.ts +1 -1
  3. package/dist/client/app/Link.js +1 -1
  4. package/dist/client/app/Sidebar/RequestAccessButton.js +2 -2
  5. package/dist/client/app/hooks/useLoginUrl.js +1 -1
  6. package/dist/client/app/hooks/useScrollTracker.js +1 -1
  7. package/dist/client/app/markdoc/custom-components/openapi/json-schema.d.ts +1 -0
  8. package/dist/client/app/markdoc/custom-components/openapi/json-schema.js +1 -1
  9. package/dist/client/app/search/useAiSearch.js +1 -1
  10. package/dist/client/app/utils/programmatic-scroll.d.ts +22 -0
  11. package/dist/client/app/utils/programmatic-scroll.js +1 -0
  12. package/dist/markdoc/helpers/get-inner-text.js +2 -2
  13. package/dist/markdoc/tags/json-schema.js +1 -1
  14. package/dist/server/constants/common.d.ts +4 -1
  15. package/dist/server/constants/common.js +1 -1
  16. package/dist/server/plugins/catalog-entities/database/remote-publish-lock-service.js +1 -1
  17. package/dist/server/plugins/graphql-docs/graphql-doc-loader.d.ts +5 -0
  18. package/dist/server/plugins/graphql-docs/graphql-doc-loader.js +1 -1
  19. package/dist/server/plugins/graphql-docs/index.js +1 -1
  20. package/dist/server/plugins/markdown/search/to-markdown.js +14 -14
  21. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.d.ts +1 -0
  22. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
  23. package/dist/server/plugins/mcp/docs-mcp/tools/core/search.d.ts +6 -0
  24. package/dist/server/plugins/mcp/docs-mcp/tools/core/search.js +6 -0
  25. package/dist/server/plugins/mcp/docs-mcp/tools/core/utils.d.ts +3 -0
  26. package/dist/server/plugins/mcp/docs-mcp/tools/core/utils.js +11 -0
  27. package/dist/server/plugins/mcp/docs-mcp/tools/core/whoami.d.ts +6 -0
  28. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-schema.d.ts +8 -0
  29. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-schema.js +3 -0
  30. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type-list.d.ts +14 -0
  31. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type-list.js +1 -0
  32. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type.d.ts +10 -0
  33. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type.js +7 -0
  34. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/list-graphql-apis.d.ts +10 -0
  35. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/list-graphql-apis.js +1 -0
  36. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/load-graphql-schema.d.ts +7 -0
  37. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/load-graphql-schema.js +1 -0
  38. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/tool-helpers.d.ts +14 -0
  39. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/tool-helpers.js +1 -0
  40. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/types.d.ts +10 -0
  41. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/types.js +1 -0
  42. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/utils.d.ts +16 -0
  43. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/utils.js +3 -0
  44. package/dist/server/plugins/mcp/docs-mcp/tools/index.d.ts +28 -7
  45. package/dist/server/plugins/mcp/docs-mcp/tools/index.js +1 -1
  46. package/dist/server/plugins/mcp/docs-mcp/tools/{get-endpoint-info.d.ts → openapi/get-endpoint-info.d.ts} +1 -1
  47. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoint-info.js +1 -0
  48. package/dist/server/plugins/mcp/docs-mcp/tools/{get-endpoints.d.ts → openapi/get-endpoints.d.ts} +1 -1
  49. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoints.js +1 -0
  50. package/dist/server/plugins/mcp/docs-mcp/tools/{get-full-api-description.d.ts → openapi/get-full-api-description.d.ts} +1 -1
  51. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-full-api-description.js +1 -0
  52. package/dist/server/plugins/mcp/docs-mcp/tools/{get-security-schemes.d.ts → openapi/get-security-schemes.d.ts} +1 -1
  53. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-security-schemes.js +1 -0
  54. package/dist/server/plugins/mcp/docs-mcp/tools/{list-apis.d.ts → openapi/list-apis.d.ts} +1 -1
  55. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/list-apis.js +1 -0
  56. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.js +1 -0
  57. package/dist/server/plugins/mcp/docs-mcp/tools/{utils.d.ts → openapi/utils.d.ts} +1 -3
  58. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.js +1 -0
  59. package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
  60. package/dist/server/plugins/mcp/index.js +1 -1
  61. package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
  62. package/dist/server/plugins/mcp/types.d.ts +7 -0
  63. package/dist/server/plugins/mcp/utils.d.ts +7 -17
  64. package/dist/server/plugins/mcp/utils.js +1 -1
  65. package/dist/server/store.d.ts +2 -0
  66. package/dist/server/store.js +1 -1
  67. package/dist/server/types/plugins/common.d.ts +2 -0
  68. package/dist/server/web-server/middleware/catalogAuthMiddleware.js +1 -1
  69. package/dist/server/web-server/routes/api-routes/api-routes.d.ts +0 -5
  70. package/dist/server/web-server/routes/api-routes/api-routes.js +1 -1
  71. package/dist/server/web-server/routes/app-data.js +1 -1
  72. package/dist/server/web-server/routes/dynamic-route.js +1 -1
  73. package/dist/server/web-server/routes/page-data.js +1 -1
  74. package/dist/server/web-server/routes/search.js +1 -1
  75. package/dist/server/web-server/utils.js +1 -1
  76. package/package.json +8 -8
  77. package/dist/server/plugins/mcp/docs-mcp/tools/get-endpoint-info.js +0 -1
  78. package/dist/server/plugins/mcp/docs-mcp/tools/get-endpoints.js +0 -1
  79. package/dist/server/plugins/mcp/docs-mcp/tools/get-full-api-description.js +0 -1
  80. package/dist/server/plugins/mcp/docs-mcp/tools/get-security-schemes.js +0 -1
  81. package/dist/server/plugins/mcp/docs-mcp/tools/helpers/load-api-description.js +0 -1
  82. package/dist/server/plugins/mcp/docs-mcp/tools/list-apis.js +0 -1
  83. package/dist/server/plugins/mcp/docs-mcp/tools/search.d.ts +0 -6
  84. package/dist/server/plugins/mcp/docs-mcp/tools/search.js +0 -6
  85. package/dist/server/plugins/mcp/docs-mcp/tools/utils.js +0 -11
  86. package/dist/server/plugins/mcp/docs-mcp/tools/whoami.d.ts +0 -6
  87. /package/dist/server/plugins/mcp/docs-mcp/tools/{whoami.js → core/whoami.js} +0 -0
  88. /package/dist/server/plugins/mcp/docs-mcp/tools/{helpers → openapi}/load-api-description.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @redocly/realm
2
2
 
3
+ ## 0.135.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 76189db569f: Added `GraphQL` support to Docs MCP server.
8
+ - 736405a5893: Added `title` attribute to the `json-schema` Markdoc tag to display a heading above the rendered schema.
9
+
10
+ ### Patch Changes
11
+
12
+ - b93a2a61665: Fixed an issue where the login button did not return users to their previous page after signing in.
13
+ - 08dea434932: Fixed scroll synchronization between the Webview and editor: dragging the Webview scrollbar scrolls the editor, and mouse-wheel scrolling maintains alignment.
14
+ - 4267dc2f1ed: Fixed an issue where the Markdoc `tabs` tag crashed if it contained content without a `label` attribute.
15
+ - c202a2acd4b: Improved HTTP caching for HTML responses by setting `Cache-Control: no-cache` on public projects and `Cache-Control: private` on protected projects.
16
+ Added `X-Redocly-Cache-Control` header to public HTML responses to enhance CDN caching.
17
+ - Updated dependencies [4267dc2f1ed]
18
+ - Updated dependencies [2d154630f33]
19
+ - @redocly/theme@0.67.0-next.1
20
+ - @redocly/openapi-docs@3.23.0-next.1
21
+ - @redocly/asyncapi-docs@1.12.0-next.1
22
+ - @redocly/graphql-docs@1.12.0-next.1
23
+ - @redocly/portal-plugin-mock-server@0.20.0-next.1
24
+
25
+ ## 0.135.0-next.0
26
+
27
+ ### Patch Changes
28
+
29
+ - 6e84a3b2458: Enter prerelease mode.
30
+ - ed64b3849b8: Fixed an issue where italic or bold text inside headings was excluded from generated anchor links.
31
+ - Updated dependencies [6e84a3b2458]
32
+ - @redocly/portal-plugin-mock-server@0.20.0-next.0
33
+ - @redocly/realm-asyncapi-sdk@0.13.0-next.0
34
+ - @redocly/portal-legacy-ui@0.18.0-next.0
35
+ - @redocly/asyncapi-docs@1.12.0-next.0
36
+ - @redocly/graphql-docs@1.12.0-next.0
37
+ - @redocly/openapi-docs@3.23.0-next.0
38
+ - @redocly/theme@0.67.0-next.0
39
+
3
40
  ## 0.134.0
4
41
 
5
42
  ### Minor Changes
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { LinkProps } from '@redocly/theme/components/Link/Link';
2
+ import type { LinkProps } from '@redocly/theme/core/types';
3
3
  export declare function Link(props: React.PropsWithChildren<LinkProps>): React.ReactElement;
4
4
  //# sourceMappingURL=Link.d.ts.map
@@ -1 +1 @@
1
- import*as l from"react";import w from"path";import{Link as U,useNavigate as z,useLocation as D}from"react-router-dom";import{getPathnameForLocale as F,withPathPrefix as I}from"@redocly/theme/core/utils";import{removeTrailingSlash as M}from"../../utils/url/remove-trailing-slash";import{normalizeRouteSlug as k}from"../../utils/path/normalize-route-slug";import{isAbsoluteUrl as S}from"../../utils/url/is-absolute-url";import{isAssetsLink as j}from"../../utils/path/is-assets-link";import{useL10nConfig as T}from"./hooks/index.js";import{loadAndNavigate as V}from"./utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as q}from"../utils/utils.js";async function v(n,t){if(S(n))return;await(typeof window<"u"?window:global).__LOADER.tryLoad(n,void 0,t)}function ee(n){const{to:t,children:f,className:b,style:i,innerRef:s,target:A,external:c,languageInsensitive:P,onClick:m,rel:R,tabIndex:d,id:u,role:p}=n,x=A||(c?"_blank":"_self"),C=c||t.match(/^(https?:\/\/|mailto:)/),h=R||(C?"noreferrer":void 0),g={};for(const[r,y]of Object.entries(n))(r.startsWith("data-")||r.startsWith("aria-"))&&typeof y=="string"&&(g[r]=y);const a={className:b,children:f,target:x,...h&&{rel:h},onClick:m,...typeof d=="number"&&{tabIndex:d},...typeof u=="string"&&{id:u},...typeof p=="string"&&{role:p},...g},{defaultLocale:E,locales:N,currentLocale:O}=T(),W=D();let e=t;e.startsWith(".")&&(e=w.resolve(w.dirname(k(W.pathname)),k(t))),e=e.startsWith("#")?e:I(P?e:F(e,E,O,N));const o=e!=="/"?M(e):e,_=z(),L=typeof window<"u"?new URL(o,window.location.origin+window.location.pathname).search:void 0;return typeof t=="string"&&t.match(/^(https?:\/\/|mailto:)/)?l.createElement("a",{...a,ref:s,style:i,href:t,onMouseOver:async()=>v(t,L)}):j(o)?l.createElement("a",{...a,ref:s,style:i,href:o}):l.createElement(U,{...a,ref:s,style:i,to:o,onClick:r=>{m?.(),!q(r,a.target)&&(r.preventDefault(),V({navigate:_,to:o}))},onMouseOver:async()=>v(o,L)})}export{ee as Link};
1
+ import*as s from"react";import u from"path";import{Link as U,useNavigate as z,useLocation as F}from"react-router-dom";import{getPathnameForLocale as M,withPathPrefix as W}from"@redocly/theme/core/utils";import{removeTrailingSlash as I}from"../../utils/url/remove-trailing-slash";import{normalizeRouteSlug as h}from"../../utils/path/normalize-route-slug";import{isAbsoluteUrl as V}from"../../utils/url/is-absolute-url";import{isAssetsLink as j}from"../../utils/path/is-assets-link";import{useL10nConfig as q}from"./hooks/index.js";import{loadAndNavigate as B}from"./utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as G}from"../utils/utils.js";async function g(o,t){if(V(o))return;await(typeof window<"u"?window:global).__LOADER.tryLoad(o,void 0,t)}function oe(o){const{to:t,children:l,className:v,style:a,innerRef:i,target:L,external:c,languageInsensitive:w,onClick:m,active:H,rel:y,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,..._}=o,x=L||(c?"_blank":"_self"),A=c||t.match(/^(https?:\/\/|mailto:)/),f=y||(A?"noreferrer":void 0),n={className:v,children:l,target:x,...f&&{rel:f},onClick:m,..._},{defaultLocale:D,locales:S,currentLocale:b}=q(),O=F();let e=t;e.startsWith(".")&&(e=u.resolve(u.dirname(h(O.pathname)),h(t))),e=e.startsWith("#")?e:W(w?e:M(e,D,b,S));const r=e!=="/"?I(e):e,T=z(),d=typeof window<"u"?new URL(r,window.location.origin+window.location.pathname).search:void 0;return typeof t=="string"&&t.match(/^(https?:\/\/|mailto:)/)?s.createElement("a",{...n,ref:i,style:a,href:t,onMouseOver:async()=>g(t,d)}):j(r)?s.createElement("a",{...n,ref:i,style:a,href:r}):s.createElement(U,{...n,ref:i,style:a,to:r,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,onClick:p=>{m?.(),!G(p,n.target)&&(p.preventDefault(),B({navigate:T,to:r}))},onMouseOver:async()=>g(r,d)})}export{oe as Link};
@@ -1,4 +1,4 @@
1
- import o,{useEffect as D,useState as a}from"react";import I from"styled-components";import{useLocation as N}from"react-router-dom";import{Button as y}from"@redocly/theme/components/Button/Button";import{Admonition as k}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{withPathPrefix as w}from"@redocly/theme/core/utils";import{usePageData as b}from"../hooks/usePageData";import{usePreloadHistory as q}from"../usePreloadHistory";import{telemetry as x}from"../telemetry/index.js";import{useLoginUrl as R}from"../hooks";const U=e=>{const{apiId:s,status:t,setStatus:r}=e,u=q(),{userData:n}=b("userData")||{},h=N(),i=R(),[l,p]=a(),[g,A]=a(),[m,E]=a(!0);D(()=>{n?.isAuthenticated&&fetch(`/api/api-keys/api-products/${s}/access`).then(d=>d.json().then(c=>{d.ok?(r(c.status),A(c.appId)):p(c.message)}).catch(()=>p("Something went wrong")).finally(()=>E(!1)))},[n?.isAuthenticated,s,r]);const P=()=>{!n?.isAuthenticated&&i?window.location.href=`${w(i)}${i.includes("?")?"&":"?"}redirectTo=${h.pathname}`:t==="ACCEPTED"?u.push("/apps/"+g||""):t==="NONE"&&u.push("/apps/?createApp&apiId="+s),x.sendRequestApiAccessButtonClickedMessage([{object:"button",action:"click"}])},C=(t==="PENDING"||m||l!=null)&&n?.isAuthenticated;return o.createElement(o.Fragment,null,o.createElement(y,{disabled:C,onClick:P,fullWidth:!0,size:"small"},T(t,m,l,!!n?.isAuthenticated)))},T=(e,s,t,r)=>{if(!r)return"Request access";if(s)return"Loading...";if(t)return"Failed to check access";switch(e){case"NONE":return"Request access";case"ACCEPTED":return"Credentials";case"PENDING":return"Pending access..."}return null},Y=e=>e==="ACCEPTED"?o.createElement(f,{type:"success",name:"You have access to this API"}):e==="PENDING"?o.createElement(f,{type:"info",name:"You have requested access to this API"}):null,f=I(k)`
1
+ import r,{useEffect as C,useState as a}from"react";import D from"styled-components";import{Button as I}from"@redocly/theme/components/Button/Button";import{Admonition as N}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{withPathPrefix as y}from"@redocly/theme/core/utils";import{usePageData as k}from"../hooks/usePageData";import{usePreloadHistory as w}from"../usePreloadHistory";import{telemetry as b}from"../telemetry/index.js";import{useLoginUrl as q}from"../hooks";const M=e=>{const{apiId:s,status:t,setStatus:i}=e,c=w(),{userData:n}=k("userData")||{},u=q(),[l,p]=a(),[h,g]=a(),[m,A]=a(!0);C(()=>{n?.isAuthenticated&&fetch(`/api/api-keys/api-products/${s}/access`).then(d=>d.json().then(o=>{d.ok?(i(o.status),g(o.appId)):p(o.message)}).catch(()=>p("Something went wrong")).finally(()=>A(!1)))},[n?.isAuthenticated,s,i]);const E=()=>{!n?.isAuthenticated&&u?window.location.href=y(u):t==="ACCEPTED"?c.push("/apps/"+h||""):t==="NONE"&&c.push("/apps/?createApp&apiId="+s),b.sendRequestApiAccessButtonClickedMessage([{object:"button",action:"click"}])},P=(t==="PENDING"||m||l!=null)&&n?.isAuthenticated;return r.createElement(r.Fragment,null,r.createElement(I,{disabled:P,onClick:E,fullWidth:!0,size:"small"},x(t,m,l,!!n?.isAuthenticated)))},x=(e,s,t,i)=>{if(!i)return"Request access";if(s)return"Loading...";if(t)return"Failed to check access";switch(e){case"NONE":return"Request access";case"ACCEPTED":return"Credentials";case"PENDING":return"Pending access..."}return null},O=e=>e==="ACCEPTED"?r.createElement(f,{type:"success",name:"You have access to this API"}):e==="PENDING"?r.createElement(f,{type:"info",name:"You have requested access to this API"}):null,f=D(N)`
2
2
  margin-top: 0px;
3
3
  margin-bottom: var(--spacing-sm);
4
- `;export{U as RequestAccessButton,Y as renderAdmonition};
4
+ `;export{M as RequestAccessButton,O as renderAdmonition};
@@ -1 +1 @@
1
- import{useThemeConfig as l}from"@redocly/theme/core/hooks";import{getPathnameForLocale as i}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as t}from"../../../constants/common";import{buildLoginUrl as s}from"../../../utils/auth/build-login-url";import{useL10nConfig as p}from"./useL10nConfig";function I(f={}){const d=l(),{auth:o}=d,{defaultLocale:n,locales:e,currentLocale:r}=p(),u=()=>{if(o?.idpsInfo?.length){if(o.idpsInfo.length===1){const m=o.idpsInfo[0];return s(m.idpId,i("",n,r,e),void 0,f)}return i(t,n,r,e)}};return o?.devLogin?i(t,n,r,e):u()}export{I as useLoginUrl};
1
+ import{useLocation as u}from"react-router-dom";import{useThemeConfig as d}from"@redocly/theme/core/hooks";import{getPathnameForLocale as e}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as i}from"../../../constants/common";import{buildLoginUrl as p}from"../../../utils/auth/build-login-url";import{useL10nConfig as a}from"./useL10nConfig";function F(c={}){const f=d(),{auth:o}=f,{defaultLocale:n,locales:t,currentLocale:r}=a(),m=u().pathname,s=()=>{if(o?.idpsInfo?.length){if(o.idpsInfo.length===1){const l=o.idpsInfo[0];return p(l.idpId,e("",n,r,t),m,c)}return e(i,n,r,t)}};return o?.devLogin?e(i,n,r,t):s()}export{F as useLoginUrl};
@@ -1 +1 @@
1
- import{useCallback as c,useEffect as d,useRef as w}from"react";import{syncScrollWithProject as l}from"../utils/syncScrollWithEditor.js";import{usePostMessage as a}from"../../providers/post-message/use-post-message.js";import{isInIframe as u}from"../../utils/utils.js";const h=()=>{const{sendMessage:t}=a(),o=w(0),n=c(()=>{const e=window.document.querySelector(":hover"),r=Date.now()-o.current<30;if(!e||!r)return;const{percentScrolled:s,sequenceNumber:i}=l(window.scrollY);t({type:"editor-scroll-updated",percentScrolled:s,sequenceNumber:i}),t({type:"scroll-updated",position:{absolute:window.scrollY,relative:Math.round(window.scrollY/(window.document.body.clientHeight-window.innerHeight)*100)}})},[t]);d(()=>{if(!u())return;const e=()=>{o.current=Date.now()};return window.addEventListener("wheel",e),window.addEventListener("touchstart",e),window.addEventListener("keydown",e),window.addEventListener("scroll",n,{passive:!0}),()=>{window.removeEventListener("wheel",e),window.removeEventListener("touchstart",e),window.removeEventListener("keydown",e),window.removeEventListener("scroll",n)}},[n])};export{h as useScrollTracker};
1
+ import{useCallback as n,useEffect as l}from"react";import{syncScrollWithProject as i}from"../utils/syncScrollWithEditor.js";import{installProgrammaticScrollMarking as s,isProgrammaticScrollEvent as c}from"../utils/programmatic-scroll.js";import{usePostMessage as d}from"../../providers/post-message/use-post-message.js";import{isInIframe as a}from"../../utils/utils.js";const g=()=>{const{sendMessage:e}=d(),o=n(()=>{if(c()||!window.document.querySelector(":hover"))return;const{percentScrolled:r,sequenceNumber:t}=i(window.scrollY);e({type:"editor-scroll-updated",percentScrolled:r,sequenceNumber:t}),e({type:"scroll-updated",position:{absolute:window.scrollY,relative:Math.round(window.scrollY/(window.document.body.clientHeight-window.innerHeight)*100)}})},[e]);l(()=>{if(a())return s(),window.addEventListener("scroll",o,{passive:!0}),()=>{window.removeEventListener("scroll",o)}},[o])};export{g as useScrollTracker};
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import type { OpenAPIDefinition, OpenAPISchema } from '@redocly/openapi-docs';
3
3
  type JsonSchemaProps = {
4
4
  options?: any;
5
+ title?: string;
5
6
  schemaResolved?: OpenAPIDefinition;
6
7
  schemaResolvedErrors?: string[];
7
8
  schema?: OpenAPISchema;
@@ -1 +1 @@
1
- import{RedocSchema as c,StoreProvider as p}from"@redocly/openapi-docs";import*as e from"react";import{Admonition as d}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{MarkdownLink as l}from"@redocly/theme/markdoc/components/MarkdownLink/MarkdownLink";import{link as h}from"../../../../../markdoc/nodes/index.js";import{OpenApiComponentWrap as f}from"../styled.elements";const k={nodes:{link:h},components:{MarkdownLink:l}};function x(r){const{options:m,schemaResolved:o,schemaResolvedErrors:t,schema:n}=r;if(n||o){const s={openapi:"3.0.0",info:{version:"1",description:"test",title:"test"},paths:{},"x-root":o?.components?.schemas?.__root||n,components:{schemas:{...o?.components?.schemas}}};return e.createElement(f,{"data-testid":"json-schema"},e.createElement(p,{options:{...m,markdocOptions:k},definition:s},t?.length?e.createElement(d,{name:"Problem in json-schema tag",type:"danger"},t.map((i,a)=>e.createElement("div",{key:a},i))):null,e.createElement(c,{pointer:"#/x-root",disableDeepLinks:!0})))}}export{x as JsonSchema};
1
+ import{RedocSchema as p,StoreProvider as l}from"@redocly/openapi-docs";import*as e from"react";import{Admonition as d}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{MarkdownLink as h}from"@redocly/theme/markdoc/components/MarkdownLink/MarkdownLink";import{link as f}from"../../../../../markdoc/nodes/index.js";import{OpenApiComponentWrap as E}from"../styled.elements";const k={nodes:{link:f},components:{MarkdownLink:h}};function S(m){const{options:s,title:t,schemaResolved:o,schemaResolvedErrors:n,schema:r}=m;if(r||o){const i={openapi:"3.0.0",info:{version:"1",description:"test",title:"test"},paths:{},"x-root":o?.components?.schemas?.__root||r,components:{schemas:{...o?.components?.schemas}}};return e.createElement(E,{"data-testid":"json-schema"},t?e.createElement("h3",null,t):null,e.createElement(l,{options:{...s,markdocOptions:k},definition:i},n?.length?e.createElement(d,{name:"Problem in json-schema tag",type:"danger"},n.map((a,c)=>e.createElement("div",{key:c},a))):null,e.createElement(p,{pointer:"#/x-root",disableDeepLinks:!0})))}}export{S as JsonSchema};
@@ -1 +1 @@
1
- import{useCallback as E,useEffect as Q,useMemo as J,useRef as m,useState as b}from"react";import{AiSearchError as d}from"@redocly/theme/core/constants";import{withPathPrefix as N,splitContentByToolCalls as V}from"@redocly/theme/core/utils";import{ServerRoutes as j}from"../../../constants/common";import{useSearchSession as B}from"@redocly/theme/core/contexts";import{AI_SEARCH_REQUEST_HEADERS as D,HTTP_ERROR_MAP as G}from"../../constants";import{useI18nConfig as K,usePageVersions as L}from"../hooks";import{telemetry as U}from"../telemetry/index.js";import{streamSSEMessages as z}from"./sse-parser";import{handleSSEMessage as W}from"./message-handlers";function or(n){const{searchSessionId:p}=B(),[r,s]=b({status:"idle"}),[_,g]=b([]),[S,y]=b([]),t=m(null),c=m(""),o=m(""),a=m([]),{currentLocale:C}=K(),{versions:w=[]}=L()||{},l=w.find(e=>e?.active),f=E(()=>{s({status:"idle",response:""}),y([]),c.current="",o.current="",a.current=[]},[]),M=E(()=>{t.current?.abort(),t.current=null,f(),g([])},[f]);Q(()=>()=>{t.current?.abort()},[]);const O=E(async(e,q)=>{if(!e)return;t.current?.abort();const h=new AbortController;t.current=h,f(),s({status:"loading",question:e,response:"",resources:[]});try{const u=await fetch(N(j.ASK_AI),{method:"POST",headers:D,body:JSON.stringify({text:e,history:q||[],locale:C,product:n?.product,filter:n?.filter,version:l&&{folder:l.folderId,label:l.label},searchSessionId:p}),signal:h.signal});if(!u.ok){s({status:"error",question:e,error:G[u.status]??d.HttpRequestFailed});return}const A=u.body;if(!A){s({status:"error",question:e,error:d.HttpRequestFailed});return}let I=!1;for await(const i of z(A,h.signal)){const F={messageId:c.current,resources:a.current,accumulatedResponse:o.current,setConversation:g,setState:s,setToolCalls:y},{messageId:v,resources:H,accumulatedResponse:P}=W(i,F);v&&(c.current=v),H&&(a.current=H),P&&(o.current=P),i.type==="error"&&(I=!0)}t.current=null,s(i=>i.status==="error"?i:o.current?{status:"success",question:e,response:o.current,resources:a.current}:{status:"error",question:e,error:d.EmptyResponse}),!I&&o.current&&e.trim()&&c.current&&U.sendSearchAIQueryMessage([{object:"search",question:e,answer:o.current,resources:JSON.stringify(a.current),searchSessionId:p,messageId:c.current,...n?.product&&{product:n.product}}])}catch(u){if(u instanceof Error&&u.name==="AbortError")return;t.current=null,s({status:"error",question:e,error:d.HttpRequestFailed})}},[f,n?.product,C,n?.filter,l,p]),R=r.status==="loading"||r.status==="success"||r.status==="idle"?r.response:void 0,k=J(()=>V(R,S),[R,S]);return{askQuestion:O,isGeneratingResponse:r.status==="loading",response:R,resources:r.status==="loading"||r.status==="success"?r.resources:[],question:r.status!=="idle"?r.question:"",error:r.status==="error"?r.error:null,clearConversation:M,conversation:_,setConversation:g,toolCalls:S,contentSegments:k}}export{or as useAiSearch};
1
+ import{useCallback as E,useEffect as Q,useMemo as J,useRef as m,useState as y}from"react";import{AiSearchError as d}from"@redocly/theme/core/constants";import{withPathPrefix as N,splitContentByToolCalls as V}from"@redocly/theme/core/utils";import{ServerRoutes as j}from"../../../constants/common";import{useSearchSession as B}from"@redocly/theme/core/contexts";import{AI_SEARCH_REQUEST_HEADERS as D,HTTP_ERROR_MAP as G}from"../../constants";import{useI18nConfig as K,usePageVersions as L}from"../hooks";import{telemetry as U}from"../telemetry/index.js";import{streamSSEMessages as $}from"./sse-parser";import{handleSSEMessage as z}from"./message-handlers";function or(u){const{searchSessionId:p}=B(),[r,t]=y({status:"idle"}),[P,g]=y([]),[S,b]=y([]),o=m(null),a=m(""),n=m(""),i=m([]),{currentLocale:C}=K(),{versions:_=[]}=L()||{},l=_.find(e=>e?.active),f=E(()=>{t({status:"idle",response:""}),b([]),a.current="",n.current="",i.current=[]},[]),w=E(()=>{o.current?.abort(),o.current=null,f(),g([])},[f]);Q(()=>()=>{o.current?.abort()},[]);const O=E(async(e,q)=>{if(!e)return;o.current?.abort();const h=new AbortController;o.current=h,f(),t({status:"loading",question:e,response:"",resources:[]});try{const c=await fetch(N(j.ASK_AI),{method:"POST",headers:D,body:JSON.stringify({text:e,history:q||[],locale:C,product:u?.product,filter:u?.filter,version:l&&{folder:l.folderId,label:l.label},searchSessionId:p}),signal:h.signal});if(!c.ok){t({status:"error",question:e,error:G[c.status]??d.HttpRequestFailed});return}const A=c.body;if(!A){t({status:"error",question:e,error:d.HttpRequestFailed});return}let I=!1;for await(const s of $(A,h.signal)){const F={messageId:a.current,resources:i.current,accumulatedResponse:n.current,setConversation:g,setState:t,setToolCalls:b},{messageId:v,resources:H,accumulatedResponse:M}=z(s,F);v&&(a.current=v),H&&(i.current=H),M&&(n.current=M),s.type==="error"&&(I=!0)}if(o.current=null,t(s=>s.status==="error"?s:n.current?{status:"success",question:e,response:n.current,resources:i.current}:{status:"error",question:e,error:d.EmptyResponse}),!I&&n.current&&e.trim()&&a.current){const s=a.current;U.sendSearchAIQueryMessage([{id:s,object:"aiSearchMessage",uri:`urn:redocly:realm:ui:aiSearchMessage:${s}`,question:e,answer:n.current,resources:JSON.stringify(i.current),searchSessionId:p,messageId:s,source:"realm",...u?.product&&{product:u.product}}])}}catch(c){if(c instanceof Error&&c.name==="AbortError")return;o.current=null,t({status:"error",question:e,error:d.HttpRequestFailed})}},[f,u?.product,C,u?.filter,l,p]),R=r.status==="loading"||r.status==="success"||r.status==="idle"?r.response:void 0,k=J(()=>V(R,S),[R,S]);return{askQuestion:O,isGeneratingResponse:r.status==="loading",response:R,resources:r.status==="loading"||r.status==="success"?r.resources:[],question:r.status!=="idle"?r.question:"",error:r.status==="error"?r.error:null,clearConversation:w,conversation:P,setConversation:g,toolCalls:S,contentSegments:k}}export{or as useAiSearch};
@@ -0,0 +1,22 @@
1
+ export declare const SCROLL_SETTLE_MS = 150;
2
+ /**
3
+ * Marks the scroll events of the next SCROLL_SETTLE_MS as programmatic
4
+ * (editor sync, navigation) so the scroll tracker doesn't report them back
5
+ * as user scrolling. The window is short and fixed on purpose: a stray sync
6
+ * push can mute real user scrolling for at most one window, while continuous
7
+ * sync streams stay suppressed because every push re-marks.
8
+ */
9
+ export declare function markProgrammaticScroll(): void;
10
+ /**
11
+ * Returns true while a recently marked programmatic scroll is settling.
12
+ */
13
+ export declare function isProgrammaticScrollEvent(): boolean;
14
+ /**
15
+ * Wraps the window scroll methods so every programmatic page scroll marks
16
+ * itself — callers (portal, theme, custom plugins) don't need to remember to
17
+ * call markProgrammaticScroll(). Element.prototype.scrollIntoView is
18
+ * intentionally left alone: it often targets inner scroll containers, and
19
+ * marking those would swallow real user page scrolls.
20
+ */
21
+ export declare function installProgrammaticScrollMarking(): void;
22
+ //# sourceMappingURL=programmatic-scroll.d.ts.map
@@ -0,0 +1 @@
1
+ const n=150;let r=!1,o=null;function c(){r=!0,o&&clearTimeout(o),o=setTimeout(()=>{r=!1,o=null},150)}function a(){return r}let l=!1;function s(){if(!l){l=!0;for(const t of["scrollTo","scroll","scrollBy"]){const e=window[t].bind(window);window[t]=((...i)=>{c(),e(...i)})}}}export{n as SCROLL_SETTLE_MS,s as installProgrammaticScrollMarking,a as isProgrammaticScrollEvent,c as markProgrammaticScroll};
@@ -1,2 +1,2 @@
1
- import{isPrimitive as n}from"../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as p}from"./get-variable.js";import{isNode as a}from"./guards/is-node.js";import{isTag as l}from"./guards/is-tag.js";import{isCodeNode as c}from"./guards/is-code-node.js";import{isConditionalNode as d}from"./guards/is-conditional-node.js";import{isExampleNode as u}from"./guards/is-example-node.js";import{isFenceNode as h}from"./guards/is-fence-node.js";import{isTextNode as N}from"./guards/is-text-node.js";import{isFunction as b}from"./guards/is-function.js";import{isVariable as g}from"./guards/is-variable.js";function t(m,r={}){const{isTrim:s=!0}=r,i=[];for(const e of m){if(n(e))i.push(String(e));else if(a(e))if(e.type==="tr"&&i.push(`
2
- `),N(e)||c(e)||h(e))i.push(t([o(e,"content")],r));else if(u(e))i.push(t(e.children.map(f=>o(f,"content")),r));else{if(d(e)&&r.skipConditionals)continue;i.push(t(e.children,r))}else l(e)&&e.name==="code"?i.push(t(e.children,r)):b(e)&&i.push(t(Object.values(e.parameters),r));g(e)&&i.push(t([p(e,r.variables)],r))}return s?i.map(e=>e.trim()).join(" ").trim():i.join(" ")}export{t as getInnerText};
1
+ import{isPrimitive as n}from"../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as p}from"./get-variable.js";import{isNode as l}from"./guards/is-node.js";import{isTag as a}from"./guards/is-tag.js";import{isCodeNode as u}from"./guards/is-code-node.js";import{isConditionalNode as c}from"./guards/is-conditional-node.js";import{isExampleNode as d}from"./guards/is-example-node.js";import{isFenceNode as h}from"./guards/is-fence-node.js";import{isTextNode as N}from"./guards/is-text-node.js";import{isFunction as b}from"./guards/is-function.js";import{isVariable as g}from"./guards/is-variable.js";function t(m,r={}){const{isTrim:s=!0}=r,e=[];for(const i of m){if(n(i))e.push(String(i));else if(l(i))if(i.type==="tr"&&e.push(`
2
+ `),N(i)||u(i)||h(i))e.push(t([o(i,"content")],r));else if(d(i))e.push(t(i.children.map(f=>o(f,"content")),r));else{if(c(i)&&r.skipConditionals)continue;e.push(t(i.children,r))}else a(i)?e.push(t(i.children,r)):b(i)&&e.push(t(Object.values(i.parameters),r));g(i)&&e.push(t([p(i,r.variables)],r))}return s?e.map(i=>i.trim()).join(" ").trim():e.join(" ")}export{t as getInnerText};
@@ -1 +1 @@
1
- import{JsonSchemaRef as e}from"../attributes/index.js";const o={schema:{attributes:{schema:{type:e},options:{type:Object,default:{}},schemaResolved:{type:Object},schemaResolvedErrors:{type:Array,default:[]}},render:"JsonSchema",selfClosing:!0,dynamicComponentLib:"openapi"},tagName:"json-schema"};export{o as jsonSchema};
1
+ import{JsonSchemaRef as e}from"../attributes/index.js";const o={schema:{attributes:{schema:{type:e},title:{type:String},options:{type:Object,default:{}},schemaResolved:{type:Object},schemaResolvedErrors:{type:Array,default:[]}},render:"JsonSchema",selfClosing:!0,dynamicComponentLib:"openapi"},tagName:"json-schema"};export{o as jsonSchema};
@@ -32,8 +32,11 @@ export declare const ASK_AI_API_URL: string;
32
32
  export declare const SEMANTIC_SEARCH_API_URL: string;
33
33
  export declare const REGISTRY_APIS_API_URL: string | undefined;
34
34
  export declare const REGISTRY_APIS_PATHS_API_URL: string | undefined;
35
- export declare const CACHE_CONTROL_NO_CACHE_HEADER_VALUE = "no-store";
35
+ export declare const CACHE_CONTROL_NO_STORE_HEADER_VALUE = "no-store";
36
36
  export declare const DEFAULT_IMMUTABLE_CACHE_MAX_AGE: number;
37
+ export declare const X_REDOCLY_CACHE_CONTROL_HEADER = "X-Redocly-Cache-Control";
38
+ export declare const CACHE_CONTROL_PUBLIC_HTML = "no-cache";
39
+ export declare const X_REDOCLY_CACHE_CONTROL_PUBLIC_HTML = "public, s-maxage=86400, max-age=10, must-revalidate";
37
40
  export declare const AUTH_URL: string | undefined;
38
41
  export declare const DEFAULT_TITLE = "Developer Documentation";
39
42
  export declare const SSR_RENDER_MODE: 'worker' | 'main';
@@ -1 +1 @@
1
- import{ServerRoutes as L,USER_THEME_ALIAS as c}from"../../constants/common.js";import{envConfig as E}from"../config/env-config.js";const N="runtime",C="/assets",x="/_spec",U="/_bundle",P="static",M="redocly:::linkOriginal",l="@",i="default",a=new RegExp("((?!@i18n\\/|@l10n\\/)\\/?@.*?(?=\\/))","g"),m="@redocly/theme/plugin.js",F="styles.css",G=["@theme/plugin.js","@theme/plugin.cjs","@theme/plugin.mjs"],u=E.JWT_SECRET_KEY||"test_secret_key",A="@i18n",p="@l10n",Y=[c,A,p],H="https://redocly.com/auth/aud",d="catalog.json",g="scorecard.json",B="page-count.json",K="sitemap.xml",h="llms.txt",R=E.PROJECT_ID,e=E.PROJECT_SLUG,n=E.ORGANIZATION_ID,s=E.ORG_SLUG,_=E.BH_API_URL,t=_&&s&&e?`${_}/orgs/${s}/projects/${e}`:void 0,o=_&&n&&R?`${_}/orgs/${n}/projects/${R}`:void 0,S=_?`${_}/entitlements/.well-known/jwks`:"https://app.cloud.redocly.com/api/entitlements/.well-known/jwks",j=E.ENTITLEMENTS_JWKS_CDN_URL||S,J=t?`${t}/feedback`:"",W=o?`${o}/ai-agentic-conversations`:"",$=o?`${o}/semantic-search`:"",f=t&&`${t}/registry/apis`,y=t&&`${t}/registry/paths`,V="no-store",k=365*24*60*60,w=E.AUTH_URL,X="Developer Documentation",T=E.REDOCLY_SSR_RENDER_MODE==="worker"?"worker":"main",v=T==="main"?0:E.REDOCLY_SSR_WORKERS_MIN!=null?Number(E.REDOCLY_SSR_WORKERS_MIN):2,b=T==="main"?1:E.REDOCLY_SSR_WORKERS_MAX!=null?Number(E.REDOCLY_SSR_WORKERS_MAX):5,Z="-----BEGIN CERTIFICATE-----",q="-----END CERTIFICATE-----",z=E.REDOCLY_TELEMETRY_ENDPOINT||"https://app.cloud.redocly.com/api/telemetry/project",Q=!E.isDevelopMode&&E.REDOCLY_TELEMETRY!=="off"||E.REDOCLY_TELEMETRY==="on",EE="http://localhost:4318/v1/traces",_E=[L.HEALTH],I=E.SERVER_EDITOR_APP_URL||"http://127.0.0.1:3000",tE=E.REDOCLY_CORS_ORIGINS?E.REDOCLY_CORS_ORIGINS.split(",").map(r=>r.trim()).filter(Boolean).concat(I):[I];export{tE as ALLOWED_CORS_ORIGINS,H as ALTERNATIVE_AUD_CLAIM_NAME,W as ASK_AI_API_URL,w as AUTH_URL,Z as BEGIN_CERTIFICATE_DELIMITER,t as BH_API_PROJECTS_URL,o as BH_API_PROJECTS_URL_V2,V as CACHE_CONTROL_NO_CACHE_HEADER_VALUE,d as CATALOG_OUTPUT_FILE_NAME,k as DEFAULT_IMMUTABLE_CACHE_MAX_AGE,G as DEFAULT_PROJECT_PLUGIN_PATHS,m as DEFAULT_THEME_PLUGIN_PATH,X as DEFAULT_TITLE,i as DEFAULT_VERSION_NAME,x as DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER,q as END_CERTIFICATE_DELIMITER,j as ENTITLEMENTS_JWKS_URL,J as FEEDBACK_API_URL,A as I18N_DIR_NAME,u as JWT_SECRET_KEY,p as L10N_DIR_NAME,M as LINK_ORIGINAL_ATTR_NAME,h as LLMS_TXT_FILE_NAME,n as ORG_ID,s as ORG_SLUG,_E as OTEL_EXCLUDED_ROUTES,EE as OTEL_TRACES_DEV_URL,B as PAGE_COUNT_OUTPUT_FILE_NAME,R as PROJECT_ID,e as PROJECT_SLUG,U as PUBLIC_API_DEFINITIONS_FOLDER,C as PUBLIC_ASSETS_FOLDER,P as PUBLIC_STATIC_FOLDER,f as REGISTRY_APIS_API_URL,y as REGISTRY_APIS_PATHS_API_URL,Y as RESERVED_DIR_NAMES,N as RUNTIME_RESOURCES_DIR,g as SCORECARD_OUTPUT_FILE_NAME,$ as SEMANTIC_SEARCH_API_URL,I as SERVER_EDITOR_APP_URL,K as SITEMAP_FILE_NAME,T as SSR_RENDER_MODE,b as SSR_WORKERS_MAX,v as SSR_WORKERS_MIN,F as STYLES_FILE,Q as TELEMETRY_ENABLED,z as TELEMETRY_ENDPOINT,a as VERSIONED_FOLDER_REGEXP_MATCH,l as VERSION_SEPARATOR};
1
+ import{ServerRoutes as L,USER_THEME_ALIAS as c}from"../../constants/common.js";import{envConfig as _}from"../config/env-config.js";const D="runtime",N="/assets",x="/_spec",U="/_bundle",P="static",l="redocly:::linkOriginal",M="@",a="default",i=new RegExp("((?!@i18n\\/|@l10n\\/)\\/?@.*?(?=\\/))","g"),m="@redocly/theme/plugin.js",H="styles.css",F=["@theme/plugin.js","@theme/plugin.cjs","@theme/plugin.mjs"],u=_.JWT_SECRET_KEY||"test_secret_key",A="@i18n",p="@l10n",G=[c,A,p],Y="https://redocly.com/auth/aud",d="catalog.json",g="scorecard.json",B="page-count.json",h="sitemap.xml",K="llms.txt",R=_.PROJECT_ID,e=_.PROJECT_SLUG,n=_.ORGANIZATION_ID,s=_.ORG_SLUG,E=_.BH_API_URL,t=E&&s&&e?`${E}/orgs/${s}/projects/${e}`:void 0,o=E&&n&&R?`${E}/orgs/${n}/projects/${R}`:void 0,S=E?`${E}/entitlements/.well-known/jwks`:"https://app.cloud.redocly.com/api/entitlements/.well-known/jwks",j=_.ENTITLEMENTS_JWKS_CDN_URL||S,J=t?`${t}/feedback`:"",W=o?`${o}/ai-agentic-conversations`:"",$=o?`${o}/semantic-search`:"",y=t&&`${t}/registry/apis`,f=t&&`${t}/registry/paths`,V="no-store",X=365*24*60*60,k="X-Redocly-Cache-Control",w="no-cache",v="public, s-maxage=86400, max-age=10, must-revalidate",b=_.AUTH_URL,Z="Developer Documentation",T=_.REDOCLY_SSR_RENDER_MODE==="worker"?"worker":"main",q=T==="main"?0:_.REDOCLY_SSR_WORKERS_MIN!=null?Number(_.REDOCLY_SSR_WORKERS_MIN):2,z=T==="main"?1:_.REDOCLY_SSR_WORKERS_MAX!=null?Number(_.REDOCLY_SSR_WORKERS_MAX):5,Q="-----BEGIN CERTIFICATE-----",__="-----END CERTIFICATE-----",E_=_.REDOCLY_TELEMETRY_ENDPOINT||"https://app.cloud.redocly.com/api/telemetry/project",t_=!_.isDevelopMode&&_.REDOCLY_TELEMETRY!=="off"||_.REDOCLY_TELEMETRY==="on",o_="http://localhost:4318/v1/traces",R_=[L.HEALTH],r=_.SERVER_EDITOR_APP_URL||"http://127.0.0.1:3000",e_=_.REDOCLY_CORS_ORIGINS?_.REDOCLY_CORS_ORIGINS.split(",").map(I=>I.trim()).filter(Boolean).concat(r):[r];export{e_ as ALLOWED_CORS_ORIGINS,Y as ALTERNATIVE_AUD_CLAIM_NAME,W as ASK_AI_API_URL,b as AUTH_URL,Q as BEGIN_CERTIFICATE_DELIMITER,t as BH_API_PROJECTS_URL,o as BH_API_PROJECTS_URL_V2,V as CACHE_CONTROL_NO_STORE_HEADER_VALUE,w as CACHE_CONTROL_PUBLIC_HTML,d as CATALOG_OUTPUT_FILE_NAME,X as DEFAULT_IMMUTABLE_CACHE_MAX_AGE,F as DEFAULT_PROJECT_PLUGIN_PATHS,m as DEFAULT_THEME_PLUGIN_PATH,Z as DEFAULT_TITLE,a as DEFAULT_VERSION_NAME,x as DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER,__ as END_CERTIFICATE_DELIMITER,j as ENTITLEMENTS_JWKS_URL,J as FEEDBACK_API_URL,A as I18N_DIR_NAME,u as JWT_SECRET_KEY,p as L10N_DIR_NAME,l as LINK_ORIGINAL_ATTR_NAME,K as LLMS_TXT_FILE_NAME,n as ORG_ID,s as ORG_SLUG,R_ as OTEL_EXCLUDED_ROUTES,o_ as OTEL_TRACES_DEV_URL,B as PAGE_COUNT_OUTPUT_FILE_NAME,R as PROJECT_ID,e as PROJECT_SLUG,U as PUBLIC_API_DEFINITIONS_FOLDER,N as PUBLIC_ASSETS_FOLDER,P as PUBLIC_STATIC_FOLDER,y as REGISTRY_APIS_API_URL,f as REGISTRY_APIS_PATHS_API_URL,G as RESERVED_DIR_NAMES,D as RUNTIME_RESOURCES_DIR,g as SCORECARD_OUTPUT_FILE_NAME,$ as SEMANTIC_SEARCH_API_URL,r as SERVER_EDITOR_APP_URL,h as SITEMAP_FILE_NAME,T as SSR_RENDER_MODE,z as SSR_WORKERS_MAX,q as SSR_WORKERS_MIN,H as STYLES_FILE,t_ as TELEMETRY_ENABLED,E_ as TELEMETRY_ENDPOINT,i as VERSIONED_FOLDER_REGEXP_MATCH,M as VERSION_SEPARATOR,k as X_REDOCLY_CACHE_CONTROL_HEADER,v as X_REDOCLY_CACHE_CONTROL_PUBLIC_HTML};
@@ -1 +1 @@
1
- import{and as w,eq as i,isNotNull as h,lt as A,sql as E}from"drizzle-orm";import{logger as d}from"../../../tools/notifiers/logger.js";import{cacheTable as a}from"../../../providers/database/databases/sqlite-db/schemas/cache-table.js";const c="catalog-publisher-locks",T="catalog-entities::publisher",f=`${T}::remote-publish-lock`,m=1800*1e3,p=Math.floor(m/1e3),y=60*1e3,I=300*1e3,O=1e3;class n{static async getInternalCacheValue({remoteConnection:t,key:e}){return(await t.client.client.select({value:a.value}).from(a).where(w(i(a.key,e),i(a.namespace,c))).get())?.value??null}static async upsertInternalCacheValue({remoteConnection:t,key:e,value:r,ttl:s=null}){const o=new Date().toISOString();await t.client.client.insert(a).values({key:e,namespace:c,value:r,ttl:s,createdAt:o,updatedAt:o}).onConflictDoUpdate({target:[a.key],set:{namespace:c,value:r,ttl:s,updatedAt:o}}).run()}static async runUnderRemotePublishLock({runId:t,remoteConnection:e,run:r}){const s=JSON.stringify({ownerRunId:t});await n.#a({runId:t,lockValue:s,remoteConnection:e});const o=n.#r({runId:t,lockValue:s,remoteConnection:e}),u=await n.#n(r);clearInterval(o);const l=await n.#s({lockValue:s,remoteConnection:e});if(!u.ok)throw l&&d.warn(`Failed to release remote publish lock after publish error for runId=${t}: ${n.#t(l)}`),n.#e(u.error,`Remote publish failed for runId=${t}: ${n.#t(u.error)}`);if(l)throw n.#e(l,`Failed to release remote publish lock for runId=${t}: ${n.#t(l)}`);return u.result}static async#a({runId:t,lockValue:e,remoteConnection:r}){if(!await n.#i({lockValue:e,remoteConnection:r,timeoutMs:I}))throw new Error(`Timed out waiting for remote publish lock. runId=${t}`)}static#r({runId:t,lockValue:e,remoteConnection:r}){return setInterval(()=>{n.#l({remoteConnection:r,lockValue:e}).catch(s=>{d.warn(`Failed to refresh remote publish lock for runId=${t}: ${n.#t(s)}`)})},y)}static async#n(t){try{return{ok:!0,result:await t()}}catch(e){return{ok:!1,error:e}}}static async#s({lockValue:t,remoteConnection:e}){try{return await n.#c({remoteConnection:e,lockValue:t}),null}catch(r){return r}}static async#i({lockValue:t,remoteConnection:e,timeoutMs:r}){const s=Date.now();for(;Date.now()-s<r;){if(await n.#o({remoteConnection:e,lockValue:t}))return!0;await n.#w(O)}return d.warn("Lock wait timeout. Wait for the other build to finish publishing entities."),!1}static async#o({remoteConnection:t,lockValue:e}){const r=t.client.client,s=new Date().toISOString();await r.delete(a).where(w(i(a.key,f),i(a.namespace,c),h(a.ttl),A(E`datetime(${a.createdAt}, '+' || ${a.ttl} || ' seconds')`,E`datetime('now')`))).run();try{return await r.insert(a).values({key:f,namespace:c,value:e,ttl:p,createdAt:s,updatedAt:s}).run(),!0}catch(o){if(n.#u(o))return!1;throw o}}static async#c({remoteConnection:t,lockValue:e}){await t.client.client.delete(a).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run()}static async#l({remoteConnection:t,lockValue:e}){const r=new Date().toISOString();await t.client.client.update(a).set({ttl:p,createdAt:r,updatedAt:r}).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run()}static#u(t){return t instanceof Error?t.message.toLowerCase().includes("unique constraint failed"):!1}static#w(t){return new Promise(e=>setTimeout(e,t))}static#e(t,e){return t instanceof Error?t:new Error(e)}static#t(t){return t instanceof Error?t.message:typeof t=="string"?t:JSON.stringify(t)}}export{c as INTERNAL_CATALOG_PUBLISH_CACHE_NAMESPACE,T as INTERNAL_CATALOG_PUBLISH_KEY_PREFIX,n as RemotePublishLockService};
1
+ import{and as w,eq as i,isNotNull as A,lt as m,sql as T}from"drizzle-orm";import{logger as p}from"../../../tools/notifiers/logger.js";import{cacheTable as a}from"../../../providers/database/databases/sqlite-db/schemas/cache-table.js";import{BATCH_TRANSIENT_RETRY as d,describeTransientError as y,withTransientErrorRetry as E}from"../../../providers/database/transient-sqld-error.js";const c="catalog-publisher-locks",I="catalog-entities::publisher",f=`${I}::remote-publish-lock`,O=1800*1e3,h=Math.floor(O/1e3),_=60*1e3,g=300*1e3,C=1e3;class s{static async getInternalCacheValue({remoteConnection:t,key:e}){return(await t.client.client.select({value:a.value}).from(a).where(w(i(a.key,e),i(a.namespace,c))).get())?.value??null}static async upsertInternalCacheValue({remoteConnection:t,key:e,value:r,ttl:n=null}){const o=new Date().toISOString();await t.client.client.insert(a).values({key:e,namespace:c,value:r,ttl:n,createdAt:o,updatedAt:o}).onConflictDoUpdate({target:[a.key],set:{namespace:c,value:r,ttl:n,updatedAt:o}}).run()}static async runUnderRemotePublishLock({runId:t,remoteConnection:e,run:r}){const n=JSON.stringify({ownerRunId:t});await s.#r({runId:t,lockValue:n,remoteConnection:e});const o=s.#a({runId:t,lockValue:n,remoteConnection:e}),u=await s.#n(r);clearInterval(o);const l=await s.#s({lockValue:n,remoteConnection:e});if(!u.ok)throw l&&p.warn(`Failed to release remote publish lock after publish error for runId=${t}: ${s.#t(l)}`),s.#e(u.error,`Remote publish failed for runId=${t}: ${s.#t(u.error)}`);if(l)throw s.#e(l,`Failed to release remote publish lock for runId=${t}: ${s.#t(l)}`);return u.result}static async#r({runId:t,lockValue:e,remoteConnection:r}){if(!await s.#i({lockValue:e,remoteConnection:r,timeoutMs:g}))throw new Error(`Timed out waiting for remote publish lock. runId=${t}`)}static#a({runId:t,lockValue:e,remoteConnection:r}){return setInterval(()=>{s.#l({remoteConnection:r,lockValue:e}).catch(n=>{p.warn(`Failed to refresh remote publish lock for runId=${t}: ${s.#t(n)}`)})},_)}static async#n(t){try{return{ok:!0,result:await t()}}catch(e){return{ok:!1,error:e}}}static async#s({lockValue:t,remoteConnection:e}){try{return await s.#c({remoteConnection:e,lockValue:t}),null}catch(r){return r}}static async#i({lockValue:t,remoteConnection:e,timeoutMs:r}){const n=Date.now();for(;Date.now()-n<r;){if(await s.#o({remoteConnection:e,lockValue:t}))return!0;await s.#w(C)}return p.warn("Lock wait timeout. Wait for the other build to finish publishing entities."),!1}static async#o({remoteConnection:t,lockValue:e}){const r=t.client.client,n=new Date().toISOString();await E(()=>r.delete(a).where(w(i(a.key,f),i(a.namespace,c),A(a.ttl),m(T`datetime(${a.createdAt}, '+' || ${a.ttl} || ' seconds')`,T`datetime('now')`))).run(),d);try{return await E(()=>r.insert(a).values({key:f,namespace:c,value:e,ttl:h,createdAt:n,updatedAt:n}).run(),d),!0}catch(o){if(s.#u(o))return!1;throw o}}static async#c({remoteConnection:t,lockValue:e}){await E(()=>t.client.client.delete(a).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run(),d)}static async#l({remoteConnection:t,lockValue:e}){const r=new Date().toISOString();await E(()=>t.client.client.update(a).set({ttl:h,createdAt:r,updatedAt:r}).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run(),d)}static#u(t){const e=new Set;for(let r=t;r instanceof Error&&!e.has(r);r=r.cause){e.add(r);const n=r.message.toLowerCase();if(n.includes("unique constraint failed")||n.includes("sqlite_constraint_unique"))return!0}return!1}static#w(t){return new Promise(e=>setTimeout(e,t))}static#e(t,e){return t instanceof Error?t:new Error(e)}static#t(t){return t instanceof Error?y(t):typeof t=="string"?t:JSON.stringify(t)}}export{c as INTERNAL_CATALOG_PUBLISH_CACHE_NAMESPACE,I as INTERNAL_CATALOG_PUBLISH_KEY_PREFIX,s as RemotePublishLockService};
@@ -9,4 +9,9 @@ export type GraphqlLoadResult = {
9
9
  settings: GraphQLConfig;
10
10
  } | undefined;
11
11
  export declare const graphqlDocLoader: LoaderFn;
12
+ export type BundledDefinition = {
13
+ relativePath: string;
14
+ settings: GraphQLConfig;
15
+ };
16
+ export declare const graphqlDocsLoader: LoaderFn<BundledDefinition[]>;
12
17
  //# sourceMappingURL=graphql-doc-loader.d.ts.map
@@ -1 +1 @@
1
- import{buildSchema as d}from"graphql";import{MenuStore as f,AppStore as g}from"@redocly/graphql-docs";import w from"node:path";import{combineUrls as u}from"@redocly/theme/core/utils";import{GRAPHQL_SPEC_SLUG as S}from"../../../constants/common.js";import{deepMerge as b}from"../../../utils/object/deep-merge.js";import{reporter as h}from"../../tools/notifiers/reporter.js";import{getApiConfigByPath as q}from"../get-api-config.js";import{replaceFileExtension as x}from"../openapi-docs/store-definition-bundles.js";const G=async(o,{getConfig:p,fs:c})=>{const t=await p(),e=t?.graphql??{},n=await c.read(o),{graphql:s={},metadata:l}=q(t.apis,o),a=b(e||{},s,{feedback:e.feedback||t.feedback,downloadUrls:e.downloadUrls||[{url:u(S,`${x(o,w.posix.extname(o))}?download`)}]});let i,m;try{const r=d(n);m=new g(r),i=new f(r,a)}catch(r){await h.panicOnBuild(r);return}return{menu:i,store:m,settings:a,metadata:l,content:n}};export{G as graphqlDocLoader};
1
+ import{buildSchema as d}from"graphql";import{MenuStore as f,AppStore as g}from"@redocly/graphql-docs";import h from"node:path";import{combineUrls as u}from"@redocly/theme/core/utils";import{GRAPHQL_SPEC_SLUG as w}from"../../../constants/common.js";import{deepMerge as q}from"../../../utils/object/deep-merge.js";import{reporter as S}from"../../tools/notifiers/reporter.js";import{getApiConfigByPath as b}from"../get-api-config.js";import{replaceFileExtension as x}from"../openapi-docs/store-definition-bundles.js";const E=async(r,{getConfig:i,fs:c})=>{const e=await i(),o=e?.graphql??{},t=await c.read(r),{graphql:n={},metadata:m}=b(e.apis,r),s=q(o||{},n,{feedback:o.feedback||e.feedback,downloadUrls:o.downloadUrls||[{url:u(w,`${x(r,h.posix.extname(r))}?download`)}]});let p,l;try{const a=d(t);l=new g(a),p=new f(a,s)}catch(a){await S.panicOnBuild(a);return}return{menu:p,store:l,settings:s,metadata:m,content:t}},F=async(r,{fs:i,cache:c,isPathIgnored:e})=>{const o=[];for(const{relativePath:t}of i.scan(/(\.gql|\.graphql)$/)){if(await e(t))continue;const n=await c.load(t,"graphql-doc").catch(()=>null);n?.data&&o.push({relativePath:t,settings:n.data.settings})}return o};export{E as graphqlDocLoader,F as graphqlDocsLoader};
@@ -1 +1 @@
1
- import{writeFileSync as v}from"node:fs";import C from"node:path";import{REDOCLY_TEAMS_RBAC as $}from"@redocly/config";import{combineUrls as I}from"@redocly/theme/core/utils";import{PUBLIC_API_DEFINITIONS_FOLDER as w}from"../../constants/common.js";import{GRAPHQL_TEMPLATE_ID as O,GRAPHQL_SPEC_SLUG as Q,PUBLIC_RBAC_SCOPE_ITEM as H}from"../../../constants/common.js";import{removeTrailingSlash as _}from"../../../utils/url/remove-trailing-slash.js";import{getTemplatePath as N}from"./get-template-path.js";import{searchResolver as F}from"./search/search-resolver.js";import{graphqlDocLoader as M}from"./graphql-doc-loader.js";import{getAiDocumentsStore as A}from"./search/ai/get-ai-search-document.js";import{fromCurrentDir as U}from"../../utils/paths.js";import{ensureDir as k}from"../../utils/fs.js";import{telemetryTraceStep as x}from"../../../cli/telemetry/helpers/trace-step.js";const B="graphql-docs-",R="graphql-spec-download";async function nt(){return{id:"graphql",requiredEntitlements:["graphql"],loaders:{"graphql-doc":M},processContent:async(t,{fs:n,cache:l,isPathIgnored:i,withPathPrefix:p})=>{await x("build.plugin.graphql_docs",async()=>{t.createRequestHandler(R,U(import.meta.url,"./spec-download.api.js")),t.addApiRoute({slug:Q+"/*",requestHandlerId:R,httpMethod:"all",[$]:H,getStaticData:async()=>({props:{}})});const m=t.createTemplate(O,N("./template/GraphQLDocs.js"));for(const{relativePath:o}of n.scan(/(\.gql|\.graphql)$/)){if(await i(o))continue;const h=await l.load(o,"graphql-doc");if(!h.data)continue;j(h.data.content,t.outdir,o);const{menu:q,content:G,settings:u,metadata:T,store:c}=h.data,L=`${B}${o}`;await t.createSharedData(L,G);const d=[{key:"graphQlSettings",id:L}],b=q.getGroups(),y=q.getSidebarItems(),g={type:"graphql",title:b[0].name,...T},s=[{slugSuffix:"",fsPath:o,templateId:m,getStaticData:S(void 0,u,p),sharedData:d,getAiDocumentsStore:A({label:u.info?.title??"GraphQL Overview",groupName:"overview",metadata:g,actions:t,store:c,includeInLLMsTxt:!0})}];for(const r of b){const f=`${r.id}`;s.push({slugSuffix:f,fsPath:o,templateId:m,getStaticData:S(r,u,p),sharedData:d});for(const e of r.typeGroups){const a=`${e.id}`;s.push({slugSuffix:a,fsPath:o,templateId:m,getStaticData:S(e,u,p),sharedData:d,getAiDocumentsStore:A({label:e.name,groupName:e.name,metadata:g,actions:t,store:c,isTypeGroup:!0,items:new Set(e.items)})});for(const E of e.items){const P=`${e.id}/${E}`;s.push({slugSuffix:P,fsPath:o,templateId:m,getStaticData:S(e,u,p),sharedData:d,getAiDocumentsStore:A({label:E,groupName:e.name,metadata:g,actions:t,store:c})})}}}if(!s.length)return;const D=s[s.length-1];D.metadata=g,D.getSidebar=r=>{function f(e){return e.map(a=>({...a,slug:a.slug&&_(I(r.baseSlug,a.slug)),routeSlug:a.routeSlug&&_(I(r.baseSlug,a.routeSlug)),link:a.link&&_(I(r.baseSlug,a.link)),items:a.items&&f(a.items)}))}return f(y)},D.getSearchDocuments=F(t,c);for(const r of s)t.addRoute(r)}})}}}function S(t,n,l){return async function(i){return{props:{seo:{title:t?.name??n.info?.title??"GraphQL Overview"},settings:{...n,location:{section:t?.id},sidebar:{hide:!0},baseUrlPath:l(i.baseSlug)},disableAutoScroll:!0}}}}function j(t,n,l){const i=w.slice(1);v(k(C.resolve(n,`${i}/${l}`)),t,"utf8")}export{nt as graphqlDocsPlugin,j as storeGqlSchema};
1
+ import{writeFileSync as v}from"node:fs";import C from"node:path";import{REDOCLY_TEAMS_RBAC as $}from"@redocly/config";import{combineUrls as q}from"@redocly/theme/core/utils";import{PUBLIC_API_DEFINITIONS_FOLDER as w}from"../../constants/common.js";import{GRAPHQL_TEMPLATE_ID as O,GRAPHQL_SPEC_SLUG as Q,PUBLIC_RBAC_SCOPE_ITEM as H}from"../../../constants/common.js";import{removeTrailingSlash as I}from"../../../utils/url/remove-trailing-slash.js";import{getTemplatePath as N}from"./get-template-path.js";import{searchResolver as F}from"./search/search-resolver.js";import{graphqlDocLoader as M,graphqlDocsLoader as U}from"./graphql-doc-loader.js";import{getAiDocumentsStore as _}from"./search/ai/get-ai-search-document.js";import{fromCurrentDir as k}from"../../utils/paths.js";import{ensureDir as x}from"../../utils/fs.js";import{telemetryTraceStep as B}from"../../../cli/telemetry/helpers/trace-step.js";const j="graphql-docs-",R="graphql-spec-download";async function nt(){return{id:"graphql",requiredEntitlements:["graphql"],loaders:{"graphql-doc":M,"load-graphql-docs":U},processContent:async(t,{fs:l,cache:n,isPathIgnored:i,withPathPrefix:p})=>{await B("build.plugin.graphql_docs",async()=>{t.createRequestHandler(R,k(import.meta.url,"./spec-download.api.js")),t.addApiRoute({slug:Q+"/*",requestHandlerId:R,httpMethod:"all",[$]:H,getStaticData:async()=>({props:{}})});const m=t.createTemplate(O,N("./template/GraphQLDocs.js"));for(const{relativePath:o}of l.scan(/(\.gql|\.graphql)$/)){if(await i(o))continue;const h=await n.load(o,"graphql-doc");if(!h.data)continue;K(h.data.content,t.outdir,o);const{menu:A,content:G,settings:u,metadata:T,store:d}=h.data,L=`${j}${o}`;await t.createSharedData(L,G);const c=[{key:"graphQlSettings",id:L}],b=A.getGroups(),y=A.getSidebarItems(),g={type:"graphql",title:b[0].name,...T},s=[{slugSuffix:"",fsPath:o,templateId:m,getStaticData:S(void 0,u,p),sharedData:c,getAiDocumentsStore:_({label:u.info?.title??"GraphQL Overview",groupName:"overview",metadata:g,actions:t,store:d,includeInLLMsTxt:!0})}];for(const r of b){const f=`${r.id}`;s.push({slugSuffix:f,fsPath:o,templateId:m,getStaticData:S(r,u,p),sharedData:c});for(const e of r.typeGroups){const a=`${e.id}`;s.push({slugSuffix:a,fsPath:o,templateId:m,getStaticData:S(e,u,p),sharedData:c,getAiDocumentsStore:_({label:e.name,groupName:e.name,metadata:g,actions:t,store:d,isTypeGroup:!0,items:new Set(e.items)})});for(const E of e.items){const P=`${e.id}/${E}`;s.push({slugSuffix:P,fsPath:o,templateId:m,getStaticData:S(e,u,p),sharedData:c,getAiDocumentsStore:_({label:E,groupName:e.name,metadata:g,actions:t,store:d})})}}}if(!s.length)return;const D=s[s.length-1];D.metadata=g,D.getSidebar=r=>{function f(e){return e.map(a=>({...a,slug:a.slug&&I(q(r.baseSlug,a.slug)),routeSlug:a.routeSlug&&I(q(r.baseSlug,a.routeSlug)),link:a.link&&I(q(r.baseSlug,a.link)),items:a.items&&f(a.items)}))}return f(y)},D.getSearchDocuments=F(t,d);for(const r of s)t.addRoute(r)}})}}}function S(t,l,n){return async function(i){return{props:{seo:{title:t?.name??l.info?.title??"GraphQL Overview"},settings:{...l,location:{section:t?.id},sidebar:{hide:!0},baseUrlPath:n(i.baseSlug)},disableAutoScroll:!0}}}}function K(t,l,n){const i=w.slice(1);v(x(C.resolve(l,`${i}/${n}`)),t,"utf8")}export{nt as graphqlDocsPlugin,K as storeGqlSchema};
@@ -1,29 +1,29 @@
1
- import{isPrimitive as v}from"../../../../utils/guards/is-primitive.js";import{getNodeAttribute as c}from"../../../../markdoc/helpers/get-node-attribute.js";import{getVariable as T}from"../../../../markdoc/helpers/get-variable.js";import{isTag as C}from"../../../../markdoc/helpers/guards/is-tag.js";import{isNode as N}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as y}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isVariable as A}from"../../../../markdoc/helpers/guards/is-variable.js";import{isExampleNode as B}from"../../../../markdoc/helpers/guards/is-example-node.js";import{isFenceNode as E}from"../../../../markdoc/helpers/guards/is-fence-node.js";function a(s,n={}){const r=[];for(const e of s){if(v(e)){const i=n.isTrim?u(String(e)):String(e);i&&r.push(i)}else if(N(e))switch(e.type){case"text":r.push(a([c(e,"content")],n));break;case"code":r.push(`\`${a([c(e,"content")],n)}\``);break;case"blockquote":r.push(`> ${a(e.children,n)}
2
- `);break;case"fence":const i=c(e,"process")===!1;r.push(f(e,n,i));break;case"list":const l=c(e,"ordered")||!1,o=c(e,"marker"),d=e.children.map((t,h)=>`${" ".repeat((n?.indent??0)*2)}${l?h+1:""}${o} ${a([t],{...n??{},indent:(n?.indent??0)+1})}`);r.push(`${d.join("")}
1
+ import{isPrimitive as S}from"../../../../utils/guards/is-primitive.js";import{getNodeAttribute as c}from"../../../../markdoc/helpers/get-node-attribute.js";import{getVariable as v}from"../../../../markdoc/helpers/get-variable.js";import{isTag as A}from"../../../../markdoc/helpers/guards/is-tag.js";import{isNode as C}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as N}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isVariable as y}from"../../../../markdoc/helpers/guards/is-variable.js";import{isExampleNode as B}from"../../../../markdoc/helpers/guards/is-example-node.js";import{isFenceNode as E}from"../../../../markdoc/helpers/guards/is-fence-node.js";function a(s,n={}){const r=[];for(const e of s){if(S(e)){const i=n.isTrim?m(String(e)):String(e);i&&r.push(i)}else if(C(e))switch(e.type){case"text":r.push(a([c(e,"content")],n));break;case"code":r.push(`\`${a([c(e,"content")],n)}\``);break;case"blockquote":r.push(`> ${a(e.children,n)}
2
+ `);break;case"fence":const i=c(e,"process")===!1;r.push(g(e,n,i));break;case"list":const h=c(e,"ordered")||!1,l=c(e,"marker"),d=e.children.map((t,o)=>`${" ".repeat((n?.indent??0)*2)}${h?o+1:""}${l} ${a([t],{...n??{},indent:(n?.indent??0)+1})}`);r.push(`${d.join("")}
3
3
  `);break;case"item":r.push(e.children.map(t=>`${a([t],n).trimEnd()}
4
- `).join(""));break;case"thead":const p=e.children.map(t=>a([t],n));r.push(`${p}| ${" --- |".repeat(e.children?.[0]?.children.length)}
5
- `);break;case"tr":const $=e.children.map(t=>a([t],n));r.push(`| ${$.join(" | ")} |
4
+ `).join(""));break;case"thead":const u=e.children.map(t=>a([t],n));r.push(`${u}| ${" --- |".repeat(e.children?.[0]?.children.length)}
5
+ `);break;case"tr":const f=e.children.map(t=>a([t],n));r.push(`| ${f.join(" | ")} |
6
6
  `);break;case"em":r.push(`*${a(e.children,n)}*`);break;case"strong":r.push(`**${a(e.children,n)}**`);break;case"softbreak":case"hardbreak":r.push(`
7
7
  `);break;case"hr":r.push(`
8
8
 
9
9
  ---
10
10
 
11
- `);break;case"heading":const g=c(e,"level")??0;r.push(`${"#".repeat(g)} ${a(e.children,n)}
12
- `);break;case"image":const k=c(e,"alt")||"",b=c(e,"src")||"";r.push(`![${k}](${b})`);break;case"link":const j=c(e,"href")||"";r.push(`[${a(e.children,n)}](${j})`);break;case"paragraph":case"table":r.push(`${a(e.children,n)}
13
- `);break;case"tag":if(y(e)&&n.skipConditionals)continue;if(B(e)){r.push(...e.children.map(t=>{if(E(t)){const h=c(t,"process")!==!0;return f(t,n,h)}return a([t],n)}));continue}if(e.tag==="code-snippet"){const t=c(e,"rawContent");if(t){const h=c(e,"language"),m=c(e,"title"),S=`
14
- \`\`\`${`${h||""}${m?`${h?" ":""}${m}`:""}`}
11
+ `);break;case"heading":const p=c(e,"level")??0;r.push(`${"#".repeat(p)} ${a(e.children,n)}
12
+ `);break;case"image":const k=c(e,"alt")||"",b=c(e,"src")||"";r.push(`![${k}](${b})`);break;case"link":const T=c(e,"href")||"";r.push(`[${a(e.children,n)}](${T})`);break;case"paragraph":case"table":r.push(`${a(e.children,n)}
13
+ `);break;case"tag":if(N(e)&&n.skipConditionals)continue;if(B(e)){r.push(...e.children.map(t=>{if(E(t)){const o=c(t,"process")!==!0;return g(t,n,o)}return a([t],n)}));continue}if(e.tag==="code-snippet"){const t=c(e,"rawContent");if(t){const o=c(e,"language"),$=c(e,"title"),j=`
14
+ \`\`\`${`${o||""}${$?`${o?" ":""}${$}`:""}`}
15
15
  ${t.trimEnd()}
16
16
  \`\`\`
17
- `;r.push(S)}continue}if(e.tag==="json-example"){const t=w(e);t&&r.push(t);continue}if(e.tag==="json-schema"){const t=x(e);t&&r.push(t);continue}if(n.renderTag){const t=n.renderTag(e,{getBody:()=>a(e.children,n)});if(t!==void 0){r.push(t);continue}}r.push(`${a(e.children,n)}`);break;default:r.push(a(e.children,n));break}else C(e)&&r.push(a(e.children,n));A(e)&&r.push(a([T(e,n.variables)],n))}return n.isTrim?u(r.map(e=>u(e)).join("")):r.join("")}function u(s){return s.replace(/^[ \t\r\f]+|[ \t\r\f]+$/g,"")}function f(s,n={},r=!1){const e=c(s,"title"),i=c(s,"language"),l=`${i||""}${e?`${i?" ":""}${e}`:""}`,o=r?(c(s,"content")||"").trimEnd():a(s.children,n).trimEnd();return`
18
- \`\`\`${l}
19
- ${o}
17
+ `;r.push(j)}continue}if(e.tag==="json-example"){const t=w(e);t&&r.push(t);continue}if(e.tag==="json-schema"){const t=x(e);t&&r.push(t);continue}if(n.renderTag){const t=n.renderTag(e,{getBody:()=>a(e.children,n)});if(t!==void 0){r.push(t);continue}}r.push(`${a(e.children,n)}`);break;default:r.push(a(e.children,n));break}else A(e)&&r.push(a(e.children,n));y(e)&&r.push(a([v(e,n.variables)],n))}return n.isTrim?m(r.map(e=>m(e)).join("")):r.join("")}function m(s){return s.replace(/^[ \t\r\f]+|[ \t\r\f]+$/g,"")}function g(s,n={},r=!1){const e=c(s,"title"),i=c(s,"language"),h=`${i||""}${e?`${i?" ":""}${e}`:""}`,l=r?(c(s,"content")||"").trimEnd():a(s.children,n).trimEnd();return`
18
+ \`\`\`${h}
19
+ ${l}
20
20
  \`\`\`
21
21
  `}function w(s){const n=c(s,"json")??c(s,"valueResolved")??c(s,"schemaResolved"),r=c(s,"title");return n===null?null:`
22
22
  \`\`\`${`json${r?` ${r}`:""}`}
23
23
  ${JSON.stringify(n,null,2)}
24
24
  \`\`\`
25
- `}function x(s){const n=c(s,"schemaResolved");if(n===null)return null;const{components:r,openapi:e,...i}=n,{__root:l,...o}=r?.schemas||{},d=l?{...l,...Object.keys(o).length>0?{components:{schemas:o}}:{},...i}:n;return`
26
- \`\`\`json
27
- ${JSON.stringify(d,null,2)}
25
+ `}function x(s){const n=c(s,"schemaResolved");if(n===null)return null;const r=c(s,"title"),{components:e,openapi:i,...h}=n,{__root:l,...d}=e?.schemas||{},u=l?{...l,...Object.keys(d).length>0?{components:{schemas:d}}:{},...h}:n;return`
26
+ \`\`\`${`json${r?` ${r}`:""}`}
27
+ ${JSON.stringify(u,null,2)}
28
28
  \`\`\`
29
29
  `}export{a as toMarkdown};
@@ -3,5 +3,6 @@ export declare function getDefaultToolSchemas(config: {
3
3
  products?: string[];
4
4
  requiresLogin: boolean;
5
5
  rbac?: Record<string, unknown>;
6
+ hasGraphqlApis?: boolean;
6
7
  }): McpToolSchema[];
7
8
  //# sourceMappingURL=tool-schemas.d.ts.map
@@ -1 +1 @@
1
- import{shouldHandleMcpAuth as n}from"../auth/auth-handlers.js";const i=["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE"];function o(e){const t=[{name:"list-apis",description:"Lists available APIs with their context and purpose",schema:{type:"object",additionalProperties:!1,required:[],properties:{filter:{type:"string",description:"API name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of APIs per page. Default is 300",minimum:1,default:300,nullable:!0}}}},{name:"get-endpoints",description:"Get all endpoints for a specific API",schema:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},{name:"get-endpoint-info",description:"Get comprehensive information about specific endpoint including parameters, security, and examples",schema:{type:"object",required:["name","path","method"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},path:{type:"string",description:"Endpoint path (e.g. /api/v1/users)",minLength:1},method:{type:"string",description:"HTTP method (GET, POST, PUT, DELETE, etc.)",enum:[...i,...i.map(r=>r.toLowerCase())],minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},{name:"get-security-schemes",description:"Get the security schemes for a specific API",schema:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},{name:"get-full-api-description",description:"Get the complete OpenAPI description",schema:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},s(e.products)];return n(e.requiresLogin,e.rbac)&&t.push({name:"whoami",description:"Get information about the currently authenticated user",schema:{type:"object",required:[],additionalProperties:!1,properties:{}}}),t}function s(e){const t=e&&e.length>0;return{name:"search",description:"Search across the documentation to fetch relevant content for a given query",schema:{type:"object",required:["query"],additionalProperties:!1,properties:{query:{type:"string",description:"Search query. Should be a single word or that phrase that is presented in a documentation.",minLength:1},...t?{product:{type:"string",description:"Optional product name to filter search results by specific product.",enum:e,nullable:!0}}:{}}}}}export{o as getDefaultToolSchemas};
1
+ import{shouldHandleMcpAuth as n}from"../auth/auth-handlers.js";import{GRAPHQL_TYPE_KINDS as a}from"./tools/graphql/types.js";const i=["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE"];function c(e){const t=[{name:"list-apis",description:"Lists available APIs with their context and purpose",schema:{type:"object",additionalProperties:!1,required:[],properties:{filter:{type:"string",description:"API name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of APIs per page. Default is 300",minimum:1,default:300,nullable:!0}}}},{name:"get-endpoints",description:"Get all endpoints for a specific API",schema:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},{name:"get-endpoint-info",description:"Get comprehensive information about specific endpoint including parameters, security, and examples",schema:{type:"object",required:["name","path","method"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},path:{type:"string",description:"Endpoint path (e.g. /api/v1/users)",minLength:1},method:{type:"string",description:"HTTP method (GET, POST, PUT, DELETE, etc.)",enum:[...i,...i.map(r=>r.toLowerCase())],minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},{name:"get-security-schemes",description:"Get the security schemes for a specific API",schema:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},{name:"get-full-api-description",description:"Get the complete OpenAPI description",schema:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name",minLength:1},version:{type:"string",description:"API version (required when multiple APIs share the same name but differ by version)",nullable:!0}}}},o(e.products)];return n(e.requiresLogin,e.rbac)&&t.push({name:"whoami",description:"Get information about the currently authenticated user",schema:{type:"object",required:[],additionalProperties:!1,properties:{}}}),e.hasGraphqlApis&&t.push(...s()),t}function s(){const e={name:{type:"string",description:"GraphQL schema name",minLength:1}},t={page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}};return[{name:"list-graphql-apis",description:"Lists available GraphQL schemas with their context and purpose",schema:{type:"object",required:[],additionalProperties:!1,properties:{filter:{type:"string",description:"GraphQL schema name (or part of it)",minLength:1,nullable:!0},...t}}},{name:"get-graphql-type-list",description:'List all operations and types in a GraphQL schema as a flat, paginated list. Each item is tagged with its kind (query, object, enum, \u2026) and carries a one-line description; operations also include their return type and argument signature \u2014 use it to decide which members to fetch in detail. Narrow the result with `kind` (one category) and/or `filter` (member-name substring, e.g. "book") to explore a domain cheaply instead of pulling the full schema.',schema:{type:"object",required:["name"],additionalProperties:!1,properties:{...e,kind:{type:"string",description:"Optional: return only a single category of schema members",enum:[...a],nullable:!0},filter:{type:"string",description:'Optional: only members whose name contains this substring (e.g. "book")',minLength:1,nullable:!0},referencesType:{type:"string",description:'Optional: only members that reference this type directly or transitively (via return, field, argument, union-member or input-field types). Finds cross-cutting members that never name it \u2014 e.g. referencesType "Book" surfaces a search query returning a union that includes Book.',minLength:1,nullable:!0},...t}}},{name:"get-graphql-type",description:"Get the SDL for a single GraphQL type, operation (query/mutation/subscription field), or directive. Set includeReferencedTypes to also pull in every type it references transitively \u2014 the full structural subgraph in one call, ideal for complete exploration of an entity (e.g. Book and all the types it touches).",schema:{type:"object",required:["name","type"],additionalProperties:!1,properties:{...e,type:{type:"string",description:"Name of the type, operation, or directive",minLength:1},includeReferencedTypes:{type:"boolean",description:"Also include the SDL of every type referenced transitively. Gives the whole subgraph at once, but can be large for highly-connected types.",default:!1,nullable:!0}}}},{name:"get-graphql-schema",description:"Get the complete GraphQL schema as SDL \u2014 the whole type graph in one call. Returns everything, so it can be very large and token-expensive for big schemas; prefer get-graphql-type-list (filter/paginate) plus targeted get-graphql-type calls, and reach for this only for small schemas or when you truly need the full SDL.",schema:{type:"object",required:["name"],additionalProperties:!1,properties:e}}]}function o(e){const t=e&&e.length>0;return{name:"search",description:"Search across the documentation to fetch relevant content for a given query",schema:{type:"object",required:["query"],additionalProperties:!1,properties:{query:{type:"string",description:"Search query. Should be a single word or that phrase that is presented in a documentation.",minLength:1},...t?{product:{type:"string",description:"Optional product name to filter search results by specific product.",enum:e,nullable:!0}}:{}}}}}export{c as getDefaultToolSchemas};
@@ -0,0 +1,6 @@
1
+ import type { McpToolHandler } from '../../../types.js';
2
+ declare const _default: {
3
+ search: McpToolHandler;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1,6 @@
1
+ import{withPathPrefix as p}from"@redocly/theme/core/utils";import{ServerRoutes as h}from"../../../../../../constants/common.js";const f=async(a,t)=>{const{query:c,product:u}=a,l=JSON.stringify({query:c,product:u});let e=`${t.baseUrl}${p(h.SEMANTIC_SEARCH)}`;e.startsWith("http://")&&(e=e.replace(/^http:\/\//,"https://"));const o=t.accessToken?`authorization=${String(t.accessToken).replace(/^Bearer /,"")}`:"";try{const s=await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...o?{Cookie:o}:{}},body:l});if(!s.ok)return{content:[{type:"text",text:"Error retrieving search results."}],isError:!0};const r=await s.json();if(!r||r.length===0)return{content:[{type:"text",text:"No results found."}]};const i=r.map(n=>`### [${n.title}](${new URL(n.url,t.baseUrl).toString()})
2
+
3
+ ${n.content}
4
+ `).join(`
5
+
6
+ `).trim();return{content:[{type:"text",text:i.length?i:"No results found."}]}}catch{return{content:[{type:"text",text:"Error retrieving search results."}],isError:!0}}};var m={search:f};export{m as default};
@@ -0,0 +1,3 @@
1
+ import type { SearchItemData } from '@redocly/theme/core/types';
2
+ export declare function processDocuments(documents: Record<string, SearchItemData[]>, outdir: string): string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,11 @@
1
+ import c from"node:fs";import f from"node:path";import{MAX_DOCUMENTS_PER_CATEGORY as $}from"../../../constants.js";function j(m,u){return Object.entries(m).map(([h,s])=>{if(!s||s.length===0)return"";const x=s.slice(0,$).map(d=>{const{document:t,highlight:o}=d,p=o?.title||(Array.isArray(t.title)?t.title[0]:t.title);let n=`Document: ${t.title}`;n+=`### [${p}](${t.url})
2
+
3
+ `;let r;if(t.url)try{let e=t.url.startsWith("/")?t.url.slice(1):t.url;const i=e.indexOf("#");i!==-1&&(e=e.substring(0,i));const l=f.extname(e);l&&(e=e.slice(0,-l.length));let y=e+".md";const a=f.join(u,y);c.existsSync(a)&&(r=c.readFileSync(a,"utf8"))}catch{}return r||(r=o?.text||(Array.isArray(t.text)?t.text[0]:t.text)),n+=r,t.facets&&(n+=`
4
+
5
+ **Categories:**
6
+ `,Object.entries(t.facets).forEach(([e,i])=>{n+=`- ${e}: ${i}
7
+ `})),n});return`## ${h}
8
+
9
+ ${x}`}).join(`
10
+
11
+ `).trim()}export{j as processDocuments};
@@ -0,0 +1,6 @@
1
+ import type { McpToolHandler } from '../../../types.js';
2
+ declare const _default: {
3
+ whoami: McpToolHandler;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=whoami.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { McpToolHandler } from '../../../types.js';
2
+ declare const _default: {
3
+ 'get-graphql-schema': McpToolHandler<{
4
+ name: string;
5
+ }>;
6
+ };
7
+ export default _default;
8
+ //# sourceMappingURL=get-graphql-schema.d.ts.map
@@ -0,0 +1,3 @@
1
+ import{printSchema as h}from"graphql";import{respondWithGraphqlSchema as t}from"./tool-helpers.js";const p=(e,a)=>t(e.name,a,({name:m,schema:r})=>`# Schema: ${m}
2
+
3
+ ${h(r)}`);var n={"get-graphql-schema":p};export{n as default};
@@ -0,0 +1,14 @@
1
+ import type { McpToolHandler } from '../../../types.js';
2
+ import type { GraphqlTypeKind } from './types.js';
3
+ declare const _default: {
4
+ 'get-graphql-type-list': McpToolHandler<{
5
+ name: string;
6
+ kind?: GraphqlTypeKind;
7
+ filter?: string;
8
+ referencesType?: string;
9
+ page?: number;
10
+ limit?: number;
11
+ }>;
12
+ };
13
+ export default _default;
14
+ //# sourceMappingURL=get-graphql-type-list.d.ts.map
@@ -0,0 +1 @@
1
+ import{GRAPHQL_TYPE_KINDS as g}from"./types.js";import{respondWithGraphqlSchema as d,paginate as u}from"./tool-helpers.js";import{groupSchemaTypes as y,filterMembersReferencingType as h}from"./utils.js";const T=(i,a)=>d(i.name,a,({name:f,schema:o})=>{const{kind:p,filter:n,referencesType:l,page:s=1,limit:m=300}=i,c=y(o);let e=(p?[p]:g).flatMap(t=>c[t].map(r=>({kind:t,...r})));if(l&&(e=h(o,e,l)),n){const t=n.toLowerCase();e=e.filter(r=>r.name.toLowerCase().includes(t))}return JSON.stringify({name:f,...u(e,s,m)},null,2)});var G={"get-graphql-type-list":T};export{G as default};
@@ -0,0 +1,10 @@
1
+ import type { McpToolHandler } from '../../../types.js';
2
+ declare const _default: {
3
+ 'get-graphql-type': McpToolHandler<{
4
+ name: string;
5
+ type: string;
6
+ includeReferencedTypes?: boolean;
7
+ }>;
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=get-graphql-type.d.ts.map
@@ -0,0 +1,7 @@
1
+ import{respondWithGraphqlSchema as d}from"./tool-helpers.js";import{printTypeOrField as y,printTypeOrFieldWithReferences as f}from"./utils.js";const l=(n,p)=>d(n.name,p,({name:r,schema:t})=>{const{type:e,includeReferencedTypes:i}=n;if(i){const{sdl:o,referencedCount:c}=f(t,e);return`# Schema: ${r}
2
+ # Type: ${e} (+ ${c} referenced types)
3
+
4
+ ${o}`}return`# Schema: ${r}
5
+ # Type: ${e}
6
+
7
+ ${y(t,e)}`});var m={"get-graphql-type":l};export{m as default};
@@ -0,0 +1,10 @@
1
+ import type { McpToolHandler } from '../../../types.js';
2
+ declare const _default: {
3
+ 'list-graphql-apis': McpToolHandler<{
4
+ filter?: string;
5
+ page?: number;
6
+ limit?: number;
7
+ }>;
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=list-graphql-apis.d.ts.map
@@ -0,0 +1 @@
1
+ import{paginate as p,textResult as r}from"./tool-helpers.js";const c=async(l,n)=>{const{filter:a,page:o=1,limit:m=300}=l;let e=n.graphqlDescriptions;if(a){const s=a.toLowerCase();e=e.filter(i=>i.name.toLowerCase().includes(s))}const t=p(e,o,m);return t.items.length===0?r("No GraphQL schemas available"):r(JSON.stringify({...t,items:t.items.map(({name:s,description:i})=>({name:s,description:i}))}))};var f={"list-graphql-apis":c};export{f as default};
@@ -0,0 +1,7 @@
1
+ import type { GraphQLSchema } from 'graphql';
2
+ import type { McpToolContext } from '../../../types.js';
3
+ export declare function loadGraphqlSchema(name: string, context: McpToolContext): Promise<{
4
+ name: string;
5
+ schema: GraphQLSchema;
6
+ }>;
7
+ //# sourceMappingURL=load-graphql-schema.d.ts.map
@@ -0,0 +1 @@
1
+ import t from"node:path";import{existsSync as m}from"node:fs";import{readFile as h}from"node:fs/promises";import{buildSchema as e}from"graphql";import{PUBLIC_API_DEFINITIONS_FOLDER as n}from"../../../../../constants/common.js";import{findGraphqlSchemaByName as f}from"./utils.js";async function w(r,a){const o=f(a.graphqlDescriptions,r);if(!o)throw new Error(`No GraphQL schema found matching "${r}".`);const i=t.join(a.outdir||"",n,o.relativePath);if(!m(i))throw new Error(`No GraphQL schema found matching "${r}".`);return{name:o.name,schema:e(await h(i,"utf-8"))}}export{w as loadGraphqlSchema};
@@ -0,0 +1,14 @@
1
+ import type { McpToolContext, McpToolWorkerResponse } from '../../../types.js';
2
+ import { loadGraphqlSchema } from './load-graphql-schema.js';
3
+ type LoadedGraphqlSchema = Awaited<ReturnType<typeof loadGraphqlSchema>>;
4
+ export declare function textResult(text: string, isError?: boolean): McpToolWorkerResponse;
5
+ export declare function respondWithGraphqlSchema(name: string, context: McpToolContext, render: (loaded: LoadedGraphqlSchema) => string): Promise<McpToolWorkerResponse>;
6
+ export declare function paginate<T>(items: T[], page: number, limit: number): {
7
+ items: T[];
8
+ limit: number;
9
+ total: number;
10
+ page: number;
11
+ totalPages: number;
12
+ };
13
+ export {};
14
+ //# sourceMappingURL=tool-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ import{loadGraphqlSchema as c}from"./load-graphql-schema.js";function o(t,e=!1){return{content:[{type:"text",text:t}],isError:e?!0:void 0}}async function u(t,e,r){try{return o(r(await c(t,e)))}catch(n){return o(n.message,!0)}}function h(t,e,r){const n=t.length,a=(e-1)*r;return{items:t.slice(a,a+r),limit:r,total:n,page:e,totalPages:Math.ceil(n/r)}}export{h as paginate,u as respondWithGraphqlSchema,o as textResult};
@@ -0,0 +1,10 @@
1
+ export declare const GRAPHQL_TYPE_KINDS: readonly ['queries', 'mutations', 'subscriptions', 'objects', 'interfaces', 'unions', 'enums', 'inputs', 'scalars', 'directives'];
2
+ export type GraphqlTypeKind = (typeof GRAPHQL_TYPE_KINDS)[number];
3
+ export type SchemaMember = {
4
+ name: string;
5
+ description?: string;
6
+ type?: string;
7
+ args?: string;
8
+ };
9
+ export type GroupedSchemaTypes = Record<GraphqlTypeKind, SchemaMember[]>;
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ const s=["queries","mutations","subscriptions","objects","interfaces","unions","enums","inputs","scalars","directives"];export{s as GRAPHQL_TYPE_KINDS};
@@ -0,0 +1,16 @@
1
+ import type { GraphQLSchema } from 'graphql';
2
+ import type { GraphqlDescriptionInfo } from '../../../types.js';
3
+ import type { GraphqlTypeKind, GroupedSchemaTypes } from './types.js';
4
+ export declare function findGraphqlSchemaByName(graphqlDescriptions: GraphqlDescriptionInfo[], name: string): GraphqlDescriptionInfo | undefined;
5
+ export declare function groupSchemaTypes(schema: GraphQLSchema): GroupedSchemaTypes;
6
+ export declare function filterMembersReferencingType<T extends {
7
+ kind: GraphqlTypeKind;
8
+ name: string;
9
+ }>(schema: GraphQLSchema, members: T[], targetName: string): T[];
10
+ export declare function referencedTypeClosure(schema: GraphQLSchema, name: string): string[];
11
+ export declare function printTypeOrField(schema: GraphQLSchema, name: string): string;
12
+ export declare function printTypeOrFieldWithReferences(schema: GraphQLSchema, name: string): {
13
+ sdl: string;
14
+ referencedCount: number;
15
+ };
16
+ //# sourceMappingURL=utils.d.ts.map