@redocly/revel 0.137.0 → 0.138.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/CHANGELOG.md +50 -2
  2. package/dist/bin.js +1 -1
  3. package/dist/cli/eject/resolveEjectParams.js +1 -1
  4. package/dist/cli/eject/themeOperations.js +1 -1
  5. package/dist/cli/generate/generate-tag.js +1 -1
  6. package/dist/cli/generate/generate.js +1 -1
  7. package/dist/client/TestProvider.js +1 -1
  8. package/dist/client/api-request-handlers-entry.d.ts +1 -1
  9. package/dist/client/app/hooks/catalog/useCatalog.d.ts +1 -2
  10. package/dist/client/app/hooks/index.d.ts +0 -1
  11. package/dist/client/app/hooks/index.js +1 -1
  12. package/dist/client/app/l10n/hooks/useL10n.js +1 -1
  13. package/dist/client/app/l10n/index.js +1 -1
  14. package/dist/client/app/search/sse-parser.d.ts +5 -2
  15. package/dist/client/app/search/sse-parser.js +2 -2
  16. package/dist/client/constants/ai-search.d.ts +8 -0
  17. package/dist/client/constants/ai-search.js +1 -1
  18. package/dist/client/mcp-tool-handlers-entry.d.ts +1 -1
  19. package/dist/client/middleware-entry.d.ts +1 -1
  20. package/dist/client/providers/theme/ThemeDataProvider.js +1 -1
  21. package/dist/client/server-props-entry.d.ts +1 -1
  22. package/dist/constants/l10n/langs/ar.js +1 -1
  23. package/dist/constants/l10n/langs/de.js +1 -1
  24. package/dist/constants/l10n/langs/en.js +1 -1
  25. package/dist/constants/l10n/langs/es.js +1 -1
  26. package/dist/constants/l10n/langs/fr.js +1 -1
  27. package/dist/constants/l10n/langs/hi.js +1 -1
  28. package/dist/constants/l10n/langs/it.js +1 -1
  29. package/dist/constants/l10n/langs/ja.js +1 -1
  30. package/dist/constants/l10n/langs/ko.js +1 -1
  31. package/dist/constants/l10n/langs/pl.js +1 -1
  32. package/dist/constants/l10n/langs/pt-BR.js +1 -1
  33. package/dist/constants/l10n/langs/pt.js +1 -1
  34. package/dist/constants/l10n/langs/ru.js +1 -1
  35. package/dist/constants/l10n/langs/uk.js +1 -1
  36. package/dist/constants/l10n/langs/zh.js +1 -1
  37. package/dist/markdoc/helpers/guards/is-example-node.d.ts +2 -1
  38. package/dist/markdoc/helpers/guards/is-example-node.js +1 -1
  39. package/dist/markdoc/nodes/fence/index.js +1 -1
  40. package/dist/server/constants/entitlements.d.ts +1 -2
  41. package/dist/server/esbuild/plugins/styled-components-ssr.js +1 -1
  42. package/dist/server/esbuild/plugins/themes-resolver.js +2 -2
  43. package/dist/server/fs/cache.js +1 -1
  44. package/dist/server/fs/fs.js +1 -1
  45. package/dist/server/fs/utils/remove-l10n-prefix.js +1 -1
  46. package/dist/server/persistence/file-hashes/repositories/file-hashes-repository.d.ts +1 -2
  47. package/dist/server/persistence/file-hashes/services/file-hashes-service.d.ts +1 -2
  48. package/dist/server/plugins/analytics/rudderstack/browser-hooks.js +1 -1
  49. package/dist/server/plugins/analytics/segment/browser-hooks.js +1 -1
  50. package/dist/server/plugins/analytics/segment/build-script.js +3 -3
  51. package/dist/server/plugins/api-docs/loader.d.ts +2 -3
  52. package/dist/server/plugins/api-docs/options.d.ts +1 -1
  53. package/dist/server/plugins/api-docs/search/get-ai-search-documents.d.ts +1 -1
  54. package/dist/server/plugins/api-docs/utils/decorators.js +1 -1
  55. package/dist/server/plugins/api-functions/index.js +1 -1
  56. package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.js +1 -1
  57. package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/arazzo-entities-extractor.js +1 -1
  58. package/dist/server/plugins/catalog-entities/types/extractors.d.ts +1 -2
  59. package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.d.ts +1 -2
  60. package/dist/server/plugins/catalog-entities/utils/openapi-schema-resolver.d.ts +1 -2
  61. package/dist/server/plugins/config-parser/format-error.js +4 -4
  62. package/dist/server/plugins/l10n/index.js +1 -1
  63. package/dist/server/plugins/lifecycle.js +2 -2
  64. package/dist/server/plugins/markdown/attribute-resolvers/code-walkthrough/file-chunk-parser.js +2 -2
  65. package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
  66. package/dist/server/plugins/markdown/attribute-resolvers/resolve-svg-content.js +1 -1
  67. package/dist/server/plugins/markdown/compiler.js +1 -1
  68. package/dist/server/plugins/markdown/errors.js +1 -1
  69. package/dist/server/plugins/markdown/markdoc/reparse-example-fences.d.ts +7 -0
  70. package/dist/server/plugins/markdown/markdoc/reparse-example-fences.js +1 -0
  71. package/dist/server/plugins/markdown/markdoc/resolve-raw-partials.js +1 -1
  72. package/dist/server/plugins/markdown/runtime-transform.js +1 -1
  73. package/dist/server/plugins/markdown/search/to-markdown.js +20 -20
  74. package/dist/server/plugins/mcp/codemode/code-execution-telemetry.d.ts +7 -2
  75. package/dist/server/plugins/mcp/codemode/code-execution-telemetry.js +1 -1
  76. package/dist/server/plugins/mcp/codemode/invoke-tool.js +1 -1
  77. package/dist/server/plugins/mcp/codemode/sandbox/unknown-tool-hint.d.ts +5 -1
  78. package/dist/server/plugins/mcp/codemode/sandbox/unknown-tool-hint.js +2 -2
  79. package/dist/server/plugins/mcp/codemode/tools/execute.js +1 -1
  80. package/dist/server/plugins/mcp/codemode/tools/tool-errors.d.ts +4 -0
  81. package/dist/server/plugins/mcp/codemode/tools/tool-errors.js +1 -1
  82. package/dist/server/plugins/mcp/constants.d.ts +1 -0
  83. package/dist/server/plugins/mcp/constants.js +1 -1
  84. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.d.ts +1 -0
  85. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
  86. package/dist/server/plugins/mcp/docs-mcp/tools/core/submit-feedback.d.ts +7 -0
  87. package/dist/server/plugins/mcp/docs-mcp/tools/core/submit-feedback.js +3 -0
  88. package/dist/server/plugins/mcp/docs-mcp/tools/core/types.d.ts +6 -0
  89. package/dist/server/plugins/mcp/docs-mcp/tools/index.d.ts +1 -0
  90. package/dist/server/plugins/mcp/docs-mcp/tools/index.js +1 -1
  91. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoint-info.js +1 -1
  92. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoints.js +1 -1
  93. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-full-api-description.js +1 -1
  94. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-security-schemes.js +1 -1
  95. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/list-apis.js +1 -1
  96. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.d.ts +16 -4
  97. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.js +1 -1
  98. package/dist/server/plugins/mcp/docs-mcp/utils/api-name-matching.d.ts +6 -1
  99. package/dist/server/plugins/mcp/docs-mcp/utils/api-name-matching.js +1 -1
  100. package/dist/server/plugins/mcp/docs-mcp/utils/api-titles.d.ts +8 -0
  101. package/dist/server/plugins/mcp/docs-mcp/utils/api-titles.js +1 -1
  102. package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
  103. package/dist/server/plugins/mcp/index.js +1 -1
  104. package/dist/server/plugins/nav-utils.js +1 -1
  105. package/dist/server/plugins/search/llmstxt/is-included-in-llms-txt.d.ts +1 -2
  106. package/dist/server/providers/database/pagination/after-and-before.js +1 -1
  107. package/dist/server/providers/database/pagination/utils/decode-cursor.js +1 -1
  108. package/dist/server/providers/database/pagination/utils/is-base-64.js +1 -1
  109. package/dist/server/sandbox/constants/host-functions.d.ts +3 -0
  110. package/dist/server/sandbox/constants/host-functions.js +1 -1
  111. package/dist/server/sandbox/constants/sandbox.d.ts +10 -0
  112. package/dist/server/sandbox/constants/sandbox.js +1 -1
  113. package/dist/server/sandbox/sandbox.js +3 -3
  114. package/dist/server/sandbox/types.d.ts +3 -0
  115. package/dist/server/sandbox/utils/read-result.d.ts +8 -0
  116. package/dist/server/sandbox/utils/read-result.js +1 -0
  117. package/dist/server/sandbox/utils/setup-host-functions.js +3 -3
  118. package/dist/server/ssr/index.js +1 -1
  119. package/dist/server/store.d.ts +1 -1
  120. package/dist/server/store.js +1 -1
  121. package/dist/server/tools/notifiers/helpers/privacy/remove-pii-from-url.js +1 -1
  122. package/dist/server/tools/notifiers/helpers/privacy/remove-pii.js +1 -1
  123. package/dist/server/types/plugins/common.d.ts +1 -2
  124. package/dist/server/utils/rbac.js +1 -1
  125. package/dist/server/web-server/middleware/apiKeyMiddleware.js +1 -1
  126. package/dist/server/web-server/middleware/catalogAuthMiddleware.js +1 -1
  127. package/dist/server/web-server/routes/catalog/helpers/create-entity-update-schema.d.ts +1 -1
  128. package/dist/server/web-server/routes/catalog/helpers/create-entity-update-schema.js +1 -1
  129. package/dist/server/web-server/routes/feedback.d.ts +3 -1
  130. package/dist/server/web-server/routes/feedback.js +1 -1
  131. package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
  132. package/dist/server/web-server/routes/otel/otel.js +1 -1
  133. package/dist/server/web-server/utils/legacy-openapi-redirects.js +1 -1
  134. package/dist/types/global-data.d.ts +1 -2
  135. package/dist/utils/slugger.js +1 -1
  136. package/dist/utils/url/sanitize-redirect-pathname.js +1 -1
  137. package/package.json +6 -6
  138. package/dist/client/app/hooks/useAnchorPositioning.d.ts +0 -6
  139. package/dist/client/app/hooks/useAnchorPositioning.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @redocly/revel
