@redocly/realm 0.137.0-next.10 → 0.137.0-next.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cli/build/index.js +1 -1
  3. package/dist/client/app/Sidebar/useActions.js +1 -1
  4. package/dist/client/app/Sidebar/useSidebarItems.js +1 -1
  5. package/dist/client/app/hooks/catalog/useCatalogFilter.js +1 -1
  6. package/dist/client/app/search/useFacets.js +1 -1
  7. package/dist/client/app/seo/SeoTags.js +1 -1
  8. package/dist/server/config/env-config.d.ts +2 -0
  9. package/dist/server/config/env-schema.d.ts +5 -0
  10. package/dist/server/config/env-schemas/feature-flags.d.ts +4 -0
  11. package/dist/server/config/env-schemas/feature-flags.js +1 -1
  12. package/dist/server/esbuild/esbuild-logger.d.ts +2 -2
  13. package/dist/server/esbuild/esbuild-logger.js +3 -3
  14. package/dist/server/plugins/api-docs/options.js +1 -1
  15. package/dist/server/plugins/api-docs/search/get-ai-search-documents.d.ts +1 -1
  16. package/dist/server/plugins/api-docs/search/get-ai-search-documents.js +33 -33
  17. package/dist/server/plugins/config-parser/loaders/content-slugs-loader.js +1 -1
  18. package/dist/server/plugins/dev-onboarding/template/components/EditAppDescriptionDialog.js +1 -1
  19. package/dist/server/plugins/dev-onboarding/template/components/EditAppDialog.js +1 -1
  20. package/dist/server/plugins/dev-onboarding/template/components/EditCallbackUrlDialog.js +1 -1
  21. package/dist/server/plugins/markdown/is-partial.js +1 -1
  22. package/dist/server/plugins/mcp/codemode/capabilities/fetch/index.js +5 -4
  23. package/dist/server/plugins/mcp/codemode/capabilities/types.d.ts +5 -2
  24. package/dist/server/plugins/mcp/codemode/capabilities/utils.js +4 -4
  25. package/dist/server/plugins/mcp/codemode/prompts.d.ts +1 -1
  26. package/dist/server/plugins/mcp/codemode/prompts.js +7 -6
  27. package/dist/server/plugins/mcp/codemode/sandbox/create-sandbox-setup.d.ts +2 -2
  28. package/dist/server/plugins/mcp/codemode/sandbox/create-sandbox-setup.js +1 -11
  29. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/console.d.ts +2 -0
  30. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/console.js +5 -0
  31. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/index.d.ts +1 -0
  32. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/index.js +2 -2
  33. package/dist/server/plugins/mcp/codemode/sandbox/tool-input-validator.d.ts +5 -0
  34. package/dist/server/plugins/mcp/codemode/sandbox/tool-input-validator.js +1 -0
  35. package/dist/server/plugins/mcp/codemode/sandbox/unknown-tool-hint.d.ts +8 -0
  36. package/dist/server/plugins/mcp/codemode/sandbox/unknown-tool-hint.js +2 -0
  37. package/dist/server/plugins/mcp/codemode/tools/describe-tools.js +3 -1
  38. package/dist/server/plugins/mcp/codemode/tools/execute.js +1 -1
  39. package/dist/server/plugins/mcp/codemode/tools/manage-credentials.js +2 -2
  40. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
  41. package/dist/server/plugins/mcp/docs-mcp/tools/core/search.js +2 -2
  42. package/dist/server/plugins/mcp/docs-mcp/tools/core/types.d.ts +2 -2
  43. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type.js +5 -5
  44. package/dist/server/plugins/mcp/docs-mcp/tools/graphql/types.d.ts +2 -1
  45. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/list-apis.js +1 -1
  46. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.d.ts +4 -2
  47. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.js +1 -1
  48. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/types.d.ts +6 -2
  49. package/dist/server/plugins/mcp/docs-mcp/utils/api-titles.d.ts +6 -0
  50. package/dist/server/plugins/mcp/docs-mcp/utils/api-titles.js +1 -0
  51. package/dist/server/plugins/mcp/gateway-mcp/fetch/ssrf-guard.js +1 -1
  52. package/dist/server/plugins/mcp/gateway-mcp/fetch/url-placeholders.d.ts +5 -0
  53. package/dist/server/plugins/mcp/gateway-mcp/fetch/url-placeholders.js +1 -0
  54. package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
  55. package/dist/server/plugins/mcp/servers/mcp-server.js +2 -2
  56. package/dist/server/plugins/mcp/types.d.ts +1 -0
  57. package/dist/server/plugins/mcp/utils/available-sandbox-tools.js +1 -1
  58. package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +1 -1
  59. package/dist/server/plugins/search/llmstxt/create-llms-txt-generator.js +1 -1
  60. package/dist/server/plugins/search/llmstxt/index.d.ts +3 -1
  61. package/dist/server/plugins/search/llmstxt/index.js +9 -9
  62. package/dist/server/sandbox/sandbox.js +2 -2
  63. package/dist/server/sandbox/types.d.ts +8 -0
  64. package/dist/server/sandbox/utils/execution-budget.js +1 -1
  65. package/dist/server/sandbox/utils/return-last-expression.d.ts +6 -0
  66. package/dist/server/sandbox/utils/return-last-expression.js +1 -0
  67. package/dist/server/sandbox/utils/setup-host-functions.d.ts +1 -0
  68. package/dist/server/sandbox/utils/setup-host-functions.js +2 -2
  69. package/dist/server/store.js +1 -1
  70. package/dist/server/utils/globs.d.ts +4 -0
  71. package/dist/server/utils/globs.js +1 -1
  72. package/dist/server/web-server/routes/dynamic-route.js +1 -1
  73. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
  74. package/dist/server/web-server/routes/mcp-routes/mcp-server-card.js +1 -1
  75. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @redocly/realm
2
2
 
3
+ ## 0.137.0-next.12
4
+
5
+ ### Minor Changes
6
+
7
+ - 7df87b0c29d: Added the `singleExpanded` attribute to the `accordion-group` Markdoc tag to keep only one accordion open at a time.
8
+ - c3957bee9b2: Improved MCP server code mode to reduce AI agent script failures and provide clearer error messages.
9
+
10
+ ### Patch Changes
11
+
12
+ - 43ec2eb3a83: Fixed the `documentationUrl` in the MCP server card to include the path prefix.
13
+ - c09e6eb1c9d: Fixed an issue in Replay where Basic authentication credentials with non-ASCII characters produced a corrupted Authorization header or prevented the request from being sent.
14
+ - e5705e50add: Fixed an issue in Replay and the Try it console where operations with many editable fields got slower on each reopening.
15
+ - 43ec2eb3a83: Fixed broken `llms.txt` links to use the configured `seo.siteUrl` instead of the Redocly-hosted domain.
16
+ - 8e4959baca4: Updated `@redocly/openapi-core` to version `2.53.0`.
17
+ - Updated dependencies [7df87b0c29d]
18
+ - Updated dependencies [0f773ab0bc9]
19
+ - Updated dependencies [8e4959baca4]
20
+ - @redocly/theme@0.69.0-next.11
21
+ - @redocly/realm-asyncapi-sdk@0.15.0-next.4
22
+ - @redocly/api-docs@0.2.0-next.12
23
+ - @redocly/portal-plugin-mock-server@0.22.0-next.9
24
+
25
+ ## 0.137.0-next.11
26
+
27
+ ### Patch Changes
28
+
29
+ - 63141551504: Fixed an empty Download panel that appeared on the OpenAPI and AsyncAPI overview page when `downloadUrls` was set to an empty list.
30
+ - 8eb519653cd: Fixed security vulnerabilities `CVE-2026-84375`, `CVE-2026-84363`, `CVE-2026-84364` and `CVE-2026-39408` by upgrading `js-yaml` to version `4.3.2` and `hono` to version `4.13.7`.
31
+ - 2fde3a15587: Fixed an issue in the **Try it** console where closing an inactive tab moved the selection to a different tab instead of keeping the tab the user was working in.
32
+ - efab0652d2f: Fixed an issue in Replay's mobile layout where the first character typed in a request input moved focus to the close button, causing the rest of the input to be lost.
33
+ - e85d19c4926: Fixed an issue where Markdown tables would render a collapsed gray header row when all heading cells were empty.
34
+ - Updated dependencies [63141551504]
35
+ - Updated dependencies [8eb519653cd]
36
+ - Updated dependencies [e85d19c4926]
37
+ - @redocly/api-docs@0.2.0-next.11
38
+ - @redocly/theme@0.69.0-next.10
39
+ - @redocly/portal-plugin-mock-server@0.22.0-next.8
40
+
3
41
  ## 0.137.0-next.10
4
42
 
5
43
  ### Minor Changes
