@redocly/openapi-docs 3.19.0-next.7 → 3.19.0-next.9
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 +2535 -2071
- package/lib/components/Download/DownloadSpecification.js +4 -4
- package/lib/components/Language/LanguageList.d.ts +2 -0
- package/lib/components/Language/LanguageList.js +1 -1
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/Replay/EmbeddedReplay.js +3 -3
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/Replay/utils.d.ts +3 -2
- package/lib/components/Replay/utils.js +1 -1
- package/lib/components/RightPanel/RightPanel.js +1 -1
- package/lib/components/ServerList/ServerList.js +11 -11
- package/package.json +8 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p,useCallback as f}from"react";import{
|
|
1
|
+
import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p,useCallback as f}from"react";import{getPathPrefix as x,combineUrls as g}from"@redocly/theme/core/openapi";import{DocumentIcon as w}from"@redocly/theme/icons/DocumentIcon/DocumentIcon";import{JsonIcon as b}from"@redocly/theme/icons/JsonIcon/JsonIcon";import{FileIcon as u}from"@redocly/theme/icons/FileIcon/FileIcon";import{DownloadButton as h}from"@redocly/theme/components/Buttons/DownloadButton";import{useTelemetry as y}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";function v({downloadObjects:t}){const l=y(),n=x(),c=f(o=>{switch(o){case"yaml":return e(w,{});case"json":return e(b,{});default:return e(u,{})}},[]);return t?e(D,{children:(t||[]).map(({title:o,url:a,iconType:m})=>{const i=n?g(n,a):a;return s(k,{onClick:()=>{l.sendDownloadDefinitionClickedMessage()},children:[s(j,{children:[c(m),e("a",{href:i,target:"_blank",download:!0,rel:"noreferrer",children:o})]}),e(h,{data:i})]},o)})}):e(d,{})}const J=p(v),k=r.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: baseline;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -10,7 +10,7 @@ import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p
|
|
|
10
10
|
padding-bottom: 0px;
|
|
11
11
|
border-bottom: none;
|
|
12
12
|
}
|
|
13
|
-
`,
|
|
13
|
+
`,j=r.span`
|
|
14
14
|
display: flex;
|
|
15
15
|
width: calc(100% - 25px);
|
|
16
16
|
gap: var(--spacing-xs);
|
|
@@ -28,7 +28,7 @@ import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p
|
|
|
28
28
|
overflow: hidden;
|
|
29
29
|
white-space: nowrap;
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,D=r.div`
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
align-self: flex-start;
|
|
@@ -36,4 +36,4 @@ import{jsx as e,Fragment as d,jsxs as s}from"react/jsx-runtime";import{memo as p
|
|
|
36
36
|
flex-direction: column;
|
|
37
37
|
gap: var(--spacing-sm);
|
|
38
38
|
font-size: var(--font-size-base);
|
|
39
|
-
`;export{
|
|
39
|
+
`;export{J as DownloadSpecification};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TFunction } from '@redocly/theme/core/openapi';
|
|
1
2
|
import type { TabType } from '../../models/tab.js';
|
|
2
3
|
type LangTypeType = TabType<{
|
|
3
4
|
lang: string;
|
|
@@ -5,6 +6,7 @@ type LangTypeType = TabType<{
|
|
|
5
6
|
interface LanguageListProps {
|
|
6
7
|
languages: LangTypeType[];
|
|
7
8
|
activeLanguage: string;
|
|
9
|
+
translate: TFunction;
|
|
8
10
|
}
|
|
9
11
|
export declare const LanguageList: import("react").NamedExoticComponent<LanguageListProps>;
|
|
10
12
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as
|
|
1
|
+
import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as j,useRef as A,useState as w,useCallback as S,memo as V,useMemo as E}from"react";import{useAtomValue as H,useSetAtom as W}from"jotai";import{Button as _}from"@redocly/theme/components/Button/Button";import{OverflowMenuVerticalIcon as v}from"@redocly/theme/icons/OverflowMenuVerticalIcon/OverflowMenuVerticalIcon";import{Tooltip as D}from"@redocly/theme/components/Tooltip/Tooltip";import{LanguageDropdown as M}from"./LanguageDropdown.js";import{languageAtom as R,layoutAtom as O}from"../../jotai/app.js";import{LanguageListContainer as z,LanguageListItem as B,Container as G}from"./styled.js";import{LanguageItem as P}from"./LanguageItem.js";import{DROPDOWN_TRIGGER_WIDTH as N,ITEM_WIDTH as L}from"./constants.js";import{LanguageListSkeleton as $}from"../common/Skeleton/LanguageListSkeleton.js";import{useTelemetry as q}from"../../hooks/index.js";function F({languages:o,activeLanguage:t,translate:r}){const[n,l]=w([]),[s,u]=w([]),d=q(),g=A(null),k=H(O),h=W(R),p=e=>{d.sendSelectLanguageClickedMessage([{object:"select_language",language:e}])},b=e=>{h(e),p(e)},x=e=>{const m=s.findIndex(i=>i.key===e);if(m!==-1){const i=[...s],c=[...n];y(c,i,m),l(c),u(i),p(e),h(e)}},f=S(()=>{const e=g?.current?.offsetWidth;if(!e)return;const{newVisibleItems:m,newHiddenItems:i}=J(e,[...o]),c=i.findIndex(T=>T.key===t);c!==-1&&y(m,i,c),l(m),u(i)},[t,o]);j(()=>(f(),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[k,t]);const C=E(()=>n.length>=5||s.length?"space-between":"start",[s.length,n.length]);return I(G,{ref:g,children:[I(z,{$justifyContent:C,children:[!n.length&&a($,{}),n.map(e=>a(B,{onClick:()=>b(e.key),active:t===e.key,children:a(P,{item:e,withIcon:!0})},e.key))]}),s.length?a(M,{activeTab:t,samples:s,onChange:x,trigger:a(D,{tip:r("openapi.languages.moreButton.tooltipText","View more languages"),arrowPosition:"right",placement:"top",children:a(_,{icon:a(v,{}),"aria-label":"More languages",variant:"text",style:{height:"100%"}})}),withArrow:!1,withCheckmark:!1,width:156}):null]})}const ae=V(F);function J(o,t){let r=0;const n=[],l=[];return t.forEach((s,u)=>{const g=u===t.length-1&&l.length===0?0:N;o&&r+L+g<=o?(n.push(s),r+=L):l.push(s)}),{newVisibleItems:n,newHiddenItems:l}}function y(o,t,r){const n=o[o.length-1];n&&(o[o.length-1]=t[r],t[r]=n)}export{ae as LanguageList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as s,Fragment as
|
|
1
|
+
import{jsx as t,jsxs as s,Fragment as p}from"react/jsx-runtime";import{CopyButton as d}from"@redocly/theme/components/Buttons/CopyButton";import{NewTabButton as a}from"@redocly/theme/components/Buttons/NewTabButton";import{EmailButton as u}from"@redocly/theme/components/Buttons/EmailButton";import{Tooltip as h}from"@redocly/theme/components/Tooltip/Tooltip";import{PanelItem as c,PanelItemDescription as n,PanelItemsList as b}from"../PanelItem/index.js";function S({info:e,translate:r}){const l=e.contact&&e.contact.url&&t(c,{header:t(n,{children:r("openapi.info.contact.url","URL")}),title:t("a",{href:e.contact.url,target:"_blank",rel:"noreferrer",children:e.contact.url}),actions:[t(a,{data:e.contact.url},"NewTabButton")]})||null,i=e.contact&&e.contact.email&&t(c,{header:t(n,{children:e.contact.name||r("openapi.info.contact.name","E-mail")}),title:t("a",{href:"mailto:"+e.contact.email,children:e.contact.email}),actions:[t(h,{tip:r("button.copy.tooltipText","Copy to clipboard"),placement:"top",arrowPosition:"right",children:t(d,{data:e.contact.email})},"CopyButton"),t(u,{data:e.contact.email},"EmailButton")]})||null,o=e.license&&t(c,{header:t(n,{children:r("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(a,{data:e.license.url||""},"NewTabButton")]})||null,m=e.termsOfService&&t(c,{title:t("a",{href:e.termsOfService,target:"_blank",rel:"noreferrer",children:r("openapi.info.termsOfService","Terms of Service")}),actions:[t(a,{data:e.termsOfService},e.termsOfService)]})||null;return t(p,{children:s(b,{children:[l,i,o,m]})})}export{S as Overview};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Suspense as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Suspense as E,lazy as h,memo as S,useEffect as x,useState as R}from"react";import{useAtomValue as o}from"jotai";import{operationStore as T}from"../../jotai/operation.js";import{appStore as O,allowedEnvironmentsAtom as C,environmentsAtom as L}from"../../jotai/app.js";import{useTranslate as V}from"../../hooks/index.js";import{convertOperationToReplayValue as j}from"./utils.js";import{getDefaultCollectorUrl as A}from"../../utils/telemetry.js";import{styled as i}from"../../styled-components.js";import{HTTPSnippet as w}from"../../services/code-samples/httpsnippet/index.js";const P=h(async()=>import("@redocly/replay").then(t=>({default:t.EmbeddedReplay})));function U({activeOperationId:t,corsProxyUrl:d,fullOpenApi:l,pointer:r,hideOtherSecuritySchemes:m}){const a=V(),s=o(T(r)),c=o(O),f=o(L),n=o(C),[u,y]=R(!1);return x(()=>{y(!0)},[]),e(W,{children:u?e(E,{fallback:e(p,{children:a("openapi.loading","Loading...")}),children:e(P,{activeOperationId:t,activeOperationPointer:r,api:l,settings:{predefinedEnvValues:f,corsProxyUrl:d,disableCollectionsTab:!0,hideOtherSecuritySchemes:m,...n&&{allowedEnvironments:n},telemetry:{tracerName:"replay-openapi",collectorUrl:A()},HTTPSnippet:w,convertOperationToReplayValue:(v,g,b)=>j(v,g,b,void 0,s,c)}})}):e(p,{children:a("openapi.loading","Loading...")})})}const G=S(U),p=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
5
5
|
min-height: 100px;
|
|
6
|
-
`,
|
|
6
|
+
`,W=i.div`
|
|
7
7
|
border: 1px solid var(--border-color-primary);
|
|
8
8
|
border-radius: var(--border-radius-lg);
|
|
9
9
|
padding: 0;
|
|
10
|
-
`;export{
|
|
10
|
+
`;export{G as EmbeddedReplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as H,memo as J,Suspense as K,useCallback as m,useRef as W,useState as w}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=H(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/use-configure-replay";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";import{HTTPSnippet as ge}from"../../services/code-samples/httpsnippet/index.js";function ve({operation:e,corsProxyUrl:
|
|
1
|
+
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as H,memo as J,Suspense as K,useCallback as m,useRef as W,useState as w}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=H(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/use-configure-replay";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";import{HTTPSnippet as ge}from"../../services/code-samples/httpsnippet/index.js";function ve({operation:e,corsProxyUrl:P,fullOpenApi:d}){const y=ue(),q=de(),h=W(null),O=p(ne),{oAuth2RedirectURI:E,routingBasePath:c}=O,I=p(se),{parser:R,options:{events:a}}=p(ae),g=p(ce),[s,N]=w(!1),[l,v]=u(ie),[A,S]=u(le),[[,V],T]=u(pe),{config:j,refresh:D}=re({userClaims:g,info:R?.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(()=>D(),[D]),G=m(({operations:t,environment:i,environments:f})=>{const k=t.reduce((b,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,L=ye.compile(["paths",F,B]);return b[L]=Q(me(L),r),b},{});S({...A,...k}),T({environment:i,environments:f})},[A,S,T]),C=()=>{if(l!==n.LOADING){if(!s&&(q.sendTryItOpenedMessage(),a?.tryItOpen&&e)){const t=Oe({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&v(n.LOADING)},U=m(t=>{if(a?.tryItSent&&e){const i=Ie({operation:e,isSuccess:t});a.tryItSent(i)}},[a,e]),_=m(t=>{if(!t)return;const i=I.find(f=>f.operationId===t);return Re(c,i?.href)},[I,c]);return d?z(M,{children:[o(Y,{onClick:C,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(K,{children:o(oe,{mountId:"api-content",children:o("div",{ref:h,children:o(X,{activeOperationId:e.operationId||e.pointer,api:d,onRequestChange:G,onClose:C,onLoad:()=>v(n.LOADED),settings:{corsProxyUrl:P,selectedEnvironment:V,apiId:R?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:E,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},HTTPSnippet:ge,convertOperationToReplayValue:fe(g,j,O),getOperationUrl:_,onRequestReset:x},onRequestSent:U})})})})]}):null}const He=J(ve);export{He as Replay};
|
|
@@ -4,7 +4,8 @@ import type { AppStore } from '../../jotai/app.js';
|
|
|
4
4
|
import type { ConfigureRequestValues, ConfigureServerRequestValues } from '@redocly/theme/ext/configure';
|
|
5
5
|
import { type UserClaims } from '@redocly/theme/core/openapi';
|
|
6
6
|
import { type SecurityRequirement } from '../../models/index.js';
|
|
7
|
-
|
|
7
|
+
import { type Options } from '../../services/index.js';
|
|
8
|
+
export declare function convertOperationToReplayValue(path: string, method: string, openAPI: OpenAPIDefinition, userClaims?: UserClaims, operationState?: OperationStore, appState?: AppStore, dynamicReplayValues?: ConfigureRequestValues | ConfigureServerRequestValues | null, options?: Options): {
|
|
8
9
|
id: string;
|
|
9
10
|
name: string;
|
|
10
11
|
method: string;
|
|
@@ -23,7 +24,7 @@ export declare function convertOperationToReplayValue(path: string, method: stri
|
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
} | undefined;
|
|
26
|
-
export declare function convertOperationToReplayValueForRedoc(userClaims?: UserClaims, dynamicReplayValues?: ConfigureRequestValues | ConfigureServerRequestValues | null): (path: string, method: string, openAPI: OpenAPIDefinition) => {
|
|
27
|
+
export declare function convertOperationToReplayValueForRedoc(userClaims?: UserClaims, dynamicReplayValues?: ConfigureRequestValues | ConfigureServerRequestValues | null, options?: Options): (path: string, method: string, openAPI: OpenAPIDefinition) => {
|
|
27
28
|
operationId: string;
|
|
28
29
|
id: string;
|
|
29
30
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isPrimitive as
|
|
1
|
+
import{isPrimitive as v}from"@redocly/theme/core/openapi";import{getOperation as O}from"../../models/index.js";import{normalizeOptions as b,OpenAPIParser as E}from"../../services/index.js";import{JsonPointer as w}from"../../utils/index.js";function V(t,r,n,a,e,o,i,m){if(!n)return;const u=new E(n),c=u.definition.paths?.[t];let d=c?.[r];!d&&c?.additionalOperations&&(d=c.additionalOperations[r]);const s=O(u,{...d,pathName:t,httpVerb:r,pathParameters:c.parameters||[],pathServers:c.servers||[]},void 0,m??b({}),"",{isCallback:!1},a,i);if(!s)return;const h=o?.activeMimeName||s.requestBody?.content?.mediaTypes[0]?.name||"application/json";return{id:s.id,name:s.name,method:s.httpVerb,operationId:s.operationId,parameters:y(s.parameters,e?.requestValues),body:q(s.requestBody,n,e?.requestValues?.body?{activeExampleName:e?.activeExampleName,[h]:e?.requestValues?.body}:e?.activeExampleName?{activeExampleName:e?.activeExampleName}:void 0),path:s.path,href:s.href,servers:s.servers,security:I(s.security),responses:Object.fromEntries(s.responses.map(l=>[l.code,{code:l.code,description:l.description,mediaTypes:l.content?.mediaTypes.reduce((p,f)=>(p[f.name]={name:f.name,schema:x(f.schema?.rawSchema,n)},p),{})}]))}}function k(t,r,n){return function(a,e,o){const i=V(a,e,o,t,void 0,void 0,r,n);if(i)return{...i,operationId:i.operationId||w.compile(["paths",i.path,i.method])}}}function y(t,r){const n=new Set,a=t.map(e=>(n.add(e.in+":"+e.name),{name:e.name,in:e.in,required:e.required,description:e.description,example:r?.[String(e.in)]?.[e.name]||e.example,schema:e.schema,...e.allowReserved&&{allowReserved:e.allowReserved}}));for(const[e,o]of Object.entries(r||{}))for(const[i,m]of Object.entries(o||{}))n.has(e+":"+i)||a.push({name:i,in:e,required:!1,description:"",example:String(m),schema:void 0});return a}function g({type:t,format:r,enum:n}){return t==="string"&&(r==="binary"||r==="base64")?"file":t==="object"?"multiline":n.length>0?"select":"text"}function N(t,r){const n=t[0]?.example||t[0]?.examples;if(n)return n;if(t.schema?.example)return t.schema.example;const a=r?.default?.value||r?.default?.rawValue;return a?.[t.name]?v(a?.[t.name])?String(a?.[t.name]):JSON.stringify(a?.[t.name]):""}function S(t){if(t?.fields)return t.fields;if(t?.oneOf){for(const r of t.oneOf)if(r?.fields)return r.fields}}function q(t,r,n){if(!t||!t.content?.mediaTypes){if(!n)return;const{activeExampleName:a,...e}=n;return{activeExampleName:a,mediaTypes:Object.fromEntries(Object.entries(e).map(([o,i])=>[o,{name:o,examples:{default:{value:i}},schema:{},parameters:[]}]))}}return{required:t.required,activeExampleName:n?.activeExampleName,mediaTypes:t.content.mediaTypes.reduce((a,e)=>{const o=e.schema,i=n?.[e.name]?{default:{value:n?.[e.name],rawValue:n?.[e.name],mime:e.name}}:e.examples||e.formExamples,m=S(o);return a[e.name]={name:e.name,examples:i,schema:x(e.schema?.rawSchema,r),parameters:m?.map(u=>({inputType:g(u.schema),name:u.name,example:N(u,i)}))},a},{})}}function x(t,r){if(!(!t||!r))return{...t,components:r?.components||{}}}function I(t){if(t)return t.map(({schemes:r})=>r.map(n=>{const a={id:n.id,type:n.type,in:n.in,openIdConnectUrl:n.openIdConnectUrl,scopes:n.scopes,scheme:n.scheme,name:n.name,flows:n.flows,serverValues:n.serverValues,"x-defaultAccessToken":n["x-defaultAccessToken"],"x-defaultTokenType":n["x-defaultTokenType"],"x-defaultClientId":n["x-defaultClientId"],"x-defaultClientSecret":n["x-defaultClientSecret"],"x-defaultUsername":n["x-defaultUsername"],"x-defaultPassword":n["x-defaultPassword"]};return Object.keys(a).forEach(e=>a[e]===void 0&&delete a[e]),a}))}export{V as convertOperationToReplayValue,k as convertOperationToReplayValueForRedoc,I as convertRequestSecurity};
|
|
@@ -1 +1 @@
|
|
|
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:g,mockServer:v},parser:{definition:s,definitionUrl:t}}=c(I),{languages:i,activeLanguage:h}=c(P),l=D({downloadUrls:g}),m=d(t,M(s.servers||[],v)),n=s?.["x-mcp"],w=d(t,n?.servers||s.servers||[]),p=!(Object.keys(s.paths||{}).length>0)&&n;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})}),!!n&&e(r,{className:"panel-download",header:a("openapi.mcp.title","MCP server"),isExpandable:!1,children:e(E,{mcpInfo:n,mcpServers:w})}),(o?.license||o?.contact||o?.termsOfService)&&e(r,{className:"panel-mcp-overview",header:a("openapi.info.title","Overview"),isExpandable:!1,children:e(S,{children:e(O,{info:o,translate:a})})}),!!i?.length&&!p&&e(r,{className:"panel-language-list",header:a("openapi.languages.title","Languages"),isExpandable:!1,children:e(L,{languages:i,activeLanguage:h})}),!!m.length&&!p&&e(r,{className:"panel-servers-list",header:a("openapi.servers.title","Servers"),isExpandable:!1,children:e(j,{servers:m,translate:a})})]})};export{J as RightPanel};
|
|
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:g,mockServer:v},parser:{definition:s,definitionUrl:t}}=c(I),{languages:i,activeLanguage:h}=c(P),l=D({downloadUrls:g}),m=d(t,M(s.servers||[],v)),n=s?.["x-mcp"],w=d(t,n?.servers||s.servers||[]),p=!(Object.keys(s.paths||{}).length>0)&&n;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})}),!!n&&e(r,{className:"panel-download",header:a("openapi.mcp.title","MCP server"),isExpandable:!1,children:e(E,{mcpInfo:n,mcpServers:w})}),(o?.license||o?.contact||o?.termsOfService)&&e(r,{className:"panel-mcp-overview",header:a("openapi.info.title","Overview"),isExpandable:!1,children:e(S,{children:e(O,{info:o,translate:a})})}),!!i?.length&&!p&&e(r,{className:"panel-language-list",header:a("openapi.languages.title","Languages"),isExpandable:!1,children:e(L,{languages:i,activeLanguage:h,translate:a})}),!!m.length&&!p&&e(r,{className:"panel-servers-list",header:a("openapi.servers.title","Servers"),isExpandable:!1,children:e(j,{servers:m,translate:a})})]})};export{J as RightPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as i,jsxs as
|
|
1
|
+
import{jsx as i,jsxs as r}from"react/jsx-runtime";import{CopyButton as x}from"@redocly/theme/components/Buttons/CopyButton";import{Tooltip as v}from"@redocly/theme/components/Tooltip/Tooltip";import{getServerDisplayName as y}from"../../utils/helpers.js";import{PanelItemDescription as u,Title as w}from"../PanelItem/index.js";import{ViewNested as T}from"../ViewNested/index.js";import{Tag as S}from"../common/index.js";import{Markdown as j}from"../Markdown/index.js";import{styled as o}from"../../styled-components.js";import{ServerDescriptionTooltip as D}from"./ServerDescriptionTooltip.js";const F=({servers:h,path:b="",translate:t})=>i($,{children:h.map(e=>{const a=e.url+b,p=Object.keys(e.variables||{}).length,d=p===1?"variable":"variables",l=`${p||""} ${t(`openapi.${d}`,d)}`,f=!!e.name&&!!e.description;return r("div",{children:[r(O,{children:[i(u,{"data-testid":"server-panel-item-name",children:y(e)}),f&&i(D,{description:e.description})]}),r(B,{children:[i(w,{suppressHydrationWarning:!0,children:a}),i(v,{tip:t("button.copy.tooltipText","Copy to clipboard"),placement:"top",arrowPosition:"right",children:i(x,{data:a},a)})]}),e.variables&&i(T,{expandText:`${t("openapi.actions.show","Show")} ${l}`,hideText:`${t("openapi.actions.hide","Hide")} ${l}`,expandByDefault:!1,expandable:!0,hideDivider:!0,children:i(z,{children:Object.entries(e.variables||{}).map(([c,n])=>r(C,{children:[i(k,{children:c}),r(s,{children:[t("openapi.default","Default")," ",i(g,{children:n.default})]}),i(W,{source:n.description}),n.enum&&r(s,{children:[t("openapi.enum","Enum")," ",i(L,{children:n.enum.map(m=>i(g,{children:m},m))})]})]},c))})})]},e.url)})}),$=o.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=o.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
|
+
`,C=o.div`
|
|
32
32
|
display: flex;
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
flex-wrap: wrap;
|
|
35
|
-
`,W=
|
|
35
|
+
`,W=o(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
|
-
`,s=
|
|
39
|
+
`,s=o.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
|
-
`,k=
|
|
45
|
+
`,k=o(s)`
|
|
46
46
|
padding-bottom: var(--spacing-xxs);
|
|
47
47
|
font-weight: var(--font-weight-semibold);
|
|
48
|
-
`,
|
|
48
|
+
`,L=o.span`
|
|
49
49
|
display: flex;
|
|
50
50
|
gap: var(--spacing-xxs);
|
|
51
51
|
flex-wrap: wrap;
|
|
52
|
-
`,g=
|
|
52
|
+
`,g=o(S)`
|
|
53
53
|
font-size: var(--font-size-sm);
|
|
54
54
|
line-height: var(--line-height-sm);
|
|
55
|
-
`,
|
|
55
|
+
`,O=o.div`
|
|
56
56
|
display: flex;
|
|
57
57
|
justify-content: start;
|
|
58
58
|
align-items: center;
|
|
59
59
|
gap: var(--spacing-xxs);
|
|
60
|
-
`,
|
|
60
|
+
`,B=o.div`
|
|
61
61
|
display: flex;
|
|
62
62
|
justify-content: space-between;
|
|
63
63
|
align-items: center;
|
|
64
|
-
`;export{
|
|
64
|
+
`;export{F as ServerList};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.19.0-next.
|
|
3
|
+
"version": "3.19.0-next.9",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,25 +21,25 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "2.20.
|
|
24
|
+
"@redocly/openapi-core": "2.20.5",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.7",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
28
28
|
"fast-xml-parser": "5.4.1",
|
|
29
29
|
"jotai": "^2.12.5",
|
|
30
|
-
"jotai-family": "
|
|
30
|
+
"jotai-family": "1.0.1",
|
|
31
31
|
"json-pointer": "^0.6.2",
|
|
32
|
-
"openapi-sampler": "1.7.
|
|
32
|
+
"openapi-sampler": "^1.7.2",
|
|
33
33
|
"react-router-dom": "^6.30.3",
|
|
34
|
-
"slugify": "^1.4.
|
|
34
|
+
"slugify": "^1.4.7",
|
|
35
35
|
"stringify-object": "^3.3.0",
|
|
36
36
|
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0",
|
|
37
37
|
"swagger2openapi": "^7.0.8",
|
|
38
38
|
"url-template": "^2.0.8",
|
|
39
39
|
"util": "~0.12.5",
|
|
40
40
|
"web-vitals": "3.3.1",
|
|
41
|
-
"@redocly/config": "0.44.
|
|
42
|
-
"@redocly/replay": "0.22.0-next.
|
|
41
|
+
"@redocly/config": "0.44.1",
|
|
42
|
+
"@redocly/replay": "0.22.0-next.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@shikijs/transformers": "3.21.0",
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"json-schema": "0.4.0",
|
|
61
61
|
"outdent": "0.8.0",
|
|
62
62
|
"path-browserify": "1.0.1",
|
|
63
|
-
"prettier-2": "npm:prettier@2.8.8",
|
|
64
63
|
"react": "^19.2.4",
|
|
65
64
|
"react-dom": "^19.2.4",
|
|
66
65
|
"rimraf": "5.0.7",
|
|
@@ -72,7 +71,7 @@
|
|
|
72
71
|
"url": "~0.11.0",
|
|
73
72
|
"vite": "7.2.6",
|
|
74
73
|
"vitest": "4.0.10",
|
|
75
|
-
"@redocly/theme": "0.63.0-next.
|
|
74
|
+
"@redocly/theme": "0.63.0-next.6"
|
|
76
75
|
},
|
|
77
76
|
"scripts": {
|
|
78
77
|
"start": "pnpm run copy-highlight-hook && vite",
|