2
2
 
3
+ ## 0.138.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4bc012cafa9: Fixed divider color in button groups, such as the page actions split button, to match custom theme button colors.
8
+ - 215ed7fc7fa: Updated the tooltip arrow to render as a compact 16px pointer with a softly rounded tip.
9
+ - 4bc012cafa9: Fixed the split button so the menu toggle and divider use the same `danger` tone as the main button.
10
+ - 215ed7fc7fa: Fixed an issue where the tooltip arrows failed to render in browsers that didn't support CSS anchor positioning.
11
+ - Updated dependencies [7f611536d82]
12
+ - Updated dependencies [4bc012cafa9]
13
+ - Updated dependencies [215ed7fc7fa]
14
+ - Updated dependencies [4bc012cafa9]
15
+ - Updated dependencies [215ed7fc7fa]
16
+ - Updated dependencies [8dcd600ebe8]
17
+ - Updated dependencies [4f85f31942f]
18
+ - @redocly/api-docs@0.3.0-next.1
19
+ - @redocly/theme@0.70.0-next.1
20
+
21
+ ## 0.138.0-next.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 0312a50ad9c: Added a `submit-feedback` tool to report documentation issues through the MCP server.
26
+ - e1b53618fb4: Changed the defaults of the `analytics.segment.trackPage`, `analytics.segment.includeTitleInPageCall`, and `analytics.rudderstack.trackPage` options to disable page view tracking by default.
27
+
28
+ ### Patch Changes
29
+
30
+ - 9e9b4914145: Improved the reliability of AI assistant answers during streaming.
31
+ - a4abb7fe95e: Fixed an issue where dropdown menus were cut off at the bottom of the viewport.
32
+ - fef7333d138: Fixed an issue where the `markdoc-example` tag rendered an empty result panel with `renderDemo=true`.
33
+ - 6605daa2732: Updated the Claude Desktop instructions on the `/mcp` page to add the Docs MCP server as a custom connector.
34
+ - e37c4f10360: Fixed an issue where MCP server lookups failed when several API description files shared a title.
35
+ - 870f2254ffb: Fixed MCP server returning an empty result instead of an error when code execution produced a value too large or invalid for JSON conversion.
36
+ - e5306838bd9: Fixed an issue where the theme UI strings remained in the previously selected language after users navigated to a page in a different locale without using the language picker.
37
+ - Updated dependencies [a4abb7fe95e]
38
+ - Updated dependencies [a4abb7fe95e]
39
+ - Updated dependencies [ded8ed1ec72]
40
+ - Updated dependencies [fef7333d138]
41
+ - Updated dependencies [6605daa2732]
42
+ - Updated dependencies [de7f42377f7]
43
+ - Updated dependencies [2f3a264ac57]
44
+ - Updated dependencies [26e86082ad6]
45
+ - Updated dependencies [bb5709ab9be]
46
+ - Updated dependencies [bb5709ab9be]
47
+ - @redocly/theme@0.70.0-next.0
48
+ - @redocly/api-docs@0.3.0-next.0
49
+ - @redocly/realm-asyncapi-sdk@0.16.0-next.0
50
+
3
51
  ## 0.137.0
4
52
 
5
53
  ### Minor Changes
@@ -36,7 +84,7 @@
36
84
  - 34e13e3c9e: Fixed OAuth2 client credentials exchange in the MCP gateway credentials form.
37
85
  - 5aa4838269: Fixed an issue where SSO login in projects without an `l10n` configuration caused identity providers with strict `ui_locales` validation to reject the login request.
38
86
  - 2f5a68164c: Fixed an issue where Docs MCP API lookups rejected names that are unique parts of API titles.
39
- - ac184788d1: Fixed an issue where angle brackets: `<`, `>` weren't rendered inside inline code within Markdown link text, such as ``[`command <name>`](./page.md)``.
87
+ - ac184788d1: Fixed an issue where angle brackets: `<`, `>` weren't rendered inside inline code within Markdown link text, such as `` [`command <name>`](./page.md) ``.
40
88
  - d43a91af69: Fixed MCP code mode tool results and descriptions to match declared signatures.
41
89
  - b146b82606: Fixed MCP server code mode crashes for runs that produce no output.
42
90
  - e984568ea3: Improved the MCP gateway to ask which credentials the user holds instead of picking the default.
@@ -254,7 +302,7 @@
254
302
 
255
303
  ### Patch Changes
256
304
 
257
- - ac184788d19: Fixed an issue where angle brackets: `<`, `>` weren't rendered inside inline code within Markdown link text, such as ``[`command <name>`](./page.md)``.
305
+ - ac184788d19: Fixed an issue where angle brackets: `<`, `>` weren't rendered inside inline code within Markdown link text, such as `` [`command <name>`](./page.md) ``.
258
306
  - bf3aa0200bf: Improved sidebar accessibility: separators are no longer announced as links by screen readers and no longer receive keyboard focus.
259
307
  - 505de02f7b8: Fixed an issue where a search query that contained double characters returned an error.
260
308
  - Updated dependencies [4925ce16bea]
