@redocly/openapi-docs 3.14.0-next.9 → 3.14.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 (66) hide show
  1. package/dist/redocly-openapi-docs.min.js +2173 -2089
  2. package/lib/components/ContentItem/ContentItem.js +1 -1
  3. package/lib/components/ContentItems/Items.js +1 -1
  4. package/lib/components/ContentItems/helpers.js +1 -1
  5. package/lib/components/McpOverview/McpOverview.d.ts +5 -0
  6. package/lib/components/McpOverview/McpOverview.js +16 -0
  7. package/lib/components/McpOverview/index.d.ts +1 -0
  8. package/lib/components/McpOverview/index.js +1 -0
  9. package/lib/components/McpTool/McpTool.d.ts +6 -0
  10. package/lib/components/McpTool/McpTool.js +9 -0
  11. package/lib/components/McpTool/index.d.ts +1 -0
  12. package/lib/components/McpTool/index.js +1 -0
  13. package/lib/components/PanelItem/styled.js +1 -0
  14. package/lib/components/RedoclyOpenAPIDocs/Error.d.ts +3 -0
  15. package/lib/components/RedoclyOpenAPIDocs/Error.js +25 -0
  16. package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
  17. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
  18. package/lib/components/Replay/Replay.js +1 -1
  19. package/lib/components/RightPanel/RightPanel.js +1 -1
  20. package/lib/components/SectionItem/SectionItem.d.ts +1 -1
  21. package/lib/components/Security/OAuthFlow.js +1 -1
  22. package/lib/components/Security/SecurityButton.js +14 -7
  23. package/lib/components/Security/SecurityFlow.d.ts +1 -1
  24. package/lib/components/Security/SecurityFlow.js +10 -5
  25. package/lib/components/ServerList/ServerDescriptionTooltip.d.ts +4 -0
  26. package/lib/components/ServerList/ServerDescriptionTooltip.js +1 -0
  27. package/lib/components/ServerList/ServerList.js +14 -9
  28. package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
  29. package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
  30. package/lib/components/TagItem/OperationNavigationItems.js +3 -3
  31. package/lib/components/TagItem/OperationsNavigation.js +2 -2
  32. package/lib/components/TagItem/TagItem.js +17 -7
  33. package/lib/components/TagItem/types.d.ts +2 -2
  34. package/lib/models/group.js +1 -1
  35. package/lib/models/types.d.ts +2 -0
  36. package/lib/services/code-samples/generator.d.ts +9 -2
  37. package/lib/services/code-samples/generator.js +1 -1
  38. package/lib/services/code-samples/httpsnippet/helpers/device-auth-snippets.d.ts +25 -0
  39. package/lib/services/code-samples/httpsnippet/helpers/device-auth-snippets.js +1 -0
  40. package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +2 -2
  41. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/httpclient.js +2 -2
  42. package/lib/services/code-samples/httpsnippet/targets/go/native.js +3 -3
  43. package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +3 -3
  44. package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +2 -2
  45. package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
  46. package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
  47. package/lib/services/code-samples/httpsnippet/targets/php/curl.js +5 -5
  48. package/lib/services/code-samples/httpsnippet/targets/python/requests.js +5 -5
  49. package/lib/services/code-samples/httpsnippet/targets/r/httr.js +1 -1
  50. package/lib/services/code-samples/httpsnippet/targets/ruby/native.js +1 -1
  51. package/lib/services/code-samples/httpsnippet/targets/shell/curl.js +7 -6
  52. package/lib/services/menu/builder.js +1 -1
  53. package/lib/services/menu/tags.d.ts +1 -0
  54. package/lib/services/menu/tags.js +2 -1
  55. package/lib/services/types.d.ts +1 -1
  56. package/lib/standalone.js +1 -1
  57. package/lib/types/open-api.d.ts +56 -0
  58. package/lib/utils/hasNestedFields.d.ts +1 -1
  59. package/lib/utils/helpers.d.ts +2 -0
  60. package/lib/utils/helpers.js +4 -4
  61. package/lib/utils/loadAndBundleSpec.js +1 -1
  62. package/lib/utils/mcp.d.ts +3 -0
  63. package/lib/utils/mcp.js +1 -0
  64. package/lib/utils/menu.d.ts +2 -0
  65. package/lib/utils/menu.js +1 -0
  66. package/package.json +8 -7
