@redocly/openapi-docs 3.15.0-next.5 → 3.15.0-rc.2
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.
- package/dist/redocly-openapi-docs.min.js +2025 -2147
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/Metadata.js +1 -1
- package/lib/components/McpOverview/McpOverview.js +7 -3
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/PanelItem/styled.js +9 -5
- package/lib/components/RedoclyOpenAPIDocs/Error.js +3 -3
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.d.ts +2 -2
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/styled.js +2 -6
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +0 -2
- package/lib/components/RightPanel/RightPanel.js +5 -1
- package/lib/components/SectionContent/SectionContent.js +4 -4
- package/lib/components/ServerList/ServerList.js +11 -11
- package/lib/components/TagItem/TagItem.js +7 -6
- package/lib/components/common/Fields/fields.js +5 -3
- package/lib/hooks/index.d.ts +1 -1
- package/lib/hooks/index.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/models/group.js +1 -1
- package/lib/models/types.d.ts +0 -1
- package/lib/services/menu/builder.js +1 -1
- package/lib/services/menu/markdown.js +1 -1
- package/lib/services/menu/tags.js +4 -2
- package/lib/services/types.d.ts +6 -1
- package/lib/standalone.d.ts +0 -1
- package/lib/standalone.js +1 -1
- package/lib/types/open-api.d.ts +7 -2
- package/lib/utils/mcp.d.ts +1 -1
- package/lib/utils/mcp.js +1 -1
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/string.js +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useAtomValue as D}from"jotai";import{LayoutVariant as g}from"@redocly/config";import{AfterOpenApiTitle as h}from"@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiTitle";import{AfterOpenApiDescription as k}from"@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiDescription";import{PageActions as S}from"@redocly/theme/components/PageActions/PageActions";import{SamplesMiddlePanel as H,Row as M}from"../common/index.js";import{ExternalDocumentation as T}from"../ExternalDocumentation/index.js";import{Markdown as m}from"../Markdown/index.js";import{ApiHeader as j}from"./styled.js";import{globalStoreAtom as y}from"../../jotai/store.js";import{saveTextBeforeHeading as P}from"../../utils/saveTextBeforeHeading.js";import{getValueFromMdParsedExtension as p}from"../../utils/helpers.js";import{RenderHook as f}from"../RenderHook/index.js";import{Metadata as v}from"./Metadata.js";import{useTranslate as E}from"../../hooks/index.js";function z({item:l,layout:t}){const c=E(),{options:{unstable_hooks:e,hideInfoMetadata:d,routingBasePath:u},parser:{definition:A}}=D(y),o=l.infoDefinition;if(!o)return null;const i=P(p(o,"description")||""),a=p(o,"summary")||void 0,n=A?.externalDocs||o?.externalDocs,x=t===g.STACKED;return r(M,{layout:t,children:s(H,{fullWidth:!0,className:"api-info",isStacked:x,children:[s(j,{children:[(o.title||"")+(o.version?` (${o.version})`:""),r(S,{pageSlug:u})]}),r(f,{Hook:h||e?.AfterApiTitle,props:{info:o}}),a&&r(m,{source:a,"data-role":"redoc-summary"}),i&&r(m,{source:i,"data-role":"redoc-description"}),r(f,{Hook:k||e?.AfterOpenApiDescription,props:{info:o}}),n&&r(T,{externalDocs:n}),!d&&r(v,{metadata:o["x-metadata"],translate:c})]})})}export{z as ApiInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useMemo as c}from"react";import{Markdown as d}from"@redocly/theme/components/Markdown/Markdown";import{H3 as p}from"@redocly/theme/components/Typography/H3";import{isNotNull as a}from"@redocly/theme/core/openapi";import{isAbsoluteUrl as s}from"../../utils/helpers.js";const f=["title","description"];function m([t,r]){return f.includes(t)?null:Array.isArray(r)?{key:t,value:r.filter(o=>typeof o!="object").join(", ")}:typeof r=="object"?null:{key:t,value:r}}function y({metadata:t,translate:r}){const o=c(()=>Object.entries(t||{}).map(m).filter(a),[t]);return t?n(d,{children:[e(p,{children:r("openapi.info.metadata.title","Metadata")}),n("table",{className:"md",children:[e("thead",{children:n("tr",{children:[e("th",{scope:"col",children:r("openapi.key","Key")}),e("th",{scope:"col",children:r("openapi.value","Value")})]})}),e("tbody",{children:o.map(({key:l,value:i})=>n("tr",{children:[e("td",{children:l}),e("td",{children:typeof i=="string"&&s(i)?e("a",{href:i,target:"_blank",rel:"noreferrer",children:i}):String(i)})]},l))})]})]}):null}export{y as Metadata};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import{jsx as t,jsxs as o,Fragment as
|
|
1
|
+
import{jsx as t,jsxs as o,Fragment as c}from"react/jsx-runtime";import*as b from"react";import{NewTabButton as h}from"@redocly/theme/components/Buttons/NewTabButton";import{PageActions as u}from"@redocly/theme/components/PageActions/PageActions";import{Tag as p}from"@redocly/theme/components/Tag/Tag";import{CheckmarkIcon as g}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{MCP_SERVER_CAPABILITIES as f,MCP_SERVER_EXPERIMENTAL_CAPABILITIES as P,PAGE_ACTIONS_MCP as E}from"../../utils/mcp.js";import{PanelItem as r}from"../PanelItem/PanelItem.js";import{Item as C,PanelItemsList as _,Title as j}from"../PanelItem/styled.js";import{useTranslate as x}from"../../hooks/index.js";import{styled as l}from"../../styled-components.js";function F({mcpInfo:e,mcpServers:s}){const a=x();function m(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.listChanged}function d(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.subscribe}return o(A,{children:[e?.protocolVersion&&t(r,{header:a("openapi.mcp.protocolVersion","Protocol version"),title:e.protocolVersion}),e?.capabilities&&t(r,{header:a("openapi.mcp.capabilities","Capabilities"),title:t(c,{children:f.map(i=>e?.capabilities[i]?o(p,{size:"small",icon:t(g,{}),children:[i,m(i)?" (list changed)":"",d(i)?" (subscribe)":""]},i):null)})}),e?.capabilities[P]&&t(r,{header:a("openapi.mcp.experimentalCapabilities","Experimental capabilities"),title:t(L,{children:Object.entries(e?.capabilities.experimental||{}).map(([i,n])=>o(b.Fragment,{children:[o("span",{children:[i,":"]}),t(p,{children:typeof n=="object"?JSON.stringify(n):String(n)})]},i))})}),t(r,{header:a("openapi.mcp.endpoint","Endpoint"),title:t(c,{children:s[0]?.url}),actions:[t(h,{data:s[0]?.url},"NewTabButton")]}),t(r,{title:t(T,{children:t(u,{actions:E,mcpUrl:s[0]?.url})})})]})}const A=l(_)`
|
|
2
|
+
${C}, ${j} {
|
|
3
|
+
overflow: visible;
|
|
4
|
+
}
|
|
5
|
+
`,T=l.div`
|
|
2
6
|
& button {
|
|
3
7
|
width: 100%;
|
|
4
8
|
}
|
|
5
9
|
> div {
|
|
6
10
|
padding: 0;
|
|
7
11
|
}
|
|
8
|
-
`,
|
|
12
|
+
`,L=l.div`
|
|
9
13
|
display: grid;
|
|
10
14
|
grid-template-columns: 1fr 2fr;
|
|
11
15
|
gap: 10px;
|
|
@@ -13,4 +17,4 @@ import{jsx as t,jsxs as o,Fragment as l}from"react/jsx-runtime";import*as b from
|
|
|
13
17
|
> * {
|
|
14
18
|
justify-self: start;
|
|
15
19
|
}
|
|
16
|
-
`;export{
|
|
20
|
+
`;export{F as McpOverview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as h,Fragment as b}from"react/jsx-runtime";import{useAtomValue as f}from"jotai";import{CopyButton as v}from"@redocly/theme/components/Buttons/CopyButton";import{NewTabButton as c}from"@redocly/theme/components/Buttons/NewTabButton";import{EmailButton as B}from"@redocly/theme/components/Buttons/EmailButton";import{AdditionalOverviewInfo as O}from"@redocly/theme/components/OpenApiDocs/hooks/AdditionalOverviewInfo";import{PanelItem as a,PanelItemDescription as l,PanelItemsList as _}from"../PanelItem/index.js";import{globalStoreAtom as g}from"../../jotai/store.js";import{RenderHook as w}from"../RenderHook/RenderHook.js";function E({info:e,translate:n}){const{options:o}=f(g),{unstable_hooks:i}=o||{},m=e.contact&&e.contact.url&&t(a,{header:t(l,{children:n("openapi.info.contact.url","URL")}),title:t("a",{href:e.contact.url,target:"_blank",rel:"noreferrer",children:e.contact.url}),actions:[t(c,{data:e.contact.url},"NewTabButton")]})||null,s=e.contact&&e.contact.email&&t(a,{header:t(l,{children:e.contact.name||n("openapi.info.contact.name","E-mail")}),title:t("a",{href:"mailto:"+e.contact.email,children:e.contact.email}),actions:[t(v,{data:e.contact.email},"CopyButton"),t(B,{data:e.contact.email},"EmailButton")]})||null,u=e.license&&t(a,{header:t(l,{children:n("openapi.info.license","License")}),title:e.license.identifier?e.license.identifier:t("a",{href:e.license.url,target:"_blank",rel:"noreferrer",children:e.license.name}),actions:[t(c,{data:e.license.url||""},"NewTabButton")]})||null,p=e.termsOfService&&t(a,{title:t("a",{href:e.termsOfService,target:"_blank",rel:"noreferrer",children:n("openapi.info.termsOfService","Terms of Service")}),actions:[t(c,{data:e.termsOfService},e.termsOfService)]})||null,d=e["x-links"]?.map(r=>t(a,{header:t(l,{children:r.name}),title:t("a",{href:r.url,target:"_blank",rel:"noreferrer",children:r.url}),actions:[t(c,{data:r.url},"NewTabButton")]},r.url))||null;return t(b,{children:h(_,{children:[m,s,u,p,d,t(w,{Hook:O||i?.AfterOpenApiInfo,props:{info:e}})]})})}export{E as Overview};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{styled as t}from"../../styled-components.js";const
|
|
1
|
+
import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{styled as t}from"../../styled-components.js";const a=t.span`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
5
5
|
padding: 0;
|
|
6
6
|
position: relative;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,
|
|
8
|
+
`,r=t.span`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
justify-content: flex-start;
|
|
@@ -16,7 +16,7 @@ import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon"
|
|
|
16
16
|
color: var(--menu-content-title-color);
|
|
17
17
|
font-size: var(--h6-font-size);
|
|
18
18
|
line-height: var(--line-height-xsm);
|
|
19
|
-
`,l=t.
|
|
19
|
+
`,l=t.p`
|
|
20
20
|
margin: 0;
|
|
21
21
|
color: var(--text-color-secondary);
|
|
22
22
|
font-size: var(--font-size-base);
|
|
@@ -44,10 +44,14 @@ import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon"
|
|
|
44
44
|
font-size: var(--font-size-base);
|
|
45
45
|
line-height: var(--line-height-base);
|
|
46
46
|
font-weight: var(--font-weight-medium);
|
|
47
|
-
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: var(--spacing-xs);
|
|
50
|
+
justify-content: flex-start;
|
|
51
|
+
`,x=t(o)`
|
|
48
52
|
width: 14px;
|
|
49
53
|
height: 14px;
|
|
50
54
|
position: absolute;
|
|
51
55
|
left: -18px;
|
|
52
56
|
bottom: 3px;
|
|
53
|
-
`;export{p as ActionsWrap,s as Header,
|
|
57
|
+
`;export{p as ActionsWrap,s as Header,r as Item,d as PanelItemDescription,a as PanelItemWrap,c as PanelItemsList,x as StyledCheckmarkIcon,l as Title};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as i}from"react/jsx-runtime";import t from"styled-components";import{GlobalStyle as a}from"@redocly/theme/core/openapi";function f({description:o}){return console.error(o),r(i,{children:[e(a,{}),r(n,{children:[e(
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as i}from"react/jsx-runtime";import t from"styled-components";import{GlobalStyle as a}from"@redocly/theme/core/openapi";function f({description:o}){return console.error(o),r(i,{children:[e(a,{}),r(n,{children:[e(l,{children:";("}),e(s,{children:"Something went wrong..."}),r(g,{children:["Please check the console for get more details or"," ",e("a",{target:"_blank",rel:"noopener noreferrer",href:"https://redocly.com/docs/redoc",children:"documentation"}),"."]})]})]})}const n=t.div`
|
|
2
2
|
height: 100vh;
|
|
3
3
|
max-width: var(--page-404-max-width);
|
|
4
4
|
display: flex;
|
|
@@ -7,12 +7,12 @@ import{jsx as e,jsxs as r,Fragment as i}from"react/jsx-runtime";import t from"st
|
|
|
7
7
|
margin: var(--page-404-margin-vertical) var(--page-404-margin-horizontal);
|
|
8
8
|
font-family: var(--page-404-font-family);
|
|
9
9
|
gap: var(--page-404-gap);
|
|
10
|
-
`,
|
|
10
|
+
`,l=t.div`
|
|
11
11
|
color: var(--page-404-status-text-color);
|
|
12
12
|
font-size: var(--page-404-status-font-size);
|
|
13
13
|
line-height: var(--page-404-status-line-height);
|
|
14
14
|
font-weight: var(--page-404-status-font-weight);
|
|
15
|
-
`,
|
|
15
|
+
`,s=t.div`
|
|
16
16
|
color: var(--page-404-title-text-color);
|
|
17
17
|
font-size: var(--page-404-title-font-size);
|
|
18
18
|
line-height: var(--page-404-title-line-height);
|
|
@@ -4,5 +4,5 @@ import type { OpenAPIDefinition } from '../../types/index.js';
|
|
|
4
4
|
import type { RedocConfig } from '@redocly/config';
|
|
5
5
|
export declare function loadSingle(spec: any, specUrl: any, options?: RedocConfig): Promise<OpenAPIDefinition>;
|
|
6
6
|
export declare function loadAndBundleSpecOrMd(url: string, title?: string): Promise<OpenAPIDefinition>;
|
|
7
|
-
export declare const AppProvider: ({ options, definitionUrl,
|
|
8
|
-
export declare function RedoclyOpenAPIDocsStandalone({ definition, definitionUrl,
|
|
7
|
+
export declare const AppProvider: ({ options, definitionUrl, definition, activeSampleLanguage, children, }: PropsWithChildren<AppProviderProps>) => ReactElement | null;
|
|
8
|
+
export declare function RedoclyOpenAPIDocsStandalone({ definition, definitionUrl, options, activeItemId, activeSampleLanguage, activeDeepLink, router, }: RedoclyOpenAPIDocsStandaloneProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{cloneElement as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{cloneElement as w,isValidElement as x,useEffect as g,useMemo as A,useState as c}from"react";import{Loading as O}from"@redocly/theme/components/Loaders/Loading";import{useDeepCompareMemoize as D,fixSpec as E}from"./utils.js";import{argValueToBoolean as L}from"../../utils/index.js";import{RedoclyOpenAPIDocs as P}from"./RedoclyOpenAPIDocs.js";import{loadAndBundleDefinition as u,loadOpenapiConfig as B}from"../../utils/loadAndBundleSpec.js";import{ErrorPage as I}from"./Error.js";async function k(e,o,t){let n;if(t?.skipBundle){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');n=e}else n=await u(e||o);try{E(n)}catch{}return n}function _(e,o){return e.endsWith(".md")?u({openapi:"3.0.0",info:{title:o||"",version:"1.0",description:{$ref:e}},paths:{}}):u(e)}const C=({options:e,definitionUrl:o,definition:t,activeSampleLanguage:n,children:r})=>{const[i,l]=c(),[h,f]=c(!0),[d,y]=c(null),[m,S]=c(e||{});g(()=>{async function v(){f(!0);try{const p=await B();S({...e,...p}),y(await k(t,o,e))}catch(p){l(p.message)}}v()},[t,o,e]);const a=A(()=>{if(d)return{definition:d,options:m,definitionUrl:o,activeSampleLanguage:n}},D([d,o,m]));return g(()=>{a&&f(!1)},[a]),i?s(I,{description:i||"Please check path to your OpenAPI description"}):a?h?L(e?.hideLoading,!1)?null:s(O,{color:"--loading-spinner-color"}):x(r)?w(r,{store:a}):null:null};function $({definition:e,definitionUrl:o,options:t={},activeItemId:n,activeSampleLanguage:r,activeDeepLink:i,router:l}){return s(C,{definition:e,definitionUrl:o,options:t,activeItemId:n,activeSampleLanguage:r,activeDeepLink:i,children:s(P,{withCommonStyles:!0,router:l||"hash"})})}export{C as AppProvider,$ as RedoclyOpenAPIDocsStandalone,_ as loadAndBundleSpecOrMd,k as loadSingle};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{styled as
|
|
1
|
+
import{styled as t}from"../../styled-components.js";const e=t.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
text-align: left;
|
|
@@ -13,13 +13,9 @@ import{styled as o}from"../../styled-components.js";const i=o.div`
|
|
|
13
13
|
font-weight: var(--font-weight-regular);
|
|
14
14
|
color: var(--text-color-primary);
|
|
15
15
|
-webkit-font-text-smoothing: var(--text-smoothing);
|
|
16
|
-
margin-top: ${({$offset:t})=>t||0}px;
|
|
17
16
|
|
|
18
17
|
* {
|
|
19
18
|
box-sizing: border-box;
|
|
20
19
|
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
scroll-margin-top: ${({$offset:t})=>t||0}px;
|
|
24
|
-
}
|
|
25
|
-
`;export{i as RedocWrap};
|
|
21
|
+
`;export{e as RedocWrap};
|
|
@@ -29,7 +29,6 @@ export interface StoreProviderProps {
|
|
|
29
29
|
}
|
|
30
30
|
export interface AppProviderProps {
|
|
31
31
|
definitionUrl?: string;
|
|
32
|
-
disableTelemetry?: boolean;
|
|
33
32
|
definition?: GenericObject;
|
|
34
33
|
options?: RedocConfig;
|
|
35
34
|
activeItemId?: string;
|
|
@@ -42,7 +41,6 @@ export interface AppProviderProps {
|
|
|
42
41
|
export interface RedoclyOpenAPIDocsStandaloneProps {
|
|
43
42
|
definition?: GenericObject;
|
|
44
43
|
definitionUrl?: string;
|
|
45
|
-
disableTelemetry?: boolean;
|
|
46
44
|
options?: RedocConfig;
|
|
47
45
|
activeItemId?: string;
|
|
48
46
|
activeSampleLanguage?: CodeSampleConfig['lang'];
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as L,jsxs as S}from"react/jsx-runtime";import{useAtomValue as f}from"jotai";import{Panel as a}from"@redocly/theme/components/Panel/Panel";import{Markdown as b}from"@redocly/theme/components/Markdown/Markdown";import{DownloadSpecification as I}from"../Download/index.js";import{Overview as P}from"../Overview/index.js";import{ServerList as j}from"../ServerList/index.js";import{globalStoreAtom as O}from"../../jotai/store.js";import{normalizeServers as v}from"../../utils/index.js";import{LanguageList as M}from"../Language/index.js";import{mergeInMockServer as k}from"../../models/operation.js";import{languageAtom as y}from"../../jotai/app.js";import{useTranslate as D}from"../../hooks/index.js";import{styled as E}from"../../styled-components.js";import{PanelItemsList as N}from"../PanelItem/styled.js";import{useDownloadInfo as A}from"../Download/useDownloadInfo.js";import{McpOverview as _}from"../McpOverview/McpOverview.js";const ee=({item:{infoDefinition:n}})=>{const r=D(),{options:{hideDownloadButtons:g,downloadUrls:h,mockServer:u},parser:{definition:o,definitionUrl:t}}=f(O),{languages:i,activeLanguage:w}=f(y),l=A({downloadUrls:h}),m=v(t,k(o.servers||[],u)).sort((d,c)=>d["x-isLive"]&&!c["x-isLive"]?-1:!d["x-isLive"]&&c["x-isLive"]?1:0),s=o?.["x-mcp"],x=v(t,s?.servers||o.servers||[]),p=!(Object.keys(o.paths||{}).length>0)&&s;return S(L,{children:[!g&&l&&e(a,{className:"panel-download",header:r("openapi.download.description.title","Download OpenAPI description"),isExpandable:!1,children:e(I,{downloadObjects:l})}),n&&e(F,{className:"panel-overview",header:r("openapi.info.title","Overview"),isExpandable:!1,children:e(b,{children:e(P,{info:n,translate:r})})}),!!s&&e(a,{className:"panel-download",header:r("openapi.mcp.title","MCP server"),isExpandable:!1,children:e(_,{mcpInfo:s,mcpServers:x})}),!!i?.length&&!p&&e(a,{className:"panel-language-list",header:r("openapi.languages.title","Languages"),isExpandable:!1,children:e(M,{languages:i,activeLanguage:w})}),!!m.length&&!p&&e(a,{className:"panel-servers-list",header:r("openapi.servers.title","Servers"),isExpandable:!1,children:e(j,{servers:m,path:"/",translate:r})})]})},F=E(a)`
|
|
2
|
+
&:has(${N}:empty) {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
`;export{ee as RightPanel};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as m,Fragment as S}from"react/jsx-runtime";import{useMemo as p}from"react";import{useAtomValue as d}from"jotai";import{LayoutVariant as c}from"@redocly/config";import{breakpoints as k}from"@redocly/theme/core/openapi";import{OpenApiHeader as u}from"@redocly/theme/components/OpenApiDocs/hooks/OpenApiHeader";import{PageFooter as v}from"../PageFooter/index.js";import{globalOptionsAtom as y}from"../../jotai/store.js";import{RenderHook as b}from"../RenderHook/index.js";import{RightPanel as C}from"../RightPanel/index.js";import{layoutAtom as w}from"../../jotai/app.js";import{Row as B,SamplesMiddlePanel as j,SamplesPanel as I}from"../common/index.js";import{Items as f}from"../ContentItems/Items.js";import{ContentItem as g}from"../ContentItem/index.js";import{styled as s}from"../../styled-components.js";function G({items:e,hideFooterAndHeader:n}){const{unstable_hooks:{MiddlePanelHeader:a},routingBasePath:i}=d(y),l=d(w),o=l===c.STACKED,P=p(()=>n?null:t(h,{isStacked:o,children:t(v,{})}),[n,o]),x=p(()=>n||!u&&!a?null:t(h,{isStacked:o,children:a?t(b,{Hook:a,props:void 0}):t(u,{})}),[a,n,o]);return e.length===0?null:m(S,{children:[x,m(B,{layout:l,style:{zIndex:1},children:[t(M,{layout:l,children:e.filter(({type:r})=>r==="section").map(r=>t(g,{item:r,routingBasePath:i,children:t(f,{items:r.items,routingBasePath:i})},r.id))}),t(R,{isStacked:o,tabIndex:0,children:t(C,{item:e[0]})})]}),e.filter(({type:r})=>r!=="section").map(r=>t(g,{item:r,routingBasePath:i,children:t(f,{items:r.items,routingBasePath:i})},r.id)),P]})}const h=s(j)`
|
|
2
2
|
align-self: flex-start;
|
|
3
3
|
padding-top: var(--panel-gap-vertical);
|
|
4
4
|
padding-bottom: var(--panel-gap-vertical);
|
|
5
|
-
`,
|
|
5
|
+
`,M=s.div`
|
|
6
6
|
width: 100%;
|
|
7
7
|
|
|
8
8
|
@media screen and (min-width: ${k.large}) {
|
|
9
9
|
width: ${({layout:e})=>e===c.STACKED?"100%":"calc(100% - var(--panel-samples-width))"};
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,R=s(I)`
|
|
12
12
|
margin: var(--spacing-base) 0;
|
|
13
|
-
`;export{
|
|
13
|
+
`;export{R as RightPanelContainer,M as SectionContainer,G as SectionContent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as i,jsxs as o}from"react/jsx-runtime";import{CopyButton as
|
|
1
|
+
import{jsx as i,jsxs as o}from"react/jsx-runtime";import{CopyButton as u}from"@redocly/theme/components/Buttons/CopyButton";import{CheckmarkFilledIcon as y}from"@redocly/theme/icons/CheckmarkFilledIcon/CheckmarkFilledIcon";import{getServerDisplayName as w}from"../../utils/helpers.js";import{PanelItemDescription as h,Title as S}from"../PanelItem/index.js";import{ViewNested as T}from"../ViewNested/index.js";import{Tag as l}from"../common/index.js";import{Markdown as j}from"../Markdown/index.js";import{styled as t}from"../../styled-components.js";import{ServerDescriptionTooltip as D}from"./ServerDescriptionTooltip.js";const A=({servers:v,path:f,translate:n})=>i($,{children:v.map(e=>{const s=e.url+f,d=Object.keys(e.variables||{}).length,c=d===1?"variable":"variables",m=`${d||""} ${n(`openapi.${c}`,c)}`,b=!!e.name&&!!e.description;return o("div",{children:[o(W,{children:[o(h,{"data-testid":"server-panel-item-name",children:[w(e),e["x-isLive"]&&o(l,{className:"tag-green",children:[i(y,{}),"Live"]})]}),b&&i(D,{description:e.description}),e["x-labels"]?.length&&i(h,{style:{margin:"var(--spacing-xs) 0"},children:e["x-labels"]?.map(r=>o(l,{className:`tag-${r.color}`,children:[r.label,": ",r.value]},r.value))})||null]}),o(I,{children:[i(S,{suppressHydrationWarning:!0,children:s}),i(u,{data:s},s)]}),e.variables&&i(T,{expandText:`${n("openapi.actions.show","Show")} ${m}`,hideText:`${n("openapi.actions.hide","Hide")} ${m}`,expandByDefault:!1,expandable:!0,hideDivider:!0,children:i(z,{children:Object.entries(e.variables||{}).map(([r,a])=>o(k,{children:[i(C,{children:r}),o(p,{children:[n("openapi.default","Default")," ",i(x,{children:a.default})]}),i(L,{source:a.description}),a.enum&&o(p,{children:[n("openapi.enum","Enum")," ",i(N,{children:a.enum.map(g=>i(x,{children:g},g))})]})]},r))})})]},e.url)})}),$=t.div`
|
|
2
2
|
& > div {
|
|
3
3
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
4
4
|
margin-bottom: var(--spacing-xs);
|
|
@@ -10,7 +10,7 @@ import{jsx as i,jsxs as o}from"react/jsx-runtime";import{CopyButton as x}from"@r
|
|
|
10
10
|
margin-bottom: 0;
|
|
11
11
|
padding-bottom: 0;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
`,z=t.div`
|
|
14
14
|
padding-left: var(--spacing-xxs);
|
|
15
15
|
& > div {
|
|
16
16
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
@@ -28,37 +28,37 @@ import{jsx as i,jsxs as o}from"react/jsx-runtime";import{CopyButton as x}from"@r
|
|
|
28
28
|
margin-bottom: 0;
|
|
29
29
|
padding-bottom: 0;
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,k=t.div`
|
|
32
32
|
display: flex;
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
flex-wrap: wrap;
|
|
35
|
-
`,
|
|
35
|
+
`,L=t(j)`
|
|
36
36
|
font-size: var(--font-size-sm);
|
|
37
37
|
line-height: var(--line-height-sm);
|
|
38
38
|
color: var(--text-color-primary);
|
|
39
|
-
`,
|
|
39
|
+
`,p=t.span`
|
|
40
40
|
display: flex;
|
|
41
41
|
gap: var(--spacing-xxs);
|
|
42
42
|
font-size: var(--font-size-sm);
|
|
43
43
|
line-height: var(--line-height-sm);
|
|
44
44
|
color: var(--text-color-primary);
|
|
45
|
-
`,
|
|
45
|
+
`,C=t(p)`
|
|
46
46
|
padding-bottom: var(--spacing-xxs);
|
|
47
47
|
font-weight: var(--font-weight-semibold);
|
|
48
|
-
`,
|
|
48
|
+
`,N=t.span`
|
|
49
49
|
display: flex;
|
|
50
50
|
gap: var(--spacing-xxs);
|
|
51
51
|
flex-wrap: wrap;
|
|
52
|
-
`,
|
|
52
|
+
`,x=t(l)`
|
|
53
53
|
font-size: var(--font-size-sm);
|
|
54
54
|
line-height: var(--line-height-sm);
|
|
55
|
-
`,
|
|
55
|
+
`,W=t.div`
|
|
56
56
|
display: flex;
|
|
57
57
|
justify-content: start;
|
|
58
58
|
align-items: center;
|
|
59
59
|
gap: var(--spacing-xxs);
|
|
60
|
-
`,
|
|
60
|
+
`,I=t.div`
|
|
61
61
|
display: flex;
|
|
62
62
|
justify-content: space-between;
|
|
63
63
|
align-items: center;
|
|
64
|
-
`;export{
|
|
64
|
+
`;export{A as ServerList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as a}from"react/jsx-runtime";import{memo as u,useCallback as v}from"react";import{useNavigate as x}from"react-router-dom";import{useAtomValue as k}from"jotai";import{LayoutVariant as b}from"@redocly/config";import{Markdown as w}from"@redocly/theme/components/Markdown/Markdown";import{breakpoints as S}from"@redocly/theme/core/openapi";import{Button as y}from"@redocly/theme/components/Button/Button";import{PageActions as M}from"@redocly/theme/components/PageActions/PageActions";import{H2 as T}from"@redocly/theme/components/Typography/H2";import{LinkIcon as $}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{joinWithSeparator as j}from"../../services/history/helpers.js";import{Row as C,SamplesMiddlePanel as I,SamplesPanel as A,ShareLink as P}from"../common/index.js";import{Markdown as W}from"../Markdown/index.js";import{OperationsNavigation as B}from"./OperationsNavigation.js";import{layoutAtom as L}from"../../jotai/app.js";import{useTranslate as D}from"../../hooks/index.js";import{styled as n}from"../../styled-components.js";function H({item:o,routingBasePath:e="",isExpanded:m}){const l=D(),{description:c,name:s,href:g}=o,p=x(),d=k(L),i=j(e,o.href),f=v(()=>{p(i)},[p,i]),r=!!o.items.length,h=d===b.STACKED;return a(N,{expanded:m,children:[a(C,{layout:d,children:[a(I,{fullWidth:!r,isStacked:h,children:[a(_,{children:[t(P,{to:g,"aria-label":`link to ${s}`}),s,t(M,{pageSlug:i})]}),t(W,{source:c})]}),r&&t(B,{items:o.items,routingBasePath:e})]}),r&&!m&&a(V,{type:"button",variant:"text",size:"medium",onClick:f,children:["+ ",l("openapi.actions.show","Show")]})]})}const ro=u(H),N=n.div`
|
|
2
2
|
padding-top: var(--spacing-lg);
|
|
3
3
|
padding-bottom: ${({expanded:o})=>o?"var(--spacing-xxl)":""};
|
|
4
4
|
|
|
@@ -7,22 +7,22 @@ import{jsx as a,jsxs as t}from"react/jsx-runtime";import{memo as u,useCallback a
|
|
|
7
7
|
E.g. SchemaDefinition, McpTool
|
|
8
8
|
padding is added by the TagItem itself
|
|
9
9
|
*/
|
|
10
|
-
${
|
|
10
|
+
${w} ${A} {
|
|
11
11
|
padding-left: 0;
|
|
12
12
|
padding-right: 0;
|
|
13
13
|
}
|
|
14
|
-
`,V=
|
|
14
|
+
`,V=n(y)`
|
|
15
15
|
margin: var(--spacing-md) var(--spacing-xl) var(--spacing-xxs);
|
|
16
16
|
width: calc(100% - var(--spacing-xl) * 2);
|
|
17
17
|
|
|
18
|
-
@media screen and (min-width: ${
|
|
18
|
+
@media screen and (min-width: ${S.medium}) {
|
|
19
19
|
--button-margin-md: calc(var(--spacing-xl) * 2);
|
|
20
20
|
|
|
21
21
|
margin-left: var(--button-margin-md);
|
|
22
22
|
margin-right: var(--button-margin-md);
|
|
23
23
|
width: calc(100% - var(--button-margin-md) * 2);
|
|
24
24
|
}
|
|
25
|
-
`,_=
|
|
25
|
+
`,_=n(T)`
|
|
26
26
|
display: flex;
|
|
27
27
|
:hover {
|
|
28
28
|
${$} {
|
|
@@ -30,4 +30,5 @@ import{jsx as a,jsxs as t}from"react/jsx-runtime";import{memo as u,useCallback a
|
|
|
30
30
|
visibility: visible;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
overflow-wrap: break-word;
|
|
34
|
+
`;export{ro as TagItem,H as TagItemComponent};
|
|
@@ -7,7 +7,7 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
|
|
|
7
7
|
color: var(--schema-type-text-color);
|
|
8
8
|
`,d=r(o)`
|
|
9
9
|
color: var(--schema-type-text-color);
|
|
10
|
-
`,
|
|
10
|
+
`,p=r(o)`
|
|
11
11
|
color: var(--schema-type-title-text-color);
|
|
12
12
|
word-break: break-word;
|
|
13
13
|
`,c=r(o).attrs({as:"div"})`
|
|
@@ -16,7 +16,7 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
|
|
|
16
16
|
line-height: var(--schema-labels-line-height);
|
|
17
17
|
font-weight: normal;
|
|
18
18
|
display: block;
|
|
19
|
-
`,
|
|
19
|
+
`,m=r(o)`
|
|
20
20
|
color: var(--schema-property-required-label-text-color);
|
|
21
21
|
font-size: var(--font-size-base);
|
|
22
22
|
line-height: var(--line-height-base);
|
|
@@ -32,6 +32,8 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
|
|
|
32
32
|
color: var(--text-color-secondary);
|
|
33
33
|
display: inline-flex;
|
|
34
34
|
word-break: var(--code-word-break);
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--spacing-xxs);
|
|
35
37
|
`,v=r(e)`
|
|
36
38
|
color: var(--schema-property-access-label-text-color);
|
|
37
39
|
background-color: var(--bg-color);
|
|
@@ -89,4 +91,4 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
|
|
|
89
91
|
padding: 0;
|
|
90
92
|
font-size: var(--font-size-sm);
|
|
91
93
|
line-height: var(--line-height-sm);
|
|
92
|
-
`;export{v as AccessLabel,b as AdditionalPropertiesLabel,u as ConstraintItem,x as DefaultValue,g as EnumValue,l as ExampleValue,f as ExtensionValue,o as FieldLabel,a as FieldValueLabel,c as PropertyLabel,h as RecursiveLabel,
|
|
94
|
+
`;export{v as AccessLabel,b as AdditionalPropertiesLabel,u as ConstraintItem,x as DefaultValue,g as EnumValue,l as ExampleValue,f as ExtensionValue,o as FieldLabel,a as FieldValueLabel,c as PropertyLabel,h as RecursiveLabel,m as RequiredLabel,e as Tag,y as ToggleButton,d as TypeName,i as TypePrefix,p as TypeTitle};
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { useRouter } from './useRouter.js';
|
|
|
3
3
|
export { useContentItems } from './useContentItems.js';
|
|
4
4
|
export { useActiveWithFallback } from './useActiveWithFallback.js';
|
|
5
5
|
export { useTranslate } from './useTranslate.js';
|
|
6
|
-
export { useTelemetry } from './useTelemetry.js';
|
|
7
6
|
export { useUppercase2LowercaseRedirect } from './useUppercase2LowercaseRedirect.js';
|
|
7
|
+
export { useTelemetry } from './useTelemetry.js';
|
|
8
8
|
export { usePerformanceMetrics } from './usePerformanceMetrics.js';
|
package/lib/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useActivateExample as o}from"./useActivateExample.js";import{useRouter as s}from"./useRouter.js";import{useContentItems as p}from"./useContentItems.js";import{useActiveWithFallback as f}from"./useActiveWithFallback.js";import{useTranslate as x}from"./useTranslate.js";import{
|
|
1
|
+
import{useActivateExample as o}from"./useActivateExample.js";import{useRouter as s}from"./useRouter.js";import{useContentItems as p}from"./useContentItems.js";import{useActiveWithFallback as f}from"./useActiveWithFallback.js";import{useTranslate as x}from"./useTranslate.js";import{useUppercase2LowercaseRedirect as i}from"./useUppercase2LowercaseRedirect.js";import{useTelemetry as n}from"./useTelemetry.js";import{usePerformanceMetrics as A}from"./usePerformanceMetrics.js";export{o as useActivateExample,f as useActiveWithFallback,p as useContentItems,A as usePerformanceMetrics,s as useRouter,n as useTelemetry,x as useTranslate,i as useUppercase2LowercaseRedirect};
|
package/lib/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export { getValueFromMdParsedExtension } from './utils/helpers.js';
|
|
|
50
50
|
export { ContentItem } from './components/ContentItem/index.js';
|
|
51
51
|
export { ExampleSwitch } from './components/Samples/ExampleSwitch.js';
|
|
52
52
|
export { CustomBadges } from './components/common/Badges.js';
|
|
53
|
+
export { PanelItem } from './components/PanelItem/PanelItem.js';
|
|
53
54
|
export { Metadata } from './components/ApiInfo/Metadata.js';
|
|
54
55
|
export { useDownloadInfo } from './components/Download/useDownloadInfo.js';
|
|
55
56
|
export { SECTION_ATTR } from './constants.js';
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useAtomValue as e}from"jotai";import{globalOptionsAtom as o}from"./jotai/store.js";import{simplifyAstStructure as n}from"./utils/simplifyAstStructure.js";import{getOperation as x}from"./models/operation.js";import{getServerEnvName as l}from"./utils/environments.js";import{getTagOrGroup as d}from"./models/group.js";import{generateDeepLink as c}from"./components/common/LinkToField.js";import{RequestSamples as
|
|
1
|
+
import{useAtomValue as e}from"jotai";import{globalOptionsAtom as o}from"./jotai/store.js";import{simplifyAstStructure as n}from"./utils/simplifyAstStructure.js";import{getOperation as x}from"./models/operation.js";import{getServerEnvName as l}from"./utils/environments.js";import{getTagOrGroup as d}from"./models/group.js";import{generateDeepLink as c}from"./components/common/LinkToField.js";import{RequestSamples as S}from"./components/RequestSamples/RequestSamples.js";import{ResponseSamples as O}from"./components/ResponseSamples/ResponseSamples.js";import{RedocSchema as R}from"./components/pluggable/RedocSchema.js";import{RedocExample as w}from"./components/pluggable/RedocExample.js";import{RedoclyOpenAPIDocs as v}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{StoreProvider as E}from"./components/RedoclyOpenAPIDocs/Providers.js";import{getMarkdownHeaderId as A}from"./components/RedoclyOpenAPIDocs/utils.js";import{safeSlugify as T}from"./utils/string.js";import{JsonPointer as h}from"./utils/JsonPointer.js";import{isOperationName as V}from"./utils/openapi.js";import{pathIncludesLink as F,normalizePath as H}from"./utils/path.js";import{saveTextBeforeHeading as z}from"./utils/saveTextBeforeHeading.js";import{OpenAPIParser as G}from"./services/OpenAPIParser.js";import{buildContentItems as _}from"./services/menu/builder.js";import{normalizeOptions as K}from"./services/config-options/normalizeOptions.js";import{makeDeepLink as U}from"./services/history/helpers.js";function p(){return e(o)}import{EmbeddedReplay as X}from"./components/Replay/EmbeddedReplay.js";import{convertOperationToReplayValue as Z}from"./components/Replay/utils.js";import{SectionContainer as ee}from"./components/SectionContent/index.js";import{Row as re}from"./components/common/panels.js";import{RightPanelContainer as pe}from"./components/SectionContent/index.js";import{Overview as ae}from"./components/Overview/index.js";import{SamplesMiddlePanel as fe,Section as xe,SamplesPanel as ie}from"./components/common/panels.js";import{Heading as se}from"./components/common/OperationItemTitle.js";import{Dropdown as ue}from"./components/common/Dropdown/index.js";import{Markdown as Pe}from"./components/Markdown/index.js";import{FieldValueLabel as ge,FieldLabel as Oe}from"./components/common/Fields/index.js";import{CodeBlockPanel as Re}from"./components/common/index.js";import{OperationSamplesPanel as we}from"./components/OperationItem/OperationItem.js";import{ExternalDocumentation as ve}from"./components/ExternalDocumentation/index.js";import{PropertyDetails as Ee}from"./components/PropertyDetails/PropertyDetails.js";import{addMarkdownItems as Ae}from"./services/menu/markdown.js";import{getValueFromMdParsedExtension as Te}from"./utils/helpers.js";import{ContentItem as he}from"./components/ContentItem/index.js";import{ExampleSwitch as Ve}from"./components/Samples/ExampleSwitch.js";import{CustomBadges as Fe}from"./components/common/Badges.js";import{PanelItem as Ne}from"./components/PanelItem/PanelItem.js";import{Metadata as qe}from"./components/ApiInfo/Metadata.js";import{useDownloadInfo as Je}from"./components/Download/useDownloadInfo.js";import{SECTION_ATTR as je}from"./constants.js";export{Re as CodeBlockPanel,he as ContentItem,Fe as CustomBadges,ue as Dropdown,X as EmbeddedReplay,Ve as ExampleSwitch,ve as ExternalDocumentation,Oe as FieldLabel,ge as FieldValueLabel,se as Heading,h as JsonPointer,Pe as Markdown,qe as Metadata,G as OpenAPIParser,we as OperationSamplesPanel,ae as Overview,Ne as PanelItem,Ee as PropertyDetails,w as RedocExample,R as RedocSchema,v as RedoclyOpenAPIDocs,S as RequestSamples,O as ResponseSamples,pe as RightPanelContainer,re as Row,je as SECTION_ATTR,fe as SamplesMiddlePanel,ie as SamplesPanel,xe as Section,ee as SectionContainer,E as StoreProvider,Ae as addMarkdownItems,_ as buildContentItems,Z as convertOperationToReplayValue,c as generateDeepLink,A as getMarkdownHeaderId,x as getOperation,l as getServerEnvName,d as getTagOrGroup,Te as getValueFromMdParsedExtension,V as isOperationName,U as makeDeepLink,K as normalizeOptions,H as normalizePath,F as pathIncludesLink,T as safeSlugify,z as saveTextBeforeHeading,n as simplifyAstStructure,Je as useDownloadInfo,p as useOpenapiDocsOptions};
|
package/lib/models/group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{REDOCLY_TEAMS_RBAC as
|
|
1
|
+
import{REDOCLY_TEAMS_RBAC as n}from"@redocly/config";import{joinWithSeparator as h}from"../services/index.js";import{getValueFromMdParsedExtension as S,safeSlugify as o}from"../utils/index.js";import{getHref as v}from"../services/menu/operation.js";import{saveTextBeforeHeading as C}from"../utils/saveTextBeforeHeading.js";function B(m,e,i){let s;i?.id&&(m==="schema"||m==="mcp")?s=h(i.id,o(e.name)):s=e.id||o(e.name);const c=e["x-displayName"]||e.name,d=e.level||1,t=e.isSchema,f=e.ast||void 0,l=C(S(e,"description")||""),a=e.items||[],x=e.externalDocs;return{id:s.toLowerCase(),type:m,parent:i,name:c,level:d,badges:e["x-badges"]||[],depth:0,isSchema:t,description:l,items:a,ast:f,externalDocs:x,href:v({id:s}),[n]:e[n]||i?.[n]}}export{B as getTagOrGroup};
|
package/lib/models/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
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:[]
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import h from"@markdoc/markdoc";import{isString as T}from"@redocly/theme/core/openapi";import{getTagOrGroup as d}from"../../models/index.js";import{safeSlugify as y,unescapeHTMLChars as A}from"../../utils/index.js";function x(e,n,a){const i=T(e)?h.parse(e):h.Ast.fromJSON(JSON.stringify(e?.result)),s=[];let o;const l=(t,u,g=s,r,p)=>{t=A(t);let f;r.attributes.id?f=r.attributes.id:(f=p?`${p}/${y(t)}`:`section/${y(t)}`,r.attributes.id=f);const b={id:f.toLowerCase(),name:t,level:u,items:[],ast:[r]};return g.push(b),b},c=(t,u)=>{t[t.length-1]?.ast?.push(u)},m=t=>{const u=C(t)||"",r=n&&n.type==="tag"?n.id:void 0;t.type==="heading"&&t.attributes.level===1?o=l(u,t.attributes.level,void 0,t,r):t.attributes.level?l(u,t.attributes.level,o?.items,t,o?.id??r):o?.items?.length?c(o?.items,t):s?.length&&c(s,t)};if(Array.isArray(i))for(const t of i)m(t);else m(i);return v(n,s,a)}function v(e,n,a=1){return n.map(i=>{const s=d("section",i,e);return s.depth=a,i.items&&(s.items=v(s,i.items,a+1)),s})}function C(e){if(typeof e?.attributes?.content=="string")return e.attributes?.content;if(e?.children)return C(e.children[0])}export{x as addMarkdownItems};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import{getTagOrGroup as d}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as
|
|
2
|
-
|
|
1
|
+
import{getTagOrGroup as d}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as u,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(i,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(s=>c[s]?(c[s].used=!0,c[s]):(console.warn(`Non-existing tag "${s}" is added to the group "${e?.name}"`),null)),n=[];for(const s of f){if(!s)continue;const r=d("tag",s,o);if(r.depth=g+1,s.name===""){const P=[...x(h(s,"description")||"",r,r.depth+1),...T(void 0,s,r.depth+1)];n.push(...P);continue}const p=v({definition:i.definition,tag:s,parent:r,schemaDefinitionsTagName:a.schemaDefinitionsTagName}),m=w(i.definition,s,r);r.items=[...p,...m,...x(h(s,"description")||"",r,r.depth+1),...T(r,s,r.depth+1)],n.push(r)}return n.filter(({name:s,items:r})=>s!==u||r.length>0)}function R(i,c,o,e,a){const t=[];for(const f of o){const n=d("group",f,c);n.depth=g,n.items=k(i,e,n,f,a),t.push(n)}return t}function v({definition:i,tag:c,parent:o,schemaDefinitionsTagName:e}){const a=e?[e]:[];return Object.entries(i.components?.schemas||{}).map(([t,f])=>{if(!(f["x-tags"]||a).includes(c.name))return null;const s=d("schema",{name:t,"x-displayName":`${f.title||t}`,description:`{% schemaDefinition showWriteOnly="true" schemaRef="#/components/schemas/${t}" /%}`,isSchema:!0,level:2},o);return s.depth=o.depth+1,s}).filter(Boolean)}function w(i,c,o){const e=[];for(const a of y)if(i["x-mcp"]?.[a]){const t=O(a),f=[t];for(const n of i["x-mcp"]?.[a]||[])if((n.tags?.length?n.tags:f).includes(c.name)){const r=b(o.id,N(n.name)),p=d("mcp",{name:n.name,"x-displayName":n.title||n.name,description:`Tool name: \`${n.name}\`
|
|
2
|
+
|
|
3
|
+
${n.description||""}
|
|
4
|
+
{% mcp${t.slice(0,-1)} toolName="${n.name}" id="${r}" /%}`,isSchema:!0,level:2},o);p.depth=o.depth+1,e.push(p)}}return e}function U(i,c){const{definition:o}=i,e={},a=o["x-webhooks"]||o.webhooks,t=o["x-mcp"];for(const f of c||[])e[f.name]={...f,operations:[]};return o.paths&&l(i,o.paths,e),a&&l(i,a,e,!0),t&&E(t,e),e}function E(i,c){for(const o of y)if(i[o])for(const e of i[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 l(i,c,o,e){for(const a of Object.keys(c||{})){const t=c[a],f=Object.keys(t).filter(S);for(const n of f){const s=t[n];if(t.$ref){const{resolved:p}=i.deref(t);l(i,{[a]:p},o,e);continue}let r=s?.tags;(!r||!r.length)&&(r=e?[u]:[""]);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({...s,pathName:a,pointer:$.compile(["paths",a,n]),httpVerb:n,pathParameters:t.parameters||[],pathServers:t.servers,isWebhook:!!e})}}}}function O(i){return i.charAt(0).toUpperCase()+i.slice(1)}export{O as capitalize,R as getTagGroupsItems,k as getTagsItems,U as getTagsWithOperations};
|
package/lib/services/types.d.ts
CHANGED
|
@@ -51,7 +51,6 @@ export type ExtendedOpenAPIOperation = {
|
|
|
51
51
|
pathServers: Array<OpenAPIServer> | undefined;
|
|
52
52
|
isWebhook: boolean;
|
|
53
53
|
defaultSampleName?: string | false;
|
|
54
|
-
keywords?: unknown;
|
|
55
54
|
} & OpenAPIOperation;
|
|
56
55
|
export type TagsInfoMap = Record<string, TagInfo>;
|
|
57
56
|
export interface TagGroup {
|
|
@@ -92,6 +91,9 @@ export interface HooksConfig {
|
|
|
92
91
|
AfterApiTitle?: HookConfig<{
|
|
93
92
|
info: OpenAPIInfo;
|
|
94
93
|
}>;
|
|
94
|
+
AfterOpenApiDescription?: HookConfig<{
|
|
95
|
+
info: OpenAPIInfo;
|
|
96
|
+
}>;
|
|
95
97
|
BeforeOperation?: HookConfig<{
|
|
96
98
|
operation: OperationModel;
|
|
97
99
|
}>;
|
|
@@ -113,6 +115,9 @@ export interface HooksConfig {
|
|
|
113
115
|
sanitize?: (raw: string) => string;
|
|
114
116
|
MiddlePanelFooter?: HookConfig<undefined>;
|
|
115
117
|
MiddlePanelHeader?: HookConfig<undefined>;
|
|
118
|
+
AfterOpenApiInfo?: HookConfig<{
|
|
119
|
+
info: OpenAPIInfo;
|
|
120
|
+
}>;
|
|
116
121
|
}
|
|
117
122
|
export type ExtendedMenuItem = Omit<IMenuItem, 'type'> & {
|
|
118
123
|
type: MenuItemType | 'spec';
|
package/lib/standalone.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { setParameterValue } from './utils/parameters.js';
|
|
|
6
6
|
export declare function hydrate(store: StoreProviderProps, element?: Element | null): void;
|
|
7
7
|
export declare function init(definitionOrDefinitionUrl: string | OpenAPIDefinition, options?: RedocConfig & {
|
|
8
8
|
router?: 'hash' | 'history';
|
|
9
|
-
disableTelemetry?: boolean;
|
|
10
9
|
}, element?: Element | null): void;
|
|
11
10
|
export declare const version: string;
|
|
12
11
|
export declare const revision: string;
|
package/lib/standalone.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
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 P,setSecurityDetailsVariants as V}from"./utils/security-details.js";import{setParameterValue as D}from"./utils/parameters.js";function d(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 E(t){const e=d(t),o={};for(const r in e){const n=r.replace(/-(.)/g,(c,s)=>s.toUpperCase());o[n]=e[r]}return o}function A(t,e=document.querySelector("redoc")){m(e,i(l,{store:t}),{onRecoverableError:(o,r)=>{o.message.includes("Minified React error #418")||console.error(o.message,r)}})}function _(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,...E(o)},router:r??"hash"},["Loading..."]))}const N=__REDOCLY_API_REFERENCE_VERSION__,v=__REDOCLY_API_REFERENCE_REVISION__;function R(){const t=a("redoc");if(!t)return;const e=t.getAttribute("spec-url");e&&_(e,{},t)}R();export{A as hydrate,_ as init,v as revision,D as setParameterValue,P as setSecurityDetails,V as setSecurityDetailsVariants,N as version};
|