package/dist/bin.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"./server/utils/set-execution-mode.js";import"./cli/utils/node-version-check.js";import o from"mri";import*as r from"node:path";import{tmpdir as T}from"node:os";import*as u from"node:fs";import{cliCommandNames as b}from"./constants/common.js";import{initPlugins as S}from"./server/plugins/lifecycle.js";import{loadEnvVariables as k}from"./server/utils/envs/load-env-variables.js";import{PORTAL_VERSION as I}from"./server/version.js";import{logger as i}from"./server/tools/notifiers/logger.js";import{reporter as t}from"./server/tools/notifiers/reporter.js";import{sha as V}from"./server/utils/crypto/sha.js";import{envConfig as L}from"./server/config/env-config.js";import{PACKAGE_NAME as w}from"./config/product-gates.js";import{develop as R}from"./cli/develop.js";import{eject as M}from"./cli/eject/index.js";import{beforeCommand as j}from"./server/utils/lifecycle-hooks.js";import{Store as E}from"./server/store.js";import{build as N}from"./cli/build/index.js";import{fromCurrentDir as _}from"./server/utils/paths.js";import{translationsCliOpts as F}from"./cli/translations/options.js";import{generateTranslations as U}from"./cli/translations/index.js";import{EntitlementsProvider as $}from"./server/entitlements/entitlements-provider.js";import{isValidPlan as B}from"./server/entitlements/is-valid-plan.js";import{stopAllCompilers as G}from"./server/esbuild/esbuild.js";import{copyLibsqlPrebuiltBinary as q}from"./cli/build/libsql/copy-prebuilt-binary.js";import{telemetry as f}from"./cli/telemetry/index.js";import{stats as K}from"./cli/stats/index.js";import{statsCliOpts as Y}from"./cli/stats/options.js";const c=process.argv[2];let a;const v={alias:{d:"project-dir",p:"port"},default:{"project-dir":L.REDOCLY_CONTENT_DIR||process.cwd(),outdir:"public"}},z={alias:v.alias,default:{...v.default,plan:"enterprise"}},H={alias:{d:"buildDir"},default:{buildDir:"public"}},J={boolean:["force"],alias:{f:"force",d:"project-dir"},default:{"project-dir":process.cwd()}};process.on("uncaughtException",async function(e){e?.code==="ERR_INVALID_STATE"?console.log("Ignore premature close error"):(i.error("Uncaught exception occurred. Stopping compilers."),await G(),i.error("Exiting due to uncaught exception"),await t.panic(e))});try{c||await t.panicOnContentError("Command not specified.");const e=$.instance();switch(["build","prepare","serve","stats"].includes(c)&&await e.init(),["eject","translate"].includes(c)&&await e.init({developModePlan:"enterprise"}),c){case"develop":case"preview":const s=o(process.argv.slice(3),z),O=r.resolve(s["project-dir"]),h=encodeURIComponent(V(O)),m=r.join(T(),"redocly-public-"+h);u.existsSync(m)&&(i.verbose("Cleaning temporary output directory..."),u.rmSync(m,{recursive:!0,force:!0}),i.verbose("Temporary output directory cleaned."));const p=s.plan.toLowerCase();B(p)||await t.panicOnContentError(`Invalid --plan argument value '${p}'.`),await e.init({developModePlan:p}),a=new E({contentDir:r.resolve(s["project-dir"]),outdir:m,serverOutDir:_(import.meta.url,"./server/esbuild/cache/server")}),await j(b.DEVELOP,s,a),await R(s,a);break;case"build":case"prepare":const n=o(process.argv.slice(3),v),g=r.resolve(r.join(n.outdir,"server"));a=new E({contentDir:r.resolve(n["project-dir"]),outdir:r.resolve(n.outdir,"client"),serverOutDir:g}),await j(b.BUILD,n,a),q(g),await N(n,a);break;case"serve":await k();const y=o(process.argv.slice(3),H),A=r.resolve(y.buildDir);f.sendServeCliCommandExecutedMessage();const C=r.join(A,"server","index.mjs");u.existsSync(C)||await t.panic(`Server not found. Please run \`${w} build\` first (or \`${w} prepare\` for the deprecated command)`),import(C).catch(async l=>{await t.panic("Failed to load server",l)});break;case"eject":e.canAccessFeature("themeEjecting")||await t.panicOnContentError('The "eject" command is not available for this project');const d=o(process.argv.slice(3),J),{lifecycleContext:{getConfig:D,fs:P}}=await S({outdir:"",contentDir:r.resolve(d["project-dir"]),setGlobalConfig:()=>null});P.dispose(),f.sendCliCommandEjectExecutedMessage([{id:"eject",object:"cliCommand",uri:"urn:redocly:realm:cli:cliCommand:eject",arguments:d}]),await M({...d,config:await D()}),i.clearAllTimeouts();break;case"translate":if(e.canAccessFeature("l10n")){const l=o(process.argv.slice(3),F);f.sendCliCommandTranslateExecutedMessage([{id:"translate",object:"cliCommand",uri:"urn:redocly:realm:cli:cliCommand:translate",arguments:l}]),await U(l)}else await t.panicOnContentError('The "translate" command is not available for this project');break;case"stats":const x=o(process.argv.slice(3),Y);await K(x);break;case"--version":console.log(I);break;default:await t.panicOnContentError(`Unknown command "${c}"`)}}catch(e){i.error("Exiting due to uncaught exception"),await t.panic(e)}
2
+ import"./server/utils/set-execution-mode.js";import"./cli/utils/node-version-check.js";import s from"mri";import*as t from"node:path";import{tmpdir as w}from"node:os";import*as d from"node:fs";import{cliCommandNames as v}from"./constants/common.js";import{initPlugins as j}from"./server/plugins/lifecycle.js";import{loadEnvVariables as E}from"./server/utils/envs/load-env-variables.js";import{PORTAL_VERSION as O}from"./server/version.js";import{logger as n}from"./server/tools/notifiers/logger.js";import{reporter as o}from"./server/tools/notifiers/reporter.js";import{sha as h}from"./server/utils/crypto/sha.js";import{envConfig as y}from"./server/config/env-config.js";import{PACKAGE_NAME as g}from"./config/product-gates.js";import{develop as A}from"./cli/develop.js";import{eject as D}from"./cli/eject/index.js";import{beforeCommand as C}from"./server/utils/lifecycle-hooks.js";import{Store as b}from"./server/store.js";import{build as P}from"./cli/build/index.js";import{fromCurrentDir as x}from"./server/utils/paths.js";import{translationsCliOpts as T}from"./cli/translations/options.js";import{generateTranslations as S}from"./cli/translations/index.js";import{EntitlementsProvider as k}from"./server/entitlements/entitlements-provider.js";import{isValidPlan as I}from"./server/entitlements/is-valid-plan.js";import{stopAllCompilers as V}from"./server/esbuild/esbuild.js";import{copyLibsqlPrebuiltBinary as L}from"./cli/build/libsql/copy-prebuilt-binary.js";import{telemetry as u}from"./cli/telemetry/index.js";import{stats as R}from"./cli/stats/index.js";import{statsCliOpts as M}from"./cli/stats/options.js";const m=process.argv[2];let c;const f={alias:{d:"project-dir",p:"port"},default:{"project-dir":y.REDOCLY_CONTENT_DIR||process.cwd(),outdir:"public"}},N={alias:f.alias,default:{...f.default,plan:"enterprise"}},_={alias:{d:"buildDir"},default:{buildDir:"public"}},F={boolean:["force"],alias:{f:"force",d:"project-dir"},default:{"project-dir":process.cwd()}};process.on("uncaughtException",async function(r){r?.code==="ERR_INVALID_STATE"?console.log("Ignore premature close error"):(n.error("Uncaught exception occurred. Stopping compilers."),await V(),n.error("Exiting due to uncaught exception"),await o.panic(r))});try{m||await o.panicOnContentError("Command not specified.");const r=k.instance();switch(["build","prepare","serve","stats"].includes(m)&&await r.init(),["eject","translate"].includes(m)&&await r.init({developModePlan:"enterprise"}),m){case"develop":case"preview":{const e=s(process.argv.slice(3),N),i=t.resolve(e["project-dir"]),a=encodeURIComponent(h(i)),l=t.join(w(),"redocly-public-"+a);d.existsSync(l)&&(n.verbose("Cleaning temporary output directory..."),d.rmSync(l,{recursive:!0,force:!0}),n.verbose("Temporary output directory cleaned."));const p=e.plan.toLowerCase();I(p)||await o.panicOnContentError(`Invalid --plan argument value '${p}'.`),await r.init({developModePlan:p}),c=new b({contentDir:t.resolve(e["project-dir"]),outdir:l,serverOutDir:x(import.meta.url,"./server/esbuild/cache/server")}),await C(v.DEVELOP,e,c),await A(e,c);break}case"build":case"prepare":{const e=s(process.argv.slice(3),f),i=t.resolve(t.join(e.outdir,"server"));c=new b({contentDir:t.resolve(e["project-dir"]),outdir:t.resolve(e.outdir,"client"),serverOutDir:i}),await C(v.BUILD,e,c),L(i),await P(e,c);break}case"serve":{await E();const e=s(process.argv.slice(3),_),i=t.resolve(e.buildDir);u.sendServeCliCommandExecutedMessage();const a=t.join(i,"server","index.mjs");d.existsSync(a)||await o.panic(`Server not found. Please run \`${g} build\` first (or \`${g} prepare\` for the deprecated command)`),import(a).catch(async l=>{await o.panic("Failed to load server",l)});break}case"eject":{r.canAccessFeature("themeEjecting")||await o.panicOnContentError('The "eject" command is not available for this project');const e=s(process.argv.slice(3),F),{lifecycleContext:{getConfig:i,fs:a}}=await j({outdir:"",contentDir:t.resolve(e["project-dir"]),setGlobalConfig:()=>null});a.dispose(),u.sendCliCommandEjectExecutedMessage([{id:"eject",object:"cliCommand",uri:"urn:redocly:realm:cli:cliCommand:eject",arguments:e}]),await D({...e,config:await i()}),n.clearAllTimeouts();break}case"translate":if(r.canAccessFeature("l10n")){const e=s(process.argv.slice(3),T);u.sendCliCommandTranslateExecutedMessage([{id:"translate",object:"cliCommand",uri:"urn:redocly:realm:cli:cliCommand:translate",arguments:e}]),await S(e)}else await o.panicOnContentError('The "translate" command is not available for this project');break;case"stats":{const e=s(process.argv.slice(3),M);await R(e);break}case"--version":console.log(O);break;default:await o.panicOnContentError(`Unknown command "${m}"`)}}catch(r){n.error("Exiting due to uncaught exception"),await o.panic(r)}
@@ -1 +1 @@
1
- import*as c from"path";import{DEFAULT_THEME_NAME as i,USER_THEME_ALIAS as k}from"../../constants/common.js";import{logger as y}from"../../server/tools/notifiers/logger.js";import{reporter as T}from"../../server/tools/notifiers/reporter.js";import{resolveTheme as A}from"./resolveTheme.js";import{EntitlementsProvider as F}from"../../server/entitlements/entitlements-provider.js";const L=["markdoc/attributes/code-walkthrough-filesets.ts","markdoc/attributes/code-walkthrough-filters.ts","markdoc/components/CodeWalkthrough/**","markdoc/tags/code-step.ts","markdoc/tags/code-toggle.ts","markdoc/tags/code-walkthrough.ts"],m=["./core/**","./markdoc/**/default.*","**/__mocks__/**","**/index.*","**/utils/**/*","**/__tests__/**/*","**/__snapshots__/**/*","**/*.stories.*","**/variables.*",...L],v=["./components/CatalogClassic/CatalogClassicCard.*","./components/ColorModeSwitcher/**","./components/ReplayGate/**","./components/ReplayTopBarActions/**","./components/Feedback/**","./components/Filter/**","./components/Footer/**","./components/LanguagePicker/**","./components/Menu/**","./components/Navbar/**","./components/PageNavigation/**","./components/Product/**","./components/Search/**","./components/UserMenu/**","./layouts/RootLayout.*","./layouts/NotFound.*","./layouts/Forbidden.*","./layouts/DocumentationLayoutTop.*","./layouts/DocumentationLayoutBottom.*","./icons/**","./markdoc/**","./ext/**"];async function C(t){const[p,r]=t._,{theme:l,force:d,onSuccess:u,onError:g,onOverride:h,config:E}=t,_=F.instance(),s=c.resolve(t["project-dir"]);let o=l;o||(o=i);const n=await A(s,E.plugins||[],o,r);n||await T.panicOnContentError(`Theme ${o} not found. Skipping eject.`);const e=n?.config.ejectIgnore;e&&!Array.isArray(e)&&y.warn("'ejectIgnore' must be of type Array. Skipping.");const a=await _.getPackageEjectIgnore(),f={force:d,onSuccess:u,onError:g,onOverride:h,onlyFiles:o===i?v:void 0,ignoreFiles:Array.isArray(e)?[...e,...a,...m]:[...a,...m]};return{objectType:p,pathToThemeFolder:n?.pluginDirAbsolutePath,pathToPortalCustomThemeFolder:c.resolve(s,k),componentToEject:r,theme:o,options:f}}export{m as DEFAULT_IGNORED_FILES,v as EJECTABLE_FILES,C as default};
1
+ import*as c from"path";import{DEFAULT_THEME_NAME as i,USER_THEME_ALIAS as f}from"../../constants/common.js";import{logger as k}from"../../server/tools/notifiers/logger.js";import{reporter as T}from"../../server/tools/notifiers/reporter.js";import{resolveTheme as A}from"./resolveTheme.js";import{EntitlementsProvider as F}from"../../server/entitlements/entitlements-provider.js";const L=["markdoc/attributes/code-walkthrough-filesets.ts","markdoc/attributes/code-walkthrough-filters.ts","markdoc/components/CodeWalkthrough/**","markdoc/tags/code-step.ts","markdoc/tags/code-toggle.ts","markdoc/tags/code-walkthrough.ts"],m=["./core/**","./markdoc/**/default.*","**/__mocks__/**","**/index.*","**/utils/**/*","**/__tests__/**/*","**/__snapshots__/**/*","**/*.stories.*","**/variables.*",...L],S=["./components/CatalogClassic/CatalogClassicCard.*","./components/ColorModeSwitcher/**","./components/ReplayGate/**","./components/ReplaySecuritySchemeActions/**","./components/ReplayTopBarActions/**","./components/Feedback/**","./components/Filter/**","./components/Footer/**","./components/LanguagePicker/**","./components/Menu/**","./components/Navbar/**","./components/PageNavigation/**","./components/Product/**","./components/Search/**","./components/UserMenu/**","./layouts/RootLayout.*","./layouts/NotFound.*","./layouts/Forbidden.*","./layouts/DocumentationLayoutTop.*","./layouts/DocumentationLayoutBottom.*","./icons/**","./markdoc/**","./ext/**"];async function v(t){const[p,r]=t._,{theme:l,force:u,onSuccess:d,onError:g,onOverride:h,config:E}=t,_=F.instance(),s=c.resolve(t["project-dir"]);let o=l;o||(o=i);const n=await A(s,E.plugins||[],o,r);n||await T.panicOnContentError(`Theme ${o} not found. Skipping eject.`);const e=n?.config.ejectIgnore;e&&!Array.isArray(e)&&k.warn("'ejectIgnore' must be of type Array. Skipping.");const a=await _.getPackageEjectIgnore(),y={force:u,onSuccess:d,onError:g,onOverride:h,onlyFiles:o===i?S:void 0,ignoreFiles:Array.isArray(e)?[...e,...a,...m]:[...a,...m]};return{objectType:p,pathToThemeFolder:n?.pluginDirAbsolutePath,pathToPortalCustomThemeFolder:c.resolve(s,f),componentToEject:r,theme:o,options:y}}export{m as DEFAULT_IGNORED_FILES,S as EJECTABLE_FILES,v as default};
@@ -1 +1 @@
1
- import*as c from"path";import{lstatSync as m,readdirSync as y,copyFileSync as F,mkdirSync as h}from"fs";import{FsErrors as g}from"../../constants/common.js";import{logger as a}from"../../server/tools/notifiers/logger.js";import{getGlobMatcher as l}from"./glob.js";import{askUserToConfirm as x,askUserToSelectComponents as j}from"./ejectPrompt.js";function f(r){return y(r).flatMap(i=>{const t=c.join(r,i);return m(t).isDirectory()?f(t):t})}function A(r,i=c.resolve("")){const t=(n,o,e)=>{o.forEach(s=>{n[s]={...n[s]||{}},n=n[s]}),n["."]=Array.isArray(n["."])?[...n["."],e]:[e]};return r.reduce((n,o)=>{if(m(c.join(i,o)).isFile()){const{dir:e,base:s}=c.parse(o),d=e?e.split(c.sep).filter(Boolean):[];t(n,d,s)}return n},{})}function u(r,i){return c.normalize(r).replace(c.normalize(i),"").replace(/^[\/\\]+/,"")}function C(r,i={}){let t=[];const{ignoreFilePatterns:n,onlyFilePatterns:o}=i;try{if(t=f(r).map(e=>u(e,r)),o){const e=l(o);t=t.filter(s=>e(s))}if(n){const e=l(n);return t.filter(s=>!e(s))}return t}catch(e){if(e.code===g.NotExist)return t;throw e}}function T(r,i){return r.filter(t=>i.includes(t))}function v(r,i,t){const n=u(t,i),o=c.resolve(i,n),e=c.resolve(r,n);return h(c.dirname(e),{recursive:!0}),F(o,e),e}function p(r,i,t,n){const o=a.startTiming(),e=v(t,i,r),s=`\u{1F4E6} Component ${r} has been ejected into %rp`;n?.onSuccess?.(s),a.infoTime(o,s,e)}async function S({componentToCopy:r,ejectedFiles:i=[],copyFrom:t,copyTo:n,options:o={}}){if(i.includes(r)&&!o.force){const e=`File [ ${r} ] will be overwritten. Are you sure ?`;return o&&o.onOverride?o.onOverride(e):await x(e)?p(r,t,n):a.info(`Skipped [ ${r} ] component ejection.`)}return p(r,t,n,o)}async function $({componentList:r,ejectedComponents:i,pathToThemeFolder:t,pathToPortalCustomThemeFolder:n,options:o}){const e=await j(r,t);for(const s of e)await S({componentToCopy:s,ejectedFiles:i,copyFrom:t,copyTo:n,options:o})}export{S as copyComponent,p as copyComponentAndReport,$ as copyComponentsFromList,v as copyThemeComponent,T as getEjectedFiles,C as getThemeFiles,u as stripComponentThemePath,A as toFileTree};
1
+ import*as c from"path";import{lstatSync as m,readdirSync as y,copyFileSync as F,mkdirSync as h}from"fs";import{FsErrors as g}from"../../constants/common.js";import{logger as a}from"../../server/tools/notifiers/logger.js";import{getGlobMatcher as l}from"./glob.js";import{askUserToConfirm as x,askUserToSelectComponents as j}from"./ejectPrompt.js";function f(r){return y(r).flatMap(i=>{const t=c.join(r,i);return m(t).isDirectory()?f(t):t})}function A(r,i=c.resolve("")){const t=(n,o,e)=>{o.forEach(s=>{n[s]={...n[s]||{}},n=n[s]}),n["."]=Array.isArray(n["."])?[...n["."],e]:[e]};return r.reduce((n,o)=>{if(m(c.join(i,o)).isFile()){const{dir:e,base:s}=c.parse(o),d=e?e.split(c.sep).filter(Boolean):[];t(n,d,s)}return n},{})}function u(r,i){return c.normalize(r).replace(c.normalize(i),"").replace(/^[/\\]+/,"")}function C(r,i={}){let t=[];const{ignoreFilePatterns:n,onlyFilePatterns:o}=i;try{if(t=f(r).map(e=>u(e,r)),o){const e=l(o);t=t.filter(s=>e(s))}if(n){const e=l(n);return t.filter(s=>!e(s))}return t}catch(e){if(e.code===g.NotExist)return t;throw e}}function T(r,i){return r.filter(t=>i.includes(t))}function v(r,i,t){const n=u(t,i),o=c.resolve(i,n),e=c.resolve(r,n);return h(c.dirname(e),{recursive:!0}),F(o,e),e}function p(r,i,t,n){const o=a.startTiming(),e=v(t,i,r),s=`\u{1F4E6} Component ${r} has been ejected into %rp`;n?.onSuccess?.(s),a.infoTime(o,s,e)}async function S({componentToCopy:r,ejectedFiles:i=[],copyFrom:t,copyTo:n,options:o={}}){if(i.includes(r)&&!o.force){const e=`File [ ${r} ] will be overwritten. Are you sure ?`;return o&&o.onOverride?o.onOverride(e):await x(e)?p(r,t,n):a.info(`Skipped [ ${r} ] component ejection.`)}return p(r,t,n,o)}async function $({componentList:r,ejectedComponents:i,pathToThemeFolder:t,pathToPortalCustomThemeFolder:n,options:o}){const e=await j(r,t);for(const s of e)await S({componentToCopy:s,ejectedFiles:i,copyFrom:t,copyTo:n,options:o})}export{S as copyComponent,p as copyComponentAndReport,$ as copyComponentsFromList,v as copyThemeComponent,T as getEjectedFiles,C as getThemeFiles,u as stripComponentThemePath,A as toFileTree};
@@ -1 +1 @@
1
- import{appendFileSync as P,mkdirSync as p,writeFileSync as a}from"fs";import e from"path";import{CUSTOM_MARKDOC_TAGS_PATH as d,CUSTOM_MARKDOC_OPTIONS_PATH as l}from"../../constants/common.js";import{USER_THEME_ALIAS as C}from"../../constants/common.js";import{logger as T}from"../../server/tools/notifiers/logger.js";import{getComponentTemplate as O}from"./get-component-template.js";import{getComponentsFileTemplate as D}from"./get-components-file-template.js";import{getSchemaTemplate as E}from"./get-schema-template.js";import{isValidFilePath as f}from"./is-valid-file-path.js";import{capitalize as F}from"./string-utils.js";async function I(h,o,m){const t=F(o),s=e.resolve(h,C),c=e.resolve(s,l,d),i=e.resolve(s,t),S=e.resolve(s,l,"components.ts"),n=e.resolve(i,`${t}.tsx`),r=e.resolve(c,`${o}.markdoc.ts`),g=!await f(n,m),u=!await f(r,m);if((g||u)&&!m)return;const v=O(t),_=E(o),A=D(t);p(i,{recursive:!0}),p(c,{recursive:!0}),a(r,_),T.success(`Generated schema: file://${r}`),a(n,v),T.success(`Generated component: file://${n}`),P(S,A)}export{I as generateTag};
1
+ import{appendFileSync as P,mkdirSync as p,writeFileSync as a}from"fs";import e from"path";import{CUSTOM_MARKDOC_TAGS_PATH as d,CUSTOM_MARKDOC_OPTIONS_PATH as l,USER_THEME_ALIAS as C}from"../../constants/common.js";import{logger as T}from"../../server/tools/notifiers/logger.js";import{getComponentTemplate as O}from"./get-component-template.js";import{getComponentsFileTemplate as D}from"./get-components-file-template.js";import{getSchemaTemplate as E}from"./get-schema-template.js";import{isValidFilePath as f}from"./is-valid-file-path.js";import{capitalize as F}from"./string-utils.js";async function k(h,o,s){const t=F(o),n=e.resolve(h,C),c=e.resolve(n,l,d),i=e.resolve(n,t),S=e.resolve(n,l,"components.ts"),m=e.resolve(i,`${t}.tsx`),r=e.resolve(c,`${o}.markdoc.ts`),g=!await f(m,s),u=!await f(r,s);if((g||u)&&!s)return;const v=O(t),_=E(o),A=D(t);p(i,{recursive:!0}),p(c,{recursive:!0}),a(r,_),T.success(`Generated schema: file://${r}`),a(m,v),T.success(`Generated component: file://${m}`),P(S,A)}export{k as generateTag};
@@ -1 +1 @@
1
- import{logger as a}from"../../server/tools/notifiers/logger.js";import{reporter as n}from"../../server/tools/notifiers/reporter.js";import{generateTag as i}from"./generate-tag.js";import{normalizeTagName as c}from"./normalize-tag-name.js";const p={Tag:"tag"},g={boolean:["force"],alias:{f:"force",d:"contentDir"},default:{contentDir:process.cwd()}};async function l(t){const[e,r]=t._;try{switch(e){case p.Tag:if(!r)return n.panicOnContentError(`${e} "name" is not provided.`);const o=await c(r);return i(t.contentDir,o,t.force);case null:case void 0:await n.panicOnContentError('generation "type" is not provided.');break;default:await n.panicOnContentError(`Unsupported type: "${e}".`)}}catch{return a.warn(`${e} was not created.`)}}export{l as generate,g as generateCliOptions};
1
+ import{logger as a}from"../../server/tools/notifiers/logger.js";import{reporter as n}from"../../server/tools/notifiers/reporter.js";import{generateTag as i}from"./generate-tag.js";import{normalizeTagName as c}from"./normalize-tag-name.js";const p={Tag:"tag"},g={boolean:["force"],alias:{f:"force",d:"contentDir"},default:{contentDir:process.cwd()}};async function l(t){const[e,r]=t._;try{switch(e){case p.Tag:{if(!r)return n.panicOnContentError(`${e} "name" is not provided.`);const o=await c(r);return i(t.contentDir,o,t.force)}case null:case void 0:await n.panicOnContentError('generation "type" is not provided.');break;default:await n.panicOnContentError(`Unsupported type: "${e}".`)}}catch{return a.warn(`${e} was not created.`)}}export{l as generate,g as generateCliOptions};
@@ -1 +1 @@
1
- import e from"react";import{BrowserRouter as o}from"react-router";import{ThemeDataContext as n,SearchSessionProvider as i}from"@redocly/theme/core/contexts";import u from"@redocly/theme/core/templates/Markdown";import{useAnchorPositioning as m,useBreadcrumbs as d,useBanner as l,useCatalogClassic as c,useCurrentProduct as p,useGlobalData as g,useI18n as h,useI18nConfig as f,useL10n as T,useL10nConfig as b,usePageData as C,usePageSharedData as k,usePageVersions as v,usePreloadHistory as P,useProducts as w,useUserMenu as y,useSubmitFeedback as S,useTranslate as D,useTranslationKeys as $,useSidebarSiblingsData as E,usePageProps as I,useUserTeams as L,useMarkdownText as M,useMarkdocRenderer as x,useCodeHighlight as F,useLoadAndNavigate as H,useCatalog as R,useCatalogSort as A,useCatalogSearch as B,useFetchCatalogEntities as G,useFetchCatalogEntitiesRelations as O,useTelemetry as r,useMcpData as U,useFetchCatalogEntityRevisions as K}from"./app/hooks";import{Link as N}from"./app/Link";import{useFacetQuery as Q,useSearch as V,useAiSearch as j}from"./app/search";import{useSidebarItems as q}from"./app/Sidebar/useSidebarItems";import{PageDataContext as z}from"./providers/page-data/PageDataContext";const s={Template:({pageProps:a,children:t})=>e.createElement(u,{pageProps:{...a,metadata:{...a.metadata,markdoc:{tagList:[]}}}},t),templateId:"markdown",isPublic:!0,props:{seo:{title:"Test"},ast:{$$mdtype:"Tag",name:"div",children:[{$$mdtype:"Tag",name:"Heading",attributes:{id:"github-flavored-markdown",level:1},children:["GitHub-flavored markdown"]},{$$mdtype:"Tag",name:"p",attributes:{},children:["These exercises assume you have",{$$mdtype:"Tag",name:"a",attributes:{href:"https://docs.redoc.ly/"},children:["basic markdown knowledge"]},"."]},{$$mdtype:"Tag",name:"Heading",attributes:{id:"create-a-new-plain-markdown-page",level:2},children:["Create a new plain markdown page"]}]},lastModified:new Date("2022-01-01").toISOString()},slug:"",userData:{isAuthenticated:!1,name:"test name",picture:""},sidebar:null,sharedData:{},sharedDataIds:{}},J={useAnchorPositioning:m,useBreadcrumbs:d,useBanner:l,useCatalog:R,useCatalogSort:A,useCatalogSearch:B,useFetchCatalogEntities:G,useFetchCatalogEntitiesRelations:O,useFetchCatalogEntityRevisions:K,useCatalogClassic:c,useCurrentProduct:p,useGlobalData:g,useSearch:V,useAiSearch:j,useFacetQuery:Q,useI18n:h,useI18nConfig:f,useL10n:T,useL10nConfig:b,usePageData:C,usePageSharedData:k,usePageVersions:v,usePreloadHistory:P,useProducts:w,useUserMenu:y,useSidebarItems:q,useSidebarSiblingsData:E,useSubmitFeedback:S,useTranslate:D,useTranslationKeys:$,useUserTeams:L,usePageProps:I,useMarkdownText:M,useMarkdocRenderer:x,useCodeHighlight:F,useLoadAndNavigate:H,useTelemetry:r,useOtelTelemetry:r,useMcpData:U},W={LinkComponent:N},X={hooks:J,components:W,config:{}};function ne({children:a,customPageData:t}){return e.createElement(o,null,e.createElement(i,null,e.createElement(z.Provider,{value:{...s,...t,props:{...s.props,...t?.props}}},e.createElement(n.Provider,{value:X},a))))}export{ne as TestProvider};
1
+ import e from"react";import{BrowserRouter as o}from"react-router";import{ThemeDataContext as n,SearchSessionProvider as i}from"@redocly/theme/core/contexts";import u from"@redocly/theme/core/templates/Markdown";import{useBreadcrumbs as m,useBanner as d,useCatalogClassic as l,useCurrentProduct as c,useGlobalData as p,useI18n as g,useI18nConfig as h,useL10n as f,useL10nConfig as T,usePageData as b,usePageSharedData as C,usePageVersions as k,usePreloadHistory as v,useProducts as w,useUserMenu as y,useSubmitFeedback as P,useTranslate as S,useTranslationKeys as D,useSidebarSiblingsData as $,usePageProps as E,useUserTeams as I,useMarkdownText as L,useMarkdocRenderer as M,useCodeHighlight as x,useLoadAndNavigate as F,useCatalog as H,useCatalogSort as R,useCatalogSearch as A,useFetchCatalogEntities as B,useFetchCatalogEntitiesRelations as G,useTelemetry as r,useMcpData as O,useFetchCatalogEntityRevisions as U}from"./app/hooks";import{Link as K}from"./app/Link";import{useFacetQuery as N,useSearch as Q,useAiSearch as V}from"./app/search";import{useSidebarItems as j}from"./app/Sidebar/useSidebarItems";import{PageDataContext as q}from"./providers/page-data/PageDataContext";const s={Template:({pageProps:a,children:t})=>e.createElement(u,{pageProps:{...a,metadata:{...a.metadata,markdoc:{tagList:[]}}}},t),templateId:"markdown",isPublic:!0,props:{seo:{title:"Test"},ast:{$$mdtype:"Tag",name:"div",children:[{$$mdtype:"Tag",name:"Heading",attributes:{id:"github-flavored-markdown",level:1},children:["GitHub-flavored markdown"]},{$$mdtype:"Tag",name:"p",attributes:{},children:["These exercises assume you have",{$$mdtype:"Tag",name:"a",attributes:{href:"https://docs.redoc.ly/"},children:["basic markdown knowledge"]},"."]},{$$mdtype:"Tag",name:"Heading",attributes:{id:"create-a-new-plain-markdown-page",level:2},children:["Create a new plain markdown page"]}]},lastModified:new Date("2022-01-01").toISOString()},slug:"",userData:{isAuthenticated:!1,name:"test name",picture:""},sidebar:null,sharedData:{},sharedDataIds:{}},z={useBreadcrumbs:m,useBanner:d,useCatalog:H,useCatalogSort:R,useCatalogSearch:A,useFetchCatalogEntities:B,useFetchCatalogEntitiesRelations:G,useFetchCatalogEntityRevisions:U,useCatalogClassic:l,useCurrentProduct:c,useGlobalData:p,useSearch:Q,useAiSearch:V,useFacetQuery:N,useI18n:g,useI18nConfig:h,useL10n:f,useL10nConfig:T,usePageData:b,usePageSharedData:C,usePageVersions:k,usePreloadHistory:v,useProducts:w,useUserMenu:y,useSidebarItems:j,useSidebarSiblingsData:$,useSubmitFeedback:P,useTranslate:S,useTranslationKeys:D,useUserTeams:I,usePageProps:E,useMarkdownText:L,useMarkdocRenderer:M,useCodeHighlight:x,useLoadAndNavigate:F,useTelemetry:r,useOtelTelemetry:r,useMcpData:O},J={LinkComponent:K},W={hooks:z,components:J,config:{}};function oe({children:a,customPageData:t}){return e.createElement(o,null,e.createElement(i,null,e.createElement(q.Provider,{value:{...s,...t,props:{...s.props,...t?.props}}},e.createElement(n.Provider,{value:W},a))))}export{oe as TestProvider};
@@ -1,3 +1,3 @@
1
- /** @ts-ignore autogenerated module, @see src/server/esbuild/plugins/api-request-handlers-resolver.ts **/
1
+ /** @ts-expect-error autogenerated module, @see src/server/esbuild/plugins/api-request-handlers-resolver.ts **/
2
2
  export { requestHandlers } from '@portal/api-request-handlers';