@@ -1 +1 @@
1
- import{getTagGroupsItems as r,getTagsItems as d,getTagsWithOperations as c}from"./tags.js";import{addMarkdownItems as g}from"./markdown.js";import{flattenByProp as p,getValueFromMdParsedExtension as h}from"../../utils/index.js";import{DEFAULT_WEBHOOKS_TAG_NAME as u}from"../../constants.js";function l(t,n){const{definition:e}=t,{schemaDefinitionsTagName:i}=n,s=[{id:"",name:e?.info?.["x-seo"]?.title||e?.info?.title||"Overview",href:"/",depth:1,level:1,type:"section",infoDefinition:e.info,items:[]}],o=[...e.tags||[]];o.some(a=>a.name===u)||o.push({name:u}),!o.find(a=>a?.name===i)&&i&&o.push({name:i});const f=c(t,o),m=e["x-tagGroups"];return s.push(...g(h(e.info,"description")||"",void 0,1)),m&&m.length>0?s.push(...r(t,void 0,m,f,n)):s.push(...d(t,f,void 0,void 0,n)),s}function E(t,n){const e=l(t,n),i=p(e||[],"items");return{contentItems:e,flatItems:i}}export{E as buildContentItems,l as buildMenuStructure};
1
+ import{getTagGroupsItems as d,getTagsItems as c,getTagsWithOperations as p}from"./tags.js";import{addMarkdownItems as g}from"./markdown.js";import{flattenByProp as h,getValueFromMdParsedExtension as l}from"../../utils/index.js";import{DEFAULT_WEBHOOKS_TAG_NAME as r}from"../../constants.js";function x(o,s){const{definition:e}=o,{schemaDefinitionsTagName:i}=s,a=[{id:"",name:e?.info?.["x-seo"]?.title||e?.info?.title||"Overview",href:"/",depth:1,level:1,type:"section",infoDefinition:e.info,items:[]}],t=[...e.tags||[]];if(t.some(n=>n.name===r)||t.push({name:r}),!t.find(n=>n?.name===i)&&i&&t.push({name:i}),e["x-mcp"])for(const n of["Tools","Resources","Prompts"])e["x-mcp"][n]&&(t.find(u=>u?.name===n)||t.push({name:n}));const m=p(o,t),f=e["x-tagGroups"];return a.push(...g(l(e.info,"description")||"",void 0,1)),f&&f.length>0?a.push(...d(o,void 0,f,m,s)):a.push(...c(o,m,void 0,void 0,s)),a}function O(o,s){const e=x(o,s),i=h(e||[],"items");return{contentItems:e,flatItems:i}}export{O as buildContentItems,x as buildMenuStructure};
@@ -25,3 +25,4 @@ export declare function getTagGroupsItems(parser: OpenAPIParser, parent: GroupMo
25
25
  * collects tags and maps each tag to list of operations belonging to this tag
26
26
  */
27
27
  export declare function getTagsWithOperations(parser: OpenAPIParser, explicitTags: OpenAPITag[]): TagsInfoMap;
28
+ export declare function capitalize(input: string): string;
@@ -1 +1,2 @@
1
- import{getTagOrGroup as u}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as h,GROUP_DEPTH as g}from"../../constants.js";import{getValueFromMdParsedExtension as l,isOperationName as x,JsonPointer as y}from"../../utils/index.js";import{getOperationsItems as T}from"./operation.js";import{addMarkdownItems as O}from"./markdown.js";function b(c,i,s,n,r){let e;if(n===void 0?e=Object.keys(i):e=n.tags,!Array.isArray(e))return console.warn("Unexpected values of tags. Check tags or x-tagGroups in your definition."),[];const f=e.map(t=>i[t]?(i[t].used=!0,i[t]):(console.warn(`Non-existing tag "${t}" is added to the group "${n?.name}"`),null)),a=[];for(const t of f){if(!t)continue;const o=u("tag",t,s);if(o.depth=g+1,t.name===""){const m=[...O(l(t,"description")||"",o,o.depth+1),...T(void 0,t,o.depth+1)];a.push(...m);continue}const p=k({definition:c.definition,tag:t,parent:o,schemaDefinitionsTagName:r.schemaDefinitionsTagName});o.items=[...p,...O(l(t,"description")||"",o,o.depth+1),...T(o,t,o.depth+1)],a.push(o)}return a.filter(({name:t,items:o})=>t!==h||o.length>0)}function G(c,i,s,n,r){const e=[];for(const f of s){const a=u("group",f,i);a.depth=g,a.items=b(c,n,a,f,r),e.push(a)}return e}function k({definition:c,tag:i,parent:s,schemaDefinitionsTagName:n}){const r=n?[n]:[];return Object.entries(c.components?.schemas||{}).map(([e,f])=>{if(!(f["x-tags"]||r).includes(i.name))return null;const t=u("schema",{name:e,"x-displayName":`${f.title||e}`,description:`{% schemaDefinition showWriteOnly="true" schemaRef="#/components/schemas/${e}" /%}`,isSchema:!0,level:2},s);return t.depth=s.depth+1,t}).filter(Boolean)}function I(c,i){const{definition:s}=c,n={},r=s["x-webhooks"]||s.webhooks;for(const e of i||[])n[e.name]={...e,operations:[]};return s.paths&&d(c,s.paths,n),r&&d(c,r,n,!0),n}function d(c,i,s,n){for(const r of Object.keys(i||{})){const e=i[r],f=Object.keys(e).filter(x);for(const a of f){const t=e[a];if(e.$ref){const{resolved:p}=c.deref(e);d(c,{[r]:p},s,n);continue}let o=t?.tags;(!o||!o.length)&&(o=n?[h]:[""]);for(const p of o){let m=s[p];m===void 0&&(m={name:p,operations:[]},s[p]=m),!m["x-traitTag"]&&m.operations.push({...t,pathName:r,pointer:y.compile(["paths",r,a]),httpVerb:a,pathParameters:e.parameters||[],pathServers:e.servers,isWebhook:!!n})}}}}export{G as getTagGroupsItems,b as getTagsItems,I as getTagsWithOperations};
1
+ import{getTagOrGroup as d}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as l,GROUP_DEPTH as g}from"../../constants.js";import{getValueFromMdParsedExtension as h,isOperationName as S,JsonPointer as $,safeSlugify as N}from"../../utils/index.js";import{getOperationsItems as T}from"./operation.js";import{addMarkdownItems as x}from"./markdown.js";import{joinWithSeparator as b}from"../history/helpers.js";const y=["tools"];function k(s,c,o,e,a){let t;if(e===void 0?t=Object.keys(c):t=e.tags,!Array.isArray(t))return console.warn("Unexpected values of tags. Check tags or x-tagGroups in your definition."),[];const f=t.map(n=>c[n]?(c[n].used=!0,c[n]):(console.warn(`Non-existing tag "${n}" is added to the group "${e?.name}"`),null)),i=[];for(const n of f){if(!n)continue;const r=d("tag",n,o);if(r.depth=g+1,n.name===""){const P=[...x(h(n,"description")||"",r,r.depth+1),...T(void 0,n,r.depth+1)];i.push(...P);continue}const p=v({definition:s.definition,tag:n,parent:r,schemaDefinitionsTagName:a.schemaDefinitionsTagName}),m=w(s.definition,n,r);r.items=[...p,...m,...x(h(n,"description")||"",r,r.depth+1),...T(r,n,r.depth+1)],i.push(r)}return i.filter(({name:n,items:r})=>n!==l||r.length>0)}function R(s,c,o,e,a){const t=[];for(const f of o){const i=d("group",f,c);i.depth=g,i.items=k(s,e,i,f,a),t.push(i)}return t}function v({definition:s,tag:c,parent:o,schemaDefinitionsTagName:e}){const a=e?[e]:[];return Object.entries(s.components?.schemas||{}).map(([t,f])=>{if(!(f["x-tags"]||a).includes(c.name))return null;const n=d("schema",{name:t,"x-displayName":`${f.title||t}`,description:`{% schemaDefinition showWriteOnly="true" schemaRef="#/components/schemas/${t}" /%}`,isSchema:!0,level:2},o);return n.depth=o.depth+1,n}).filter(Boolean)}function w(s,c,o){const e=[];for(const a of y)if(s["x-mcp"]?.[a]){const t=O(a),f=[t];for(const i of s["x-mcp"]?.[a]||[])if((i.tags?.length?i.tags:f).includes(c.name)){const r=b(o.id,N(i.name)),p=d("mcp",{name:i.name,"x-displayName":i.title||i.name,description:`${i.description||""}
2
+ {% mcp${t.slice(0,-1)} toolName="${i.name}" id="${r}" /%}`,isSchema:!0,level:2},o);p.depth=o.depth+1,e.push(p)}}return e}function U(s,c){const{definition:o}=s,e={},a=o["x-webhooks"]||o.webhooks,t=o["x-mcp"];for(const f of c||[])e[f.name]={...f,operations:[]};return o.paths&&u(s,o.paths,e),a&&u(s,a,e,!0),t&&E(t,e),e}function E(s,c){for(const o of y)if(s[o])for(const e of s[o]){const a=e.tags&&e.tags.length?e.tags:[O(o)];for(const t of a){let f=c[t];f===void 0&&(f={name:t,operations:[],used:!0},c[t]=f)}}}function u(s,c,o,e){for(const a of Object.keys(c||{})){const t=c[a],f=Object.keys(t).filter(S);for(const i of f){const n=t[i];if(t.$ref){const{resolved:p}=s.deref(t);u(s,{[a]:p},o,e);continue}let r=n?.tags;(!r||!r.length)&&(r=e?[l]:[""]);for(const p of r){let m=o[p];m===void 0&&(m={name:p,operations:[]},o[p]=m),!m["x-traitTag"]&&m.operations.push({...n,pathName:a,pointer:$.compile(["paths",a,i]),httpVerb:i,pathParameters:t.parameters||[],pathServers:t.servers,isWebhook:!!e})}}}}function O(s){return s.charAt(0).toUpperCase()+s.slice(1)}export{O as capitalize,R as getTagGroupsItems,k as getTagsItems,U as getTagsWithOperations};
@@ -17,7 +17,7 @@ export type ExternalLinkSeparator = {
17
17
  separator?: string;
18
18
  separatorLine?: boolean;
19
19
  };