@@ -1 +1 @@
1
- import b from"node:path";import{unlink as R}from"node:fs/promises";import{writeFileSync as y}from"node:fs";import{envConfig as h}from"../../server/config/env-config.js";import{PORTAL_VERSION as A}from"../../server/version.js";import{logger as e}from"../../server/tools/notifiers/logger.js";import{reporter as T}from"../../server/tools/notifiers/reporter.js";import{shutdowner as O}from"../../server/tools/shutdowner.js";import{promiseMapLimit as D}from"../../server/utils/async/promise-map-limit.js";import{validateReactPages as E}from"../../server/plugins/pages/validators/validate-react-pages.js";import{ensureDir as S}from"../../server/utils/index.js";import{initPlugins as M,runPlugins as j,writeClientEntries as x}from"../../server/plugins/lifecycle.js";import{createClientCompiler as L,createNodeBundleCompiler as J}from"../../server/esbuild/esbuild.js";import{validateAllMarkdowns as k}from"../../server/plugins/markdown/compiler.js";import{copyEnvFiles as F}from"./copy-env-files.js";import{EsbuildError as s,esbuildLogger as d}from"../../server/esbuild/esbuild-logger.js";import{reportAllErrors as U}from"../../server/utils/report-all-errors.js";import{collectAnalytics as z}from"./analytics/collect-analytics.js";import{copyMigrationsFolder as N}from"../../server/providers/database/copy-migrations.js";import{telemetry as c}from"../telemetry/index.js";import{telemetryTraceStep as m}from"../telemetry/helpers/trace-step.js";async function li(v,i){c.initialize(A),e.info("Starting project build.");const C=e.startTiming();await m("com.redocly.build.start",async P=>{x(i);const p=await L(i,i.outdir,"production"),u=await J(i,i.serverOutDir,"production");let o,g;try{await m("com.redocly.build.clientCompilation",async()=>{const l=e.startTiming(),n=await p.rebuild().catch(a=>{throw new s(a)});Array.isArray(n.warnings)&&d(new s({warnings:n.warnings}));const r=e.infoTime(l,"Client JavaScript compiled");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...r}])}),await m("com.redocly.build.serverCompilation",async()=>{const l=e.startTiming(),n=await u.rebuild().catch(a=>{throw new s(a)});Array.isArray(n.warnings)&&d(new s({warnings:n.warnings}));const r=e.infoTime(l,"Server JavaScript compiled");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",message:r.message,timeMs:r.timeMs}])}),await i.reloadMarkdocOptions();let t;({pluginInstances:t,lifecycleContext:o}=await M({outdir:i.outdir,serverOutDir:i.serverOutDir,contentDir:i.contentDir,devLogin:v.devLogin,setGlobalConfig:i.setGlobalConfig})),o.fs.dispose(),i.lifecycleContext=o,N(i),await j(t,i,o),g=z(i,o),await m("com.redocly.build.clientServerRecompile",async()=>{const l=e.startTiming();e.info("Re-compiling JavaScript with user code"),(await Promise.all([p.rebuild(),u.rebuild()]).catch(a=>{throw new s(a)})).forEach(({warnings:a})=>{Array.isArray(a)&&d(new s({warnings:a}))});const r=e.infoTime(l,"JavaScript re-compiled");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...r}])}),await m("com.redocly.build.pagesValidation",async()=>{await E(i,o),await k(i,o)}),await U(o),i.markUserCodeReady()}catch(t){P?.error(t),t instanceof s&&d(t)}finally{g&&await g.catch(()=>{}),await p.dispose(),await u.dispose()}T.printErrors(),e.info("Rendering pages..."),await m("com.redocly.build.prepareStaticData",async t=>{const l=e.startTiming(),n=[...i.getAllRoutes(),...i.getAllApiRoutes()];t?.setAttribute("totalRoutes",n.length.toString()),await D(n,15,a=>i.writeRouteStaticData(a,o));const r=e.successTime(l,"Page static data prepared.");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...r}])}),await m("com.redocly.build.storeSerialization",async()=>{const t=e.startTiming();S(i.serverOutDir),y(b.join(i.serverOutDir,"store.json"),JSON.stringify(await i.toJson())),e.successTime(t,"Store serialized and written."),F(i)});const f=h.REDOCLY_PROBLEMS_OUTPUT_FILE;if(f){const t=e.startTiming();y(S(f),JSON.stringify(T.getProblems()),"utf-8"),e.successTime(t,"Broken links written.")}await R(b.join(i.serverOutDir,"index.css"));const w=e.successTime(C,"All done");w&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...w}])}),await O.exitWithCode(0)}export{li as build};
1
+ import y from"node:path";import{unlink as R}from"node:fs/promises";import{writeFileSync as T}from"node:fs";import{envConfig as h}from"../../server/config/env-config.js";import{PORTAL_VERSION as A}from"../../server/version.js";import{logger as e}from"../../server/tools/notifiers/logger.js";import{reporter as f}from"../../server/tools/notifiers/reporter.js";import{shutdowner as O}from"../../server/tools/shutdowner.js";import{promiseMapLimit as D}from"../../server/utils/async/promise-map-limit.js";import{validateReactPages as E}from"../../server/plugins/pages/validators/validate-react-pages.js";import{ensureDir as S}from"../../server/utils/index.js";import{initPlugins as M,runPlugins as j,writeClientEntries as x}from"../../server/plugins/lifecycle.js";import{createClientCompiler as L,createNodeBundleCompiler as J}from"../../server/esbuild/esbuild.js";import{validateAllMarkdowns as k}from"../../server/plugins/markdown/compiler.js";import{copyEnvFiles as F}from"./copy-env-files.js";import{EsbuildError as s,esbuildLogger as d}from"../../server/esbuild/esbuild-logger.js";import{reportAllErrors as U}from"../../server/utils/report-all-errors.js";import{collectAnalytics as z}from"./analytics/collect-analytics.js";import{copyMigrationsFolder as N}from"../../server/providers/database/copy-migrations.js";import{telemetry as c}from"../telemetry/index.js";import{telemetryTraceStep as m}from"../telemetry/helpers/trace-step.js";async function li(v,i){c.initialize(A),e.info("Starting project build.");const C=e.startTiming();await m("com.redocly.build.start",async P=>{x(i);const p=await L(i,i.outdir,"production"),u=await J(i,i.serverOutDir,"production");let o,g;try{await m("com.redocly.build.clientCompilation",async()=>{const l=e.startTiming(),n=await p.rebuild().catch(a=>{throw new s(a)});Array.isArray(n.warnings)&&d(new s({warnings:n.warnings}));const r=e.infoTime(l,"Client JavaScript compiled");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...r}])}),await m("com.redocly.build.serverCompilation",async()=>{const l=e.startTiming(),n=await u.rebuild().catch(a=>{throw new s(a)});Array.isArray(n.warnings)&&d(new s({warnings:n.warnings}));const r=e.infoTime(l,"Server JavaScript compiled");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",message:r.message,timeMs:r.timeMs}])}),await i.reloadMarkdocOptions();let t;({pluginInstances:t,lifecycleContext:o}=await M({outdir:i.outdir,serverOutDir:i.serverOutDir,contentDir:i.contentDir,devLogin:v.devLogin,setGlobalConfig:i.setGlobalConfig})),o.fs.dispose(),i.lifecycleContext=o,N(i),await j(t,i,o),g=z(i,o),await m("com.redocly.build.clientServerRecompile",async()=>{const l=e.startTiming();e.info("Re-compiling JavaScript with user code"),(await Promise.all([p.rebuild(),u.rebuild()]).catch(a=>{throw new s(a)})).forEach(({warnings:a})=>{Array.isArray(a)&&d(new s({warnings:a}))});const r=e.infoTime(l,"JavaScript re-compiled");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...r}])}),await m("com.redocly.build.pagesValidation",async()=>{await E(i,o),await k(i,o)}),await U(o),i.markUserCodeReady()}catch(t){P?.error(t),t instanceof s&&await d(t),await f.panic(t instanceof Error?t:String(t))}finally{g&&await g.catch(()=>{}),await p.dispose(),await u.dispose()}f.printErrors(),e.info("Rendering pages..."),await m("com.redocly.build.prepareStaticData",async t=>{const l=e.startTiming(),n=[...i.getAllRoutes(),...i.getAllApiRoutes()];t?.setAttribute("totalRoutes",n.length.toString()),await D(n,15,a=>i.writeRouteStaticData(a,o));const r=e.successTime(l,"Page static data prepared.");r&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...r}])}),await m("com.redocly.build.storeSerialization",async()=>{const t=e.startTiming();S(i.serverOutDir),T(y.join(i.serverOutDir,"store.json"),JSON.stringify(await i.toJson())),e.successTime(t,"Store serialized and written."),F(i)});const w=h.REDOCLY_PROBLEMS_OUTPUT_FILE;if(w){const t=e.startTiming();T(S(w),JSON.stringify(f.getProblems()),"utf-8"),e.successTime(t,"Broken links written.")}await R(y.join(i.serverOutDir,"index.css"));const b=e.successTime(C,"All done");b&&c.sendTimingPerformedMessage([{id:"buildStep",object:"timing",uri:"urn:redocly:realm:cli:timing:buildStep",...b}])}),await O.exitWithCode(0)}export{li as build};
@@ -1 +1 @@
1
- import t from"react";import{LayoutVariant as o}from"@redocly/config";import{usePageSharedData as C}from"../../providers/page-data/hooks";function L(){const e=C("apiDocsStore"),c=!!e,a=e?.options?.layout,[n,s]=t.useState(a||o.THREE_PANEL),[i,l]=t.useState(!1),[u,r]=t.useState(!1);t.useEffect(()=>{u||s(a||o.THREE_PANEL)},[a,u]);function f(){s(n===o.STACKED?o.THREE_PANEL:o.STACKED),r(!0)}function p(){l(E=>!E)}return{onChangeViewClick:f,onChangeCollapseSidebarClick:p,layout:n,collapsedSidebar:i,isApiDocs:c}}export{L as useActions};
1
+ import e from"react";import{LayoutVariant as o}from"@redocly/config";import{usePageSharedData as f}from"../../providers/page-data/hooks";function d(){const t=f("apiDocsStore"),n=!!t,s=t?.options?.layout,[c,i]=e.useState(!1),[l,u]=e.useState(null),a=l??s??o.THREE_PANEL;function r(){u(a===o.STACKED?o.THREE_PANEL:o.STACKED)}function p(){i(S=>!S)}return{onChangeViewClick:r,onChangeCollapseSidebarClick:p,layout:a,collapsedSidebar:c,isApiDocs:n}}export{d as useActions};
@@ -1 +1 @@
1
- import{useLocation as _}from"react-router";import{useEffect as k,useMemo as S,useState as b}from"react";import{useActiveSectionId as D}from"@redocly/theme/core/hooks";import{getMenuItemType as v}from"@redocly/theme/core/utils";import{MenuItemType as C}from"@redocly/theme/core/constants";import{CATALOG_BASE_SLUG as T,CATALOG_SLUGS as h}from"../../../constants/catalog-entities";import{usePageSharedData as y,useSidebarItemsData as G,useSidebarConnectedCatalogConfig as E,useSidebarConnectedCatalogEntity as O}from"../../providers/page-data/hooks";import{mapItemsPropsToState as g}from"./utils";import{injectCatalogItems as K}from"../../utils/catalog/inject-catalog-items";import{filterOutVersionedItems as B}from"./helpers/filter-out-versioned-items";const M="catalog.backToAllLabel",P=`${T}/${h.ALL}`;function U(n){const e=G();return S(()=>B(e,n),[e,n])}function J(n){const e=_(),t=D(e,!0),a=O(),p=E(),s=U(n),c=a?K(s,a.key,p?.slug,e.search):s,[u,I]=b(null),r=S(()=>g(c,e,t),[t,e,c]),l=y("current-catalog-info"),L=S(()=>f(r),[c]),[o,m]=b(L),i=o.length>0?o[o.length-1]:void 0,A=i&&g([...i.item.link?[{...i.item,items:[],menuStyle:void 0,separatorLine:!1}]:[],...i.item.items],e,t);k(()=>{if(!u||u!==t){const d=f(r);m(d),I(t)}},[s,e,t,u]);const w=i?{slug:i.previousLink,event:"sidebar_drilldown_back_button.clicked"}:a?{label:"Back to Catalog",labelTranslationKey:M,slug:P,event:"back_to_catalog_button.clicked"}:l?{label:l.catalog.label,labelTranslationKey:l.catalog.labelTranslationKey,slug:l.catalog.link,event:"back_to_catalog_button.clicked"}:void 0;return{currentItems:A||r,allSidebarItems:r,popDrilldownState:()=>{o.length>0&&m(o.slice(0,o.length-1))},pushDrilldownState:d=>{m([...o,d])},backLink:w,versionLabel:a?.version??null}}function f(n,e=[]){for(const t of n){if(!t.active&&!t.hasActiveSubItem)continue;if(v(t)===C.DrillDown&&e.push({item:t}),t.active)return e;if(t.hasActiveSubItem)return f(t.items,e)}return e}export{U as useRawSidebarItems,J as useSidebarItems};
1
+ import{useLocation as A}from"react-router";import{useEffect as w,useMemo as f,useRef as _,useState as k}from"react";import{useActiveSectionId as D}from"@redocly/theme/core/hooks";import{getMenuItemType as C}from"@redocly/theme/core/utils";import{MenuItemType as v}from"@redocly/theme/core/constants";import{CATALOG_BASE_SLUG as T,CATALOG_SLUGS as h}from"../../../constants/catalog-entities";import{usePageSharedData as y,useSidebarItemsData as G,useSidebarConnectedCatalogConfig as E,useSidebarConnectedCatalogEntity as O}from"../../providers/page-data/hooks";import{mapItemsPropsToState as b}from"./utils";import{injectCatalogItems as K}from"../../utils/catalog/inject-catalog-items";import{filterOutVersionedItems as R}from"./helpers/filter-out-versioned-items";const B="catalog.backToAllLabel",M=`${T}/${h.ALL}`;function U(o){const e=G();return f(()=>R(e,o),[e,o])}function J(o){const e=A(),t=D(e,!0),a=O(),g=E(),c=U(o),s=a?K(c,a.key,g?.slug,e.search):c,u=_(null),r=f(()=>b(s,e,t),[t,e,s]),l=y("current-catalog-info"),p=f(()=>S(r),[s]),[n,m]=k(p),i=n.length>0?n[n.length-1]:void 0,I=i&&b([...i.item.link?[{...i.item,items:[],menuStyle:void 0,separatorLine:!1}]:[],...i.item.items],e,t);w(()=>{if(!u.current||u.current!==t){const d=S(r);m(d),u.current=t}},[c,e,t]);const L=i?{slug:i.previousLink,event:"sidebar_drilldown_back_button.clicked"}:a?{label:"Back to Catalog",labelTranslationKey:B,slug:M,event:"back_to_catalog_button.clicked"}:l?{label:l.catalog.label,labelTranslationKey:l.catalog.labelTranslationKey,slug:l.catalog.link,event:"back_to_catalog_button.clicked"}:void 0;return{currentItems:I||r,allSidebarItems:r,popDrilldownState:()=>{n.length>0&&m(n.slice(0,n.length-1))},pushDrilldownState:d=>{m([...n,d])},backLink:L,versionLabel:a?.version??null}}function S(o,e=[]){for(const t of o){if(!t.active&&!t.hasActiveSubItem)continue;if(C(t)===v.DrillDown&&e.push({item:t}),t.active)return e;if(t.hasActiveSubItem)return S(t.items,e)}return e}export{U as useRawSidebarItems,J as useSidebarItems};
@@ -1 +1 @@
1
- import{useCallback as h,useEffect as w,useMemo as y,useState as P}from"react";import{useSearchParams as Q}from"react-router";import{telemetry as b}from"../../telemetry/index.js";import{parseFilterQuery as g,formatFilterQuery as C,collectFilterOptions as U}from"../../../utils";import{getBaseDataAttributes as I}from"@redocly/theme/core/utils";function O(r){return r instanceof Set?r.size>0:!!(r?.from||r?.to)}function x(r,m){const[u,d]=Q(),o=u.get("filter")||"",[i,f]=P(()=>g(o,r?.filters||[])),p=y(()=>U(r?.filters,m),[r?.filters,m]);w(()=>{const t=r?.filters||[];if(t.length>0&&i.length!==t.length){const e=g(o,t);f(e)}},[r?.filters,i.length,o]);const F=h((t,e)=>{f(l=>l.map((s,c)=>{if(c!==t||!(s instanceof Set))return s;const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n})),window.scrollTo(0,0)},[]),S=h((t,e)=>{f(l=>l.map((a,s)=>s!==t?a:a instanceof Set?e&&typeof e=="string"?new Set([e]):new Set:{from:typeof e=="object"?e?.from:void 0,to:typeof e=="object"?e?.to:void 0})),b.sendCatalogFilterChangedMessage([{...I("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[]);return w(()=>{const t=new URLSearchParams(u),e=C(i,r?.filters||[]);e?t.set("filter",e):t.delete("filter"),d(t,{replace:!0})},[r?.filters,i,u,d]),y(()=>{const t=p.map((l,a)=>{const s=i[a],c=O(s);return{...l,toggleOption:n=>F(a,n),selectOption:n=>S(a,n),selectedOptions:s??new Set,isFilterUsed:c}});return{filters:t.map(l=>{const a=t.findIndex(n=>n.property===l.parentFilter),s=i[a],c=l.parentFilter?O(s):!0;return{...l,parentUsed:c}}),filterQuery:o}},[p,i,F,S,o])}export{x as useCatalogFilter};
1
+ import{useCallback as h,useEffect as P,useMemo as w,useState as Q}from"react";import{useSearchParams as b}from"react-router";import{telemetry as C}from"../../telemetry/index.js";import{parseFilterQuery as y,formatFilterQuery as U,collectFilterOptions as j}from"../../../utils";import{getBaseDataAttributes as I}from"@redocly/theme/core/utils";function O(t){return t instanceof Set?t.size>0:!!(t?.from||t?.to)}function z(t,d){const[u,p]=b(),c=u.get("filter")||"",[o,f]=Q(()=>y(c,t?.filters||[])),F=w(()=>j(t?.filters,d),[t?.filters,d]),m=t?.filters||[];m.length>0&&o.length!==m.length&&f(y(c,m));const S=h((s,e)=>{f(l=>l.map((r,i)=>{if(i!==s||!(r instanceof Set))return r;const n=new Set(r);return n.has(e)?n.delete(e):n.add(e),n})),window.scrollTo(0,0)},[]),g=h((s,e)=>{f(l=>l.map((a,r)=>r!==s?a:a instanceof Set?e&&typeof e=="string"?new Set([e]):new Set:{from:typeof e=="object"?e?.from:void 0,to:typeof e=="object"?e?.to:void 0})),C.sendCatalogFilterChangedMessage([{...I("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[]);return P(()=>{const s=new URLSearchParams(u),e=U(o,t?.filters||[]);e?s.set("filter",e):s.delete("filter"),p(s,{replace:!0})},[t?.filters,o,u,p]),w(()=>{const s=F.map((l,a)=>{const r=o[a],i=O(r);return{...l,toggleOption:n=>S(a,n),selectOption:n=>g(a,n),selectedOptions:r??new Set,isFilterUsed:i}});return{filters:s.map(l=>{const a=s.findIndex(n=>n.property===l.parentFilter),r=o[a],i=l.parentFilter?O(r):!0;return{...l,parentUsed:i}}),filterQuery:c}},[F,o,S,g,c])}export{z as useCatalogFilter};
@@ -1 +1 @@
1
- import{useCallback as y,useEffect as u,useState as n}from"react";import{withPathPrefix as S}from"@redocly/theme/core/utils";import{ServerRoutes as d}from"../../../constants/api";import{useI18nConfig as b}from"../hooks";function h(e){const[o,c]=n([]),[s,a]=n(null),[t,r]=n(null),[p,i]=n(!1),{currentLocale:f}=b();u(()=>{i(!0),m()},[t]);const m=y(async()=>{if(e&&t===null){i(!1);return}let l={locale:f,field:e};t&&(l={...l,...t});const F=await(await fetch(S(d.SEARCH_FACETS),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(l)})).json();e?a(F):c(F),i(!1)},[f,t,e]);return{initialFacets:o,searchFacets:s,isFacetsLoading:p,setSearchFacetQuery:r}}function E(e){const[o,c]=n(null),{searchFacets:s,setSearchFacetQuery:a}=h(e);return u(()=>{const t=s?s.find(r=>r.field===e)??null:null;c(t)},[s,e]),{searchFacet:o,setSearchFacet:c,setSearchFacetQuery:a}}const L=e=>{const[o,c]=n([]),{initialFacets:s}=h();return u(()=>{if(e&&Object.keys(e).length){const a=[];for(const t of s)a.push({...t,values:e[t.field]?.map(r=>({...r,isCounterVisible:!0}))||[]});c(a)}else c(s)},[s,e]),{facets:o}};export{E as useFacetQuery,L as useFacets};
1
+ import{useCallback as y,useEffect as f,useMemo as S,useState as r}from"react";import{withPathPrefix as b}from"@redocly/theme/core/utils";import{ServerRoutes as d}from"../../../constants/api";import{useI18nConfig as g}from"../hooks";function h(e){const[s,a]=r([]),[t,n]=r(null),[c,o]=r(null),[p,i]=r(!1),{currentLocale:l}=g();f(()=>{i(!0),m()},[c]);const m=y(async()=>{if(e&&c===null){i(!1);return}let u={locale:l,field:e};c&&(u={...u,...c});const F=await(await fetch(b(d.SEARCH_FACETS),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u)})).json();e?n(F):a(F),i(!1)},[l,c,e]);return{initialFacets:s,searchFacets:t,isFacetsLoading:p,setSearchFacetQuery:o}}function L(e){const[s,a]=r(null),{searchFacets:t,setSearchFacetQuery:n}=h(e);return f(()=>{const c=t?t.find(o=>o.field===e)??null:null;a(c)},[t,e]),{searchFacet:s,setSearchFacet:a,setSearchFacetQuery:n}}const O=e=>{const{initialFacets:s}=h();return{facets:S(()=>!e||!Object.keys(e).length?s:s.map(t=>({...t,values:e[t.field]?.map(n=>({...n,isCounterVisible:!0}))||[]})),[s,e])}};export{L as useFacetQuery,O as useFacets};
@@ -1 +1 @@
1
- import n from"react";import{Helmet as u}from"@dr.pogodin/react-helmet";import{combineUrls as p}from"@redocly/theme/core/utils";import{isTruthy as g}from"../../../utils/guards/is-truthy";import{usePageVersions as k}from"../../providers/page-data/hooks";import{getMetaTagsAttributes as d}from"../utils/get-meta-tags-attributes";import{useHreflangLinks as E}from"./hooks/useHreflangLinks";function U(o){const{seo:e,slug:i}=o,{versions:s}=k(),r=e?.siteUrl,{localeAlternates:a}=E(r);if(!e)return null;const m=d(e),c=[e.title,e.projectTitle].filter(g).join(" | "),f=s.find(t=>t.default)?.link||i;return n.createElement(u,null,n.createElement("title",null,c),r?n.createElement("link",{rel:"canonical",href:p(r,f)}):null,a.map(({hrefLang:t,href:l})=>n.createElement("link",{key:t,rel:"alternate",hrefLang:t,href:l})),e.jsonLd?n.createElement("script",{type:"application/ld+json"},JSON.stringify(e.jsonLd)):null,m.map((t,l)=>n.createElement("meta",{key:l,...t})))}export{U as SeoTags};
1
+ import n from"react";import{Helmet as p}from"@dr.pogodin/react-helmet";import{combineUrls as g,withPathPrefix as k}from"@redocly/theme/core/utils";import{isTruthy as d}from"../../../utils/guards/is-truthy";import{usePageVersions as E}from"../../providers/page-data/hooks";import{getMetaTagsAttributes as h}from"../utils/get-meta-tags-attributes";import{useHreflangLinks as j}from"./hooks/useHreflangLinks";function U(o){const{seo:e,slug:s}=o,{versions:a}=E(),r=e?.siteUrl,{localeAlternates:m}=j(r);if(!e)return null;const c=h(e),f=[e.title,e.projectTitle].filter(d).join(" | "),i=a.find(t=>t.default)?.link,u=i?k(i):s;return n.createElement(p,null,n.createElement("title",null,f),r?n.createElement("link",{rel:"canonical",href:g(r,u)}):null,m.map(({hrefLang:t,href:l})=>n.createElement("link",{key:t,rel:"alternate",hrefLang:t,href:l})),e.jsonLd?n.createElement("script",{type:"application/ld+json"},JSON.stringify(e.jsonLd)):null,c.map((t,l)=>n.createElement("meta",{key:l,...t})))}export{U as SeoTags};
@@ -55,6 +55,7 @@ declare function loadEnvConfig(): {
55
55
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
56
56
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: boolean | undefined;
57
57
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: boolean | undefined;
58
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: boolean | undefined;
58
59
  SEARCH_DEV_REINIT?: string | undefined;
59
60
  SEARCH_DEV_DEBUG: boolean;
60
61
  REDOCLY_SKIP_TYPESENSE_INDEXING: boolean;
@@ -138,6 +139,7 @@ export declare const envConfig: {
138
139
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
139
140
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: boolean | undefined;
140
141
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: boolean | undefined;
142
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: boolean | undefined;
141
143
  SEARCH_DEV_REINIT?: string | undefined;
142
144
  SEARCH_DEV_DEBUG: boolean;
143
145
  REDOCLY_SKIP_TYPESENSE_INDEXING: boolean;
@@ -59,6 +59,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
59
59
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
60
60
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
61
61
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
62
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
62
63
  } & {
63
64
  SEARCH_DEV_REINIT: z.ZodOptional<z.ZodString>;
64
65
  SEARCH_DEV_DEBUG: z.ZodEffects<z.ZodDefault<z.ZodEnum<["true", "false"]>>, boolean, "false" | "true" | undefined>;
@@ -139,6 +140,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
139
140
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
140
141
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: boolean | undefined;
141
142
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: boolean | undefined;
143
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: boolean | undefined;
142
144
  SEARCH_DEV_REINIT?: string | undefined;
143
145
  SEARCH_DEV_DEBUG: boolean;
144
146
  REDOCLY_SKIP_TYPESENSE_INDEXING: boolean;
@@ -212,6 +214,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
212
214
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
213
215
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: "false" | "true" | undefined;
214
216
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: "false" | "true" | undefined;
217
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: "false" | "true" | undefined;
215
218
  SEARCH_DEV_REINIT?: string | undefined;
216
219
  SEARCH_DEV_DEBUG?: "false" | "true" | undefined;
217
220
  REDOCLY_SKIP_TYPESENSE_INDEXING?: "false" | "true" | undefined;
@@ -285,6 +288,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
285
288
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
286
289
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: boolean | undefined;
287
290
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: boolean | undefined;
291
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: boolean | undefined;
288
292
  SEARCH_DEV_REINIT?: string | undefined;
289
293
  SEARCH_DEV_DEBUG: boolean;
290
294
  REDOCLY_SKIP_TYPESENSE_INDEXING: boolean;
@@ -358,6 +362,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
358
362
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
359
363
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: "false" | "true" | undefined;
360
364
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: "false" | "true" | undefined;
365
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: "false" | "true" | undefined;
361
366
  SEARCH_DEV_REINIT?: string | undefined;
362
367
  SEARCH_DEV_DEBUG?: "false" | "true" | undefined;
363
368
  REDOCLY_SKIP_TYPESENSE_INDEXING?: "false" | "true" | undefined;
@@ -21,6 +21,8 @@ export declare const featureFlagsSchema: z.ZodObject<{
21
21
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
22
22
  /** Experimental: register custom MCP tools from `@mcp` folders. */
23
23
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
24
+ /** Experimental: enables the GraphQL request body in Try It and embedded Replay. */
25
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
24
26
  }, "strip", z.ZodTypeAny, {
25
27
  NEW_CATALOG_ENABLED?: boolean | undefined;
26
28
  NEW_SCORECARDS_ENABLED?: boolean | undefined;
@@ -34,6 +36,7 @@ export declare const featureFlagsSchema: z.ZodObject<{
34
36
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
35
37
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: boolean | undefined;
36
38
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: boolean | undefined;
39
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: boolean | undefined;
37
40
  }, {
38
41
  NEW_CATALOG_ENABLED?: "false" | "true" | undefined;
39
42
  NEW_SCORECARDS_ENABLED?: "false" | "true" | undefined;
@@ -47,5 +50,6 @@ export declare const featureFlagsSchema: z.ZodObject<{
47
50
  REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
48
51
  REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE?: "false" | "true" | undefined;
49
52
  REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED?: "false" | "true" | undefined;
53
+ REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: "false" | "true" | undefined;
50
54
  }>;
51
55
  //# sourceMappingURL=feature-flags.d.ts.map
@@ -1 +1 @@
1
- import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const N=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:_.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_DISABLE_API_FUNCTION_SANDBOX:E(),REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE:E(),REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED:E()});export{N as featureFlagsSchema};
1
+ import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const D=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:_.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_DISABLE_API_FUNCTION_SANDBOX:E(),REDOCLY_MCP_ENFORCE_TOKEN_AUDIENCE:E(),REDOCLY_EXP_MCP_CUSTOM_TOOLS_ENABLED:E(),REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED:E()});export{D as featureFlagsSchema};
@@ -8,9 +8,9 @@ export type Location = {
8
8
  export declare class EsbuildError extends Error {
9
9
  errors: BuildFailure['errors'];
10
10
  warnings: BuildFailure['warnings'];
11
- constructor({ errors, warnings }: Partial<BuildFailure>);
11
+ constructor(failure: Partial<BuildFailure>);
12
12
  }
13
- export declare function esbuildLogger({ errors, warnings }: EsbuildError): Promise<void>;
13
+ export declare function esbuildLogger({ errors, warnings, message }: EsbuildError): Promise<void>;
14
14
  export declare function reportEsbuildError(message: string, sourceFileRelativePath: string, fileContent: string, location?: Location | null): {
15
15
  message: string;
16
16
  sourceFileRelativePath: string;
@@ -1,3 +1,3 @@
1
- import*as E from"esbuild";import{logger as c}from"../tools/notifiers/logger.js";import{reporter as u}from"../tools/notifiers/reporter.js";import{envConfig as f}from"../config/env-config.js";import{telemetry as d}from"../../cli/telemetry/index.js";import{stopAllCompilers as y}from"./esbuild.js";import{getCodeframe as C}from"../utils/codeframes/codeframes.js";import{shutdowner as M}from"../tools/shutdowner.js";class S extends Error{errors;warnings;constructor({errors:r=[],warnings:e=[]}){super(),this.errors=r,this.warnings=e}}async function T({errors:n,warnings:r}){const e=await m(n,"error"),s=await m(r,"warning");r.forEach((t,o)=>{c.warn(s[o])}),n.forEach((t,o)=>{const i=t.location?.file||"";i&&i.includes("node_modules/")?(c.error(e[o]),d.sendCliErrorCaughtMessage([{id:"cli",object:"error",uri:"urn:redocly:realm:cli:error:cli",message:JSON.stringify(t)}])):(c.contentError(e[o]),d.sendCliErrorCaughtMessage([{id:"cli",object:"error",uri:"urn:redocly:realm:cli:error:cli",message:JSON.stringify(t),scope:"content"}]))}),n.length&&f.isBuildMode&&(await y(),await M.exitWithCode(1))}async function m(n,r){return f.REDOCLY_LOG_FORMAT==="JSON"?n.map(e=>JSON.stringify(e)):await E.formatMessages(n,{kind:r,color:!1,terminalWidth:0})}function w(n,r){if(!r?.lineText)return{line:1,column:1,lines:n.split(`
2
- `),hasMatched:!1};const e=n.split(`
3
- `),{lineText:s}=r,t=i=>{const l=i.indexOf(s);return l===-1?null:l};if(r.line&&r.line<=e.length&&t(e[r.line-1]))return{line:r.line,column:r.column||1,lines:e,hasMatched:!0};const o=e.findIndex(i=>t(i)!==null);if(o>=0){const i=t(e[o]);return{line:o+1,column:(i??0)+1,lines:e,hasMatched:!0}}return{line:1,column:1,lines:e,hasMatched:!1}}function _(n,r,e,s){const{line:t,column:o,lines:i,hasMatched:l}=w(e,s),{frame:h,start:p}=C({start:{line:t,character:o},end:{line:t,character:o+(s?.lineText?.length||0)},lines:i},!0),g=`${n}::${r}::${t}`,a={message:n,sourceFileRelativePath:r,sourceFileLocation:p,codeframe:h,hasMatched:l};return u.getCompilationProblem(g)||u.reportCompilationError({type:"ERROR",severity:"ERROR",...a}),a}export{S as EsbuildError,T as esbuildLogger,_ as reportEsbuildError};
1
+ import*as E from"esbuild";import{logger as c}from"../tools/notifiers/logger.js";import{reporter as f}from"../tools/notifiers/reporter.js";import{envConfig as m}from"../config/env-config.js";import{telemetry as d}from"../../cli/telemetry/index.js";import{stopAllCompilers as y}from"./esbuild.js";import{getCodeframe as C}from"../utils/codeframes/codeframes.js";import{shutdowner as M}from"../tools/shutdowner.js";class N extends Error{errors;warnings;constructor(r){super(r.message,r instanceof Error?{cause:r}:void 0),this.errors=r.errors??[],this.warnings=r.warnings??[]}}async function T({errors:n,warnings:r,message:t}){const s=await h(n,"error"),o=await h(r,"warning");if(r.forEach((e,i)=>{c.warn(o[i])}),n.forEach((e,i)=>{const a=e.location?.file||"";a&&a.includes("node_modules/")?(c.error(s[i]),d.sendCliErrorCaughtMessage([{id:"cli",object:"error",uri:"urn:redocly:realm:cli:error:cli",message:JSON.stringify(e)}])):(c.contentError(s[i]),d.sendCliErrorCaughtMessage([{id:"cli",object:"error",uri:"urn:redocly:realm:cli:error:cli",message:JSON.stringify(e),scope:"content"}]))}),!n.length&&t){const e=`JavaScript compilation failed: ${t}`;c.error(e),d.sendCliErrorCaughtMessage([{id:"cli",object:"error",uri:"urn:redocly:realm:cli:error:cli",message:e}])}(n.length>0||t)&&m.isBuildMode&&(await y(),await M.exitWithCode(1))}async function h(n,r){return n.length?m.REDOCLY_LOG_FORMAT==="JSON"?n.map(t=>JSON.stringify(t)):await E.formatMessages(n,{kind:r,color:!1,terminalWidth:0}):[]}function w(n,r){if(!r?.lineText)return{line:1,column:1,lines:n.split(`
2
+ `),hasMatched:!1};const t=n.split(`
3
+ `),{lineText:s}=r,o=e=>{const i=e.indexOf(s);return i===-1?null:i};if(r.line&&r.line<=t.length&&o(t[r.line-1]))return{line:r.line,column:r.column||1,lines:t,hasMatched:!0};const l=t.findIndex(e=>o(e)!==null);if(l>=0){const e=o(t[l]);return{line:l+1,column:(e??0)+1,lines:t,hasMatched:!0}}return{line:1,column:1,lines:t,hasMatched:!1}}function _(n,r,t,s){const{line:o,column:l,lines:e,hasMatched:i}=w(t,s),{frame:a,start:g}=C({start:{line:o,character:l},end:{line:o,character:l+(s?.lineText?.length||0)},lines:e},!0),p=`${n}::${r}::${o}`,u={message:n,sourceFileRelativePath:r,sourceFileLocation:g,codeframe:a,hasMatched:i};return f.getCompilationProblem(p)||f.reportCompilationError({type:"ERROR",severity:"ERROR",...u}),u}export{N as EsbuildError,T as esbuildLogger,_ as reportEsbuildError};
@@ -1 +1 @@
1
- import*as w from"node:path";import{findFirstBinding as M,markdocParser as P}from"@redocly/api-docs";import{combineUrls as i}from"@redocly/theme/core/openapi";import{withPathPrefix as h}from"@redocly/theme/core/utils";import{GRAPHQL_SPEC_SLUG as _}from"../../../constants/common.js";import{PUBLIC_API_DEFINITIONS_FOLDER as f}from"../../constants/common.js";import{deepMerge as B}from"../../../utils/object/deep-merge.js";import{normalizeFeedbackOptions as E}from"./utils/normalize-feedback-options.js";import{replaceFileExtension as u}from"./utils/replace-file-extension.js";import{relativePathToBaseSlug as I}from"./utils/relative-path-to-base-slug.js";const U={tags:{},nodes:{},components:{}};function A(o,r){if(!(o?.off!==!0))return o;const t=I(r);return{url:h(`/_mock${t}`),position:"first",description:"Mock server",...o}}function L(o,r){return(r==="graphql"?[i(_,`${u(o,w.posix.extname(o))}?download`)]:[i(f,`${u(o,".json")}?download`),i(f,`${u(o,".yaml")}?download`)]).map(t=>({url:h(t)}))}function H(o,r,m){const{rootConfig:t,config:c,apiConfig:s,mergedConfig:e,relativePath:d}=m,a=B(t?.[o]||{},c[o]||{},s[o]||s.theme?.[o]||{}),b=r["x-feedback"]||a.feedback||c.feedback,S=!!e[o]?.excludeFromSearch||!!e.theme?.[o]?.excludeFromSearch||!!t?.[o]?.excludeFromSearch||!!t?.theme?.[o]?.excludeFromSearch,x=e.rbac||s.rbac,g=E(b),k=c.metadata,O={...g&&{feedback:g},mockServer:A(e?.mockServer||t?.mockServer,d),disableRouter:!0,downloadUrls:a.downloadUrls||L(d,o),excludeFromSearch:S,rbac:x,markdownParser:P};let l;if(o==="graphql"){const n=a;l={title:n.info?.title,...k,...n.metadata??{}}}else{const n=r.info,F=n?.["x-metadata"];l={title:n?.title,description:n?.description,...o==="openapi"&&{summary:n?.summary},...k,...F}}o==="openapi"&&a.showSchemaCatalogLinks&&(r["x-schema-catalog-link"]=i(f,d));const C=a.markdocOptions??U,p={...a,...O,specType:o,markdocOptions:C,metadata:l};return o==="asyncapi"&&(p.protocol=M(r)??void 0),p}export{L as buildDownloadUrls,H as createOptions};
1
+ import*as F from"node:path";import{findFirstBinding as P,markdocParser as _}from"@redocly/api-docs";import{combineUrls as i}from"@redocly/theme/core/openapi";import{withPathPrefix as k}from"@redocly/theme/core/utils";import{GRAPHQL_SPEC_SLUG as w}from"../../../constants/common.js";import{PUBLIC_API_DEFINITIONS_FOLDER as f}from"../../constants/common.js";import{envConfig as L}from"../../config/env-config.js";import{deepMerge as M}from"../../../utils/object/deep-merge.js";import{normalizeFeedbackOptions as A}from"./utils/normalize-feedback-options.js";import{replaceFileExtension as g}from"./utils/replace-file-extension.js";import{relativePathToBaseSlug as B}from"./utils/relative-path-to-base-slug.js";const R={tags:{},nodes:{},components:{}};function D(o,r){if(!(o?.off!==!0))return o;const t=B(r);return{url:k(`/_mock${t}`),position:"first",description:"Mock server",...o}}function I(o,r){return(r==="graphql"?[i(w,`${g(o,F.posix.extname(o))}?download`)]:[i(f,`${g(o,".json")}?download`),i(f,`${g(o,".yaml")}?download`)]).map(t=>({url:k(t)}))}function j(o,r,m){const{rootConfig:t,config:c,apiConfig:s,mergedConfig:e,relativePath:l}=m,a=M(t?.[o]||{},c[o]||{},s[o]||s.theme?.[o]||{}),b=r["x-feedback"]||a.feedback||c.feedback,S=!!e[o]?.excludeFromSearch||!!e.theme?.[o]?.excludeFromSearch||!!t?.[o]?.excludeFromSearch||!!t?.theme?.[o]?.excludeFromSearch,x=e.rbac||s.rbac,p=A(b),u=c.metadata,C={...p&&{feedback:p},mockServer:D(e?.mockServer||t?.mockServer,l),disableRouter:!0,downloadUrls:a.downloadUrls||I(l,o),excludeFromSearch:S,rbac:x,markdownParser:_,replayFeatures:{graphql:L.REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED??!1}};let d;if(o==="graphql"){const n=a;d={title:n.info?.title,...u,...n.metadata??{}}}else{const n=r.info,E=n?.["x-metadata"];d={title:n?.title,description:n?.description,...o==="openapi"&&{summary:n?.summary},...u,...E}}o==="openapi"&&a.showSchemaCatalogLinks&&(r["x-schema-catalog-link"]=i(f,l));const O=a.markdocOptions??R,h={...a,...C,specType:o,markdocOptions:O,metadata:d};return o==="asyncapi"&&(h.protocol=P(r)??void 0),h}export{I as buildDownloadUrls,j as createOptions};
@@ -15,6 +15,6 @@ type AiDocumentsStoreParams = {
15
15
  getSearchFacets: () => Map<string, SearchFacet>;
16
16
  markdocTags?: Record<string, MarkdocTagSchema>;
17
17
  };
18
- export declare function getAiDocumentsStore({ items, metadata, store, document, specType, excludeFromSearch, basePath, getSearchFacets, markdocTags, }: AiDocumentsStoreParams): (route: PageRouteDetails, _staticData: unknown, context: AfterRoutesCreatedLifecycleContext, actions: AfterRoutesCreatedActions) => Promise<AiDocumentsStore | undefined>;
18
+ export declare function getAiDocumentsStore({ items, metadata, store, document, specType, excludeFromSearch, basePath, getSearchFacets, markdocTags, }: AiDocumentsStoreParams): (route: PageRouteDetails, _staticData: unknown, _context: AfterRoutesCreatedLifecycleContext, actions: AfterRoutesCreatedActions) => Promise<AiDocumentsStore | undefined>;
19
19
  export {};
20
20
  //# sourceMappingURL=get-ai-search-documents.d.ts.map
@@ -1,34 +1,34 @@
1
- import P from"node:path";import{REDOCLY_TEAMS_RBAC as O}from"@redocly/config";import{nodeTypes as h,contentType as g}from"@redocly/api-docs";import{normalizeApiVersion as sn}from"../utils/normalize-api-version.js";import{replaceFileExtension as v}from"../utils/replace-file-extension.js";import{isResourcePubliclyAccessible as cn,canDownloadApiDefinition as ln,extractTeamsFromScopeItems as fn}from"../../../utils/rbac.js";import{getLlmsTxtMdPathBySlug as J}from"../../../utils/llmstxt/get-llms-txt-md-path-by-slug.js";import{PUBLIC_API_DEFINITIONS_FOLDER as Q}from"../../../constants/common.js";import{GRAPHQL_SPEC_SLUG as an}from"../../../../constants/common.js";import{ANONYMOUS_AUTH_DETAILS as pn}from"../../../constants/rbac.js";import{toMarkdown as N}from"../../markdown/search/to-markdown.js";import{createRenderTagFn as un}from"../../markdown/search/create-render-tag-fn.js";import{getLocaleFromRelativePath as dn}from"../../../fs/utils/get-locale-from-relative-path.js";import{getBuildTranslateContext as hn}from"../../../utils/l10n/get-build-translate-context.js";import{llmsTxtLink as w}from"../../search/llmstxt/index.js";import{formatDocumentMetadata as mn}from"../../search/utils.js";import{extractDocumentSearchFacets as $n}from"./search-facets.js";import{createApiDocsSearchIndexer as gn}from"./create-indexer.js";function A(t,r){return r==="openapi"&&"openapi"in t}function H(t,r){return r==="asyncapi"&&"asyncapi"in t}function Qn({items:t,metadata:r,store:s,document:n,specType:o,excludeFromSearch:i,basePath:e,getSearchFacets:l,markdocTags:c}){return async(f,a,u,d)=>{if(i)return;const m={...d.markdocOptions?.tags,...c},{locale:X,translate:Z}=await hn(f.slug,d.getGlobalData?.().l10n),C=un(m,X,Z),x=await u.getConfig(),L=dn(f.fsPath),j=gn(e,s?.schemaStore,n,s?.exampleStore),M=y=>{for(const p of y)j.addItem(p),p.items?.length&&M(p.items)};M(t);const nn=j.getResult(),V=new Map;for(const y of nn)V.set(y.url,y);const R=typeof r.title=="string"?r.title:void 0,_=sn(r.version),D=$n(f.metadata||{},R,_,l),S=[],I=[],q=yn(r,n,o),F=bn(o,r,f.fsPath,x),tn=In(t,x,C),en=q+F+`
2
- `+tn,on=q+F;I.push({title:R||"API Overview",description:typeof r.description=="string"?r.description:void 0,content:en,slug:e,fsPath:f.fsPath,includeInLLMsTxt:!0}),S.push({title:R||"API Overview",content:on,url:e,fsPath:f.fsPath,locale:L,product:f.product?.name,facets:D});const rn=n&&A(n,o)?n.security:void 0,E=y=>{for(const p of y){if(!p.content||!p.link){p.items?.length&&E(p.items);continue}const k=V.get(p.link),G=p.content.contentType,z=p[O],W=z?fn(z):void 0,B=W?.length?W:void 0;if(G===g.ITEM){const $=Pn(p,n,o)??Y(p,k,o,_,rn,C);if($){const b=p.label||"";I.push({title:b,description:void 0,content:$,slug:p.link,fsPath:f.fsPath,includeInLLMsTxt:!1}),S.push({title:b,content:$,url:p.link,fsPath:f.fsPath,locale:L,product:f.product?.name,facets:D,rbacTeams:B})}}else if(G===g.GROUP){const $=On(p,x,o,C);if($){const b=p.label||"";I.push({title:b,description:k?Rn(k.text):void 0,content:$.llmstxt,slug:p.link,fsPath:f.fsPath,includeInLLMsTxt:!1}),S.push({title:b,content:$.aiSearch,url:p.link,fsPath:f.fsPath,locale:L,product:f.product?.name,facets:D,rbacTeams:B})}}p.items?.length&&E(p.items)}};return E(t),{async getLLMsTxts(){return I},async getSearchDocuments(){return S}}}}function yn(t,r,s){const n=typeof t.title=="string"?t.title:"",o=typeof t.description=="string"?t.description:"",i=typeof t.summary=="string"?t.summary:"",e=typeof t.version=="string"?t.version:"";let l=n?`# ${n}
1
+ import P from"node:path";import{REDOCLY_TEAMS_RBAC as O}from"@redocly/config";import{nodeTypes as h,contentType as y}from"@redocly/api-docs";import{normalizeApiVersion as sn}from"../utils/normalize-api-version.js";import{replaceFileExtension as U}from"../utils/replace-file-extension.js";import{isResourcePubliclyAccessible as cn,canDownloadApiDefinition as ln,extractTeamsFromScopeItems as fn}from"../../../utils/rbac.js";import{getLlmsTxtMdPathBySlug as J}from"../../../utils/llmstxt/get-llms-txt-md-path-by-slug.js";import{PUBLIC_API_DEFINITIONS_FOLDER as Q}from"../../../constants/common.js";import{GRAPHQL_SPEC_SLUG as an}from"../../../../constants/common.js";import{ANONYMOUS_AUTH_DETAILS as pn}from"../../../constants/rbac.js";import{toMarkdown as v}from"../../markdown/search/to-markdown.js";import{createRenderTagFn as un}from"../../markdown/search/create-render-tag-fn.js";import{getLocaleFromRelativePath as dn}from"../../../fs/utils/get-locale-from-relative-path.js";import{getBuildTranslateContext as hn}from"../../../utils/l10n/get-build-translate-context.js";import{llmsTxtLink as N}from"../../search/llmstxt/index.js";import{formatDocumentMetadata as mn}from"../../search/utils.js";import{extractDocumentSearchFacets as $n}from"./search-facets.js";import{createApiDocsSearchIndexer as yn}from"./create-indexer.js";function A(t,o){return o==="openapi"&&"openapi"in t}function H(t,o){return o==="asyncapi"&&"asyncapi"in t}function Qn({items:t,metadata:o,store:s,document:n,specType:r,excludeFromSearch:i,basePath:e,getSearchFacets:l,markdocTags:c}){return async(f,a,u,d)=>{if(i)return;const m={...d.markdocOptions?.tags,...c},{locale:X,translate:Z}=await hn(f.slug,d.getGlobalData?.().l10n),x=un(m,X,Z),C=d.getConfig(),L=dn(f.fsPath),j=yn(e,s?.schemaStore,n,s?.exampleStore),M=g=>{for(const p of g)j.addItem(p),p.items?.length&&M(p.items)};M(t);const nn=j.getResult(),V=new Map;for(const g of nn)V.set(g.url,g);const R=typeof o.title=="string"?o.title:void 0,_=sn(o.version),D=$n(f.metadata||{},R,_,l),S=[],I=[],q=gn(o,n,r),F=bn(r,o,f.fsPath,C),tn=In(t,C,x),en=q+F+`
2
+ `+tn,on=q+F;I.push({title:R||"API Overview",description:typeof o.description=="string"?o.description:void 0,content:en,slug:e,fsPath:f.fsPath,includeInLLMsTxt:!0}),S.push({title:R||"API Overview",content:on,url:e,fsPath:f.fsPath,locale:L,product:f.product?.name,facets:D});const rn=n&&A(n,r)?n.security:void 0,E=g=>{for(const p of g){if(!p.content||!p.link){p.items?.length&&E(p.items);continue}const k=V.get(p.link),G=p.content.contentType,z=p[O],W=z?fn(z):void 0,B=W?.length?W:void 0;if(G===y.ITEM){const $=Pn(p,n,r)??Y(p,k,r,_,rn,x);if($){const b=p.label||"";I.push({title:b,description:void 0,content:$,slug:p.link,fsPath:f.fsPath,includeInLLMsTxt:!1}),S.push({title:b,content:$,url:p.link,fsPath:f.fsPath,locale:L,product:f.product?.name,facets:D,rbacTeams:B})}}else if(G===y.GROUP){const $=On(p,C,r,x);if($){const b=p.label||"";I.push({title:b,description:k?Rn(k.text):void 0,content:$.llmstxt,slug:p.link,fsPath:f.fsPath,includeInLLMsTxt:!1}),S.push({title:b,content:$.aiSearch,url:p.link,fsPath:f.fsPath,locale:L,product:f.product?.name,facets:D,rbacTeams:B})}}p.items?.length&&E(p.items)}};return E(t),{async getLLMsTxts(){return I},async getSearchDocuments(){return S}}}}function gn(t,o,s){const n=typeof t.title=="string"?t.title:"",r=typeof t.description=="string"?t.description:"",i=typeof t.summary=="string"?t.summary:"",e=typeof t.version=="string"?t.version:"";let l=n?`# ${n}
3
3
 
4
- `:"";if(l+=o?`${o}
4
+ `:"";if(l+=r?`${r}
5
5
 
6
6
  `:"",l+=i?`${i}
7
7
 
8
8
  `:"",l+=e?`Version: ${e}
9
- `:"",r){if(A(r,s)){const{info:c}=r;c?.license?.name&&(l+=`License: ${c.license.name}
9
+ `:"",o){if(A(o,s)){const{info:c}=o;c?.license?.name&&(l+=`License: ${c.license.name}
10
10
  `);const f=c["x-metadata"],a=mn(f);a&&(l+=`
11
11
  Metadata:
12
12
  ${a}
13
- `)}else if(H(r,s)){const{info:c}=r;c?.license?.name&&(l+=`License: ${c.license.name}
13
+ `)}else if(H(o,s)){const{info:c}=o;c?.license?.name&&(l+=`License: ${c.license.name}
14
14
  `)}}return l+=`
15
- `,l+=An(r,s),l+=Sn(r,s),l}function bn(t,r,s,n){if(!s)return"";let o,i,e;if(t==="openapi")o=P.posix.join(Q,v(s,".yaml")),i="## Download OpenAPI description",e="OpenAPI definition";else if(t==="asyncapi")o=P.posix.join(Q,v(s,".yaml")),i="## Download AsyncAPI description",e="AsyncAPI definition";else if(t==="graphql"){const f=P.posix.extname(s)||".graphql";o=P.posix.join(an,v(s,f)),i="## Download GraphQL schema",e="GraphQL schema"}else return"";if(!ln(o,n.access?.rbac??{},n.access?.requiresLogin??!1,pn))return"";const c=typeof r.title=="string"&&r.title||e;return`${i}
15
+ `,l+=An(o,s),l+=Sn(o,s),l}function bn(t,o,s,n){if(!s)return"";let r,i,e;if(t==="openapi")r=P.posix.join(Q,U(s,".yaml")),i="## Download OpenAPI description",e="OpenAPI definition";else if(t==="asyncapi")r=P.posix.join(Q,U(s,".yaml")),i="## Download AsyncAPI description",e="AsyncAPI definition";else if(t==="graphql"){const f=P.posix.extname(s)||".graphql";r=P.posix.join(an,U(s,f)),i="## Download GraphQL schema",e="GraphQL schema"}else return"";if(!ln(r,n.access?.rbac??{},n.access?.requiresLogin??!1,pn))return"";const c=typeof o.title=="string"&&o.title||e;return`${i}
16
16
 
17
- - ${w({title:c,description:void 0,slug:o})}`}function An(t,r){if(!t)return"";if(A(t,r)){const{servers:s}=t;if(!s?.length)return"";let n=`## Servers
17
+ - ${N({title:c,description:void 0,slug:r,siteUrl:n.seo?.siteUrl})}`}function An(t,o){if(!t)return"";if(A(t,o)){const{servers:s}=t;if(!s?.length)return"";let n=`## Servers
18
18
 
19
- `;for(const o of s)if(o.description&&(n+=`${o.description}
19
+ `;for(const r of s)if(r.description&&(n+=`${r.description}
20
20
  `),n+=`\`\`\`
21
- ${o.url}
21
+ ${r.url}
22
22
  \`\`\`
23
23
 
24
- `,o.variables){n+=`Variables:
25
- `;for(const[i,e]of Object.entries(o.variables))n+=`- \`${i}\`${e.description?`: ${e.description}`:""}
24
+ `,r.variables){n+=`Variables:
25
+ `;for(const[i,e]of Object.entries(r.variables))n+=`- \`${i}\`${e.description?`: ${e.description}`:""}
26
26
  `,e.default&&(n+=` Default: ${JSON.stringify(e.default)}
27
27
  `),e.enum&&(n+=` Enum: ${e.enum.map(l=>JSON.stringify(l)).join(", ")}
28
28
  `);n+=`
29
- `}return n}if(H(t,r)){const{servers:s}=t;if(!s||!Object.keys(s).length)return"";let n=`## Servers
29
+ `}return n}if(H(t,o)){const{servers:s}=t;if(!s||!Object.keys(s).length)return"";let n=`## Servers
30
30
 
31
- `;for(const[o,i]of Object.entries(s))n+=`### ${o}
31
+ `;for(const[r,i]of Object.entries(s))n+=`### ${r}
32
32
 
33
33
  `,i.description&&(n+=`${i.description}
34
34
  `),i.host&&(n+=`Host: ${i.host}
@@ -36,9 +36,9 @@ ${o.url}
36
36
  `),i.protocolVersion&&(n+=`Protocol Version: ${i.protocolVersion}
37
37
  `),i.pathname&&(n+=`Pathname: ${i.pathname}
38
38
  `),n+=`
39
- `;return n}return""}function Sn(t,r){if(!t||!A(t,r))return"";const s=t.components?.securitySchemes;if(!s)return"";let n=`## Security
39
+ `;return n}return""}function Sn(t,o){if(!t||!A(t,o))return"";const s=t.components?.securitySchemes;if(!s)return"";let n=`## Security
40
40
 
41
- `;for(const[o,i]of Object.entries(s)){if(!i||"$ref"in i)continue;const e=i;n+=`### ${o}
41
+ `;for(const[r,i]of Object.entries(s)){if(!i||"$ref"in i)continue;const e=i;n+=`### ${r}
42
42
 
43
43
  `,e.description&&(n+=`${e.description}
44
44
 
@@ -53,43 +53,43 @@ ${o.url}
53
53
  `),c.scopes)){n+=`Scopes:
54
54
  `;for(const[f,a]of Object.entries(c.scopes))n+=`- \`${f}\`: ${a}
55
55
  `}n+=`
56
- `}return n}function In(t,r,s){let n="";const o=(i,e)=>{for(const l of i)if(l.link){if(l.content?.contentType===g.GROUP)n+=`${e} ${l.label||""}
56
+ `}return n}function In(t,o,s){let n="";const r=(i,e)=>{for(const l of i)if(l.link){if(l.content?.contentType===y.GROUP)n+=`${e} ${l.label||""}
57
57
 
58
- `,l.items?.length&&o(l.items,e+"#");else if(l.content?.contentType===g.ITEM){if(!U(l,r))continue;const c=l,f=c.httpVerb,a=c.httpPath,u=f&&a?`${f.toUpperCase()} ${a}`:l.label||"",d=l.content?T(l.content.children,s):void 0;n+=` - ${w({title:u,description:d?d.slice(0,200):void 0,slug:J(l.link)})}`}}};return o(t,"##"),n}function Y(t,r,s,n,o,i){if(!t.content)return;const e=t,l=t.label||"",c=T(t.content.children,i),f=t.content.meta?.deprecated;let a=`# ${l}${f?" (deprecated)":""}
58
+ `,l.items?.length&&r(l.items,e+"#");else if(l.content?.contentType===y.ITEM){if(!w(l,o))continue;const c=l,f=c.httpVerb,a=c.httpPath,u=f&&a?`${f.toUpperCase()} ${a}`:l.label||"",d=l.content?T(l.content.children,s):void 0;n+=` - ${N({title:u,description:d?d.slice(0,200):void 0,slug:J(l.link),siteUrl:o.seo?.siteUrl})}`}}};return r(t,"##"),n}function Y(t,o,s,n,r,i){if(!t.content)return;const e=t,l=t.label||"",c=T(t.content.children,i),f=t.content.meta?.deprecated;let a=`# ${l}${f?" (deprecated)":""}
59
59
 
60
60
  `;if(c&&(a+=`${c}
61
61
 
62
62
  `),s==="openapi"||s==="asyncapi"){const u=e.httpVerb,d=e.httpPath;u&&d?a+=`Endpoint: ${u.toUpperCase()} ${d}
63
63
  `:u&&(a+=`Method: ${u.toUpperCase()}
64
64
  `),n&&(a+=`Version: ${n}
65
- `);const m=Tn(t.content.children,o);m&&(a+=`Security: ${m}
66
- `)}return r?.parameters?.length&&s!=="graphql"&&(a+=`
67
- `+Cn(r.parameters)+`
68
- `),s==="graphql"&&(a+=xn(t.content.children)),a}function Pn(t,r,s){if(t.httpVerb!=="tool"||!r||!A(r,s))return;const n=t.content?.meta?.name,o=n?r["x-mcp"]?.tools?.find(e=>e.name===n):void 0;if(!o)return;let i=`# ${t.label||o.name}
65
+ `);const m=Tn(t.content.children,r);m&&(a+=`Security: ${m}
66
+ `)}return o?.parameters?.length&&s!=="graphql"&&(a+=`
67
+ `+xn(o.parameters)+`
68
+ `),s==="graphql"&&(a+=Cn(t.content.children)),a}function Pn(t,o,s){if(t.httpVerb!=="tool"||!o||!A(o,s))return;const n=t.content?.meta?.name,r=n?o["x-mcp"]?.tools?.find(e=>e.name===n):void 0;if(!r)return;let i=`# ${t.label||r.name}
69
69
 
70
- `;return typeof o.description=="string"&&o.description&&(i+=`${o.description}
70
+ `;return typeof r.description=="string"&&r.description&&(i+=`${r.description}
71
71
 
72
72
  `),i+=`## Input schema:
73
73
 
74
74
  `,i+=`\`\`\`json
75
- ${JSON.stringify(o.inputSchema,null,2)}
75
+ ${JSON.stringify(r.inputSchema,null,2)}
76
76
  \`\`\`
77
77
 
78
- `,o.outputSchema&&(i+=`## Output schema:
78
+ `,r.outputSchema&&(i+=`## Output schema:
79
79
 
80
80
  `,i+=`\`\`\`json
81
- ${JSON.stringify(o.outputSchema,null,2)}
81
+ ${JSON.stringify(r.outputSchema,null,2)}
82
82
  \`\`\`
83
83
 
84
- `),i}function On(t,r,s,n){if(!t.content)return;const o=t.label||"",i=T(t.content.children,n);let e=`# ${o}
84
+ `),i}function On(t,o,s,n){if(!t.content)return;const r=t.label||"",i=T(t.content.children,n);let e=`# ${r}
85
85
 
86
86
  `;if(i&&(e+=`${i}
87
87
 
88
- `),s==="graphql"){let c="";const f=a=>{for(const u of a??[])if(!(!u.content||!U(u,r)))if(u.content.contentType===g.ITEM){const d=Y(u,void 0,s,void 0,void 0,n);d&&(c+=`${d}
88
+ `),s==="graphql"){let c="";const f=a=>{for(const u of a??[])if(!(!u.content||!w(u,o)))if(u.content.contentType===y.ITEM){const d=Y(u,void 0,s,void 0,void 0,n);d&&(c+=`${d}
89
89
 
90
90
  ---
91
91
 
92
- `)}else u.content.contentType===g.GROUP&&f(u.items)};return f(t.items),{llmstxt:e+c,aiSearch:e}}let l="";if(t.items?.length)for(const c of t.items){if(!c.link||!c.content||c.content.contentType!==g.ITEM||!U(c,r))continue;const f=c,a=f.httpVerb,u=f.httpPath,d=a&&u?`${a.toUpperCase()} ${u}`:c.label||"",m=c.content?T(c.content.children,n):void 0;l+=` - ${w({title:d,description:m?m.slice(0,200):void 0,slug:J(c.link)})}`}return{llmstxt:e+l,aiSearch:e}}function Tn(t,r){const s=[],n=o=>{for(const i of o)if(i.nodeType===h.SECURITY){const e=i;for(const l of e.requirements)for(const c of l.schemes)c[O]||c.name&&!s.includes(c.name)&&s.push(c.name)}else(i.nodeType===h.CONTAINER||i.nodeType===h.OVERVIEW_SECTION_WRAPPER)&&n(i.children)};if(n(t),s.length)return s.join(", ");if(r?.length){const o=r.flatMap(i=>Object.keys(i));if(o.length)return[...new Set(o)].join(", ")}}function Cn(t){const r={};for(const n of t){const o=`${n.place}${n.mediaType?` (${n.mediaType})`:""}`;r[o]||(r[o]=[]),r[o].push(n)}return Object.entries(r).map(([n,o])=>{const i=o.map(e=>{const l=[...e.path||[],e.name],c=Array.isArray(e.description)?e.description.join(" "):e.description;let f=` - \`${l.join(".")}\` (${e.type}${e.required?", required":""})
92
+ `)}else u.content.contentType===y.GROUP&&f(u.items)};return f(t.items),{llmstxt:e+c,aiSearch:e}}let l="";if(t.items?.length)for(const c of t.items){if(!c.link||!c.content||c.content.contentType!==y.ITEM||!w(c,o))continue;const f=c,a=f.httpVerb,u=f.httpPath,d=a&&u?`${a.toUpperCase()} ${u}`:c.label||"",m=c.content?T(c.content.children,n):void 0;l+=` - ${N({title:d,description:m?m.slice(0,200):void 0,slug:J(c.link),siteUrl:o.seo?.siteUrl})}`}return{llmstxt:e+l,aiSearch:e}}function Tn(t,o){const s=[],n=r=>{for(const i of r)if(i.nodeType===h.SECURITY){const e=i;for(const l of e.requirements)for(const c of l.schemes)c[O]||c.name&&!s.includes(c.name)&&s.push(c.name)}else(i.nodeType===h.CONTAINER||i.nodeType===h.OVERVIEW_SECTION_WRAPPER)&&n(i.children)};if(n(t),s.length)return s.join(", ");if(o?.length){const r=o.flatMap(i=>Object.keys(i));if(r.length)return[...new Set(r)].join(", ")}}function xn(t){const o={};for(const n of t){const r=`${n.place}${n.mediaType?` (${n.mediaType})`:""}`;o[r]||(o[r]=[]),o[r].push(n)}return Object.entries(o).map(([n,r])=>{const i=r.map(e=>{const l=[...e.path||[],e.name],c=Array.isArray(e.description)?e.description.join(" "):e.description;let f=` - \`${l.join(".")}\` (${e.type}${e.required?", required":""})
93
93
  `;return c&&(f+=` ${c.trim()}
94
94
  `),e.enum?f+=` Enum: ${e.enum.map(a=>JSON.stringify(a)).join(", ")}
95
95
  `:e.example&&(f+=` Example: ${e.example}
@@ -97,9 +97,9 @@ ${JSON.stringify(o.outputSchema,null,2)}
97
97
 
98
98
  ${i.join(`
99
99
  `)}`}).join(`
100
- `)}function xn(t){let r="";const s=n=>{for(const o of n)if(o.nodeType===h.ITEM){const i=o;i.graphqlSchema&&(r+=Ln(i.graphqlSchema,i.variant))}else(o.nodeType===h.CONTAINER||o.nodeType===h.OVERVIEW_SECTION_WRAPPER)&&s(o.children)};return s(t),r}function Ln(t,r){let n=`
101
- ## ${K(r==="return-type"?"Return type":r==="graphql-args"||r==="arguments"?"Arguments":r==="graphql-fields"?"Fields":r)}:
100
+ `)}function Cn(t){let o="";const s=n=>{for(const r of n)if(r.nodeType===h.ITEM){const i=r;i.graphqlSchema&&(o+=Ln(i.graphqlSchema,i.variant))}else(r.nodeType===h.CONTAINER||r.nodeType===h.OVERVIEW_SECTION_WRAPPER)&&s(r.children)};return s(t),o}function Ln(t,o){let n=`
101
+ ## ${K(o==="return-type"?"Return type":o==="graphql-args"||o==="arguments"?"Arguments":o==="graphql-fields"?"Fields":o)}:
102
102
 
103
- `;const o=i=>{const e=i.description?N(Array.isArray(i.description)?i.description:[i.description]).trim():"";return` - \`${i.name}\` (${i.type})${e?`: ${e}`:""}
104
- `};if(!Array.isArray(t)){const i=t.description?N(Array.isArray(t.description)?t.description:[t.description]).trim():"";n+=` Type: ${t.type}`,i&&(n+=` - ${i}`),n+=`
105
- `;for(const e of t.fields??[])n+=o(e);return n}if(!t.length)return"";for(const i of t)n+=o(i);return n}function T(t,r){const s=[],n=i=>{for(const e of i)if(e.nodeType===h.MARKDOC){const l=e.content,c=Array.isArray(l)?l:[l],f=N(c,{renderTag:r}).trim();f&&s.push(f)}else(e.nodeType===h.CONTAINER||e.nodeType===h.OVERVIEW_SECTION_WRAPPER)&&n(e.children)};return n(t),s.join(" ").trim()||void 0}function Rn(t){return(Array.isArray(t)?t.join(" "):t)||void 0}function K(t){return t.charAt(0).toUpperCase()+t.slice(1)}function U(t,r){return r.access?.requiresLogin?!0:cn({slug:t.link||"",[O]:t[O]},r)}export{Qn as getAiDocumentsStore};
103
+ `;const r=i=>{const e=i.description?v(Array.isArray(i.description)?i.description:[i.description]).trim():"";return` - \`${i.name}\` (${i.type})${e?`: ${e}`:""}
104
+ `};if(!Array.isArray(t)){const i=t.description?v(Array.isArray(t.description)?t.description:[t.description]).trim():"";n+=` Type: ${t.type}`,i&&(n+=` - ${i}`),n+=`
105
+ `;for(const e of t.fields??[])n+=r(e);return n}if(!t.length)return"";for(const i of t)n+=r(i);return n}function T(t,o){const s=[],n=i=>{for(const e of i)if(e.nodeType===h.MARKDOC){const l=e.content,c=Array.isArray(l)?l:[l],f=v(c,{renderTag:o}).trim();f&&s.push(f)}else(e.nodeType===h.CONTAINER||e.nodeType===h.OVERVIEW_SECTION_WRAPPER)&&n(e.children)};return n(t),s.join(" ").trim()||void 0}function Rn(t){return(Array.isArray(t)?t.join(" "):t)||void 0}function K(t){return t.charAt(0).toUpperCase()+t.slice(1)}function w(t,o){return o.access?.requiresLogin?!0:cn({slug:t.link||"",[O]:t[O]},o)}export{Qn as getAiDocumentsStore};
@@ -1 +1 @@
1
- import d from"path";import{combineUrls as c}from"@redocly/theme/core/utils";import{VERSION_SEPARATOR as p}from"../../../constants/common.js";import{removeTrailingSlash as h}from"../../../../utils/url/remove-trailing-slash.js";import{slash as V}from"../../../../utils/path/slash.js";import{logger as w}from"../../../tools/notifiers/logger.js";import{getDefaultVersionByPath as D}from"./versions-config-loader.js";import{GithubSlugger as E,slug as S}from"../../../utils/index.js";import{parseBaseName as F}from"../../utils.js";const I=new Set([".jpg",".jpeg",".png",".gif",".webp",".svg",".ico",".avif",".mp3",".wav",".ogg",".m4a",".mp4",".avi",".mov",".webm",".pdf",".doc",".docx",".zip",".rar",".gz",".ttf",".woff",".woff2"]),A=async(i,{fs:e,cache:n})=>{const a=w.startTiming(),r=(await n.load("versions-config","versions-config")).data,t=new Map,l=new Map,o=new Set,s={pageVsPage:0,dirVsDir:0},g=new E;l.set(".","/"),l.set("/","/");const f=e.scan().sort((u,m)=>m.relativePath.localeCompare(u.relativePath));for(const{relativePath:u}of f){if(I.has(d.posix.extname(u)))continue;const{data:m}=await n.load(u,"is-ignored");if(m)continue;const b=V(u).replace(new RegExp("^(@i18n|@l10n)\\/"),""),v=D(u,r);N(b,{defaultVersion:v,fileSlugs:t,dirSlugs:l,allFileSlugsList:o,githubSlugger:g,collisions:s})}return w.verboseTime(a,"Calculated slugs. Number of file paths processed: "+f.length),{fileSlugs:t,dirSlugs:l,collisions:s}};function N(i,e){const n=e.fileSlugs.get(i);if(n)return n;let a=d.posix.dirname(i);const r=z(a,e)||"",{baseName:t,isIndexFile:l}=F(i),o=e.dirSlugs.has(d.posix.join(a,t));let s;if(!l&&o){const g=S(c(r,t));e.allFileSlugsList.has(g)||(s=g)}if(!s){const g=l?e.dirSlugs.get(a):void 0;if(g)s=g;else{const f=c(r,t),u=S(f);s=e.githubSlugger.slug(f),s!==u&&e.collisions.pageVsPage++}}s=h(s),e.fileSlugs.set(i,s),e.allFileSlugsList.add(s)}function z(i,e){if(e.dirSlugs.has(i))return e.dirSlugs.get(i);const n=h(d.posix.normalize(i)).split("/");let a="/",r="";for(const t of n){r=d.posix.join(r,t);const l=T(t,e.defaultVersion);let o=e.dirSlugs.get(r);if(!o){const s=c("/",a,l),g=S(s);o=e.githubSlugger.slug(s),o!==g&&e.collisions.dirVsDir++}o.endsWith("/")||(o=o+"/"),e.dirSlugs.set(r,o),a=o}return e.dirSlugs.get(i)}function T(i,e){if(!i.startsWith(p))return i;const n=i.substring(p.length);return n===e?"":n}export{I as IGNORED_EXTS,A as contentSlugsLoader};
1
+ import f from"path";import{combineUrls as S}from"@redocly/theme/core/utils";import{VERSION_SEPARATOR as b}from"../../../constants/common.js";import{removeTrailingSlash as v}from"../../../../utils/url/remove-trailing-slash.js";import{slash as E}from"../../../../utils/path/slash.js";import{logger as m}from"../../../tools/notifiers/logger.js";import{getDefaultVersionByPath as I}from"./versions-config-loader.js";import{GithubSlugger as N,slug as h}from"../../../utils/index.js";import{isPartial as z}from"../../markdown/is-partial.js";import{parseBaseName as T}from"../../utils.js";const j=new Set([".jpg",".jpeg",".png",".gif",".webp",".svg",".ico",".avif",".mp3",".wav",".ogg",".m4a",".mp4",".avi",".mov",".webm",".pdf",".doc",".docx",".zip",".rar",".gz",".ttf",".woff",".woff2"]),U=async(i,{fs:s,cache:r,getConfig:l})=>{const t=m.startTiming(),g=(await r.load("versions-config","versions-config")).data,{markdown:u}=await l(),o=u?.partialsFolders??[],e=new Map,n=new Map,c=new Set,d={pageVsPage:0,dirVsDir:0},D=new N;n.set(".","/"),n.set("/","/");const w=s.scan().sort((a,p)=>p.relativePath.localeCompare(a.relativePath));for(const{relativePath:a}of w){if(j.has(f.posix.extname(a)))continue;const{data:p}=await r.load(a,"is-ignored");if(p||f.posix.extname(a)===".md"&&z(a,o))continue;const F=E(a).replace(new RegExp("^(@i18n|@l10n)\\/"),""),V=I(a,g);y(F,{defaultVersion:V,fileSlugs:e,dirSlugs:n,allFileSlugsList:c,githubSlugger:D,collisions:d})}return m.verboseTime(t,"Calculated slugs. Number of file paths processed: "+w.length),{fileSlugs:e,dirSlugs:n,collisions:d}};function y(i,s){const r=s.fileSlugs.get(i);if(r)return r;let l=f.posix.dirname(i);const t=L(l,s)||"",{baseName:g,isIndexFile:u}=T(i),o=s.dirSlugs.has(f.posix.join(l,g));let e;if(!u&&o){const n=h(S(t,g));s.allFileSlugsList.has(n)||(e=n)}if(!e){const n=u?s.dirSlugs.get(l):void 0;if(n)e=n;else{const c=S(t,g),d=h(c);e=s.githubSlugger.slug(c),e!==d&&(s.collisions.pageVsPage++,m.verbose("File slug collision: %s wanted %s, assigned %s",i,d,e))}}e=v(e),s.fileSlugs.set(i,e),s.allFileSlugsList.add(e)}function L(i,s){if(s.dirSlugs.has(i))return s.dirSlugs.get(i);const r=v(f.posix.normalize(i)).split("/");let l="/",t="";for(const g of r){t=f.posix.join(t,g);const u=P(g,s.defaultVersion);let o=s.dirSlugs.get(t);if(!o){const e=S("/",l,u),n=h(e);o=s.githubSlugger.slug(e),o!==n&&(s.collisions.dirVsDir++,m.verbose("Directory slug collision: %s wanted %s, assigned %s",t,n,o))}o.endsWith("/")||(o=o+"/"),s.dirSlugs.set(t,o),l=o}return s.dirSlugs.get(i)}function P(i,s){if(!i.startsWith(b))return i;const r=i.substring(b.length);return r===s?"":r}export{j as IGNORED_EXTS,U as contentSlugsLoader};
@@ -1 +1 @@
1
- import*as e from"react";import{useMutation as h,useQueryClient as P}from"@tanstack/react-query";import{useParams as D}from"react-router";import{Button as k}from"@redocly/theme/components/Button/Button";import{H2 as A}from"@redocly/theme/components/Typography/H2";import{Admonition as S}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as T}from"../../../../../client/app/hooks";import{Dialog as w}from"./Dialog";import{ButtonWithLoading as I}from"./ButtonWithLoading";import{ButtonsContainer as K}from"./RollAPIKey";import{DialogInputMultiline as O,DialogRow as R,DialogRowContent as x}from"./DialogStyledComponents";import{MAX_DESCRIPTION_LENGTH as p,CharacterCounter as B}from"./CharacterCounter";const G=u=>{const{id:o}=D(),{initialDescription:g,open:y,onOpen:f,onClose:s}=u,t=g||"",{translate:a}=T(),[n,i]=e.useState(t);e.useEffect(()=>{i(t)},[t]);const c=async()=>{await C(),s()},E=l=>{l.key==="Enter"&&!r&&c()},d=()=>{s(),i(t)},v=P(),{mutateAsync:C,isPending:r,error:m}=h({mutationKey:["UPDATE_APP"+o],mutationFn:()=>fetch(`/api/api-keys/apps/${o}`,{method:"PUT",body:JSON.stringify({description:n})}),onSettled:()=>{v.invalidateQueries({queryKey:["APP:"+o]}),i(n)}});return e.createElement(w,{open:y,onClose:d,onOpen:f},e.createElement(e.Fragment,null,e.createElement(A,{"data-translation-key":"dev.edit.description.dialog.title"},a("dev.edit.description.dialog.title","Change description")),e.createElement(R,null,e.createElement(x,null,e.createElement(O,{maxLength:p,value:n,onChange:l=>i(l.target.value),onKeyPress:E,rows:6,cols:60}))),e.createElement(B,null,n.length,"/",p),m&&e.createElement(S,{type:"danger"},m.message," "),e.createElement(K,null,e.createElement(k,{onClick:d,"data-translation-key":"dev.edit.description.dialog.cancel",variant:"text",size:"large"},a("dev.edit.description.dialog.cancel","Cancel")),e.createElement(I,{variant:"primary",loading:r,onClick:c,disabled:r,"data-translation-key":"dev.edit.description.dialog.save"},a("dev.edit.description.dialog.save","Save changes")))))};export{G as EditAppDescriptionDialog};
1
+ import*as e from"react";import{useMutation as E,useQueryClient as C}from"@tanstack/react-query";import{useParams as f}from"react-router";import{Button as v}from"@redocly/theme/components/Button/Button";import{H2 as D}from"@redocly/theme/components/Typography/H2";import{Admonition as h}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as P}from"../../../../../client/app/hooks";import{Dialog as A}from"./Dialog";import{ButtonWithLoading as k}from"./ButtonWithLoading";import{ButtonsContainer as S}from"./RollAPIKey";import{DialogInputMultiline as T,DialogRow as w,DialogRowContent as K}from"./DialogStyledComponents";import{MAX_DESCRIPTION_LENGTH as d,CharacterCounter as O}from"./CharacterCounter";const Q=o=>{const{initialDescription:n,open:a,onOpen:i,onClose:t}=o;return e.createElement(A,{open:a,onClose:t,onOpen:i},e.createElement(R,{initialDescription:n,onClose:t}))},R=o=>{const{id:n}=f(),{initialDescription:a,onClose:i}=o,{translate:t}=P(),[r,p]=e.useState(a||""),c=async()=>{await y(),i()},u=s=>{s.key==="Enter"&&!l&&c()},g=C(),{mutateAsync:y,isPending:l,error:m}=E({mutationKey:["UPDATE_APP"+n],mutationFn:()=>fetch(`/api/api-keys/apps/${n}`,{method:"PUT",body:JSON.stringify({description:r})}),onSettled:()=>{g.invalidateQueries({queryKey:["APP:"+n]})}});return e.createElement(e.Fragment,null,e.createElement(D,{"data-translation-key":"dev.edit.description.dialog.title"},t("dev.edit.description.dialog.title","Change description")),e.createElement(w,null,e.createElement(K,null,e.createElement(T,{maxLength:d,value:r,onChange:s=>p(s.target.value),onKeyPress:u,rows:6,cols:60}))),e.createElement(O,null,r.length,"/",d),m&&e.createElement(h,{type:"danger"},m.message," "),e.createElement(S,null,e.createElement(v,{onClick:i,"data-translation-key":"dev.edit.description.dialog.cancel",variant:"text",size:"large"},t("dev.edit.description.dialog.cancel","Cancel")),e.createElement(k,{variant:"primary",loading:l,onClick:c,disabled:l,"data-translation-key":"dev.edit.description.dialog.save"},t("dev.edit.description.dialog.save","Save changes"))))};export{Q as EditAppDescriptionDialog};
@@ -1 +1 @@
1
- import*as e from"react";import{useMutation as A,useQueryClient as D}from"@tanstack/react-query";import{useParams as S}from"react-router";import{Button as N}from"@redocly/theme/components/Button/Button";import{H2 as w}from"@redocly/theme/components/Typography/H2";import{Admonition as I}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as K}from"../../../../../client/app/hooks";import{Dialog as O}from"./Dialog";import{ButtonWithLoading as R}from"./ButtonWithLoading";import{ButtonsContainer as B}from"./RollAPIKey";import{DialogInput as T,DialogRow as $,DialogRowContent as b}from"./DialogStyledComponents";const M=e.forwardRef((g,f)=>{const{id:o}=S(),{appName:y,appDisplayName:v}=g,t=v||y||"",[a,n]=e.useState(t),[E,m]=e.useState(!1),h=s=>n(s.target.value),{translate:i}=K(),p=async()=>{await k(),l()},C=s=>{s.key==="Enter"&&!r&&u&&p()},d=()=>{m(!0)};e.useImperativeHandle(f,()=>({open:d}));const l=()=>{m(!1),n(t)};e.useEffect(()=>{n(t)},[t]);const P=D(),{mutateAsync:k,isPending:r,error:c}=A({mutationKey:["UPDATE_APP"+o],mutationFn:()=>fetch(`/api/api-keys/apps/${o}`,{method:"PUT",body:JSON.stringify({name:a})}),onSettled:()=>{P.invalidateQueries({queryKey:["APPS","APP:"+o]}),n(a)}}),u=/^(?!\s*$).{1,100}$/gi.test(a);return e.createElement(O,{open:E,onClose:l,onOpen:d},e.createElement(e.Fragment,null,e.createElement(w,{"data-translation-key":"dev.edit.app.dialog.title"},i("dev.edit.app.dialog.title","Change display name")),e.createElement($,null,e.createElement(b,null,e.createElement(T,{value:a,onChange:h,onKeyPress:C}))),c&&e.createElement(I,{type:"danger"},c.message," "),e.createElement(B,null,e.createElement(N,{onClick:l,"data-translation-key":"dev.edit.app.dialog.cancel",variant:"text",size:"large"},i("dev.edit.app.dialog.cancel","Cancel")),e.createElement(R,{variant:"primary",loading:r,onClick:p,disabled:r||!u,"data-translation-key":"dev.edit.app.dialog.save"},i("dev.edit.app.dialog.save","Save changes")))))});export{M as EditAppDialog};
1
+ import*as e from"react";import{useMutation as v,useQueryClient as E}from"@tanstack/react-query";import{useParams as C}from"react-router";import{Button as h}from"@redocly/theme/components/Button/Button";import{H2 as P}from"@redocly/theme/components/Typography/H2";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as k}from"../../../../../client/app/hooks";import{Dialog as D}from"./Dialog";import{ButtonWithLoading as N}from"./ButtonWithLoading";import{ButtonsContainer as S}from"./RollAPIKey";import{DialogInput as w,DialogRow as K,DialogRowContent as O}from"./DialogStyledComponents";const U=e.forwardRef((l,a)=>{const{appName:s,appDisplayName:o}=l,[n,i]=e.useState(!1),r=()=>{i(!0)},t=()=>{i(!1)};return e.useImperativeHandle(a,()=>({open:r})),e.createElement(D,{open:n,onClose:t,onOpen:r},e.createElement(R,{initialName:o||s||"",onClose:t}))}),R=l=>{const{id:a}=C(),{initialName:s,onClose:o}=l,[n,i]=e.useState(s),r=p=>i(p.target.value),{translate:t}=k(),d=async()=>{await f(),o()},g=p=>{p.key==="Enter"&&!m&&u&&d()},y=E(),{mutateAsync:f,isPending:m,error:c}=v({mutationKey:["UPDATE_APP"+a],mutationFn:()=>fetch(`/api/api-keys/apps/${a}`,{method:"PUT",body:JSON.stringify({name:n})}),onSettled:()=>{y.invalidateQueries({queryKey:["APPS","APP:"+a]})}}),u=/^(?!\s*$).{1,100}$/gi.test(n);return e.createElement(e.Fragment,null,e.createElement(P,{"data-translation-key":"dev.edit.app.dialog.title"},t("dev.edit.app.dialog.title","Change display name")),e.createElement(K,null,e.createElement(O,null,e.createElement(w,{value:n,onChange:r,onKeyPress:g}))),c&&e.createElement(A,{type:"danger"},c.message," "),e.createElement(S,null,e.createElement(h,{onClick:o,"data-translation-key":"dev.edit.app.dialog.cancel",variant:"text",size:"large"},t("dev.edit.app.dialog.cancel","Cancel")),e.createElement(N,{variant:"primary",loading:m,onClick:d,disabled:m||!u,"data-translation-key":"dev.edit.app.dialog.save"},t("dev.edit.app.dialog.save","Save changes"))))};export{U as EditAppDialog};
@@ -1 +1 @@
1
- import*as e from"react";import{useMutation as b,useQueryClient as U}from"@tanstack/react-query";import{useParams as C}from"react-router";import{Button as E}from"@redocly/theme/components/Button/Button";import{H2 as w}from"@redocly/theme/components/Typography/H2";import{Admonition as P}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as D}from"../../../../../client/app/hooks";import{Dialog as R}from"./Dialog";import{ButtonWithLoading as S}from"./ButtonWithLoading";import{ButtonsContainer as A}from"./RollAPIKey";import{DialogHelperText as T,DialogInputMultiline as x,DialogRow as K,DialogRowContent as j}from"./DialogStyledComponents";const z=p=>{const{id:o}=C(),{initialCallbackUrl:u,open:g,onOpen:k,onClose:s}=p,l=u||"",{translate:a}=D(),[r,n]=e.useState(l);e.useEffect(()=>{n(l)},[l]);const c=async()=>{await f(),s()},y=t=>{t.key==="Enter"&&!i&&c()},d=()=>{s(),n(l)},h=U(),{mutateAsync:f,isPending:i,error:m}=b({mutationKey:["UPDATE_APP"+o],mutationFn:async()=>{const t=await fetch(`/api/api-keys/apps/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({callbackUrl:r})});if(!t.ok){const v=await t.json().catch(()=>null);throw new Error(v?.error||`Request failed with status ${t.status}`)}return t.json()},onSettled:()=>{h.invalidateQueries({queryKey:["APP:"+o]}),n(r)}});return e.createElement(R,{open:g,onClose:d,onOpen:k},e.createElement(e.Fragment,null,e.createElement(w,{"data-translation-key":"dev.edit.callbackUrls.dialog.title"},a("dev.edit.callbackUrls.dialog.title","Change callback URLs")),e.createElement(K,null,e.createElement(j,null,e.createElement(x,{value:r,onChange:t=>n(t.target.value),onKeyPress:y,placeholder:a("dev.edit.callbackUrls.dialog.placeholder","https://example.com/callback"),rows:3}),e.createElement(T,{"data-translation-key":"dev.edit.callbackUrls.dialog.hint"},a("dev.edit.callbackUrls.dialog.hint","Separate multiple URLs with a comma")))),m&&e.createElement(P,{type:"danger"},m.message," "),e.createElement(A,null,e.createElement(E,{onClick:d,"data-translation-key":"dev.edit.callbackUrls.dialog.cancel",variant:"text",size:"large"},a("dev.edit.callbackUrls.dialog.cancel","Cancel")),e.createElement(S,{variant:"primary",loading:i,onClick:c,disabled:i,"data-translation-key":"dev.edit.callbackUrls.dialog.save"},a("dev.edit.callbackUrls.dialog.save","Save changes")))))};export{z as EditCallbackUrlDialog};
1
+ import*as e from"react";import{useMutation as y,useQueryClient as b}from"@tanstack/react-query";import{useParams as C}from"react-router";import{Button as U}from"@redocly/theme/components/Button/Button";import{H2 as h}from"@redocly/theme/components/Typography/H2";import{Admonition as v}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as E}from"../../../../../client/app/hooks";import{Dialog as f}from"./Dialog";import{ButtonWithLoading as w}from"./ButtonWithLoading";import{ButtonsContainer as P}from"./RollAPIKey";import{DialogHelperText as D,DialogInputMultiline as R,DialogRow as S,DialogRowContent as A}from"./DialogStyledComponents";const Q=o=>{const{initialCallbackUrl:l,open:r,onOpen:n,onClose:a}=o;return e.createElement(f,{open:r,onClose:a,onOpen:n},e.createElement(T,{initialCallbackUrl:l,onClose:a}))},T=o=>{const{id:l}=C(),{initialCallbackUrl:r,onClose:n}=o,{translate:a}=E(),[c,m]=e.useState(r||""),s=async()=>{await g(),n()},p=t=>{t.key==="Enter"&&!i&&s()},u=b(),{mutateAsync:g,isPending:i,error:d}=y({mutationKey:["UPDATE_APP"+l],mutationFn:async()=>{const t=await fetch(`/api/api-keys/apps/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({callbackUrl:c})});if(!t.ok){const k=await t.json().catch(()=>null);throw new Error(k?.error||`Request failed with status ${t.status}`)}return t.json()},onSettled:()=>{u.invalidateQueries({queryKey:["APP:"+l]})}});return e.createElement(e.Fragment,null,e.createElement(h,{"data-translation-key":"dev.edit.callbackUrls.dialog.title"},a("dev.edit.callbackUrls.dialog.title","Change callback URLs")),e.createElement(S,null,e.createElement(A,null,e.createElement(R,{value:c,onChange:t=>m(t.target.value),onKeyPress:p,placeholder:a("dev.edit.callbackUrls.dialog.placeholder","https://example.com/callback"),rows:3}),e.createElement(D,{"data-translation-key":"dev.edit.callbackUrls.dialog.hint"},a("dev.edit.callbackUrls.dialog.hint","Separate multiple URLs with a comma")))),d&&e.createElement(v,{type:"danger"},d.message," "),e.createElement(P,null,e.createElement(U,{onClick:n,"data-translation-key":"dev.edit.callbackUrls.dialog.cancel",variant:"text",size:"large"},a("dev.edit.callbackUrls.dialog.cancel","Cancel")),e.createElement(w,{variant:"primary",loading:i,onClick:s,disabled:i,"data-translation-key":"dev.edit.callbackUrls.dialog.save"},a("dev.edit.callbackUrls.dialog.save","Save changes"))))};export{Q as EditCallbackUrlDialog};
@@ -1 +1 @@
1
- import a from"path";import{pathMatchesGlobPattern as i}from"../../utils/globs.js";const p=(r,o)=>o.some(t=>{const e=a.posix.normalize(t);return i(r,e)});export{p as isPartial};
1
+ import c from"path";import{compileGlobMatcher as n}from"../../utils/globs.js";const m=new WeakMap,i=(o,e)=>{if(e.length===0)return!1;let t=m.get(e);return t||(t=n(e.map(r=>c.posix.normalize(r))),m.set(e,t)),t(o)};export{i as isPartial};
@@ -1,4 +1,5 @@
1
- import{getCallableApis as n,isFetchCapable as o}from"../../../gateway-mcp/callable-apis.js";import{FETCH_TOOL_NAME as i}from"../../constants.js";const c=["```ts","/**"," * Call a documented API. Only the callable APIs' documented hosts are reachable."," * Responses cap at 1 MiB and redirects are not followed."," */","declare function fetch(url: string | URL, init?: {"," method?: string;"," /** `content-type` is set automatically for URLSearchParams/FormData unless you set one. */"," headers?: Record<string, string>;"," /** string \xB7 URLSearchParams (\u2192 application/x-www-form-urlencoded) \xB7 FormData (\u2192 multipart/form-data) */"," body?: string | URLSearchParams | FormData;"," /** Security scheme name (from the operation's `security` or `getSecuritySchemes`) whose credential to send. Omit to let the server choose. */"," securityScheme?: string;","}): Promise<{"," status: number;"," statusText: string;"," ok: boolean;"," headers: { get(name: string): string | null };"," json(): Promise<unknown>;"," text(): Promise<string>;","}>;","```"].join(`
2
- `),l=["Example - list the paid invoices of a billing API:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const [api] = items;",`if (!api) return { error: 'no API matches "billing"' };`,"const { endpoints } = await tools.getEndpoints({ name: api.name });","const ep = endpoints.find((e) => e.method === 'GET' && e.path.includes('invoices'));","const info = await tools.getEndpointInfo({ name: api.name, path: ep.path, method: ep.method });","const url = new URL((info.servers?.[0]?.url ?? '') + ep.path);","// Every name below comes from `info.endpoint.parameters` - read them first, never guess them.","url.searchParams.set('filter', 'status:paid');","url.searchParams.set('sort', '-createdTime');","url.searchParams.set('limit', '100');","try {"," const res = await fetch(url, { method: ep.method });"," return res.ok ? await res.json() : { status: res.status, error: await res.text() };","} catch (error) {"," return { error: error instanceof Error ? error.message : String(error), endpointId: info };","}","```"].join(`
3
- `);function m(s){const t=new Map;for(const{name:e,version:r}of s){if(!e)continue;const a=t.get(e)??[];r&&a.push(r),t.set(e,a)}return[...t.entries()].map(([e,r])=>r.length>1?`${e} (${r.map(a=>`v${a}`).join(", ")})`:e).join(", ")}const p={id:i,purpose:"Call the documented APIs over HTTP",isActive:o,annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!0},renderSection(s){const t=m(n(s));return["## `fetch` \u2014 call the documented APIs","",c,"","Always call `getEndpointInfo` before `fetch` for the exact URL, required parameters, and body shape. Put filtering, sorting, and paging in the query parameters, and keep sandbox JS for what the endpoint cannot express. Never guess.","","When an operation accepts more than one security scheme, pass `securityScheme` with the scheme name the user holds a credential for; without it the server picks one, and a mismatched credential fails upstream.","",`Callable APIs (their documented hosts are reachable via \`fetch\`): ${t}`,"",l].join(`
4
- `)}};export{c as FETCH_DECLARATION,p as fetchCapability};
1
+ import{getCallableApis as n,isFetchCapable as o}from"../../../gateway-mcp/callable-apis.js";import{FETCH_TOOL_NAME as i}from"../../constants.js";const l=["```ts","/**"," * Call a documented API. Only the callable APIs' documented hosts are reachable."," * Responses cap at 1 MiB and redirects are not followed."," */","declare function fetch(url: string | URL, init?: {"," method?: string;"," /** `content-type` is set automatically for URLSearchParams/FormData unless you set one. */"," headers?: Record<string, string>;"," /** string \xB7 URLSearchParams (\u2192 application/x-www-form-urlencoded) \xB7 FormData (\u2192 multipart/form-data) */"," body?: string | URLSearchParams | FormData;"," /** Security scheme name (from the operation's `security` or `getSecuritySchemes`) whose credential to send. Omit to let the server choose. */"," securityScheme?: string;","}): Promise<{"," status: number;"," statusText: string;"," ok: boolean;"," headers: { get(name: string): string | null };"," json(): Promise<unknown>;"," text(): Promise<string>;","}>;","```"].join(`
2
+ `),c=["listApis","getEndpoints","getEndpointInfo"],h=["Example - list the paid invoices of a billing API:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const [api] = items;",`if (!api) return { error: 'no API matches "billing"' };`,"const { endpoints } = await tools.getEndpoints({ name: api.name });","const ep = endpoints.find((e) => e.method === 'GET' && e.path.includes('invoices'));","const info = await tools.getEndpointInfo({ name: api.name, path: ep.path, method: ep.method });","// Replace every `{placeholder}` first.","const url = new URL((info.servers?.[0]?.url ?? '') + ep.path);","// Every name below comes from `info.endpoint.parameters` - read them first, never guess them.","url.searchParams.set('filter', 'status:paid');","url.searchParams.set('sort', '-createdTime');","url.searchParams.set('limit', '100');","try {"," const res = await fetch(url, { method: ep.method });"," return res.ok ? await res.json() : { status: res.status, error: await res.text() };","} catch (error) {"," return { error: error instanceof Error ? error.message : String(error), endpointId: info };","}","```"].join(`
3
+ `),p=["Example - call an endpoint you already read:","","```ts","// Call `getEndpointInfo` first for the server URL, the path, and the parameter names.","// Replace every `{placeholder}` first.","const url = new URL('https://api.example.com/invoices');","url.searchParams.set('filter', 'status:paid');","try {"," const res = await fetch(url, { method: 'GET' });"," return res.ok ? await res.json() : { status: res.status, error: await res.text() };","} catch (error) {"," return { error: error instanceof Error ? error.message : String(error) };","}","```"].join(`
4
+ `);function m(r){return c.every(t=>r.includes(t))?h:p}function d(r){const t=new Map;for(const{name:e,version:a}of r){if(!e)continue;const s=t.get(e)??[];a&&s.push(a),t.set(e,s)}return[...t.entries()].map(([e,a])=>a.length>1?`${e} (${a.map(s=>`v${s}`).join(", ")})`:e).join(", ")}const g={id:i,purpose:"Call the documented APIs over HTTP",isActive:o,annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!0},renderSection(r,t){const e=d(n(r));return["## `fetch` \u2014 call the documented APIs","",l,"","Always call `getEndpointInfo` before `fetch` for the exact URL, required parameters, and body shape. Put filtering, sorting, and paging in the query parameters, and keep sandbox JS for what the endpoint cannot express. Never guess.","","A `servers[].url` or an endpoint path can hold `{placeholders}`. Replace every one before you call `fetch`. Use the server variable `default`. Ask the user when the `default` only repeats the variable name, such as `{organizationId}`.","","When an operation accepts more than one security scheme, pass `securityScheme` with the scheme name the user holds a credential for; without it the server picks one, and a mismatched credential fails upstream.","",`Callable APIs (their documented hosts are reachable via \`fetch\`): ${e}`,"",m(t)].join(`
5
+ `)}};export{l as FETCH_DECLARATION,g as fetchCapability};
@@ -8,7 +8,10 @@ export type SandboxCapability = {
8
8
  isActive(context: McpToolContext): boolean;
9
9
  /** How this capability changes `execute`'s MCP annotations when active. */
10
10
  annotations: Partial<ToolAnnotations>;
11
- /** The self-contained `describe-tools` section for this capability: heading, TS declaration, guidance, and example. */
12
- renderSection(context: McpToolContext): string;
11
+ /**
12
+ * The self-contained `describe-tools` section for this capability: heading, TS declaration,
13
+ * guidance, and an example built only from `describedToolNames`.
14
+ */
15
+ renderSection(context: McpToolContext, describedToolNames: string[]): string;
13
16
  };
14
17
  //# sourceMappingURL=types.d.ts.map