3
3
  //# sourceMappingURL=api-request-handlers-entry.d.ts.map
@@ -1,4 +1,3 @@
1
- import type { UseCatalogResponse } from '@redocly/theme/core/types';
2
- import type { UseCatalogProps } from '@redocly/theme/core/types';
1
+ import type { UseCatalogResponse, UseCatalogProps } from '@redocly/theme/core/types';
3
2
  export declare function useCatalog(props?: UseCatalogProps): UseCatalogResponse;
4
3
  //# sourceMappingURL=useCatalog.d.ts.map
@@ -31,5 +31,4 @@ export { useCodeHighlight } from './codeHighlight/useCodeHighlight';
31
31
  export { useLoadAndNavigate } from './useLoadAndNavigate';
32
32
  export { useUserClaims } from './useUserClaims';
33
33
  export { useMcpData } from './useMcpData';
34
- export { useAnchorPositioning } from './useAnchorPositioning';
35
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export*from"../../providers/page-data/hooks";import{usePageSharedData as t}from"../../providers/hooks";import{useLoginUrl as a}from"./useLoginUrl";import{useGlobalData as f}from"../useGlobalData";import{useL10n as p}from"../l10n/hooks";import{useL10nConfig as n}from"./useL10nConfig";import{useL10n as l}from"../l10n/hooks";import{useTranslate as C}from"../l10n/hooks";import{useTranslationKeys as d}from"../l10n/hooks";import{useL10nConfig as L}from"./useL10nConfig";export*from"./useCurrentUserTeams";export*from"./products";import{usePageVersions as F}from"../../providers/page-data/hooks";import{useUserMenu as P}from"../UserMenu/useUserMenu";import{useSubmitFeedback as U}from"../Feedback/useSubmitFeedback";import{usePreloadHistory as D}from"../usePreloadHistory";import{useBreadcrumbs as R}from"../Sidebar/useBreadcrumbs";import{useBanner as A}from"./useBanner";import{useCatalog as H}from"./catalog/useCatalog";import{useCatalogSort as w}from"./catalog/useCatalogSort";import{useCatalogSearch as K}from"./catalog/useCatalogSearch";import{useFetchCatalogEntities as V}from"./catalog/useFetchCatalogEntities";import{useFetchCatalogEntitiesRelations as q}from"./catalog/useFetchCatalogEntitiesRelations";import{useFetchCatalogEntityRevisions as J}from"./catalog/useFetchCatalogEntityRevisions";import{useCatalogClassic as Q}from"./catalog/useCatalogClassic";import{useTelemetry as X}from"./useTelemetry";import{useUserTeams as Z}from"./useUserTeams";import{useMarkdownText as $}from"./markdown/useMarkdownText";import{useMarkdocRenderer as oe}from"./markdown/useMarkdocRenderer";import{useCodeHighlight as te}from"./codeHighlight/useCodeHighlight";import{useLoadAndNavigate as ae}from"./useLoadAndNavigate";import{useUserClaims as fe}from"./useUserClaims";import{useMcpData as pe}from"./useMcpData";import{useAnchorPositioning as ne}from"./useAnchorPositioning";export{ne as useAnchorPositioning,A as useBanner,R as useBreadcrumbs,H as useCatalog,Q as useCatalogClassic,K as useCatalogSearch,w as useCatalogSort,te as useCodeHighlight,V as useFetchCatalogEntities,q as useFetchCatalogEntitiesRelations,J as useFetchCatalogEntityRevisions,f as useGlobalData,p as useI18n,n as useI18nConfig,l as useL10n,L as useL10nConfig,ae as useLoadAndNavigate,a as useLoginUrl,oe as useMarkdocRenderer,$ as useMarkdownText,pe as useMcpData,t as usePageSharedData,F as usePageVersions,D as usePreloadHistory,U as useSubmitFeedback,X as useTelemetry,C as useTranslate,d as useTranslationKeys,fe as useUserClaims,P as useUserMenu,Z as useUserTeams};
1
+ export*from"../../providers/page-data/hooks";import{usePageSharedData as t}from"../../providers/hooks";import{useLoginUrl as a}from"./useLoginUrl";import{useGlobalData as f}from"../useGlobalData";import{useL10n as p}from"../l10n/hooks";import{useL10nConfig as n}from"./useL10nConfig";import{useL10n as l}from"../l10n/hooks";import{useTranslate as C}from"../l10n/hooks";import{useTranslationKeys as c}from"../l10n/hooks";import{useL10nConfig as L}from"./useL10nConfig";export*from"./useCurrentUserTeams";export*from"./products";import{usePageVersions as F}from"../../providers/page-data/hooks";import{useUserMenu as S}from"../UserMenu/useUserMenu";import{useSubmitFeedback as k}from"../Feedback/useSubmitFeedback";import{usePreloadHistory as E}from"../usePreloadHistory";import{useBreadcrumbs as R}from"../Sidebar/useBreadcrumbs";import{useBanner as B}from"./useBanner";import{useCatalog as I}from"./catalog/useCatalog";import{useCatalogSort as A}from"./catalog/useCatalogSort";import{useCatalogSearch as K}from"./catalog/useCatalogSearch";import{useFetchCatalogEntities as V}from"./catalog/useFetchCatalogEntities";import{useFetchCatalogEntitiesRelations as q}from"./catalog/useFetchCatalogEntitiesRelations";import{useFetchCatalogEntityRevisions as J}from"./catalog/useFetchCatalogEntityRevisions";import{useCatalogClassic as Q}from"./catalog/useCatalogClassic";import{useTelemetry as X}from"./useTelemetry";import{useUserTeams as Z}from"./useUserTeams";import{useMarkdownText as $}from"./markdown/useMarkdownText";import{useMarkdocRenderer as oe}from"./markdown/useMarkdocRenderer";import{useCodeHighlight as te}from"./codeHighlight/useCodeHighlight";import{useLoadAndNavigate as ae}from"./useLoadAndNavigate";import{useUserClaims as fe}from"./useUserClaims";import{useMcpData as pe}from"./useMcpData";export{B as useBanner,R as useBreadcrumbs,I as useCatalog,Q as useCatalogClassic,K as useCatalogSearch,A as useCatalogSort,te as useCodeHighlight,V as useFetchCatalogEntities,q as useFetchCatalogEntitiesRelations,J as useFetchCatalogEntityRevisions,f as useGlobalData,p as useI18n,n as useI18nConfig,l as useL10n,L as useL10nConfig,ae as useLoadAndNavigate,a as useLoginUrl,oe as useMarkdocRenderer,$ as useMarkdownText,pe as useMcpData,t as usePageSharedData,F as usePageVersions,E as usePreloadHistory,k as useSubmitFeedback,X as useTelemetry,C as useTranslate,c as useTranslationKeys,fe as useUserClaims,S as useUserMenu,Z as useUserTeams};
@@ -1 +1 @@
1
- import n from"i18next";const e=()=>({changeLanguage:n.changeLanguage,lang:n.language});export{e as useL10n};
1
+ import e from"i18next";import{useSyncExternalStore as g}from"react";const t=n=>(e.on("languageChanged",n),()=>e.off("languageChanged",n)),a=()=>e.language,u=()=>{const n=g(t,a,a);return{changeLanguage:e.changeLanguage,lang:n}};export{u as useL10n};
@@ -1 +1 @@
1
- import e from"i18next";import{useEffect as a}from"react";import{DEFAULT_LOCALE_PLACEHOLDER as s}from"../../../constants/common";import{defaultTranslationImports as l}from"../../../constants/l10n/default-translations";import{useL10nConfig as i}from"../hooks";const p=()=>{const{currentLocale:t}=i();a(()=>{const o=!t||t===s?"en":t;document.documentElement.setAttribute("lang",o)},[t])},g=async t=>{if(!t)return;const o=new Set(e.languages);for(const n of Object.keys(t.translations)){const r=await l[n]?.()||{};e.addResourceBundle(n,"translation",{...r,...t.translations[n]?.translation??{}},!0,!0),o.delete(n)}for(const n of o)e.removeResourceBundle(n,"translation")};export{g as updateTranslations,p as useL10n};
1
+ import e from"i18next";import{useEffect as r}from"react";import{DEFAULT_LOCALE_PLACEHOLDER as s}from"../../../constants/common";import{defaultTranslationImports as i}from"../../../constants/l10n/default-translations";import{useL10nConfig as l}from"../hooks";const d=()=>{const{currentLocale:t}=l();r(()=>{const o=!t||t===s?"en":t;document.documentElement.setAttribute("lang",o),t&&e.language!==t&&e.changeLanguage(t)},[t])},p=async t=>{if(!t)return;const o=new Set(e.languages);for(const n of Object.keys(t.translations)){const a=await i[n]?.()||{};e.addResourceBundle(n,"translation",{...a,...t.translations[n]?.translation??{}},!0,!0),o.delete(n)}for(const n of o)e.removeResourceBundle(n,"translation")};export{p as updateTranslations,d as useL10n};
@@ -1,8 +1,11 @@
1
1
  import type { SSEMessage } from '../../types/ai-search';
