@redocly/openapi-docs 3.18.0-next.8 → 3.18.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 +2678 -2599
- package/lib/components/ExpandAllButton/ExpandAllButton.js +2 -2
- package/lib/components/Language/LanguageList.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/components/Samples/ExampleSwitch.js +1 -1
- package/lib/components/Security/ScopeTagWithTooltip.d.ts +1 -1
- package/lib/components/Security/Security.js +1 -1
- package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/models/request.js +1 -1
- package/lib/models/response.js +1 -1
- package/lib/types/open-api.d.ts +3 -0
- package/lib/utils/openapi.d.ts +3 -0
- package/lib/utils/openapi.js +1 -1
- package/package.json +11 -11
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import{useAtom as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{useAtom as d}from"jotai";import{MaximizeIcon as m}from"@redocly/theme/icons/MaximizeIcon/MaximizeIcon";import{Button as c}from"@redocly/theme/components/Button/Button";import{operationStore as x}from"../../jotai/operation.js";import{useTelemetry as u,useTranslate as f}from"../../hooks/index.js";import{styled as A}from"../../styled-components.js";const _=({operationPointer:a,type:e,onPanelToggle:s})=>{const l=f(),[t,r]=d(x(a)),i=u(),p=()=>{const o=!t[e].expandedAll;i.sendExpandCollapseAllClickedMessage([{id:`expand-collapse-${e}-panel`,object:"expand_collapse_all",uri:window.location.href,isExpanded:o}]),r({[e]:{expandedAll:o}}),s?.(o,e==="request"?"request":"responses")};return n(g,{icon:n(m,{}),iconPosition:"right",size:"small",variant:"ghost",onClick:p,children:t[e].expandedAll?l("openapi.collapseAll","Collapse all"):l("openapi.expandAll","Expand all")})},g=A(c)`
|
|
2
2
|
margin-left: auto;
|
|
3
|
-
`;export{
|
|
3
|
+
`;export{_ as ExpandAllButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as T,useRef as
|
|
1
|
+
import{jsx as a,jsxs as I}from"react/jsx-runtime";import{useLayoutEffect as T,useRef as j,useState as L,useCallback as A,memo as S,useMemo as E}from"react";import{useAtomValue as H,useSetAtom as V}from"jotai";import{Button as W}from"@redocly/theme/components/Button/Button";import{OverflowMenuVerticalIcon as _}from"@redocly/theme/icons/OverflowMenuVerticalIcon/OverflowMenuVerticalIcon";import{LanguageDropdown as v}from"./LanguageDropdown.js";import{languageAtom as D,layoutAtom as R}from"../../jotai/app.js";import{LanguageListContainer as M,LanguageListItem as O,Container as z}from"./styled.js";import{LanguageItem as G}from"./LanguageItem.js";import{DROPDOWN_TRIGGER_WIDTH as B,ITEM_WIDTH as w}from"./constants.js";import{LanguageListSkeleton as N}from"../common/Skeleton/LanguageListSkeleton.js";import{useTelemetry as P}from"../../hooks/index.js";function $({languages:o,activeLanguage:t}){const[n,i]=L([]),[s,l]=L([]),u=P(),g=j(null),f=H(R),h=V(D),p=e=>{u.sendSelectLanguageClickedMessage([{object:"select_language",language:e}])},k=e=>{h(e),p(e)},C=e=>{const m=s.findIndex(r=>r.key===e);if(m!==-1){const r=[...s],c=[...n];y(c,r,m),i(c),l(r),p(e),h(e)}},d=A(()=>{const e=g?.current?.offsetWidth;if(!e)return;const{newVisibleItems:m,newHiddenItems:r}=q(e,[...o]),c=r.findIndex(x=>x.key===t);c!==-1&&y(m,r,c),i(m),l(r)},[t,o]);T(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[f,t]);const b=E(()=>n.length>=5||s.length?"space-between":"start",[s.length,n.length]);return I(z,{ref:g,children:[I(M,{$justifyContent:b,children:[!n.length&&a(N,{}),n.map(e=>a(O,{onClick:()=>k(e.key),active:t===e.key,children:a(G,{item:e,withIcon:!0})},e.key))]}),s.length?a(v,{activeTab:t,samples:s,onChange:C,trigger:a(W,{icon:a(_,{}),variant:"text",style:{height:"100%"}}),withArrow:!1,withCheckmark:!1,width:156}):null]})}const se=S($);function q(o,t){let n=0;const i=[],s=[];return t.forEach((l,u)=>{const f=u===t.length-1&&s.length===0?0:B;o&&n+w+f<=o?(i.push(l),n+=w):s.push(l)}),{newVisibleItems:i,newHiddenItems:s}}function y(o,t,n){const i=o[o.length-1];i&&(o[o.length-1]=t[n],t[n]=i)}export{se as LanguageList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as s,Fragment as
|
|
1
|
+
import{jsx as t,jsxs as s,Fragment as x}from"react/jsx-runtime";import{memo as C,useRef as O,useEffect as T}from"react";import{LayoutVariant as d}from"@redocly/config";import{useSetAtom as j}from"jotai";import{ThreePanelLayout as A}from"@redocly/theme/layouts/ThreePanelLayout";import{SidebarLogo as I}from"@redocly/theme/components/SidebarLogo/SidebarLogo";import{GlobalStyle as M,useMount as _}from"@redocly/theme/core/openapi";import{StoreProvider as N}from"./Providers.js";import{Overlay as v}from"../Overlay.js";import{RedocWrap as D}from"./styled.js";import{StickyResponsiveSidebar as V}from"../StickySidebar/index.js";import{SideMenu as k}from"../SideMenu/index.js";import{Content as B}from"../Content/index.js";import{useContentItems as K,useUppercase2LowercaseRedirect as F,useTelemetry as H,usePerformanceMetrics as U}from"../../hooks/index.js";import{withRouter as Y}from"../../hoc/withRouter.js";import{withStore as G}from"../../hoc/withStore.js";import{compose as W}from"../../utils/index.js";import{useLicense as q}from"../../hooks/useLicense.js";import{allOperationsAtom as z}from"../../jotai/replay.js";const J=W(Y,G,C)(({licenseKey:m,onLoaded:a,children:e,options:o,layout:i,collapsedSidebar:u,parser:c,withCommonStyles:g})=>{const R=O(null),{isValid:l,licenseInfo:S}=q(m),h=j(z),y=H();F();const{contentItems:b,flatItems:f}=K({parser:c,options:o});U({sendTelemetry:p=>{const r=Object.fromEntries(Object.entries(p).map(([E,w])=>[E.toLowerCase(),w]));y.sendPerformanceMetricsMessage([{object:"metrics",cls:r.cls,lcp:r.lcp,fcp:r.fcp,ttfb:r.ttfb}])}}),T(()=>{if(!o.hideReplay&&f.length>0){const p=f.filter(r=>r.type==="operation");h(p)}},[f,o.hideReplay,h]),_(()=>{a?.(),y.sendViewedMessage([{object:"view_stats",layout:i}])});const{hideSidebar:P,scrollYOffset:L}=o||{},n=c.definition?.info?.["x-logo"];return s(x,{children:[g&&t(M,{}),s(D,{className:"redoc-wrap",ref:R,children:[!l&&t(v,{licenseInfo:S}),!P&&s(V,{scrollYOffset:L,className:"menu-content",collapsedSidebar:!u,children:[t(I,{imageUrl:n?.url,href:n?.href||c.definition?.info?.contact?.url,altText:n?.altText,backgroundColor:n?.backgroundColor}),t(k,{items:l?b:[]})]}),s(A,{className:"api-content",id:"api-content",layout:i===d.THREE_PANEL?d.THREE_PANEL:d.STACKED,collapsedSidebar:u,children:[t(B,{items:l?b:[],routingBasePath:o.routingBasePath}),e]})]})]})});function he({onLoaded:m,children:a,store:e,withCommonStyles:o,router:i}){return e?.definition?t(N,{...e,children:t(J,{onLoaded:m,basePath:e.options?.routingBasePath,licenseKey:e.options?.licenseKey,disableRouter:e.options?.disableRouter,withCommonStyles:o,router:i,children:a})}):null}export{he as RedoclyOpenAPIDocs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as h,Fragment as u,jsxs as E}from"react/jsx-runtime";import{memo as O}from"react";import{useAtom as g}from"jotai";import{ExampleSwitch as v,useExampleKey as j}from"../Samples/index.js";import{useActivateExample as w,useTelemetry as K}from"../../hooks/index.js";import{operationStore as b}from"../../jotai/operation.js";function C({mediaType:e,mediaContent:l,renderSample:r}){const m=K(),p=e.operation.pointer,[n,i]=g(b(p)),s=e.examples||e.formExamples||{},t=Object.keys(s),x=w(l),{exampleKey:c}=j(e.operation,s),a=t[n.activeOneOf[e?.examplesPointer||e.operation.pointer]]||c;return!t.length||t.length===1?r():E(u,{children:[h(v,{examples:s,exampleKey:a,onChange:o=>{const f=e.examplesPointer&&e.examplesPointer.startsWith(e.operation.pointer)?e.examplesPointer:e.operation.pointer;m.sendExamplesSwitcherClickedMessage([{id:"examples-switcher-request-body",uri:window.location.href,object:"examples_switcher",exampleNumber:t.indexOf(o),totalExamples:t.length}]),i({...n,activeExampleName:o,activeOneOf:{...n.activeOneOf,[f]:t.indexOf(o)},requestValues:{body:null}}),x(o)}}),r(a)]})}const M=O(C);export{M as Example};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as o,jsxs as D}from"react/jsx-runtime";import{memo as T,useCallback as L,useMemo as k}from"react";import{useAtomValue as y,useAtom as
|
|
1
|
+
import{jsx as o,jsxs as D}from"react/jsx-runtime";import{memo as T,useCallback as L,useMemo as k}from"react";import{useAtomValue as y,useAtom as _}from"jotai";import{PanelHeader as U}from"@redocly/theme/components/Panel/PanelHeader";import{PayloadSamples as W}from"../PayloadSamples/index.js";import{CodeSample as B}from"./CodeSample.js";import{useCodeSamples as F}from"./useCodeSamples.js";import{isPayloadSample as H}from"../../models/index.js";import{createCodeSampleCopyEvent as O,createLanguageSwitchEvent as V}from"../../events/index.js";import{globalStoreAtom as $}from"../../jotai/store.js";import{ServerListDropdown as z}from"../ServerListDropdown/index.js";import{LanguageDropdown as G}from"../Language/index.js";import{activeMimeNameAtom as J,languageAtom as K}from"../../jotai/app.js";import{Replay as A}from"../Replay/index.js";import{CodeBlockPanel as w}from"../common/index.js";import{useActiveWithFallback as Q,useTelemetry as X}from"../../hooks/index.js";import{operationStore as Y}from"../../jotai/operation.js";import{styled as S}from"../../styled-components.js";function Z({operation:a,disableFooter:P,onPanelToggle:v,...p}){const m=X(),[{activeLanguage:q,languages:c},R]=_(K),{samples:n}=F(a),{parser:d,options:{events:l,corsProxyUrl:g,hideReplay:j}}=y($),i=!P&&!a.isWebhook&&!j&&!a.hideReplay,t=!!c?.length,u=Q(n,q),E=e=>{R(e),m.sendSelectLanguageClickedMessage([{object:"select_language",language:e}]);const r=c?.find(s=>s.key===e);if(l?.codeSamplesLanguageSwitch&&r){const s=V({operation:a,sample:{lang:r.lang,label:r.title}});l.codeSamplesLanguageSwitch(s)}},h=y(J),{activeExampleName:C}=y(Y(a.pointer)),f=L(({lang:e,title:r})=>()=>{const s=O({operation:a,label:r,lang:e,type:"request",activeMimeName:h,activeExampleName:C});m.sendCopyCodeSnippetClickedMessage([{object:"code_snippet",snippetType:"request",language:e}]),l?.codeSamplesCopy?.(s)},[a,m,l,h,C]),b=L(e=>{v?.(e,"request-samples")},[v]),x=()=>D(I,{isExpandable:!1,withReplay:!t&&i,children:[o(ee,{operation:a}),t&&o(G,{activeTab:u,samples:n,onChange:E}),!t&&i&&o(A,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})]}),M=k(()=>{if(i&&t)return o(ae,{children:o(A,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})})},[i,t,a,g,d.definition]),N=k(()=>n.map(e=>e.key===u?o("div",{children:H(e)?o(W,{content:e.requestBodyContent,onCopyClick:f(e),onPanelToggle:b,...p}):o(B,{lang:e.lang,source:e.source,externalSample:e,operation:a,onCopyClick:f(e),...p})},e.key+a.id):null),[u,f,b,a,p,n]);return c&&!n.length?o(w,{className:"panel-request-samples",header:x,isExpandable:!1,expanded:!1}):n.length?o(w,{className:"panel-request-samples",header:x,footer:M,isExpandable:!1,children:N}):null}const Ce=T(Z),I=S(U)`
|
|
2
2
|
flex-wrap: nowrap;
|
|
3
3
|
${({withReplay:a})=>a&&"padding: var(--spacing-xs) var(--spacing-sm);"}
|
|
4
4
|
`,ee=S(z)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{memo as b,useCallback as i}from"react";import{useAtomValue as n}from"jotai";import{PayloadSamples as h,StyledCodeBlock as v}from"../PayloadSamples/index.js";import{createCodeSampleCopyEvent as k}from"../../events/index.js";import{globalOptionsAtom as T}from"../../jotai/store.js";import{Summary as g}from"./Summary.js";import{Tabs as x}from"../Tabs/index.js";import{CodeBlockPanel as N}from"../common/index.js";import{useTelemetry as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{memo as b,useCallback as i}from"react";import{useAtomValue as n}from"jotai";import{PayloadSamples as h,StyledCodeBlock as v}from"../PayloadSamples/index.js";import{createCodeSampleCopyEvent as k}from"../../events/index.js";import{globalOptionsAtom as T}from"../../jotai/store.js";import{Summary as g}from"./Summary.js";import{Tabs as x}from"../Tabs/index.js";import{CodeBlockPanel as N}from"../common/index.js";import{useTelemetry as j,useTranslate as A}from"../../hooks/index.js";import{activeMimeNameAtom as E}from"../../jotai/app.js";import{operationStore as M}from"../../jotai/operation.js";function P({operation:o,activeResponseTab:d,onTabChange:f,onPanelToggle:a}){const m=j(),{events:p}=n(T),y=A(),C=o.responses.filter(e=>e.content?.hasSample??!1),s=o.responses.map(({code:e})=>({key:e,title:e})),r=s?.find(({key:e})=>e===d)||s?.[0],l=n(E),{activeExampleName:c}=n(M(o.pointer)),u=i(()=>{m.sendCopyCodeSnippetClickedMessage([{object:"code_snippet",snippetType:"response"}]);const e=k({operation:o,type:"response",activeMimeName:l,activeExampleName:c});p?.codeSamplesCopy?.(e)},[m,o,p,l,c]),S=i(e=>{a?.(e,"response-samples")},[a]);return C.length?t(N,{className:"panel-response-samples",header:()=>t(g,{tabs:t(x,{tabs:s,activeTab:r,onChange:e=>f(e.key)})}),isExpandable:!1,children:o.responses.map(e=>e.code===r.key?t("div",{"data-testid":"response-payload-sample",children:e?.content?.hasSample?t(h,{content:e.content,onCopyClick:u,onPanelToggle:S}):t(v,{source:y("openapi.noResponseContent","No content")})},e.code):null)}):null}const J=b(P);export{J as ResponseSamples};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{useState as d,useEffect as p}from"react";import{MimeLabel as h,Container as x,Select as v}from"../common/index.js";import{SelectOrLabel as S}from"../SelectOrLabel/index.js";import{normalizeText as b}from"../../utils/index.js";const O=({exampleKey:o,examples:n,onChange:l,className:c})=>{const a=Object.keys(n),t=o?a.indexOf(o):0,[m,s]=d(t>-1?t:0);p(()=>s(t>-1?t:0),[o,t]);const r=a.map((e,f)=>({value:b(n[e].summary)||e,idx:f})),u=({idx:e})=>{s(e),l(a[e])};return r.length<2?null:i(x,{"data-testid":"example-switch",className:c,children:i(S,{Select:v,Label:h,variant:"dark",fullWidth:!0,options:r,value:r[m]?.value,onChange:u})})};export{O as ExampleSwitch};
|
|
@@ -10,7 +10,7 @@ interface ScopeTagWithTooltipProps {
|
|
|
10
10
|
tip?: string | ReactNode;
|
|
11
11
|
ariaLabel?: string;
|
|
12
12
|
TagComponent?: ComponentType<TagComponentProps>;
|
|
13
|
-
arrowPosition?: '
|
|
13
|
+
arrowPosition?: 'left' | 'right' | 'center';
|
|
14
14
|
compact?: boolean;
|
|
15
15
|
}
|
|
16
16
|
export declare function ScopeTagWithTooltip({ className, text, maxChars, tip, ariaLabel, TagComponent, arrowPosition, compact, }: ScopeTagWithTooltipProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,Fragment as f,jsxs as y}from"react/jsx-runtime";import{useState as h,useRef as C}from"react";import{Portal as b}from"@redocly/theme/components/Portal/Portal";import{useModalScrollLock as w}from"@redocly/theme/core/openapi";import{SecurityButton as M}from"./SecurityButton.js";import{SecurityModal as S}from"./SecurityModal.js";import{useTelemetry as g}from"../../hooks/index.js";function _({securities:t}){const[i,c]=h(!1),l=g(),e=C(null);if(w(i),!t.length)return null;const m=()=>{const o=t.flatMap(s=>s.schemes),n=[...new Set(o.map(s=>s.type))],u=o.length,a=n.length>1,p=Date.now();e.current={securityTypes:n,schemesCount:u,isCombined:a,modalOpenTime:p},l.sendViewSecurityDetailsClickedMessage({id:"openapi-docs-security-button",object:"button",uri:window.location.href,securityTypes:n,schemesCount:u,isCombined:a}),c(!0)},d=()=>{if(e.current){const o=Date.now()-e.current.modalOpenTime;l.sendViewSecurityDetailsClosedMessage({id:"openapi-docs-security-button",object:"button",uri:window.location.href,securityTypes:e.current.securityTypes,schemesCount:e.current.schemesCount,isCombined:e.current.isCombined,timeInModalMs:o}),e.current=null}c(!1)};return y(f,{children:[r(M,{securities:t,onClick:m}),i&&r(b,{mountId:"api-content",children:r(S,{securities:t,onClose:d})})]})}export{_ as Security};
|
|
1
|
+
import{jsx as r,Fragment as f,jsxs as y}from"react/jsx-runtime";import{useState as h,useRef as C}from"react";import{Portal as b}from"@redocly/theme/components/Portal/Portal";import{useModalScrollLock as w}from"@redocly/theme/core/openapi";import{SecurityButton as M}from"./SecurityButton.js";import{SecurityModal as S}from"./SecurityModal.js";import{useTelemetry as g}from"../../hooks/index.js";function _({securities:t}){const[i,c]=h(!1),l=g(),e=C(null);if(w(i),!t.length)return null;const m=()=>{const o=t.flatMap(s=>s.schemes),n=[...new Set(o.map(s=>s.type))],u=o.length,a=n.length>1,p=Date.now();e.current={securityTypes:n,schemesCount:u,isCombined:a,modalOpenTime:p},l.sendViewSecurityDetailsClickedMessage([{id:"openapi-docs-security-button",object:"button",uri:window.location.href,securityTypes:n,schemesCount:u,isCombined:a}]),c(!0)},d=()=>{if(e.current){const o=Date.now()-e.current.modalOpenTime;l.sendViewSecurityDetailsClosedMessage([{id:"openapi-docs-security-button",object:"button",uri:window.location.href,securityTypes:e.current.securityTypes,schemesCount:e.current.schemesCount,isCombined:e.current.isCombined,timeInModalMs:o}]),e.current=null}c(!1)};return y(f,{children:[r(M,{securities:t,onClick:m}),i&&r(b,{mountId:"api-content",children:r(S,{securities:t,onClose:d})})]})}export{_ as Security};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as f}from"react/jsx-runtime";import{useMemo as S,useCallback as c}from"react";import{useAtom as g,useAtomValue as w}from"jotai";import{DropdownMenu as y}from"@redocly/theme/components/Dropdown/DropdownMenu";import{Dropdown as A}from"@redocly/theme/components/Dropdown/Dropdown";import{getOperationColor as C}from"@redocly/theme/core/openapi";import{HttpVerb as b}from"../common/index.js";import{PathWrapper as k,Path as
|
|
1
|
+
import{jsx as e,jsxs as f}from"react/jsx-runtime";import{useMemo as S,useCallback as c}from"react";import{useAtom as g,useAtomValue as w}from"jotai";import{DropdownMenu as y}from"@redocly/theme/components/Dropdown/DropdownMenu";import{Dropdown as A}from"@redocly/theme/components/Dropdown/Dropdown";import{getOperationColor as C}from"@redocly/theme/core/openapi";import{HttpVerb as b}from"../common/index.js";import{PathWrapper as k,Path as j,StyledCopyButton as P,StyledDropdownMenuItem as V}from"./styled.js";import{PanelItem as x}from"../PanelItem/index.js";import{joinWithSeparator as D}from"../../services/index.js";import{getServerDisplayName as M,replaceVariables as E}from"../../utils/index.js";import{environmentAtom as N}from"../../jotai/app.js";import{useActiveWithFallback as O,useTelemetry as W}from"../../hooks/index.js";import{getServerEnvName as p}from"../../utils/environments.js";import{createTargetServerSwitchEvent as _}from"../../events/index.js";import{globalStoreAtom as I}from"../../jotai/store.js";const $=({operation:r,className:h})=>{const n=W(),[[d],m]=g(N),{options:{events:i}}=w(I),s=O(r.servers.map(t=>({...t,key:t.url})),d.server),a=c(t=>{t.stopPropagation()},[]),l=c(t=>()=>{if(r.servers.length!==1&&(m({environment:p(t)}),n.sendSwitchServersClickedMessage([{object:"switch_servers",server:p(t)}]),i?.targetServerSwitch&&t)){const o=_({operation:r,serverUrl:t.url});i.targetServerSwitch(o)}},[r,m,n,i]),v=S(()=>r.servers.map(t=>{const o=D(E(t),r.path);return e(V,{onAction:l(t),children:e(x,{header:M(t),title:o,actions:[e(P,{data:o,toasterPlacement:"left",onCopyClick:a},o)],active:t.url===s,withCheckmark:!0})},o)}),[r.servers,r.path,l,a,s]),u=C({isAdditionalOperation:r.isAdditionalOperation,httpVerb:r.httpVerb});return e(A,{className:h,trigger:f(k,{variant:"ghost",children:[e(b,{color:u,children:r.httpVerb}),e(j,{children:r.path})]}),withArrow:!0,children:e(y,{children:v})})};export{$ as ServerListDropdown};
|
package/lib/models/request.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getValueFromMdParsedExtension as m,JsonPointer as q,getContent as p}from"../utils/index.js";import{getMediaContent as a}from"./mediaContent.js";function y({parser:e,infoOrRef:n,options:d,isEvent:s,operation:o}){const{resolved:t}=e.deref(n),u=m(t,"description")||"",c=t.required;let i;const f=!s,r=p(e,t);return r!==void 0&&(i=a({parser:e,info:r,isRequestType:f,options:d,data:{operation:o,type:"request",absolutePointer:n.$ref||q.join(o.pointer,["requestBody"])}})),{description:u,required:c,content:i}}export{y as getRequestBody};
|
package/lib/models/response.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getStatusCodeType as h,
|
|
1
|
+
import{getStatusCodeType as h,JsonPointer as c,getValueFromMdParsedExtension as d,getContent as x}from"../utils/index.js";import{getField as C}from"./field.js";import{getMediaContent as j}from"./mediaContent.js";function M({parser:n,code:s,defaultAsError:a,infoOrRef:m,options:p,isEvent:y,operation:o}){const g=!!y,{resolved:t}=n.deref(m),e={code:s};t["x-summary"]!==void 0?(e.summary=d(t,"x-summary"),e.description=d(t,"description")||""):(e.summary=d(t,"description")||"",e.description=""),e.type=h(s,a);const i=t.headers,u=m.$ref||c.join(o?.pointer||"",["responses",s]);i!==void 0&&(e.headers=Object.keys(i).map(r=>{const l=i[r];return C(n,{...l,name:r},c.join(u,["headers",r]),p,{operation:o,type:"response",response:e})}));const f=x(n,t);return f!==void 0&&(e.content=j({parser:n,info:f,isRequestType:g,options:p,data:{operation:o,type:"response",response:e,absolutePointer:u}})),e}export{M as getResponse};
|
package/lib/types/open-api.d.ts
CHANGED
|
@@ -313,6 +313,9 @@ export interface OpenAPIComponents {
|
|
|
313
313
|
callbacks?: {
|
|
314
314
|
[name: string]: Referenced<OpenAPICallback>;
|
|
315
315
|
};
|
|
316
|
+
mediaTypes?: {
|
|
317
|
+
[name: string]: Referenced<OpenAPIMediaType>;
|
|
318
|
+
};
|
|
316
319
|
}
|
|
317
320
|
export interface OpenAPISecurityRequirement {
|
|
318
321
|
[name: string]: string[];
|
package/lib/utils/openapi.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ export declare const shortenHTTPVerb: (verb: string) => string;
|
|
|
38
38
|
export declare function isRedocExtension(key: string): boolean;
|
|
39
39
|
export declare function extractExtensions(obj: GenericObject, showExtensions: string[] | true): GenericObject;
|
|
40
40
|
export declare function pluralizeType(displayType: string): string;
|
|
41
|
+
export declare function getContent(parser: OpenAPIParser, info: OpenAPIRequestBody | OpenAPIResponse): {
|
|
42
|
+
[mime: string]: OpenAPIMediaType;
|
|
43
|
+
} | undefined;
|
|
41
44
|
export declare function getContentWithLegacyExamples(info: OpenAPIRequestBody | OpenAPIResponse): {
|
|
42
45
|
[mime: string]: OpenAPIMediaType;
|
|
43
46
|
} | undefined;
|
package/lib/utils/openapi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as b}from"path";import m from"url-template";import{deleteEmptyArrayItem as w,isArrayOfObjects as E,isNumeric as S,removeQueryStringAndHash as T,resolveUrl as N,sanitizeItemId as l,normalizeText as g,getValueFromMdParsedExtension as j,isAbsoluteUrl as z}from"./helpers.js";import{DEFAULT_TAG_SLUG as D,MediaTypes as a}from"../constants.js";import{JsonPointer as _}from"./JsonPointer.js";import{joinWithSeparator as $}from"../services/index.js";import{tryDecodeURIComponent as R}from"./string.js";import{getUrlDirname as q}from"./url.js";import{IS_BROWSER as L}from"./dom.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ne(e){return e==="default"||S(e)||P(e)}function ie(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(P(e)&&(t*=100),t<100||t>599)throw new Error("invalid HTTP code");let n="success";return t>=300&&t<400?n="redirect":t>=400?n="error":t<200&&(n="info"),n}const U={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0,"x-query":!0,query:!0};function oe(e){return e in U}function ue(e){const{operationId:r,pathName:t}=e,n=g(j(e,"description"));return g(j(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function se(e,r){return r?.id?$(r.id,l(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?l(e.operationId?e.operationId:d(e.pointer)):l(e.operationId?$(D,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const O={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",contentEncoding:"string",contentMediaType:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",unevaluatedProperties:"object",patternProperties:"object",properties:"object"};function ae(e){if(e.type!==void 0&&!Array.isArray(e.type))return e.type;const r=Object.keys(O);for(const t of r){const n=O[t];if(e[t]!==void 0)return n}return"any"}function F(e,r=e.type){if(e["x-circular-ref"]||e["x-complex"])return!0;if(e.oneOf!==void 0||e.anyOf!==void 0||e.if&&e.then||e.if&&e.else)return!1;let t=!0;const n=Array.isArray(r);return(r==="object"||n&&r?.includes("object"))&&(t=e.properties!==void 0?Object.keys(e.properties).length===0:e.additionalProperties===void 0&&e.unevaluatedProperties===void 0&&e.patternProperties===void 0),Array.isArray(e.items)||Array.isArray(e.prefixItems)?!1:(e.items!==void 0&&typeof e.items!="boolean"&&(r==="array"||n&&r?.includes("array"))&&(t=F(e.items,e.items.type)),t)}function k(e){return e.search(/json/i)!==-1}function ce(e){return e?.search(/xml/i)!==-1}function pe(e){return e===a.URL_ENCODED}function fe(e){return e===a.MULTIPART}function me(e){return[a.JSONL,a.NDJSON,a.JSON_SEQ,a.EVENT_STREAM,a.MULTIPART_MIXED].includes(e)}function p(e,r,t){return Array.isArray(e)?e.map(n=>n.toString()).join(t):typeof e=="object"?Object.keys(e).map(n=>`${n}${t}${e[n]}`).join(t):r+"="+e.toString()}function A(e,r){return Array.isArray(e)?(console.warn("deepObject style cannot be used with array value:"+e.toString()),""):typeof e=="object"?Object.keys(e).map(t=>e[t]?`${r}[${t}]=${e[t]}`:void 0).filter(Boolean).join("&"):(console.warn("deepObject style cannot be used with non-object value:"+e.toString()),"")}function c(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return m.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function I(e,r){const t=e?"*":"",n="__redoc_param_name__",i=m.parse(`{${n}${t}}`);return R(i.expand({[n]:r}))}function le(e,r={}){if(Array.isArray(e))throw new Error("Payload must have fields: "+e.toString());return Object.keys(e).map(t=>{const n=e[t],{style:i="form",explode:o=!0}=r[t]||{};switch(i){case"form":return c(t,o,n);case"spaceDelimited":return p(n,t,"%20");case"pipeDelimited":return p(n,t,"|");case"deepObject":return A(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function W(e,r,t,n){const i=t?"*":"";let o="";r==="label"?o=".":r==="matrix"&&(o=";");const s="__redoc_param_name__";return m.parse(`{${o}${s}${i}}`).expand({[s]:n}).replace(/__redoc_param_name__/g,e)}function H(e,r,t,n){const i=o=>{switch(r){case"form":return c(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"|");case"deepObject":return!t||Array.isArray(o)||typeof o!="object"?(console.warn("The style deepObject is only applicable for objects with explode=true"),""):A(o,e);case"simple":return I(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return E(n)&&(n=w(n).map(o=>i(o))),i(n)}function C(e,r,t){switch(e){case"simple":return I(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function J(e,r,t,n){switch(r){case"form":return c(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function M(e,r){return k(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function de(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return M(r,o);case"cookie":case"query":return`${t}=${M(r,o)}`;default:return console.warn("Unexpected parameter location: "+e.in),""}if(!n)return console.warn(`Missing style attribute or content for parameter ${t}`),"";switch(e.in){case"path":return W(t,n,i,r);case"query":return H(t,n,i,r);case"header":return C(n,i,r);case"cookie":return J(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function xe(e){return e.search(/xml/i)!==-1?"xml":e.includes("application/json-seq")?"json-seq":e.includes("application/jsonl")?"jsonl":e.includes("json")?"json":e.includes("multipart/mixed")?"multipart-mixed":e.includes("text/event-stream")?"yaml":"clike"}const h=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function ye(e){return h.test(e||"")}function be(e){return e?.match(h)?.pop()}function B(e){if(e===void 0)return;const r=e.toString(10);return/^0\.0*1$/.test(r)?`decimal places <= ${r.split(".")[1].length}`:`multiple of ${r}`}function x(e,r,t){let n;return r!==void 0&&t!==void 0?r===t?n=`= ${r} ${e}`:n=`[ ${r} .. ${t} ] ${e}`:t!==void 0?n=`<= ${t} ${e}`:r!==void 0&&(r===1?n="non-empty":n=`>= ${r} ${e}`),n}function G(e){const r=typeof e.exclusiveMinimum=="number"?Math.min(e.exclusiveMinimum,e.minimum??1/0):e.minimum,t=typeof e.exclusiveMaximum=="number"?Math.max(e.exclusiveMaximum,e.maximum??-1/0):e.maximum,n=typeof e.exclusiveMinimum=="number"||e.exclusiveMinimum,i=typeof e.exclusiveMaximum=="number"||e.exclusiveMaximum;if(r!==void 0&&t!==void 0)return`${n?"( ":"[ "}${r} .. ${t}${i?" )":" ]"}`;if(t!==void 0)return`${i?"< ":"<= "}${t}`;if(r!==void 0)return`${n?"> ":">= "}${r}`}function ge(e){const r=[],t=x("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=x("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=x(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=B(e.multipleOf);o!==void 0&&r.push(o);const s=G(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function je(e,r=[]){const t=[],n=[],i=[];return e.forEach(o=>{o.required?r.includes(o.name)?n.push(o):i.push(o):t.push(o)}),n.sort((o,s)=>r.indexOf(o.name)-r.indexOf(s.name)),[...n,...i,...t]}function _e(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function $e(e,r=[],t=[],{pathPointer:n,operationPointer:i}){const o={};t.forEach(u=>{({resolved:u}=e.deref(u)),o[u.name+"_"+u.in]=!0});const s=r.map((u,f)=>({paramOrRef:u,pointer:_.join(n,["parameters",String(f)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),y=t.map((u,f)=>({paramOrRef:u,pointer:_.join(i,["parameters",String(f)])}));return[...s,...y]}function Pe(e,r){const n=e===void 0?T((()=>{if(!L)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?b(i):i})()):z(e)?q(e):b(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?N(n,i.url):i.url,description:i.description||""}))}const Oe=e=>({delete:"del",options:"opts"})[e]||e;function Q(e){return e in{"x-circular-ref":!0,"x-complex":!0,"x-parentRefs":!0,"x-refsStack":!0,"x-codeSamples":!0,"x-displayName":!0,"x-examples":!0,"x-logo":!0,"x-nullable":!0,"x-servers":!0,"x-tagGroups":!0,"x-traitTag":!0,"x-additionalPropertiesName":!0,"x-explicitMappingOnly":!0,"x-enumDescriptions":!0,"x-badges":!0,"x-hideReplay":!0,"x-feedback":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function Ae(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Q(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function Ie(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Me(e){let r=e.content;const t=e["x-examples"],n=e["x-example"];if(t){r={...r};for(const i of Object.keys(t)){const o=t[i];r[i]={...r[i],examples:o}}}else if(n){r={...r};for(const i of Object.keys(n)){const o=n[i];r[i]={...r[i],example:o}}}return r}export{ae as detectType,Ae as extractExtensions,Me as getContentWithLegacyExamples,be as getDefinitionName,se as getOperationId,ue as getOperationName,ie as getStatusCodeType,ge as humanizeConstraints,G as humanizeNumberRange,pe as isFormUrlEncoded,k as isJsonLike,fe as isMultipartFormData,ye as isNamedDefinition,oe as isOperationName,F as isPrimitiveType,Q as isRedocExtension,me as isSequentialMediaType,ne as isStatusCode,ce as isXmlLike,xe as langFromMime,$e as mergeParams,Pe as normalizeServers,Ie as pluralizeType,de as serializeParameterValue,M as serializeParameterValueWithMime,H as serializeQueryParameter,Oe as shortenHTTPVerb,_e as sortByDeprecated,je as sortByRequired,le as urlFormEncodePayload};
|
|
1
|
+
import{dirname as g}from"path";import m from"url-template";import{deleteEmptyArrayItem as w,isArrayOfObjects as E,isNumeric as S,removeQueryStringAndHash as T,resolveUrl as N,sanitizeItemId as l,normalizeText as b,getValueFromMdParsedExtension as j,isAbsoluteUrl as z}from"./helpers.js";import{DEFAULT_TAG_SLUG as D,MediaTypes as a}from"../constants.js";import{JsonPointer as _}from"./JsonPointer.js";import{joinWithSeparator as $}from"../services/index.js";import{tryDecodeURIComponent as R}from"./string.js";import{getUrlDirname as q}from"./url.js";import{IS_BROWSER as L}from"./dom.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ie(e){return e==="default"||S(e)||P(e)}function oe(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(P(e)&&(t*=100),t<100||t>599)throw new Error("invalid HTTP code");let n="success";return t>=300&&t<400?n="redirect":t>=400?n="error":t<200&&(n="info"),n}const U={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0,"x-query":!0,query:!0};function ue(e){return e in U}function se(e){const{operationId:r,pathName:t}=e,n=b(j(e,"description"));return b(j(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function ae(e,r){return r?.id?$(r.id,l(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?l(e.operationId?e.operationId:d(e.pointer)):l(e.operationId?$(D,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const O={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",contentEncoding:"string",contentMediaType:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",unevaluatedProperties:"object",patternProperties:"object",properties:"object"};function ce(e){if(e.type!==void 0&&!Array.isArray(e.type))return e.type;const r=Object.keys(O);for(const t of r){const n=O[t];if(e[t]!==void 0)return n}return"any"}function F(e,r=e.type){if(e["x-circular-ref"]||e["x-complex"])return!0;if(e.oneOf!==void 0||e.anyOf!==void 0||e.if&&e.then||e.if&&e.else)return!1;let t=!0;const n=Array.isArray(r);return(r==="object"||n&&r?.includes("object"))&&(t=e.properties!==void 0?Object.keys(e.properties).length===0:e.additionalProperties===void 0&&e.unevaluatedProperties===void 0&&e.patternProperties===void 0),Array.isArray(e.items)||Array.isArray(e.prefixItems)?!1:(e.items!==void 0&&typeof e.items!="boolean"&&(r==="array"||n&&r?.includes("array"))&&(t=F(e.items,e.items.type)),t)}function k(e){return e.search(/json/i)!==-1}function pe(e){return e?.search(/xml/i)!==-1}function fe(e){return e===a.URL_ENCODED}function me(e){return e===a.MULTIPART}function le(e){return[a.JSONL,a.NDJSON,a.JSON_SEQ,a.EVENT_STREAM,a.MULTIPART_MIXED].includes(e)}function p(e,r,t){return Array.isArray(e)?e.map(n=>n.toString()).join(t):typeof e=="object"?Object.keys(e).map(n=>`${n}${t}${e[n]}`).join(t):r+"="+e.toString()}function A(e,r){return Array.isArray(e)?(console.warn("deepObject style cannot be used with array value:"+e.toString()),""):typeof e=="object"?Object.keys(e).map(t=>e[t]?`${r}[${t}]=${e[t]}`:void 0).filter(Boolean).join("&"):(console.warn("deepObject style cannot be used with non-object value:"+e.toString()),"")}function c(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return m.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function I(e,r){const t=e?"*":"",n="__redoc_param_name__",i=m.parse(`{${n}${t}}`);return R(i.expand({[n]:r}))}function de(e,r={}){if(Array.isArray(e))throw new Error("Payload must have fields: "+e.toString());return Object.keys(e).map(t=>{const n=e[t],{style:i="form",explode:o=!0}=r[t]||{};switch(i){case"form":return c(t,o,n);case"spaceDelimited":return p(n,t,"%20");case"pipeDelimited":return p(n,t,"|");case"deepObject":return A(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function W(e,r,t,n){const i=t?"*":"";let o="";r==="label"?o=".":r==="matrix"&&(o=";");const s="__redoc_param_name__";return m.parse(`{${o}${s}${i}}`).expand({[s]:n}).replace(/__redoc_param_name__/g,e)}function C(e,r,t,n){const i=o=>{switch(r){case"form":return c(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"|");case"deepObject":return!t||Array.isArray(o)||typeof o!="object"?(console.warn("The style deepObject is only applicable for objects with explode=true"),""):A(o,e);case"simple":return I(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return E(n)&&(n=w(n).map(o=>i(o))),i(n)}function H(e,r,t){switch(e){case"simple":return I(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function J(e,r,t,n){switch(r){case"form":return c(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function M(e,r){return k(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function xe(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return M(r,o);case"cookie":case"query":return`${t}=${M(r,o)}`;default:return console.warn("Unexpected parameter location: "+e.in),""}if(!n)return console.warn(`Missing style attribute or content for parameter ${t}`),"";switch(e.in){case"path":return W(t,n,i,r);case"query":return C(t,n,i,r);case"header":return H(n,i,r);case"cookie":return J(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function ye(e){return e.search(/xml/i)!==-1?"xml":e.includes("application/json-seq")?"json-seq":e.includes("application/jsonl")?"jsonl":e.includes("json")?"json":e.includes("multipart/mixed")?"multipart-mixed":e.includes("text/event-stream")?"yaml":"clike"}const h=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function ge(e){return h.test(e||"")}function be(e){return e?.match(h)?.pop()}function B(e){if(e===void 0)return;const r=e.toString(10);return/^0\.0*1$/.test(r)?`decimal places <= ${r.split(".")[1].length}`:`multiple of ${r}`}function x(e,r,t){let n;return r!==void 0&&t!==void 0?r===t?n=`= ${r} ${e}`:n=`[ ${r} .. ${t} ] ${e}`:t!==void 0?n=`<= ${t} ${e}`:r!==void 0&&(r===1?n="non-empty":n=`>= ${r} ${e}`),n}function G(e){const r=typeof e.exclusiveMinimum=="number"?Math.min(e.exclusiveMinimum,e.minimum??1/0):e.minimum,t=typeof e.exclusiveMaximum=="number"?Math.max(e.exclusiveMaximum,e.maximum??-1/0):e.maximum,n=typeof e.exclusiveMinimum=="number"||e.exclusiveMinimum,i=typeof e.exclusiveMaximum=="number"||e.exclusiveMaximum;if(r!==void 0&&t!==void 0)return`${n?"( ":"[ "}${r} .. ${t}${i?" )":" ]"}`;if(t!==void 0)return`${i?"< ":"<= "}${t}`;if(r!==void 0)return`${n?"> ":">= "}${r}`}function je(e){const r=[],t=x("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=x("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=x(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=B(e.multipleOf);o!==void 0&&r.push(o);const s=G(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function _e(e,r=[]){const t=[],n=[],i=[];return e.forEach(o=>{o.required?r.includes(o.name)?n.push(o):i.push(o):t.push(o)}),n.sort((o,s)=>r.indexOf(o.name)-r.indexOf(s.name)),[...n,...i,...t]}function $e(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function Pe(e,r=[],t=[],{pathPointer:n,operationPointer:i}){const o={};t.forEach(u=>{({resolved:u}=e.deref(u)),o[u.name+"_"+u.in]=!0});const s=r.map((u,f)=>({paramOrRef:u,pointer:_.join(n,["parameters",String(f)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),y=t.map((u,f)=>({paramOrRef:u,pointer:_.join(i,["parameters",String(f)])}));return[...s,...y]}function Oe(e,r){const n=e===void 0?T((()=>{if(!L)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?g(i):i})()):z(e)?q(e):g(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?N(n,i.url):i.url,description:i.description||""}))}const Ae=e=>({delete:"del",options:"opts"})[e]||e;function Q(e){return e in{"x-circular-ref":!0,"x-complex":!0,"x-parentRefs":!0,"x-refsStack":!0,"x-codeSamples":!0,"x-displayName":!0,"x-examples":!0,"x-logo":!0,"x-nullable":!0,"x-servers":!0,"x-tagGroups":!0,"x-traitTag":!0,"x-additionalPropertiesName":!0,"x-explicitMappingOnly":!0,"x-enumDescriptions":!0,"x-badges":!0,"x-hideReplay":!0,"x-feedback":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function Ie(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Q(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function Me(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function he(e,r){const{resolved:t}=e.deref(r.content);return X({...r,content:t})}function X(e){let r=e.content;const t=e["x-examples"],n=e["x-example"];if(t){r={...r};for(const i of Object.keys(t)){const o=t[i];r[i]={...r[i],examples:o}}}else if(n){r={...r};for(const i of Object.keys(n)){const o=n[i];r[i]={...r[i],example:o}}}return r}export{ce as detectType,Ie as extractExtensions,he as getContent,X as getContentWithLegacyExamples,be as getDefinitionName,ae as getOperationId,se as getOperationName,oe as getStatusCodeType,je as humanizeConstraints,G as humanizeNumberRange,fe as isFormUrlEncoded,k as isJsonLike,me as isMultipartFormData,ge as isNamedDefinition,ue as isOperationName,F as isPrimitiveType,Q as isRedocExtension,le as isSequentialMediaType,ie as isStatusCode,pe as isXmlLike,ye as langFromMime,Pe as mergeParams,Oe as normalizeServers,Me as pluralizeType,xe as serializeParameterValue,M as serializeParameterValueWithMime,C as serializeQueryParameter,Ae as shortenHTTPVerb,$e as sortByDeprecated,_e as sortByRequired,de as urlFormEncodePayload};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.18.0
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@redocly/theme": ">=0.62.0-next.0",
|
|
18
|
-
"react": "19.2.4",
|
|
19
|
-
"react-dom": "19.2.4",
|
|
18
|
+
"react": "^19.2.4",
|
|
19
|
+
"react-dom": "^19.2.4",
|
|
20
20
|
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "2.15.
|
|
24
|
+
"@redocly/openapi-core": "2.15.2",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.7",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
28
|
-
"fast-xml-parser": "5.
|
|
28
|
+
"fast-xml-parser": "5.3.4",
|
|
29
29
|
"jotai": "^2.12.5",
|
|
30
30
|
"jotai-family": "^1.0.1",
|
|
31
31
|
"json-pointer": "^0.6.2",
|
|
32
32
|
"openapi-sampler": "1.6.2",
|
|
33
|
-
"react-router-dom": "^6.
|
|
33
|
+
"react-router-dom": "^6.30.3",
|
|
34
34
|
"slugify": "^1.4.4",
|
|
35
35
|
"stringify-object": "^3.3.0",
|
|
36
36
|
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"url-template": "^2.0.8",
|
|
39
39
|
"util": "~0.12.5",
|
|
40
40
|
"web-vitals": "3.3.1",
|
|
41
|
-
"@redocly/
|
|
42
|
-
"@redocly/
|
|
41
|
+
"@redocly/replay": "0.21.0",
|
|
42
|
+
"@redocly/config": "0.42.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@shikijs/transformers": "3.21.0",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"outdent": "0.8.0",
|
|
62
62
|
"path-browserify": "1.0.1",
|
|
63
63
|
"prettier-2": "npm:prettier@2.8.8",
|
|
64
|
-
"react": "19.2.4",
|
|
65
|
-
"react-dom": "19.2.4",
|
|
64
|
+
"react": "^19.2.4",
|
|
65
|
+
"react-dom": "^19.2.4",
|
|
66
66
|
"rimraf": "5.0.7",
|
|
67
67
|
"rollup-plugin-bundle-stats": "^4.20.2",
|
|
68
68
|
"shiki": "3.21.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"url": "~0.11.0",
|
|
73
73
|
"vite": "7.2.6",
|
|
74
74
|
"vitest": "4.0.10",
|
|
75
|
-
"@redocly/theme": "0.62.0
|
|
75
|
+
"@redocly/theme": "0.62.0"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"start": "pnpm run copy-highlight-hook && vite",
|