20
- export type MenuItemGroupType = 'group' | 'tag' | 'section' | 'schema';
20
+ export type MenuItemGroupType = 'group' | 'tag' | 'section' | 'schema' | 'mcp';
21
21
  export type MenuItemType = MenuItemGroupType | 'operation';
22
22
  /** Generic interface for MenuItems */
23
23
  export interface IMenuItem {
package/lib/standalone.js CHANGED
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{createElement as p}from"react";import{createRoot as u,hydrateRoot as m}from"react-dom/client";import{querySelector as a}from"./utils/dom.js";import{RedoclyOpenAPIDocs as l}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{RedoclyOpenAPIDocsStandalone as f}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js";import{setSecurityDetails as v,setSecurityDetailsVariants as V}from"./utils/security-details.js";import{setParameterValue as D}from"./utils/parameters.js";function _(t){const o={},e=t.attributes;for(let r=0;r<e.length;r++){const n=e[r];o[n.name]=n.value}return o}function d(t){const o=_(t),e={};for(const r in o){const n=r.replace(/-(.)/g,(c,s)=>s.toUpperCase());e[n]=o[r]}return e}function N(t,o=document.querySelector("redoc")){m(o,i(l,{store:t}))}function E(t,o={},e=a("redoc")){if(e===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');const{router:r,...n}=o;let c,s;typeof t=="string"?c=t:typeof t=="object"&&(s=t),u(e).render(p(f,{definition:s,definitionUrl:c,options:{...n,...d(e)},router:r??"history"},["Loading..."]))}const b=__REDOCLY_API_REFERENCE_VERSION__,C=__REDOCLY_API_REFERENCE_REVISION__;function R(){const t=a("redoc");if(!t)return;const o=t.getAttribute("spec-url");o&&E(o,{},t)}R();export{N as hydrate,E as init,C as revision,D as setParameterValue,v as setSecurityDetails,V as setSecurityDetailsVariants,b as version};
1
+ import{jsx as i}from"react/jsx-runtime";import{createElement as p}from"react";import{createRoot as u,hydrateRoot as m}from"react-dom/client";import{querySelector as a}from"./utils/dom.js";import{RedoclyOpenAPIDocs as l}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{RedoclyOpenAPIDocsStandalone as f}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js";import{setSecurityDetails as v,setSecurityDetailsVariants as V}from"./utils/security-details.js";import{setParameterValue as D}from"./utils/parameters.js";function _(t){const e={},o=t.attributes;for(let r=0;r<o.length;r++){const n=o[r];e[n.name]=n.value}return e}function d(t){const e=_(t),o={};for(const r in e){const n=r.replace(/-(.)/g,(c,s)=>s.toUpperCase());o[n]=e[r]}return o}function N(t,e=document.querySelector("redoc")){m(e,i(l,{store:t}))}function E(t,e={},o=a("redoc")){if(o===null)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');const{router:r,...n}=e;let c,s;typeof t=="string"?c=t:typeof t=="object"&&(s=t),u(o).render(p(f,{definition:s,definitionUrl:c,options:{...n,...d(o)},router:r??"hash"},["Loading..."]))}const b=__REDOCLY_API_REFERENCE_VERSION__,C=__REDOCLY_API_REFERENCE_REVISION__;function R(){const t=a("redoc");if(!t)return;const e=t.getAttribute("spec-url");e&&E(e,{},t)}R();export{N as hydrate,E as init,C as revision,D as setParameterValue,v as setSecurityDetails,V as setSecurityDetailsVariants,b as version};
@@ -10,6 +10,7 @@ export interface OpenAPIDefinition {
10
10
  tags?: OpenAPITag[];
11
11
  externalDocs?: OpenAPIExternalDocumentation;
12
12
  webhooks?: OpenAPIPaths;
13
+ 'x-mcp'?: OpenAPIMcp;
13
14
  'x-webhooks'?: OpenAPIPaths;
14
15
  'x-tagGroups'?: Array<{
15
16
  name: string;
@@ -47,6 +48,7 @@ export interface XSEO {
47
48
  export interface OpenAPIServer extends ParsedDescription {
48
49
  url: string;
49
50
  description?: string;
51
+ name?: string;
50
52
  variables?: OpenAPIServerVariables;
51
53
  }
52
54
  export interface OpenAPIServerVariables {
@@ -314,6 +316,8 @@ export interface OpenAPISecurityScheme extends ParsedDescription {
314
316
  scheme?: string;
315
317
  bearerFormat: string;
316
318
  'x-defaultClientId'?: string;
319
+ deprecated?: boolean;
320
+ oauth2MetadataUrl?: string;
317
321
  flows: {
318
322
  implicit?: {
319
323
  refreshUrl?: string;
@@ -321,6 +325,13 @@ export interface OpenAPISecurityScheme extends ParsedDescription {
321
325
  authorizationUrl: string;
322
326
  'x-defaultClientId'?: string;
323
327
  };
328
+ deviceAuthorization?: {
329
+ deviceAuthorizationUrl: string;
330
+ scopes: Record<string, string>;
331
+ tokenUrl: string;
332
+ refreshUrl?: string;
333
+ 'x-defaultClientId'?: string;
334
+ };
324
335
  password?: {
325
336
  refreshUrl?: string;
326
337
  scopes: Record<string, string>;
@@ -374,3 +385,48 @@ export interface ParsedDescription {
374
385
  export interface ParsedDescriptionWithSummary extends ParsedDescription {
375
386
  'x-parsed-md-summary'?: GenericObject;
376
387
  }
388
+ export interface OpenAPIMcp {
389
+ protocolVersion: string;
390
+ capabilities: {
391
+ [key: string]: boolean | {
392
+ listChanged?: boolean;
393
+ subscribe?: boolean;
394
+ [key: string]: unknown;
395
+ };
396
+ };
397
+ servers: OpenAPIServer[];
398
+ tools: McpTool[];
399
+ resources: McpResource[];
400
+ prompts: McpPrompt[];
401
+ }
402
+ export interface McpTool {
403
+ name: string;
404
+ title?: string;
405
+ description?: string;
406
+ inputSchema: OpenAPISchema;
407
+ outputSchema?: OpenAPISchema;
408
+ security?: OpenAPISecurityRequirement[];
409
+ tags?: string[];
410
+ 'x-badges'?: OpenAPIXBadges[];
411
+ }
412
+ export interface McpResource {
413
+ name: string;
414
+ title?: string;
415
+ description?: string;
416
+ uri: string;
417
+ mimeType: string;
418
+ security?: OpenAPISecurityRequirement[];
419
+ tags?: string[];
420
+ 'x-badges'?: OpenAPIXBadges[];
421
+ }
422
+ export interface McpPrompt {
423
+ name: string;
424
+ title?: string;
425
+ description: string;
426
+ arguments: McpPromptArgument[];
427
+ }
428
+ export interface McpPromptArgument {
429
+ name: string;
430
+ description: string;
431
+ required: boolean;
432
+ }
@@ -1,2 +1,2 @@
1
- import type { SchemaModel } from 'src/models/index.js';
1
+ import type { SchemaModel } from '../models/types.js';
2
2
  export declare function hasNestedFields(schema?: SchemaModel): boolean;
@@ -1,3 +1,4 @@
1
+ import type { OpenAPIServer } from '../types/open-api';
1
2
  /**
2
3
  * Maps over array passing `isLast` bool to iterator as the second argument
3
4
  */
@@ -42,5 +43,6 @@ export declare function getWindowReferenceOptions<T>(option: string): T | null;
42
43
  export declare function getJsUrl(): string;
43
44
  export declare const normalizeText: (text?: string | GenericObject) => string;
44
45
  export declare const getValueFromMdParsedExtension: (item: GenericObject, key: "description" | "summary" | "x-summary" | "x-enumDescriptions") => any;
46
+ export declare function getServerDisplayName(server: OpenAPIServer): string | undefined;
45
47
  export declare function isLastInArray(arr: Array<unknown>, index: number): boolean;
46
48
  export declare function isLastProperty(obj: object, key: string): boolean;
@@ -1,12 +1,12 @@
1
- import{isObject as i,isString as a}from"@redocly/theme/core/openapi";import{isNamedDefinition as f}from"./openapi.js";import{JsonPointer as l}from"./JsonPointer.js";import{urlParse as u}from"./url.js";import{IS_BROWSER as c}from"./dom.js";function O(r,t){const e=[];for(let n=0;n<r.length-1;n++)e.push(t(r[n],!1));return r.length!==0&&e.push(t(r[r.length-1],!0)),e}function y(r,t){const e={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=t(r[n],n,r));return e}function A(r,t){const e=[],n=o=>{for(const s of o)e.push(s),s[t]&&n(s[t])};return n(r),e}function p(r){return r.endsWith("/")?r.substring(0,r.length-1):r}function b(r){return!isNaN(parseFloat(r))&&isFinite(r)}function E(r,t,e){const n=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(r))return r.replace(o,`$1
1
+ import{isObject as i,isString as a}from"@redocly/theme/core/openapi";import{isNamedDefinition as f}from"./openapi.js";import{JsonPointer as l}from"./JsonPointer.js";import{urlParse as u}from"./url.js";import{IS_BROWSER as c}from"./dom.js";function O(r,e){const t=[];for(let n=0;n<r.length-1;n++)t.push(e(r[n],!1));return r.length!==0&&t.push(e(r[r.length-1],!0)),t}function y(r,e){const t={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=e(r[n],n,r));return t}function A(r,e){const t=[],n=o=>{for(const s of o)t.push(s),s[e]&&n(s[e])};return n(r),t}function p(r){return r.endsWith("/")?r.substring(0,r.length-1):r}function b(r){return!isNaN(parseFloat(r))&&isFinite(r)}function E(r,e,t){const n=new RegExp(`(^|\\n)#\\s?${e}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${e}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(r))return r.replace(o,`$1
2
2
 
3
- ${e}
3
+ ${t}
4
4
  $4`);{const s=r===""||r.endsWith(`
5
5
 
6
6
  `)?"":r.endsWith(`
7
7
  `)?`
8
8
  `:`
9
9
 
10
- `;return`${r}${s}# ${t}
10
+ `;return`${r}${s}# ${e}
11
11
 
12
- ${e}`}}const R=r=>Array.isArray(r)&&r.some(t=>i(t)),W=r=>r.filter(t=>!!t),C=r=>i(r)&&!Array.isArray(r);function d(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function I(r,t){let e;if(t.startsWith("//"))e=`${u(r,!0)?.protocol||"https:"}${t}`;else if(d(t))e=t;else if(!t.startsWith("/"))e=p(r)+"/"+t;else{const n=u(r);n?(n.pathname=t,e=n.toString()):e=t}return p(e)}function L(r){return r.charAt(0).toUpperCase()+r.slice(1)}function M(r){try{if(!r)return"";const t=new URL(r);return t.search="",t.hash="",t.toString()}catch{return r}}function N(r){return r.replace(/["\\]/g,"\\$&")}function P(r){return r.replace(/&#(\d+);/g,(t,e)=>String.fromCharCode(parseInt(e,10))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function T(r){return r&&r.replace(/#/g,"_").toLowerCase()}function j(r,t){return t||f(r)&&l.baseName(r)||""}function z(r={},t,e){return typeof t=="string"&&(t=t.split(".")),t.reduce((n,o)=>n&&n[o]?n[o]:e,r)}function x(r){return(...t)=>t.filter(Boolean).join(r)}const D=x(".");function F(r){return c?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}function _(){if(!c)return"";const r=+new Date+Math.random();try{return(!document.currentScript||!(document.currentScript.async||document.currentScript.defer))&&document.write(`<script id="dummy${r}"></script>`),(document.getElementById("dummy"+r)?.previousSibling).src}catch{return""}}const B=r=>a(r)?r:r?.raw,H=(r,t)=>{const e=r?.[`x-parsed-md-${t}`]||r?.[t];if(!e)return;if(!r?.[`x-parsed-md-${t}`]&&t!=="x-enumDescriptions")return r?.[t];if(t!=="x-enumDescriptions")return g(r,t);let n={};for(const o in e)o.startsWith("x-parsed-md")||(n[o]=e?.[`x-parsed-md-${o}`]||e?.[o]);return Object.keys(n).length?n:e};function g(r,t){const e=r?.[`x-parsed-md-${t}`]||r?.[t];return e?.raw?e:{result:e?.result||r?.[t]?.result||r?.[t],raw:r?.[t]}}function U(r,t){return t===r.length-1}function V(r,t){const e=Object.keys(r);return e.indexOf(t)===e.length-1}export{E as appendToMdHeading,W as deleteEmptyArrayItem,D as dottedString,N as escapeHTMLAttrChars,A as flattenByProp,z as get,_ as getJsUrl,H as getValueFromMdParsedExtension,F as getWindowReferenceOptions,d as isAbsoluteUrl,R as isArrayOfObjects,U as isLastInArray,V as isLastProperty,C as isMergeableObject,b as isNumeric,x as joinStringFactory,y as mapValues,O as mapWithLast,B as normalizeText,M as removeQueryStringAndHash,I as resolveUrl,T as sanitizeItemId,p as stripTrailingSlash,L as titleize,P as unescapeHTMLChars,j as useSchemaTitle};
12
+ ${t}`}}const R=r=>Array.isArray(r)&&r.some(e=>i(e)),W=r=>r.filter(e=>!!e),C=r=>i(r)&&!Array.isArray(r);function d(r){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(r)}function I(r,e){let t;if(e.startsWith("//"))t=`${u(r,!0)?.protocol||"https:"}${e}`;else if(d(e))t=e;else if(!e.startsWith("/"))t=p(r)+"/"+e;else{const n=u(r);n?(n.pathname=e,t=n.toString()):t=e}return p(t)}function N(r){return r.charAt(0).toUpperCase()+r.slice(1)}function L(r){try{if(!r)return"";const e=new URL(r);return e.search="",e.hash="",e.toString()}catch{return r}}function M(r){return r.replace(/["\\]/g,"\\$&")}function P(r){return r.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}function T(r){return r&&r.replace(/#/g,"_").toLowerCase()}function j(r,e){return e||f(r)&&l.baseName(r)||""}function z(r={},e,t){return typeof e=="string"&&(e=e.split(".")),e.reduce((n,o)=>n&&n[o]?n[o]:t,r)}function x(r){return(...e)=>e.filter(Boolean).join(r)}const D=x(".");function F(r){return c?window?.REFERENCE_DOCS_OPTIONS?.[r]:null}function _(){if(!c)return"";const r=+new Date+Math.random();try{return(!document.currentScript||!(document.currentScript.async||document.currentScript.defer))&&document.write(`<script id="dummy${r}"></script>`),(document.getElementById("dummy"+r)?.previousSibling).src}catch{return""}}const B=r=>a(r)?r:r?.raw,H=(r,e)=>{const t=r?.[`x-parsed-md-${e}`]||r?.[e];if(!t)return;if(!r?.[`x-parsed-md-${e}`]&&e!=="x-enumDescriptions")return r?.[e];if(e!=="x-enumDescriptions")return m(r,e);let n={};for(const o in t)o.startsWith("x-parsed-md")||(n[o]=t?.[`x-parsed-md-${o}`]||t?.[o]);return Object.keys(n).length?n:t};function U(r){return r.name||r.description}function m(r,e){const t=r?.[`x-parsed-md-${e}`]||r?.[e];return t?.raw?t:{result:t?.result||r?.[e]?.result||r?.[e],raw:r?.[e]}}function V(r,e){return e===r.length-1}function v(r,e){const t=Object.keys(r);return t.indexOf(e)===t.length-1}export{E as appendToMdHeading,W as deleteEmptyArrayItem,D as dottedString,M as escapeHTMLAttrChars,A as flattenByProp,z as get,_ as getJsUrl,U as getServerDisplayName,H as getValueFromMdParsedExtension,F as getWindowReferenceOptions,d as isAbsoluteUrl,R as isArrayOfObjects,V as isLastInArray,v as isLastProperty,C as isMergeableObject,b as isNumeric,x as joinStringFactory,y as mapValues,O as mapWithLast,B as normalizeText,L as removeQueryStringAndHash,I as resolveUrl,T as sanitizeItemId,p as stripTrailingSlash,N as titleize,P as unescapeHTMLChars,j as useSchemaTitle};
@@ -1 +1 @@
1
- import{bundle as a,loadConfig as r}from"@redocly/openapi-core";import{combineUrls as s}from"@redocly/theme/core/openapi";import{convertSwagger2OpenAPI as c}from"./convertSwagger2OpenAPI.js";import{IS_BROWSER as t}from"./dom.js";import{REDOCLY_CONFIG_FILE as f}from"../constants.js";async function w(){const o=t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():"";try{return(await r({configPath:s(o,f)}))?.resolvedConfig.openapi||{}}catch(n){return console.warn("Error loading redocly.yaml",n),{}}}async function b(o){const n=await r(),e={config:n,base:t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};t&&(n.resolve.http.customFetch=globalThis.fetch),typeof o=="object"&&o!==null?e.doc=l(o):e.ref=o;const{bundle:{parsed:i}}=await a(e);return i.swagger!==void 0?c(i):i}function l(o){return{source:{absoluteRef:""},parsed:o}}export{b as loadAndBundleDefinition,w as loadOpenapiConfig};
1
+ import{bundle as a,loadConfig as r}from"@redocly/openapi-core";import{combineUrls as s}from"@redocly/theme/core/openapi";import{convertSwagger2OpenAPI as c}from"./convertSwagger2OpenAPI.js";import{IS_BROWSER as t}from"./dom.js";import{REDOCLY_CONFIG_FILE as f}from"../constants.js";async function w(){const o=t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():"";try{return(await r({configPath:s(o,f)}))?.resolvedConfig.openapi||{}}catch{return{}}}async function b(o){const n=await r(),e={config:n,base:t?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};t&&(n.resolve.http.customFetch=globalThis.fetch),typeof o=="object"&&o!==null?e.doc=d(o):e.ref=o;const{bundle:{parsed:i}}=await a(e);return i.swagger!==void 0?c(i):i}function d(o){return{source:{absoluteRef:""},parsed:o}}export{b as loadAndBundleDefinition,w as loadOpenapiConfig};
@@ -0,0 +1,3 @@
1
+ export declare const MCP_SERVER_CAPABILITIES: string[];
2
+ export declare const MCP_SERVER_EXPERIMENTAL_CAPABILITIES = "experimental";
3
+ export declare const PAGE_ACTIONS_MCP: "mcp-cursor"[];
@@ -0,0 +1 @@
1
+ const o=["tools","resources","prompts","logging","subscribe","completions"],s="experimental",e=["mcp-cursor"];export{o as MCP_SERVER_CAPABILITIES,s as MCP_SERVER_EXPERIMENTAL_CAPABILITIES,e as PAGE_ACTIONS_MCP};
@@ -0,0 +1,2 @@
1
+ import type { IMenuItem } from '../services/types';
2
+ export declare function isRenderableMenuItem(item: IMenuItem): boolean;
@@ -0,0 +1 @@
1
+ function n(e){return e.type==="operation"||e.type==="schema"||e.type==="mcp"}export{n as isRenderableMenuItem};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.14.0-next.9",
3
+ "version": "3.14.1",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@markdoc/markdoc": "0.5.2",
24
- "@redocly/openapi-core": "2.2.0",
24
+ "@redocly/openapi-core": "2.3.1",
25
25
  "deepmerge": "^4.2.2",
26
- "dompurify": "3.2.6",
26
+ "dompurify": "3.2.7",
27
27
  "fast-deep-equal": "^3.1.3",
28
28
  "jotai": "^2.12.5",
29
29
  "json-pointer": "^0.6.2",
@@ -36,8 +36,8 @@
36
36
  "url-template": "^2.0.8",
37
37
  "util": "~0.12.5",
38
38
  "web-vitals": "3.3.1",
39
- "@redocly/config": "0.34.0",
40
- "@redocly/replay": "0.17.0-next.9"
39
+ "@redocly/config": "0.35.1",
40
+ "@redocly/replay": "0.17.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "29.5.0",
@@ -75,7 +75,7 @@
75
75
  "typescript": "5.6.2",
76
76
  "url": "~0.11.0",
77
77
  "vite": "6.3.6",
78
- "@redocly/theme": "0.58.0-next.6"
78
+ "@redocly/theme": "0.58.1"
79
79
  },
80
80
  "scripts": {
81
81
  "start": "npm run copy-highlight-hook && vite",
@@ -84,7 +84,8 @@
84
84
  "build:standalone": "vite build && node scripts/minify.js dist",
85
85
  "prepare:community-source": "npx tsx scripts/prepare-community-source.ts --",
86
86
  "prepare:community-source-only": "npm run prepare:community-source --ignore /src/* private-readme.md",
87
- "test": "jest -w 2",
87
+ "prepare:community-dependencies": "npx tsx scripts/prepare-community-dependencies.ts",
88
+ "test": "npm run prepare:community-source && cd redoc && npm install && npm run lint && npm run unit && cd ../ && jest -w 2",
88
89
  "test:update": "jest -u",
89
90
  "test:watch": "jest --watch",
90
91
  "test:coverage": "jest --coverage",