2
2
  /**
3
- * Parses SSE data lines from a chunk string
3
+ * Parses SSE lines, keeping the trailing incomplete line buffered between network chunks
4
4
  */
5
- export declare function parseSSEChunk(chunk: string): SSEMessage[];
5
+ export declare function createSSEParser(): {
6
+ push(chunk: string): SSEMessage[];
7
+ flush(): SSEMessage[];
8
+ };
6
9
  /**
7
10
  * Creates an async generator that reads SSE messages from a ReadableStream
8
11
  */
@@ -1,2 +1,2 @@
1
- import{SSE_EVENTS as i,SSE_DATA_PREFIX as a}from"../../constants";function d(e){return Object.values(i).includes(e)}function p(e){const s=[],t=e.split(`
2
- `);for(const n of t){if(!n.startsWith(a))continue;const r=n.slice(a.length);if(r)try{const c=JSON.parse(r),o=S(c);o&&s.push(o)}catch{}}return s}function S(e){return e.type&&typeof e.type=="string"&&d(e.type)?e:"messageId"in e&&typeof e.messageId=="string"?{type:i.MESSAGE_ID,messageId:e.messageId}:"sources"in e&&Array.isArray(e.sources)?{type:i.SOURCES,sources:e.sources}:"answer"in e&&typeof e.answer=="string"?{type:i.ANSWER,answer:e.answer}:null}async function*y(e,s){const t=e.getReader(),n=new TextDecoder;try{for(;!s?.aborted;){const{value:r,done:c}=await t.read();if(c)break;const o=n.decode(r),u=p(o);for(const f of u)yield f}}finally{t.releaseLock()}}export{p as parseSSEChunk,y as streamSSEMessages};
1
+ import{SSE_EVENTS as a,SSE_DATA_PREFIX as c,SSE_EVENT_PREFIX as f,SSE_ERROR_EVENT_NAME as l}from"../../constants";const p="Stream error";function S(e){return Object.values(a).includes(e)}function E(){let e="",o="";const u=s=>{if(s==="")return o="",null;if(s.startsWith(f))return o=s.slice(f.length).trim(),null;if(!s.startsWith(c))return null;const r=s.slice(c.length);if(!r)return null;try{const n=JSON.parse(r);if(o===l){const t=typeof n.message=="string"?n.message:p;return{type:a.ERROR,error:{message:t}}}return d(n)}catch{return console.warn(`[redocly-ai-search] Skipping malformed SSE data line: ${r}`),null}},i=s=>{const r=[];for(const n of s){const t=u(n);t&&r.push(t)}return r};return{push(s){e+=s;const r=e.split(`
2
+ `);return e=r.pop()??"",i(r)},flush(){const s=e;return e="",s?i([s]):[]}}}function d(e){return e.type&&typeof e.type=="string"&&S(e.type)?e:"messageId"in e&&typeof e.messageId=="string"?{type:a.MESSAGE_ID,messageId:e.messageId}:"sources"in e&&Array.isArray(e.sources)?{type:a.SOURCES,sources:e.sources}:"answer"in e&&typeof e.answer=="string"?{type:a.ANSWER,answer:e.answer}:null}async function*m(e,o){const u=e.getReader(),i=new TextDecoder,s=E();try{for(;!o?.aborted;){const{value:r,done:n}=await u.read();if(o?.aborted)break;if(n){for(const t of[...s.push(i.decode()),...s.flush()])yield t;break}for(const t of s.push(i.decode(r,{stream:!0})))yield t}}finally{u.releaseLock()}}export{E as createSSEParser,m as streamSSEMessages};
@@ -4,6 +4,14 @@ import { AiSearchError } from '@redocly/theme/core/constants';
4
4
  * Following the SSE specification: https://html.spec.whatwg.org/multipage/server-sent-events.html
