@redocly/openapi-docs 3.14.0-next.9 → 3.14.0
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 +2172 -2089
- package/lib/components/ContentItem/ContentItem.js +1 -1
- package/lib/components/ContentItems/Items.js +1 -1
- package/lib/components/ContentItems/helpers.js +1 -1
- package/lib/components/McpOverview/McpOverview.d.ts +5 -0
- package/lib/components/McpOverview/McpOverview.js +16 -0
- package/lib/components/McpOverview/index.d.ts +1 -0
- package/lib/components/McpOverview/index.js +1 -0
- package/lib/components/McpTool/McpTool.d.ts +6 -0
- package/lib/components/McpTool/McpTool.js +9 -0
- package/lib/components/McpTool/index.d.ts +1 -0
- package/lib/components/McpTool/index.js +1 -0
- package/lib/components/PanelItem/styled.js +1 -0
- package/lib/components/RedoclyOpenAPIDocs/Error.d.ts +3 -0
- package/lib/components/RedoclyOpenAPIDocs/Error.js +25 -0
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/RightPanel/RightPanel.js +1 -1
- package/lib/components/SectionItem/SectionItem.d.ts +1 -1
- package/lib/components/Security/OAuthFlow.js +1 -1
- package/lib/components/Security/SecurityButton.js +14 -7
- package/lib/components/Security/SecurityFlow.d.ts +1 -1
- package/lib/components/Security/SecurityFlow.js +10 -5
- package/lib/components/ServerList/ServerDescriptionTooltip.d.ts +4 -0
- package/lib/components/ServerList/ServerDescriptionTooltip.js +1 -0
- package/lib/components/ServerList/ServerList.js +14 -9
- package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/TagItem/OperationNavigationItems.js +3 -3
- package/lib/components/TagItem/OperationsNavigation.js +2 -2
- package/lib/components/TagItem/TagItem.js +17 -7
- package/lib/components/TagItem/types.d.ts +2 -2
- package/lib/models/group.js +1 -1
- package/lib/models/types.d.ts +2 -0
- package/lib/services/code-samples/generator.d.ts +9 -2
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/device-auth-snippets.d.ts +25 -0
- package/lib/services/code-samples/httpsnippet/helpers/device-auth-snippets.js +1 -0
- package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +2 -2
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/httpclient.js +2 -2
- package/lib/services/code-samples/httpsnippet/targets/go/native.js +3 -3
- package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +3 -3
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +2 -2
- package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/php/curl.js +5 -5
- package/lib/services/code-samples/httpsnippet/targets/python/requests.js +5 -5
- package/lib/services/code-samples/httpsnippet/targets/r/httr.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/ruby/native.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/shell/curl.js +7 -6
- package/lib/services/menu/builder.js +1 -1
- package/lib/services/menu/tags.d.ts +1 -0
- package/lib/services/menu/tags.js +2 -1
- package/lib/services/types.d.ts +1 -1
- package/lib/standalone.js +1 -1
- package/lib/types/open-api.d.ts +56 -0
- package/lib/utils/hasNestedFields.d.ts +1 -1
- package/lib/utils/helpers.d.ts +2 -0
- package/lib/utils/helpers.js +4 -4
- package/lib/utils/loadAndBundleSpec.js +1 -1
- package/lib/utils/mcp.d.ts +3 -0
- package/lib/utils/mcp.js +1 -0
- package/lib/utils/menu.d.ts +2 -0
- package/lib/utils/menu.js +1 -0
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,Fragment as i,jsxs as f}from"react/jsx-runtime";import{memo as u}from"react";import{useAtomValue as x}from"jotai";import{joinWithSeparator as I}from"../../services/index.js";import{TagItem as r}from"../TagItem/index.js";import{OperationItem as g}from"../OperationItem/index.js";import{Section as y}from"../common/index.js";import{useIsExpanded as C}from"./useIsExpanded.js";import{SectionItem as h}from"../SectionItem/index.js";import j from"../ContentItems/useScrollOnRender.js";import{isRootItem as E}from"../ContentItems/helpers.js";import{ApiInfo as R}from"../ApiInfo/index.js";import{layoutAtom as S}from"../../jotai/app.js";import{isRenderableMenuItem as A}from"../../utils/menu.js";const _={group:null,tag:r,section:h,schema:o=>t(r,{...o,item:o.item,isExpanded:!0}),operation:g,mcp:o=>t(r,{...o,item:o.item,isExpanded:!0}),root:R};function b({item:o,routingBasePath:e,children:p,layout:s}){const a=E(o),m=_[a?"root":o.type],d=o.type==="tag"&&o.items.length>0,n=C({item:o,routingBasePath:e});let l=j(o,e);const c=x(S);return f(i,{children:[m&&t(y,{id:o.id,ref:l,sectionId:I(e,o.id),underlined:A(o),expanded:d&&!n,children:t(m,{item:o,routingBasePath:e,isExpanded:n,layout:s||c})}),(n||o.type!=="tag")&&!!o.items?.length&&t(i,{children:p})]})}const J=u(b);export{J as ContentItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,Fragment as o}from"react/jsx-runtime";import{memo as l,useCallback as a}from"react";import{ContentItem as d}from"../ContentItem/index.js";import{VirtualList as s}from"./VirtualList.js";import{isRenderableMenuItem as u}from"../../utils/menu.js";function c({items:r,routingBasePath:n}){const m=a(e=>t(d,{item:e,routingBasePath:n,children:e.items.length>0&&t(s,{items:e.items,renderItem:m,routingBasePath:n})},e.id),[n]);if(!r.length)return null;const i=r.length>15&&r.every(e=>u(e));return t(o,{children:i?t(s,{items:r,renderItem:m,routingBasePath:n}):t(o,{children:r.map(m)})})}const x=l(c);export{x as Items};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizePath as
|
|
1
|
+
import{normalizePath as n}from"../../utils/index.js";import{isRenderableMenuItem as f}from"../../utils/menu.js";function c(t){return t.type==="section"&&t.id===""}function m(t){const r=[],e=[],s=[];let i;for(const o of t)switch(o.type){case"group":r.push(o);break;case"tag":e.push(o);break;case"operation":s.push(o);break;case"section":c(o)&&(i=o);break}return{groupItems:r,tagItems:e,operationItems:s,rootItem:i}}function p(t,r){for(const e of t){if(e.type==="group")return p(e.items,r);if(e.type==="tag"){if(!e.description)return n(p(e.items,r));if(e.href)return n(e.href)}else if(f(e))return n(e.href)}return r}export{p as getFirstPageLink,m as getItemsByType,c as isRootItem};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{jsx as t,jsxs as o,Fragment as l}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 E,PAGE_ACTIONS_MCP as P}from"../../utils/mcp.js";import{PanelItem as r}from"../PanelItem/PanelItem.js";import{PanelItemsList as C}from"../PanelItem/styled.js";import{useTranslate as _}from"../../hooks/index.js";import{styled as c}from"../../styled-components.js";function O({mcpInfo:e,mcpServers:s}){const a=_();function d(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.listChanged}function m(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.subscribe}return o(C,{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(l,{children:f.map(i=>e?.capabilities[i]?o(p,{size:"small",icon:t(g,{}),children:[i,d(i)?" (list changed)":"",m(i)?" (subscribe)":""]},i):null)})}),e?.capabilities[E]&&t(r,{header:a("openapi.mcp.experimentalCapabilities","Experimental capabilities"),title:t(x,{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(l,{children:s[0]?.url}),actions:[t(h,{data:s[0]?.url},"NewTabButton")]}),t(r,{title:t(j,{children:t(u,{actions:P,mcpUrl:s[0]?.url})})})]})}const j=c.div`
|
|
2
|
+
& button {
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
> div {
|
|
6
|
+
padding: 0;
|
|
7
|
+
}
|
|
8
|
+
`,x=c.div`
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: 1fr 2fr;
|
|
11
|
+
gap: 10px;
|
|
12
|
+
|
|
13
|
+
> * {
|
|
14
|
+
justify-self: start;
|
|
15
|
+
}
|
|
16
|
+
`;export{O as McpOverview};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './McpOverview.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./McpOverview.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{jsxs as a,jsx as n}from"react/jsx-runtime";import{memo as M,useCallback as g,useMemo as l}from"react";import{useAtomValue as s}from"jotai";import{LayoutVariant as k}from"@redocly/config";import{getMediaContent as C,getSecurity as j}from"../../models/index.js";import{globalStoreAtom as f}from"../../jotai/store.js";import{Section as P,Row as b,SamplesMiddlePanel as v,SamplesPanel as A,CodeBlockPanel as E}from"../common/index.js";import{Schema as R}from"../Schema/index.js";import{getSchema as F}from"../../models/schema.js";import{layoutAtom as L}from"../../jotai/app.js";import{MediaTypeSamples as O}from"../PayloadSamples/MediaTypeSamples.js";import{useTranslate as w}from"../../hooks/index.js";import{Title as D}from"../common/OperationItemTitle.js";import{LinkToField as I}from"../common/LinkToField.js";import{makeDeepLink as V}from"../../services/index.js";import{Security as _}from"../Security/Security.js";import{styled as h}from"../../styled-components.js";function q({toolName:t,id:m}){const{parser:i}=s(f),o=w(),e=l(()=>(i.definition["x-mcp"]?.tools||[]).find(r=>r.name===t),[i,t]),c=l(()=>e?j(e.security,i):null,[i,e]);return e?a(P,{children:[n(S,{id:m,type:"input",schema:e.inputSchema,title:o("openapi.mcp.inputSchema","Input schema"),exampleTitle:o("openapi.mcp.inputExample","Input example"),children:c&&n(_,{securities:c})}),e.outputSchema&&n(S,{id:m,type:"output",schema:e.outputSchema,title:o("openapi.mcp.outputSchema","Output schema"),exampleTitle:o("openapi.mcp.outputExample","Output example")})]}):a("div",{children:["Tool not found: ",t]})}function S({schema:t,title:m,exampleTitle:i,id:o,type:e,children:c}){const{parser:p,options:r}=s(f),u=s(L),d=u===k.STACKED,T=l(()=>C({parser:p,info:{"application/json":{schema:t}},isRequestType:!1,options:r,data:{operation:{pointer:"McpTool"}}}),[r,p,t]),y=l(()=>t&&F({parser:p,schemaOrRef:t,pointer:"#",options:r,deps:{operation:{pointer:o},parentFieldFullPath:e+"-schema"}}),[r,p,t,o,e]),x=g(()=>{},[]);return a(B,{layout:u,children:[n(K,{isStacked:d,children:a("div",{children:[a(D,{children:[o&&n(I,{to:V(o,e)}),m]}),c,n(R,{schema:y})]})}),n(A,{isStacked:d,children:n(E,{className:"panel-response-samples",header:i,children:n(O,{mediaType:T.mediaTypes[0],onChange:x})})})]})}const B=h(b)`
|
|
2
|
+
margin: calc(var(--spacing-unit) * 2) 0;
|
|
3
|
+
|
|
4
|
+
& + & {
|
|
5
|
+
margin-top: calc(var(--spacing-base) * 2);
|
|
6
|
+
}
|
|
7
|
+
`,K=h(v)`
|
|
8
|
+
padding-left: 0;
|
|
9
|
+
`,re=M(q);export{re as McpTool};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './McpTool.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./McpTool.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
height: 100vh;
|
|
3
|
+
max-width: var(--page-404-max-width);
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
margin: var(--page-404-margin-vertical) var(--page-404-margin-horizontal);
|
|
8
|
+
font-family: var(--page-404-font-family);
|
|
9
|
+
gap: var(--page-404-gap);
|
|
10
|
+
`,l=t.div`
|
|
11
|
+
color: var(--page-404-status-text-color);
|
|
12
|
+
font-size: var(--page-404-status-font-size);
|
|
13
|
+
line-height: var(--page-404-status-line-height);
|
|
14
|
+
font-weight: var(--page-404-status-font-weight);
|
|
15
|
+
`,s=t.div`
|
|
16
|
+
color: var(--page-404-title-text-color);
|
|
17
|
+
font-size: var(--page-404-title-font-size);
|
|
18
|
+
line-height: var(--page-404-title-line-height);
|
|
19
|
+
font-weight: var(--page-404-title-font-weight);
|
|
20
|
+
`,g=t.div`
|
|
21
|
+
color: var(--page-404-description-text-color);
|
|
22
|
+
font-size: var(--page-404-description-font-size);
|
|
23
|
+
line-height: var(--page-404-description-line-height);
|
|
24
|
+
font-weight: var(--page-404-description-font-weight);
|
|
25
|
+
`;export{f as ErrorPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as d}from"react/jsx-runtime";import{memo as v,useCallback as
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{memo as v,useCallback as g,useEffect as y,useMemo as b}from"react";import S from"@markdoc/markdoc";import{LayoutVariant as E}from"@redocly/config";import{createStore as O,Provider as A}from"jotai";import{html as N}from"@redocly/theme/markdoc/tags/html";import{Heading as M}from"@redocly/theme/markdoc/components/Heading/Heading";import{normalizeOptions as T,OpenAPIParser as D}from"../../services/index.js";import{SchemaDefinition as j}from"../SchemaDefinition/index.js";import{McpTool as k}from"../McpTool/index.js";import{getMarkdownHeaderId as x}from"./utils.js";import{mergeInMockServer as C}from"../../models/operation.js";import{normalizeServers as P}from"../../utils/index.js";import{appStore as H,appStoreOverrideAtom as I,layoutAtom as p,allowedEnvironmentsAtom as L,environmentAtom as R,userClaimsAtom as V}from"../../jotai/app.js";import{mapObject as z}from"../../utils/object.js";import{getServerEnvName as _}from"../../utils/environments.js";import{globalStoreAtom as h}from"../../jotai/store.js";import{getDefaultOperationStore as q,operationStore as B}from"../../jotai/operation.js";const F={ignoreNamedSchemas:["java.io.ObjectStreamField"],maxDisplayedEnumValues:10,markdocOptions:{tags:{html:N.schema,schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean},htmlWrap:{type:String,default:!1}}},mcpTool:{render:"McpTool",attributes:{toolName:{type:String},id:{type:String}}}},nodes:{heading:{children:["inline"],attributes:{id:{type:String},level:{type:Number,required:!0,default:1}},transform(n,i){const t=n.transformAttributes(i),m=n.transformChildren(i),e=typeof t.id=="string"?t.id:x(m);return new S.Tag("Heading",{...t,id:e,level:n.attributes.level},m)}}},components:{SchemaDefinition:j,McpTool:k,Heading:M}}},se=v(({children:n,options:i,definitionUrl:t,definition:m,withState:e})=>{const l=g(()=>{const r=T(i,F),o=new D(m,t,r);return{options:r,parser:o}},[m,t,i]),a=b(()=>{const r=O(),o=l();r.set(h,o);const c=P(o.parser.definitionUrl,C(o.parser.definition?.servers||[],o.options.mockServer));r.sub(H,()=>{}),r.set(p,o.options?.layout||E.THREE_PANEL);const f=Object.fromEntries(c.map(s=>[_(s),{server:s.url,...z(s.variables||{},u=>u.default||"")}]));if(r.set(R,{environments:f}),r.set(V,e?.userClaims||{}),r.set(L,e?.allowedEnvironments),e&&r.set(I,{activeMimeName:e.activeMimeName,userClaims:e.userClaims,environment:e.environment,environments:e.environments}),e?.operation){const s=q(e.operation.pointer,e.operation.state.requestValues,e.operation.state.activeExampleName);r.set(B(e.operation.pointer),s)}return r},[l,e]);return y(()=>{e?.layout&&a.set(p,e?.layout)},[a,e?.layout]),d(A,{store:a,children:n})});export{se as StoreProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx 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 +1 @@
|
|
|
1
|
-
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as W,useCallback as m,useRef as w,useState as H}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=J(async()=>import("@redocly/replay").then(e=>({default:e.ReplayOverlay})));import{Button as Y}from"@redocly/theme/components/Button/Button";import{useFocusTrap as Z,useModalScrollLock as $}from"@redocly/theme/core/openapi";import{RocketIcon as ee}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as te}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as oe}from"@redocly/theme/components/Portal/Portal";import{useConfigureReplay as re}from"@redocly/theme/ext/useConfigureReplay";import{globalOptionsAtom as ne,globalStoreAtom as ae}from"../../jotai/store.js";import{allOperationsAtom as se,replayStateAtom as ie}from"../../jotai/replay.js";import{allOperations as le,getDefaultOperationStore as me}from"../../jotai/operation.js";import{LOADING_STATE as n}from"../../constants.js";import{environmentAtom as pe,userClaimsAtom as ce}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as fe}from"./utils.js";import{useTranslate as ue,useTelemetry as de}from"../../hooks/index.js";import{JsonPointer as ye}from"../../utils/index.js";import{getDefaultCollectorUrl as he}from"../../utils/telemetry.js";import{createTryItOpenEvent as Oe,createTryItSentEvent as Ie}from"../../events/index.js";import{joinWithSeparator as Re}from"../../services/history/helpers.js";function ge({operation:e,corsProxyUrl:
|
|
1
|
+
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as W,useCallback as m,useRef as w,useState as H}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=J(async()=>import("@redocly/replay").then(e=>({default:e.ReplayOverlay})));import{Button as Y}from"@redocly/theme/components/Button/Button";import{useFocusTrap as Z,useModalScrollLock as $}from"@redocly/theme/core/openapi";import{RocketIcon as ee}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as te}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as oe}from"@redocly/theme/components/Portal/Portal";import{useConfigureReplay as re}from"@redocly/theme/ext/useConfigureReplay";import{globalOptionsAtom as ne,globalStoreAtom as ae}from"../../jotai/store.js";import{allOperationsAtom as se,replayStateAtom as ie}from"../../jotai/replay.js";import{allOperations as le,getDefaultOperationStore as me}from"../../jotai/operation.js";import{LOADING_STATE as n}from"../../constants.js";import{environmentAtom as pe,userClaimsAtom as ce}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as fe}from"./utils.js";import{useTranslate as ue,useTelemetry as de}from"../../hooks/index.js";import{JsonPointer as ye}from"../../utils/index.js";import{getDefaultCollectorUrl as he}from"../../utils/telemetry.js";import{createTryItOpenEvent as Oe,createTryItSentEvent as Ie}from"../../events/index.js";import{joinWithSeparator as Re}from"../../services/history/helpers.js";function ge({operation:e,corsProxyUrl:L,fullOpenApi:d}){const y=ue(),P=de(),h=w(null),{mockServer:q,oAuth2RedirectURI:E,routingBasePath:c}=p(ne),O=p(se),{parser:I,options:{events:a}}=p(ae),R=p(ce),[s,N]=H(!1),[l,g]=u(ie),[v,A]=u(le),[[,V],S]=u(pe),{config:j,refresh:T}=re({userClaims:R,info:I?.definition.info,operation:{name:e.name,path:e.path,operationId:e.operationId||"",href:e.href,method:e.httpVerb},servers:e.servers},s);Z(h),$(s);const x=m(()=>T(),[T]),k=m(({operations:t,environment:i,environments:f})=>{const _=t.reduce((C,r)=>{r.requestValues.body=r.requestValues.body instanceof URLSearchParams?Object.fromEntries(r.requestValues.body.entries()):r.requestValues.body;const{path:F,method:B}=r.apiPath,b=ye.compile(["paths",F,B]);return C[b]=Q(me(b),r),C},{});A({...v,..._}),S({environment:i,environments:f})},[v,A,S]),D=()=>{if(l!==n.LOADING){if(!s&&(P.sendOpenapiDocsTryItOpenedMessage(),a?.tryItOpen&&e)){const t=Oe({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&g(n.LOADING)},G=m(t=>{if(a?.tryItSent&&e){const i=Ie({operation:e,isSuccess:t});a.tryItSent(i)}},[a,e]),U=m(t=>{if(!t)return;const i=O.find(f=>f.operationId===t);return Re(c,i?.href)},[O,c]);return d?z(M,{children:[o(Y,{onClick:D,variant:"primary",iconPosition:"left",icon:l===n.LOADING?o(te,{}):o(ee,{}),children:l===n.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),s&&o(W,{children:o(oe,{mountId:"api-content",children:o("div",{ref:h,children:o(X,{activeOperationId:e.operationId||e.pointer,api:d,onRequestChange:k,onClose:D,onLoad:()=>g(n.LOADED),settings:{corsProxyUrl:L,mockServer:q,selectedEnvironment:V,apiId:I?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:E,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},convertOperationToReplayValue:fe(R,j),getOperationUrl:U,onRequestReset:x},onRequestSent:G})})})})]}):null}const Me=K(ge);export{Me as Replay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as u,jsxs as x}from"react/jsx-runtime";import{useAtomValue as c}from"jotai";import{Panel as r}from"@redocly/theme/components/Panel/Panel";import{Markdown as S}from"@redocly/theme/components/Markdown/Markdown";import{DownloadSpecification as b}from"../Download/index.js";import{Overview as O}from"../Overview/index.js";import{ServerList as j}from"../ServerList/index.js";import{globalStoreAtom as I}from"../../jotai/store.js";import{normalizeServers as d}from"../../utils/index.js";import{LanguageList as L}from"../Language/index.js";import{mergeInMockServer as M}from"../../models/operation.js";import{languageAtom as P}from"../../jotai/app.js";import{useTranslate as k}from"../../hooks/index.js";import{useDownloadInfo as D}from"../Download/useDownloadInfo.js";import{McpOverview as E}from"../McpOverview/McpOverview.js";const J=({item:{infoDefinition:o}})=>{const a=k(),{options:{hideDownloadButtons:f,downloadUrls:v,mockServer:g},parser:{definition:n,definitionUrl:t}}=c(I),{languages:i,activeLanguage:h}=c(P),l=D({downloadUrls:v}),p=d(t,M(n.servers||[],g)),s=n?.["x-mcp"],w=d(t,s?.servers||[]),m=!(Object.keys(n.paths||{}).length>0)&&s;return x(u,{children:[!f&&l&&e(r,{className:"panel-download",header:a("openapi.download.description.title","Download OpenAPI description"),isExpandable:!1,children:e(b,{downloadObjects:l})}),!!s&&e(r,{className:"panel-mcp-overview",header:a("openapi.mcp.title","MCP server"),isExpandable:!1,children:e(E,{mcpInfo:s,mcpServers:w})}),(o?.license||o?.contact||o?.termsOfService)&&e(r,{className:"panel-overview",header:a("openapi.info.title","Overview"),isExpandable:!1,children:e(S,{children:e(O,{info:o,translate:a})})}),!!i?.length&&!m&&e(r,{className:"panel-language-list",header:a("openapi.languages.title","Languages"),isExpandable:!1,children:e(L,{languages:i,activeLanguage:h})}),!!p.length&&!m&&e(r,{className:"panel-servers-list",header:a("openapi.servers.title","Servers"),isExpandable:!1,children:e(j,{servers:p,path:"/",translate:a})})]})};export{J as RightPanel};
|
|
@@ -2,6 +2,6 @@ import { LayoutVariant } from '@redocly/config';
|
|
|
2
2
|
import type { GroupModel } from '../../models/index.js';
|
|
3
3
|
export interface SectionItemProps {
|
|
4
4
|
item: GroupModel;
|
|
5
|
-
layout
|
|
5
|
+
layout?: LayoutVariant;
|
|
6
6
|
}
|
|
7
7
|
export declare const SectionItem: import("react").NamedExoticComponent<SectionItemProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as a,jsxs as
|
|
1
|
+
import{jsx as e,Fragment as a,jsxs as i}from"react/jsx-runtime";import{memo as l}from"react";import{SecuritySchemeItem as n}from"./SecuritySchemeItem.js";import{StyledLink as o}from"./styled.js";import{useTranslate as h}from"../../hooks/index.js";function u({flow:r}){const t=h();return i(a,{children:[e(n,{label:`${t("openapi.authorizationUrl","Authorization URL")}:`,value:r?.authorizationUrl&&e(o,{target:"_blank",rel:"noopener noreferrer",href:r?.authorizationUrl,children:r?.authorizationUrl})}),e(n,{label:`${t("openapi.tokenUrl","Token URL")}:`,value:r?.tokenUrl&&e(o,{target:"_blank",rel:"noopener noreferrer",href:r?.tokenUrl,children:r?.tokenUrl})}),e(n,{label:`${t("openapi.refreshUrl","Refresh URL")}:`,value:r?.refreshUrl&&e(o,{target:"_blank",rel:"noopener noreferrer",href:r?.refreshUrl,children:r?.refreshUrl})}),e(n,{label:`${t("openapi.deviceAuthorizationUrl","Device Authorization URL")}:`,value:r?.deviceAuthorizationUrl&&e(o,{target:"_blank",rel:"noopener noreferrer",href:r?.deviceAuthorizationUrl,children:r?.deviceAuthorizationUrl})})]})}const d=l(u);export{d as OAuthFlow};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
import{jsx as r,jsxs as o}from"react/jsx-runtime";import{Fragment as d}from"react";import{SecurityIcon as v}from"@redocly/theme/icons/SecurityIcon/SecurityIcon";import{Panel as u}from"@redocly/theme/components/Panel/Panel";import{Button as h}from"@redocly/theme/components/Button/Button";import{Tooltip as y}from"@redocly/theme/components/Tooltip/Tooltip";import{WarningFilledIcon as b}from"@redocly/theme/icons/WarningFilledIcon/WarningFilledIcon";import{useTranslate as x}from"../../hooks/index.js";import{styled as e}from"../../styled-components.js";import{deprecatedCss as w}from"../common/index.js";function N({securities:a,onClick:m}){const i=x();return r(j,{header:()=>o(k,{children:[r(v,{}),r(B,{children:i("openapi.security","Security")}),r(T,{onClick:m,variant:"link",children:i("openapi.viewSecurityDetails","View details")})]}),isExpandable:!1,children:r(C,{children:a.map((t,n)=>{const s=a.length>1&&t.schemes.length>1,f=t.schemes.map(({id:l,deprecated:c=!1},g)=>o(d,{children:[o(S,{deprecated:c,children:[l,c&&r(y,{tip:i("openapi.badges.deprecated","Deprecated"),children:r(b,{color:"var(--badge-deprecated-bg-color)"})})]}),g<t.schemes.length-1&&r(p,{children:" and "})]},l));return o(d,{children:[s?"(":"",f,s?")":"",n<a.length-1&&r(p,{children:" or "})]},n)})})})}const S=e.span`
|
|
2
|
+
${({deprecated:a})=>a&&w}
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: var(--spacing-xxs);
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
};
|
|
8
|
+
`,j=e(u)`
|
|
2
9
|
margin-top: var(--spacing-base);
|
|
3
10
|
border: var(--panel-border);
|
|
4
11
|
border-radius: var(--panel-border-radius);
|
|
5
|
-
`,
|
|
12
|
+
`,k=e.div`
|
|
6
13
|
display: flex;
|
|
7
14
|
align-items: center;
|
|
8
15
|
justify-content: space-between;
|
|
@@ -12,19 +19,19 @@ import{jsx as r,jsxs as t}from"react/jsx-runtime";import{Fragment as c}from"reac
|
|
|
12
19
|
background-color: var(--layer-color);
|
|
13
20
|
border-bottom: var(--panel-border);
|
|
14
21
|
border-radius: var(--panel-border-radius) var(--panel-border-radius) 0 0;
|
|
15
|
-
`,
|
|
22
|
+
`,T=e(h)`
|
|
16
23
|
margin-left: auto;
|
|
17
24
|
font-size: var(--font-size-sm);
|
|
18
|
-
`,
|
|
25
|
+
`,B=e.span`
|
|
19
26
|
font-family: var(--font-family-base);
|
|
20
27
|
font-weight: var(--font-weight-medium);
|
|
21
28
|
color: var(--text-color-primary);
|
|
22
|
-
`,
|
|
29
|
+
`,C=e.div`
|
|
23
30
|
flex: 1;
|
|
24
31
|
text-overflow: ellipsis;
|
|
25
32
|
overflow: hidden;
|
|
26
33
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
27
34
|
color: var(--text-color-primary);
|
|
28
|
-
`,
|
|
35
|
+
`,p=e.span`
|
|
29
36
|
color: var(--text-color-description);
|
|
30
|
-
`;export{
|
|
37
|
+
`;export{N as SecurityButton};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { SecurityRequirement, ExtendedOpenAPISecurityScheme } from '../../models/index.js';
|
|
3
|
-
export declare function SecurityFlow({ type, bearerFormat, name, flows, openIdConnectUrl, description, id, securities, in: apiKeyIn, }: Partial<ExtendedOpenAPISecurityScheme> & {
|
|
3
|
+
export declare function SecurityFlow({ type, bearerFormat, name, flows, openIdConnectUrl, description, id, securities, in: apiKeyIn, deprecated, oauth2MetadataUrl, }: Partial<ExtendedOpenAPISecurityScheme> & {
|
|
4
4
|
securities: SecurityRequirement[];
|
|
5
5
|
}): ReactElement | null;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,Fragment as m,jsxs as t}from"react/jsx-runtime";import{Badge as S}from"@redocly/theme/components/Badge/Badge";import{SecuritySchemeItem as a}from"./SecuritySchemeItem.js";import{titleize as w}from"../../utils/index.js";import{OAuthFlow as y}from"./OAuthFlow.js";import{StyledLink as d}from"./styled.js";import{Markdown as F}from"../Markdown/index.js";import{useTranslate as T}from"../../hooks/index.js";import{OAuthScopes as k}from"./OAuthScopes.js";import{styled as n}from"../../styled-components.js";function N({type:o,bearerFormat:h,name:u,flows:i,openIdConnectUrl:l,description:f,id:p,securities:g,in:b,deprecated:v=!1,oauth2MetadataUrl:s}){const r=T();if(!o||!p)return null;const x={http:t(m,{children:[e(a,{label:r("openapi.httpAuthorizationScheme","HTTP Authorization Scheme"),value:o}),e(a,{label:r("openapi.bearerFormat","Bearer Format"),value:h})]}),apiKey:e(a,{label:`${w(b||"")} ${r("openapi.parameterName","parameter name")}:`,value:u}),oauth2:t(m,{children:[e(a,{label:r("openapi.flowType","Flow type"),value:o}),i&&Object.keys(i).map(c=>e(y,{flow:i[c]},c))]}),openIdConnect:e(a,{label:r("openapi.connectUrl","Connect URL"),value:l&&e(d,{target:"_blank",rel:"noopener noreferrer",href:l,children:l})})};return t(j,{children:[t(z,{children:[e(_,{children:p}),v&&e(S,{deprecated:!0,children:r("openapi.badges.deprecated","Deprecated")})]}),e(F,{source:f}),s&&e(a,{label:r("openapi.oauth2MetadataUrl","OAuth2 Metadata URL"),value:e(d,{target:"_blank",rel:"noopener noreferrer",href:s,children:s})}),t(A,{children:[x[o]||null,e(k,{id:p,securities:g,flows:i})]})]})}const z=n.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--spacing-xxs);
|
|
5
|
+
margin: 0 0 var(--spacing-xs);
|
|
6
|
+
`,j=n.div`
|
|
2
7
|
background: var(--layer-color);
|
|
3
8
|
padding: var(--spacing-base);
|
|
4
9
|
border-radius: var(--border-radius);
|
|
5
10
|
border: 1px solid var(--border-color-secondary);
|
|
6
11
|
width: 100%;
|
|
7
12
|
margin-top: var(--spacing-base);
|
|
8
|
-
`,
|
|
13
|
+
`,A=n.div`
|
|
9
14
|
width: 100%;
|
|
10
15
|
margin-top: var(--spacing-md);
|
|
11
|
-
`,
|
|
16
|
+
`,_=n.p`
|
|
12
17
|
font-size: var(--font-size-base);
|
|
13
|
-
margin: 0
|
|
18
|
+
margin: 0;
|
|
14
19
|
text-transform: capitalize;
|
|
15
20
|
font-weight: var(--font-weight-semibold);
|
|
16
|
-
`;export{
|
|
21
|
+
`;export{N as SecurityFlow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useEffect as s,useState as i}from"react";import{Button as a}from"@redocly/theme/components/Button/Button";import{Tooltip as m}from"@redocly/theme/components/Tooltip/Tooltip";import{InformationIcon as c}from"@redocly/theme/icons/InformationIcon/InformationIcon";const v=({description:n})=>{const[o,e]=i(!1);return s(()=>{const r=()=>{o&&e(!1)};if(o)return document.addEventListener("touchmove",r,{passive:!0}),()=>{document.removeEventListener("touchmove",r)}},[o]),t(m,{tip:n,placement:"bottom",arrowPosition:"left",isOpen:o,children:t(a,{size:"small",variant:"ghost",icon:t(c,{}),"data-testid":"server-item-description-tooltip",onClick:()=>e(!0),onBlur:()=>e(!1),onFocus:()=>e(!0),onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),onTouchCancel:()=>e(!1)})})};export{v as ServerDescriptionTooltip};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as i,jsxs as
|
|
1
|
+
import{jsx as i,jsxs as o}from"react/jsx-runtime";import{CopyButton as x}from"@redocly/theme/components/Buttons/CopyButton";import{getServerDisplayName as b}from"../../utils/helpers.js";import{PanelItemDescription as u,Title as y}from"../PanelItem/index.js";import{ViewNested as w}from"../ViewNested/index.js";import{Tag as S}from"../common/index.js";import{Markdown as T}from"../Markdown/index.js";import{styled as e}from"../../styled-components.js";import{ServerDescriptionTooltip as j}from"./ServerDescriptionTooltip.js";const q=({servers:h,path:f,translate:r})=>i(D,{children:h.map(t=>{const a=t.url+f,p=Object.keys(t.variables||{}).length,d=p===1?"variable":"variables",l=`${p||""} ${r(`openapi.${d}`,d)}`,v=!!t.name&&!!t.description;return o("div",{children:[o(L,{children:[i(u,{"data-testid":"server-panel-item-name",children:b(t)}),v&&i(j,{description:t.description})]}),o(O,{children:[i(y,{suppressHydrationWarning:!0,children:a}),i(x,{data:a},a)]}),t.variables&&i(w,{expandText:`${r("openapi.actions.show","Show")} ${l}`,hideText:`${r("openapi.actions.hide","Hide")} ${l}`,expandByDefault:!1,expandable:!0,hideDivider:!0,children:i($,{children:Object.entries(t.variables||{}).map(([c,n])=>o(z,{children:[i(k,{children:c}),o(s,{children:[r("openapi.default","Default")," ",i(g,{children:n.default})]}),i(W,{source:n.description}),n.enum&&o(s,{children:[r("openapi.enum","Enum")," ",i(C,{children:n.enum.map(m=>i(g,{children:m},m))})]})]},c))})})]},t.url)})}),D=e.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 t}from"react/jsx-runtime";import{CopyButton as v}from"@r
|
|
|
10
10
|
margin-bottom: 0;
|
|
11
11
|
padding-bottom: 0;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
`,$=e.div`
|
|
14
14
|
padding-left: var(--spacing-xxs);
|
|
15
15
|
& > div {
|
|
16
16
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
@@ -28,11 +28,11 @@ import{jsx as i,jsxs as t}from"react/jsx-runtime";import{CopyButton as v}from"@r
|
|
|
28
28
|
margin-bottom: 0;
|
|
29
29
|
padding-bottom: 0;
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,z=e.div`
|
|
32
32
|
display: flex;
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
flex-wrap: wrap;
|
|
35
|
-
|
|
35
|
+
`,W=e(T)`
|
|
36
36
|
font-size: var(--font-size-sm);
|
|
37
37
|
line-height: var(--line-height-sm);
|
|
38
38
|
color: var(--text-color-primary);
|
|
@@ -42,18 +42,23 @@ import{jsx as i,jsxs as t}from"react/jsx-runtime";import{CopyButton as v}from"@r
|
|
|
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
|
+
`,k=e(s)`
|
|
46
46
|
padding-bottom: var(--spacing-xxs);
|
|
47
47
|
font-weight: var(--font-weight-semibold);
|
|
48
|
-
`,
|
|
48
|
+
`,C=e.span`
|
|
49
49
|
display: flex;
|
|
50
50
|
gap: var(--spacing-xxs);
|
|
51
51
|
flex-wrap: wrap;
|
|
52
|
-
`,g=e(
|
|
52
|
+
`,g=e(S)`
|
|
53
53
|
font-size: var(--font-size-sm);
|
|
54
54
|
line-height: var(--line-height-sm);
|
|
55
|
-
`,
|
|
55
|
+
`,L=e.div`
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: start;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--spacing-xxs);
|
|
60
|
+
`,O=e.div`
|
|
56
61
|
display: flex;
|
|
57
62
|
justify-content: space-between;
|
|
58
63
|
align-items: center;
|
|
59
|
-
`;export{
|
|
64
|
+
`;export{q as ServerList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as d}from"react/jsx-runtime";import{useMemo as f,useCallback as l}from"react";import{useAtom as S,useAtomValue as g}from"jotai";import{DropdownMenu as w}from"@redocly/theme/components/Dropdown/DropdownMenu";import{Dropdown as y}from"@redocly/theme/components/Dropdown/Dropdown";import{HttpVerb as k}from"../common/index.js";import{PathWrapper as A,Path as C,StyledCopyButton as b,StyledDropdownMenuItem as D}from"./styled.js";import{PanelItem as P}from"../PanelItem/index.js";import{joinWithSeparator as j}from"../../services/index.js";import{getServerDisplayName as x,replaceVariables as V}from"../../utils/index.js";import{environmentAtom as M}from"../../jotai/app.js";import{useActiveWithFallback as E,useTelemetry as N}from"../../hooks/index.js";import{getServerEnvName as p}from"../../utils/environments.js";import{createTargetServerSwitchEvent as W}from"../../events/index.js";import{globalStoreAtom as I}from"../../jotai/store.js";const X=({operation:r,className:h})=>{const n=N(),[[v],i]=S(M),{options:{events:m}}=g(I),s=E(r.servers.map(e=>({...e,key:e.url})),v.server),a=l(e=>{e.stopPropagation()},[]),c=l(e=>()=>{if(r.servers.length!==1&&(i({environment:p(e)}),n.sendOpenapiDocsSwitchServersClickedMessage({server:p(e)}),m?.targetServerSwitch&&e)){const o=W({operation:r,serverUrl:e.url});m.targetServerSwitch(o)}},[r,i,n,m]),u=f(()=>r.servers.map(e=>{const o=j(V(e),r.path);return t(D,{onAction:c(e),children:t(P,{header:x(e),title:o,actions:[t(b,{data:o,toasterPlacement:"left",onCopyClick:a},o)],active:e.url===s,withCheckmark:!0})},o)}),[r.servers,r.path,c,a,s]);return t(y,{className:h,trigger:d(A,{variant:"ghost",children:[t(k,{color:r.httpVerb,children:r.httpVerb}),t(C,{children:r.path})]}),withArrow:!0,children:t(w,{children:u})})};export{X as ServerListDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as
|
|
1
|
+
import{useMemo as l}from"react";import{useLocation as h}from"react-router-dom";import{useActiveSectionId as I}from"@redocly/theme/core/openapi";import{pathMatchedLink as k}from"../../../utils/index.js";import{DEFAULT_WEBHOOKS_TAG_NAME as A}from"../../../constants.js";import{joinWithSeparator as y}from"../../../services/history/helpers.js";function O({items:o,routingBasePath:r}){const t=h(),s=I(t,!1,!1);return l(()=>S(o,s,t,r),[s,o,t,r])}function S(o,r="",t,s){const n=[];return c({contentItems:o,sidebarItems:n,activeItemId:r,location:t,routingBasePath:s}),n}function b(o,r="",t,s){return o.href?r&&s?y(s,o.id)===r:r&&!s?o.id===r:k(t,o.href):!1}function d(o,r="",t,s){return(o.items||[]).some(i=>b(i,r,t,s)||d(i,r,t,s))}function c(o){const{contentItems:r,sidebarItems:t,activeItemId:s,location:n,routingBasePath:i}=o;let p=!0;for(const e of r){const a=b(e,s,n,i),m=d(e,s,n,i);switch(e.type){case"group":t.push({type:"separator",label:e.name,active:a,hasActiveSubItem:m}),c({...o,contentItems:e.items,sidebarItems:t});break;case"tag":const f={type:"group",label:e.name,items:[],link:e.href,active:a,hasActiveSubItem:m,modified:!0};t.push(f),c({contentItems:e.items,sidebarItems:f.items||[],activeItemId:s,location:n,routingBasePath:i});break;case"operation":case"schema":case"mcp":e.isWebhook&&p&&e.parent.name!==A&&(t.push({type:"separator",label:"Webhooks",variant:"secondary"}),p=!1),t.push({type:"link",label:e.name,httpVerb:e.type=="operation"?e.httpVerb:e.type,link:e.href,badges:e.badges,active:a,hasActiveSubItem:m,modified:!0,deprecated:e.deprecated});break;case"section":if(e.depth===-1)continue;const u={type:e.items.length?"group":"link",label:e.name,link:e.href,items:[],active:a,hasActiveSubItem:m,modified:!0};t.push(u),e.items.length&&c({contentItems:e.items,sidebarItems:u.items,activeItemId:s,location:n,routingBasePath:i});break}}}export{O as useMenuItems};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as i,Fragment as x}from"react/jsx-runtime";import{memo as u}from"react";import{joinWithSeparator as y}from"../../services/index.js";import{encodeBackSlashes as w}from"../../utils/index.js";import{HttpVerb as j,NavigationBadge as s}from"../common/index.js";import{styled as t}from"../../styled-components.js";import{StyledButton as z}from"./styled.js";function k({title:p,items:c,onClick:l,routingBasePath:d,translate:h}){return i(x,{children:[r(B,{children:p}),c.map(e=>{const{id:g,href:f,deprecated:o,badges:m}=e,v=e.type==="operation"?e.path:e.name,a=e.type==="operation"?e.httpVerb:e.type;return r(I,{variant:"outlined",size:"large",onClick:()=>l(y(d,w(f))),children:i("span",{children:[r(j,{color:o?"http-deprecated":a,children:a}),r(N,{children:v}),o&&r(s,{deprecated:!0,children:h("openapi.badges.deprecated","Deprecated")}),m?.map(({name:n,color:b})=>r(s,{color:b,children:n},n))]})},g)})]})}const D=u(k),B=t.span`
|
|
2
2
|
font-size: var(--font-size-base);
|
|
3
3
|
line-height: var(--line-height-base);
|
|
4
4
|
font-weight: var(--font-weight-bold);
|
|
5
5
|
color: var(--text-color-primary);
|
|
6
6
|
margin: var(--spacing-sm) 0 var(--spacing-xxs) 0;
|
|
7
|
-
`,
|
|
7
|
+
`,I=t(z)`
|
|
8
8
|
border-radius: var(--border-radius);
|
|
9
9
|
background: var(--bg-color);
|
|
10
10
|
justify-content: space-between;
|
|
@@ -24,7 +24,7 @@ import{jsx as e,jsxs as i,Fragment as b}from"react/jsx-runtime";import{memo as x
|
|
|
24
24
|
content: '→';
|
|
25
25
|
line-height: var(--line-height-base);
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,N=t.span`
|
|
28
28
|
font-family: var(--font-family-base);
|
|
29
29
|
font-size: var(--font-size-base);
|
|
30
30
|
line-height: var(--line-height-base);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as k}from"react/jsx-runtime";import{useMemo as O,memo as M,useState as A,useCallback as N}from"react";import{useNavigate as j}from"react-router-dom";import{LayoutVariant as E}from"@redocly/config";import{useAtomValue as I}from"jotai/index";import{SamplesPanel as P}from"../common/index.js";import{layoutAtom as W}from"../../jotai/app.js";import{OperationNavigationItems as l}from"./OperationNavigationItems.js";import{StyledButton as B}from"./styled.js";import{useTranslate as _}from"../../hooks/index.js";import{styled as R}from"../../styled-components.js";import{isRenderableMenuItem as V}from"../../utils/menu.js";const p=8;function z({items:m,routingBasePath:n}){const o=_(),[a,x]=A(!1),c=j(),C=I(W)===E.STACKED,{operations:h,webhooks:u,schemas:f,mcpTools:d,showMoreCount:g,totalCount:y}=O(()=>{const e=m.filter(s=>V(s)),w=a?e:e.slice(0,p),{operations:b,webhooks:v,schemas:S,mcpTools:T}=w.reduce((s,t)=>(t.type==="operation"&&t.isWebhook?s.webhooks.push(t):t.type==="operation"?s.operations.push(t):t.type==="schema"?s.schemas.push(t):t.type==="mcp"&&s.mcpTools.push(t),s),{operations:[],webhooks:[],schemas:[],mcpTools:[]});return{operations:b,schemas:S,mcpTools:T,webhooks:v,showMoreCount:!a&&e.length>p?e.length-p:0,totalCount:e.length}},[a,m]),i=N(e=>c(e),[c]);return y?k(D,{isStacked:C,"data-testid":"operation-navigation-list",children:[f.length>0&&r(l,{items:f,onClick:i,routingBasePath:n,translate:o,title:o("openapi.schemas","Schemas")}),d.length>0&&r(l,{items:d,onClick:i,routingBasePath:n,translate:o,title:o("openapi.mcp.tools","MCP Tools")}),h.length>0&&r(l,{items:h,onClick:i,routingBasePath:n,translate:o,title:o("openapi.operations","Operations")}),u.length>0&&r(l,{items:u,onClick:i,routingBasePath:n,translate:o,title:o("openapi.webhooks","Webhooks")}),!a&&!!g&&k(B,{variant:"link",size:"large","data-testid":"show-more-operations",fullWidth:!0,onClick:()=>x(!0),children:[o("openapi.actions.show","Show")," ",g," ",o("openapi.actions.more","more"),"..."]})]}):null}const oo=M(z),D=R(P)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: var(--spacing-xxs);
|
|
5
5
|
padding-top: var(--spacing-xxl);
|
|
6
|
-
`;export{
|
|
6
|
+
`;export{oo as OperationsNavigation,z as OperationsNavigationComponent};
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import{jsx as a,jsxs as
|
|
1
|
+
import{jsx as a,jsxs as t}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 S}from"@redocly/theme/components/Markdown/Markdown";import{breakpoints as w}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 r}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]),n=!!o.items.length,h=d===b.STACKED;return t(N,{expanded:m,children:[t(C,{layout:d,children:[t(I,{fullWidth:!n,isStacked:h,children:[t(_,{children:[a(P,{to:g,"aria-label":`link to ${s}`}),s,a(M,{pageSlug:i})]}),a(W,{source:c})]}),n&&a(B,{items:o.items,routingBasePath:e})]}),n&&!m&&t(V,{type:"button",variant:"text",size:"medium",onClick:f,children:["+ ",l("openapi.actions.show","Show")]})]})}const no=u(H),N=r.div`
|
|
2
2
|
padding-top: var(--spacing-lg);
|
|
3
|
-
padding-bottom: ${({expanded:
|
|
4
|
-
|
|
3
|
+
padding-bottom: ${({expanded:o})=>o?"var(--spacing-xxl)":""};
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Markdoc components inside markdown that use SamplesPanel should not have padding.
|
|
7
|
+
E.g. SchemaDefinition, McpTool
|
|
8
|
+
padding is added by the TagItem itself
|
|
9
|
+
*/
|
|
10
|
+
${S} ${A} {
|
|
11
|
+
padding-left: 0;
|
|
12
|
+
padding-right: 0;
|
|
13
|
+
}
|
|
14
|
+
`,V=r(y)`
|
|
5
15
|
margin: var(--spacing-md) var(--spacing-xl) var(--spacing-xxs);
|
|
6
16
|
width: calc(100% - var(--spacing-xl) * 2);
|
|
7
17
|
|
|
8
|
-
@media screen and (min-width: ${
|
|
18
|
+
@media screen and (min-width: ${w.medium}) {
|
|
9
19
|
--button-margin-md: calc(var(--spacing-xl) * 2);
|
|
10
20
|
|
|
11
21
|
margin-left: var(--button-margin-md);
|
|
12
22
|
margin-right: var(--button-margin-md);
|
|
13
23
|
width: calc(100% - var(--button-margin-md) * 2);
|
|
14
24
|
}
|
|
15
|
-
`,
|
|
25
|
+
`,_=r(T)`
|
|
16
26
|
display: flex;
|
|
17
27
|
:hover {
|
|
18
|
-
${
|
|
28
|
+
${$} {
|
|
19
29
|
opacity: 1;
|
|
20
30
|
visibility: visible;
|
|
21
31
|
}
|
|
22
32
|
}
|
|
23
|
-
`;export{
|
|
33
|
+
`;export{no as TagItem,H as TagItemComponent};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OperationMenuItem } from '../../models/index.js';
|
|
1
|
+
import type { GroupModel, OperationMenuItem } from '../../models/index.js';
|
|
2
2
|
export type OperationsNavigationProps = {
|
|
3
|
-
items: OperationMenuItem[];
|
|
3
|
+
items: (OperationMenuItem | GroupModel)[];
|
|
4
4
|
routingBasePath: string;
|
|
5
5
|
};
|
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 x}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=x(i.id,o(e.name)):s=e.id||o(e.name);const t=e["x-displayName"]||e.name,c=e.level||1,d=e.isSchema,f=e.ast||void 0,l=C(S(e,"description")||""),a=e.items||[],h=e.externalDocs;return{id:s.toLowerCase(),type:m,parent:i,name:t,level:c,depth:0,isSchema:d,description:l,items:a,ast:f,externalDocs:h,href:v({id:s}),[n]:e[n]||i?.[n]}}export{B as getTagOrGroup};
|
package/lib/models/types.d.ts
CHANGED
|
@@ -185,6 +185,8 @@ export type GroupModel = {
|
|
|
185
185
|
description?: string | GenericObject;
|
|
186
186
|
isSchema?: boolean;
|
|
187
187
|
type: MenuItemGroupType;
|
|
188
|
+
deprecated?: boolean;
|
|
189
|
+
badges?: OpenAPIXBadges[];
|
|
188
190
|
items: ContentItemModel[];
|
|
189
191
|
ast?: Node[];
|
|
190
192
|
parent?: GroupModel;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as Sampler from 'openapi-sampler';
|
|
2
2
|
import type { JSONSchema7 } from 'json-schema';
|
|
3
|
-
import type { OperationModel } from '../../models/index.js';
|
|
3
|
+
import type { OperationModel, ExtendedOpenAPISecurityScheme } from '../../models/index.js';
|
|
4
4
|
import type * as HAR from './har.js';
|
|
5
5
|
import type { Languages } from './types.js';
|
|
6
6
|
import { type TFunction } from '@redocly/theme/core/openapi';
|
|
7
7
|
export type CustomHAR = HAR.Request & {
|
|
8
|
-
securityOAuth2ExtraCalls?:
|
|
8
|
+
securityOAuth2ExtraCalls?: OAuth2ExtraCall[];
|
|
9
9
|
basicAuth?: {
|
|
10
10
|
username: string;
|
|
11
11
|
password: string;
|
|
@@ -27,6 +27,13 @@ export declare function getCodeSample({ lang, operation, exampleName, pathParams
|
|
|
27
27
|
environment: Record<string, string>;
|
|
28
28
|
translate: TFunction;
|
|
29
29
|
}): string;
|
|
30
|
+
type OAuth2ExtraCall = HAR.Request & {
|
|
31
|
+
flowType: keyof ExtendedOpenAPISecurityScheme['flows'];
|
|
32
|
+
securityOAuth2ExtraCalls: OAuth2ExtraCall[];
|
|
33
|
+
tokenUrl?: string;
|
|
34
|
+
clientId?: string;
|
|
35
|
+
};
|
|
30
36
|
export declare function getDataRequest(exampleValue: any, properties: any): boolean | any;
|
|
31
37
|
export declare function isDefined<T>(arg?: T): arg is T;
|
|
32
38
|
export declare function capitalizeFirst(str: string): string;
|
|
39
|
+
export {};
|