5
5
  */
6
6
  export declare const SSE_DATA_PREFIX = "data: ";
7
+ /**
8
+ * SSE protocol prefix that names the event a following `data:` line belongs to
9
+ */
10
+ export declare const SSE_EVENT_PREFIX = "event: ";
11
+ /**
12
+ * Event name the API uses to frame a stream failure, see the `SseStream` decorator
13
+ */
14
+ export declare const SSE_ERROR_EVENT_NAME = "error";
7
15
  /**
8
16
  * Maximum number of resources to display in the search results
9
17
  * Limits UI clutter while providing sufficient context
@@ -1 +1 @@
1
- import{AiSearchError as o}from"@redocly/theme/core/constants";const t="data: ",r=5,S={"Content-Type":"application/json"},e={MESSAGE_ID:"messageId",SOURCES:"sources",ANSWER:"answer",TOOL_CALL:"toolCall",TOOL_RESULT:"toolResult",ERROR:"error"},R={401:o.Unauthorized,403:o.Forbidden};export{S as AI_SEARCH_REQUEST_HEADERS,R as HTTP_ERROR_MAP,r as MAX_DISPLAYED_RESOURCES,t as SSE_DATA_PREFIX,e as SSE_EVENTS};
1
+ import{AiSearchError as E}from"@redocly/theme/core/constants";const t="data: ",r="event: ",S="error",e=5,R={"Content-Type":"application/json"},_={MESSAGE_ID:"messageId",SOURCES:"sources",ANSWER:"answer",TOOL_CALL:"toolCall",TOOL_RESULT:"toolResult",ERROR:"error"},n={401:E.Unauthorized,403:E.Forbidden};export{R as AI_SEARCH_REQUEST_HEADERS,n as HTTP_ERROR_MAP,e as MAX_DISPLAYED_RESOURCES,t as SSE_DATA_PREFIX,S as SSE_ERROR_EVENT_NAME,_ as SSE_EVENTS,r as SSE_EVENT_PREFIX};
@@ -1,3 +1,3 @@
1
- /** @ts-ignore autogenerated module, @see src/server/esbuild/plugins/mcp-tool-handlers-resolver.ts **/
1
+ /** @ts-expect-error autogenerated module, @see src/server/esbuild/plugins/mcp-tool-handlers-resolver.ts **/
2
2
  export { mcpToolHandlers } from '@portal/mcp-tool-handlers';
3
3
  //# sourceMappingURL=mcp-tool-handlers-entry.d.ts.map
@@ -1,3 +1,3 @@
1
- /** @ts-ignore autogenerated module, @see src/server/esbuild/plugins/api-request-handlers-resolver.ts **/
1
+ /** @ts-expect-error autogenerated module, @see src/server/esbuild/plugins/api-request-handlers-resolver.ts **/
2
2
  export { middleware } from '@portal/middleware';
3
3
  //# sourceMappingURL=middleware-entry.d.ts.map
@@ -1 +1 @@
1
- import e from"react";import{ThemeDataContext as m,SearchSessionProvider as d}from"@redocly/theme/core/contexts";import{useAnchorPositioning as g,useBreadcrumbs as p,useBanner as b,useCatalogClassic as f,useCurrentProduct as h,useGlobalData as s,useI18n as C,useI18nConfig as P,useL10n as S,useL10nConfig as T,usePageData as r,usePageSharedData as D,usePageVersions as M,usePreloadHistory as k,useProducts as v,useUserMenu as F,useSubmitFeedback as y,useTranslate as E,useTranslationKeys as L,useSidebarSiblingsData as R,usePageProps as O,useUserTeams as A,useMarkdownText as w,useMarkdocRenderer as x,useCodeHighlight as I,useLoadAndNavigate as j,useCatalog as B,useCatalogSort as H,useCatalogSearch as N,useFetchCatalogEntities as U,useFetchCatalogEntitiesRelations as _,useFetchCatalogEntityRevisions as G,useTelemetry as n,useMcpData as K}from"../../app/hooks";import{Link as Q}from"../../app/Link";import{useFacetQuery as V,useSearch as W,useAiSearch as q}from"../../app/search";import{useSidebarItems as z}from"../../app/Sidebar/useSidebarItems";import{deepMerge as J}from"../../../utils/object/deep-merge";import{allowlistObject as X}from"../../../utils/object/allowlist-object";const Y=["title","description","seo","sidebar","excludeFromSearch","template","redirects","rbac","metadata","slug","codeSnippet","breadcrumbs","markdown","seo","navbar","footer","colorMode","feedback","navigation"],Z={useAnchorPositioning:g,useBreadcrumbs:p,useBanner:b,useCatalog:B,useCatalogSort:H,useCatalogSearch:N,useFetchCatalogEntities:U,useFetchCatalogEntitiesRelations:_,useFetchCatalogEntityRevisions:G,useCatalogClassic:f,useCurrentProduct:h,useGlobalData:s,useSearch:W,useAiSearch:q,useFacetQuery:V,useI18n:C,useI18nConfig:P,useL10n:S,useL10nConfig:T,usePageData:r,usePageSharedData:D,usePageVersions:M,usePreloadHistory:k,useProducts:v,useUserMenu:F,useSidebarItems:z,useSidebarSiblingsData:R,useSubmitFeedback:y,useTranslate:E,useTranslationKeys:L,useUserTeams:A,usePageProps:O,useMarkdownText:w,useMarkdocRenderer:x,useCodeHighlight:I,useLoadAndNavigate:j,useTelemetry:n,useOtelTelemetry:n,useMcpData:K},$={LinkComponent:Q};function ie({children:u}){const{props:t}=r()||{},a=s(),o=e.useMemo(()=>a||{},[a]),i=e.useMemo(()=>{const l=X(t?.frontmatter||{},Y);return J(o,l)},[o,t?.frontmatter]),c={hooks:Z,components:$,config:i};return e.createElement(d,null,e.createElement(m.Provider,{value:c},u))}export{ie as ThemeDataProvider};
1
+ import e from"react";import{ThemeDataContext as m,SearchSessionProvider as d}from"@redocly/theme/core/contexts";import{useBreadcrumbs as g,useBanner as p,useCatalogClassic as b,useCurrentProduct as f,useGlobalData as s,useI18n as C,useI18nConfig as h,useL10n as S,useL10nConfig as P,usePageData as r,usePageSharedData as T,usePageVersions as D,usePreloadHistory as M,useProducts as k,useUserMenu as v,useSubmitFeedback as F,useTranslate as y,useTranslationKeys as E,useSidebarSiblingsData as L,usePageProps as R,useUserTeams as O,useMarkdownText as w,useMarkdocRenderer as x,useCodeHighlight as A,useLoadAndNavigate as I,useCatalog as j,useCatalogSort as B,useCatalogSearch as H,useFetchCatalogEntities as N,useFetchCatalogEntitiesRelations as U,useFetchCatalogEntityRevisions as _,useTelemetry as n,useMcpData as G}from"../../app/hooks";import{Link as K}from"../../app/Link";import{useFacetQuery as Q,useSearch as V,useAiSearch as W}from"../../app/search";import{useSidebarItems as q}from"../../app/Sidebar/useSidebarItems";import{deepMerge as z}from"../../../utils/object/deep-merge";import{allowlistObject as J}from"../../../utils/object/allowlist-object";const X=["title","description","seo","sidebar","excludeFromSearch","template","redirects","rbac","metadata","slug","codeSnippet","breadcrumbs","markdown","seo","navbar","footer","colorMode","feedback","navigation"],Y={useBreadcrumbs:g,useBanner:p,useCatalog:j,useCatalogSort:B,useCatalogSearch:H,useFetchCatalogEntities:N,useFetchCatalogEntitiesRelations:U,useFetchCatalogEntityRevisions:_,useCatalogClassic:b,useCurrentProduct:f,useGlobalData:s,useSearch:V,useAiSearch:W,useFacetQuery:Q,useI18n:C,useI18nConfig:h,useL10n:S,useL10nConfig:P,usePageData:r,usePageSharedData:T,usePageVersions:D,usePreloadHistory:M,useProducts:k,useUserMenu:v,useSidebarItems:q,useSidebarSiblingsData:L,useSubmitFeedback:F,useTranslate:y,useTranslationKeys:E,useUserTeams:O,usePageProps:R,useMarkdownText:w,useMarkdocRenderer:x,useCodeHighlight:A,useLoadAndNavigate:I,useTelemetry:n,useOtelTelemetry:n,useMcpData:G},Z={LinkComponent:K};function ue({children:u}){const{props:t}=r()||{},a=s(),o=e.useMemo(()=>a||{},[a]),i=e.useMemo(()=>{const l=J(t?.frontmatter||{},X);return z(o,l)},[o,t?.frontmatter]),c={hooks:Y,components:Z,config:i};return e.createElement(d,null,e.createElement(m.Provider,{value:c},u))}export{ue as ThemeDataProvider};
@@ -1,3 +1,3 @@
1
- /** @ts-ignore autogenerated module, @see src/server/esbuild/plugins/server-props-resolver.ts **/
1
+ /** @ts-expect-error autogenerated module, @see src/server/esbuild/plugins/server-props-resolver.ts **/
2
2
  export { serverProps } from '@portal/server-props';
3
3
  //# sourceMappingURL=server-props-entry.d.ts.map