@redocly/openapi-docs 3.22.0-next.2 → 3.22.0-next.3
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 +2727 -2757
- package/lib/components/ApiInfo/ApiInfo.d.ts +1 -1
- package/lib/components/Callbacks/CallbackDetails.js +2 -2
- package/lib/components/Callbacks/CallbackSummary.d.ts +1 -1
- package/lib/components/ContentItem/ContentItem.js +1 -1
- package/lib/components/ContentItem/useIsExpanded.d.ts +1 -1
- package/lib/components/ContentItems/ContentItems.js +1 -1
- package/lib/components/ContentItems/Items.js +1 -1
- package/lib/components/Download/DownloadSpecification.d.ts +1 -1
- package/lib/components/Download/DownloadSpecification.js +2 -2
- package/lib/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/lib/components/Language/LanguageItem.js +1 -1
- package/lib/components/Language/styled.js +1 -1
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/McpOverview/McpOverview.d.ts +1 -1
- package/lib/components/McpOverview/McpOverview.js +1 -1
- package/lib/components/McpTool/McpPrompt.js +1 -1
- package/lib/components/McpTool/McpResource.js +1 -1
- package/lib/components/McpTool/McpTool.js +1 -1
- package/lib/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib/components/OperationItem/Description.js +1 -1
- package/lib/components/OperationItem/OperationItem.js +1 -1
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/PayloadSamples/Example.d.ts +1 -1
- package/lib/components/PayloadSamples/ExampleValue.d.ts +1 -1
- package/lib/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib/components/PropertyDetails/DescriptionEnums.d.ts +1 -1
- package/lib/components/PropertyDetails/DescriptionEnums.js +1 -1
- package/lib/components/PropertyDetails/EnumValues.js +1 -1
- package/lib/components/PropertyDetails/Examples.js +1 -1
- package/lib/components/PropertyDetails/Extensions.js +2 -2
- package/lib/components/PropertyDetails/FieldDetail.js +1 -1
- package/lib/components/PropertyDetails/FieldDetails.js +2 -2
- package/lib/components/PropertyDetails/Pattern.js +1 -1
- package/lib/components/PropertyDetails/SchemaTypeInfo.js +1 -1
- package/lib/components/PropertyDetails/SimpleEnums.d.ts +1 -1
- package/lib/components/PropertyDetails/SimpleEnums.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.d.ts +1 -1
- package/lib/components/Replay/EmbeddedReplay.d.ts +1 -1
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/Replay/utils.d.ts +1 -1
- package/lib/components/Request/RequestDetails.js +1 -1
- package/lib/components/RequestParameters/ParametersGroup.js +1 -1
- package/lib/components/RequestParameters/RequestParameters.d.ts +1 -1
- package/lib/components/RequestParameters/RequestParameters.js +1 -1
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/RequestSamples/useCodeSamples.d.ts +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.d.ts +1 -1
- package/lib/components/Responses/OperationResponseList.js +1 -1
- package/lib/components/Responses/ResponseDetails.js +1 -1
- package/lib/components/RightPanel/RightPanel.js +1 -1
- package/lib/components/Schema/ArraySchema.js +1 -1
- package/lib/components/Schema/ObjectSchema.js +1 -1
- package/lib/components/Schema/OneOfSchema.js +1 -1
- package/lib/components/Schema/helpers.d.ts +1 -1
- package/lib/components/SectionContent/SectionContent.d.ts +1 -1
- package/lib/components/SectionContent/SectionContent.js +1 -1
- package/lib/components/SectionItem/SectionItem.js +1 -1
- package/lib/components/Security/OAuthFlow.js +1 -1
- package/lib/components/Security/OAuthScopes.js +1 -1
- package/lib/components/Security/RequiredScopesList.d.ts +1 -1
- package/lib/components/Security/RequiredScopesList.js +1 -1
- package/lib/components/Security/ScopeTagWithTooltip.d.ts +1 -1
- package/lib/components/Security/Security.js +1 -1
- package/lib/components/Security/SecurityFlow.d.ts +1 -1
- package/lib/components/Security/SecurityFlow.js +1 -1
- package/lib/components/ServerListDropdown/styled.js +1 -1
- package/lib/components/StickySidebar/SidebarActions.js +1 -1
- package/lib/components/StickySidebar/StickyResponsiveSidebar.js +2 -2
- package/lib/components/TagItem/Breadcrumbs.js +1 -1
- package/lib/components/TagItem/OperationNavigationItems.d.ts +1 -1
- package/lib/components/TagItem/OperationNavigationItems.js +1 -1
- package/lib/components/TagItem/OperationsNavigation.d.ts +1 -1
- package/lib/components/TagItem/TagItem.d.ts +1 -1
- package/lib/components/TagItem/TagItem.js +1 -1
- package/lib/components/ViewNested/ViewNested.js +1 -1
- package/lib/components/common/Badges.js +1 -1
- package/lib/components/common/BodyContent/BodyContent.js +2 -2
- package/lib/components/common/ConstraintsView.js +1 -1
- package/lib/components/common/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/common/Dropdown/Dropdown.js +1 -1
- package/lib/components/common/Extensions.js +2 -2
- package/lib/components/common/LinkToField.js +1 -1
- package/lib/components/common/OperationItemTitle.js +2 -2
- package/lib/components/common/SchemaSelection/SchemaSelection.d.ts +1 -1
- package/lib/components/common/linkify.js +1 -1
- package/lib/components/common/mixins.d.ts +1 -1
- package/lib/empty.d.ts +4 -4
- package/lib/jotai/app.d.ts +2 -2
- package/lib/jotai/operation.d.ts +1 -1
- package/lib/models/mediaContent.d.ts +1 -1
- package/lib/models/mediaType.d.ts +1 -1
- package/lib/models/request.d.ts +1 -1
- package/lib/models/response.d.ts +1 -1
- package/lib/models/schema.d.ts +1 -1
- package/lib/models/security.d.ts +1 -1
- package/lib/services/code-samples/generator.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-builder.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +3 -3
- package/lib/services/code-samples/httpsnippet/targets/__mocks__/mock.d.ts +39 -39
- package/lib/services/code-samples/httpsnippet/targets/index.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/index.d.ts +1 -1
- package/lib/utils/helpers.d.ts +1 -1
- package/lib/utils/openapi.d.ts +1 -1
- package/lib/utils/theme-helpers.d.ts +2 -2
- package/package.json +7 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LayoutVariant } from '@redocly/config';
|
|
2
2
|
import type { ReactElement } from 'react';
|
|
3
3
|
import type { GroupModel } from '../../models/index.js';
|
|
4
|
-
export declare function ApiInfo({ item, layout
|
|
4
|
+
export declare function ApiInfo({ item, layout }: {
|
|
5
5
|
item: GroupModel;
|
|
6
6
|
layout: LayoutVariant;
|
|
7
7
|
}): ReactElement | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as l,jsxs as s
|
|
1
|
+
import{Fragment as t,jsx as l,jsxs as s}from"react/jsx-runtime";import{memo as r,useCallback as m}from"react";import{LinkIcon as p}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{OperationResponseList as d}from"../Responses/index.js";import{RequestDetails as k}from"../Request/RequestDetails.js";import{LinkToField as a}from"../common/LinkToField.js";import{makeDeepLink as c}from"../../services/index.js";import{styled as b}from"../../styled-components.js";function h({operation:e,translate:i}){const n=m(o=>s(f,{children:[l(a,{to:c(e.id,`${e.callbackId}/callback-response&c=${o.key}`)}),i("openapi.callbackResponse","Callback Response")]}),[e.callbackId,e.id,i]);return s(t,{children:[l(k,{operation:e,title:s(t,{children:[l(a,{to:c(e.id,`${e.callbackId}/callback-request`)}),i("openapi.callbackRequest","Callback Request")]})}),e.responses?.length?l(d,{responses:e.responses,operationId:e.id,operationPointer:e.pointer,callbackId:e.callbackId,renderTitle:n}):null]})}const j=r(h),f=b.h4`
|
|
2
2
|
position: relative;
|
|
3
3
|
font-size: var(--h4-font-size);
|
|
4
4
|
font-weight: var(--h4-font-weight);
|
|
@@ -10,7 +10,7 @@ import{jsx as l,jsxs as s,Fragment as t}from"react/jsx-runtime";import{memo as r
|
|
|
10
10
|
justify-content: space-between;
|
|
11
11
|
margin: 0 var(--spacing-sm) 0 0;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
&:hover {
|
|
14
14
|
${p} {
|
|
15
15
|
opacity: 1;
|
|
16
16
|
visibility: visible;
|
|
@@ -6,4 +6,4 @@ export interface CallbackTitleProps extends PanelHeaderProps {
|
|
|
6
6
|
callback: OperationModel;
|
|
7
7
|
translate: TFunction;
|
|
8
8
|
}
|
|
9
|
-
export declare function CallbackSummary({ expanded, toggle, callback: { name, httpVerb, deprecated, callbackId, id }, translate
|
|
9
|
+
export declare function CallbackSummary({ expanded, toggle, callback: { name, httpVerb, deprecated, callbackId, id }, translate }: CallbackTitleProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as i,jsx as t,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 e}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 E}from"../SectionItem/index.js";import h from"../ContentItems/useScrollOnRender.js";import{isRootItem as j}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:e,section:E,schema:o=>t(e,{...o,item:o.item,isExpanded:!0}),operation:g,tool:o=>t(e,{...o,item:o.item,isExpanded:!0}),rsrc:o=>t(e,{...o,item:o.item,isExpanded:!0}),prompt:o=>t(e,{...o,item:o.item,isExpanded:!0}),root:R};function b({item:o,routingBasePath:n,children:p,layout:s}){const a=j(o),m=_[a?"root":o.type],d=o.type==="tag"&&o.items.length>0,r=C({item:o,routingBasePath:n});let l=h(o,n);const c=x(S);return f(i,{children:[m&&t(y,{id:o.id,ref:l,sectionId:I(n,o.id),underlined:A(o),expanded:d&&!r,children:t(m,{item:o,routingBasePath:n,isExpanded:r,layout:s||c})}),(r||o.type!=="tag")&&!!o.items?.length&&t(i,{children:p})]})}const J=u(b);export{J as ContentItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as l,jsx as t,jsxs as f}from"react/jsx-runtime";import{memo as u,useMemo as p}from"react";import{Navigate as c,Route as n,Routes as m}from"react-router-dom";import{getFirstPageLink as d,getItemsByType as g}from"./helpers.js";import{SectionContent as s}from"../SectionContent/index.js";function h({items:e,root:r=!1}){const{rootItem:o}=g(e),a=!r||o?"/":d(e,"/"),i=p(()=>f(m,{children:[o&&t(n,{path:`${o.href||"/"}*`,element:t(s,{items:e})}),t(n,{path:"*",element:t(c,{to:a,replace:!0})})]}),[o,"/",e,a]);return r&&!e.length?t(m,{children:t(n,{path:"*",element:t(s,{items:e})})}):e.length?t(l,{children:i}):null}const I=u(h);export{I as ContentItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as o,jsx as t}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,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { UseDownloadInfoReturnType } from './types';
|
|
3
|
-
declare function DownloadSpecificationComponent({ downloadObjects
|
|
3
|
+
declare function DownloadSpecificationComponent({ downloadObjects }: {
|
|
4
4
|
downloadObjects: UseDownloadInfoReturnType;
|
|
5
5
|
}): ReactElement;
|
|
6
6
|
export declare const DownloadSpecification: import("react").MemoExoticComponent<typeof DownloadSpecificationComponent>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as m,jsx as e,jsxs as s}from"react/jsx-runtime";import{memo as p,useCallback as f}from"react";import{getPathPrefix as w,combineUrls as x}from"@redocly/theme/core/openapi";import{DocumentIcon as g}from"@redocly/theme/icons/DocumentIcon/DocumentIcon";import{JsonIcon as b}from"@redocly/theme/icons/JsonIcon/JsonIcon";import{FileIcon as h}from"@redocly/theme/icons/FileIcon/FileIcon";import{DownloadButton as u}from"@redocly/theme/components/Buttons/DownloadButton";import{transformStringToTelemetryId as y}from"../../utils/helpers.js";import{useTelemetry as v}from"../../hooks/index.js";import{styled as n}from"../../styled-components.js";function j({downloadObjects:t}){const c=v(),i=w(),l=f(o=>{switch(o){case"yaml":return e(g,{});case"json":return e(b,{});default:return e(h,{})}},[]);return t?e(C,{children:(t||[]).map(({title:o,url:a,iconType:d})=>{const r=i?x(i,a):a;return s(k,{onClick:()=>{c.sendDownloadDefinitionClickedMessage([{id:y("definition",window.location.hostname,o),object:"definition",uri:new URL(r,window.location.origin).href}])},children:[s(D,{children:[l(d),e("a",{href:r,target:"_blank",download:!0,rel:"noreferrer",children:o})]}),e(u,{data:r})]},o)})}):e(m,{})}const L=p(j),k=n.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: baseline;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -6,7 +6,7 @@ import{jsx as e,Fragment as m,jsxs as s}from"react/jsx-runtime";import{memo as p
|
|
|
6
6
|
|
|
7
7
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
8
8
|
padding-bottom: var(--spacing-sm);
|
|
9
|
-
|
|
9
|
+
&:last-of-type {
|
|
10
10
|
padding-bottom: 0px;
|
|
11
11
|
border-bottom: none;
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e
|
|
1
|
+
import{Fragment as n,jsx as r,jsxs as e}from"react/jsx-runtime";import{Children as s,Component as i}from"react";import{styled as o}from"../../styled-components.js";const d=o.div`
|
|
2
2
|
padding: 20px;
|
|
3
3
|
color: red;
|
|
4
4
|
`;class h extends i{constructor(t){super(t),this.state={error:void 0}}componentDidCatch(t){return this.setState({error:t}),!1}render(){return this.state.error?e(d,{children:[r("h1",{children:"Something went wrong..."}),e("small",{children:[" ",this.state.error.message," "]}),r("p",{children:e("details",{children:[r("summary",{children:"Stack trace"}),r("pre",{children:this.state.error.stack})]})}),typeof __REDOC_VERSION__<"u"?e(n,{children:[e("small",{children:[" References docs version: ",__REDOC_VERSION__]})," ",r("br",{})]}):null,typeof __REDOC_REVISION__<"u"?e("small",{children:[" Commit: ",__REDOC_REVISION__]}):null]}):r(n,{children:s.only(this.props.children)})}}export{h as ErrorBoundary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as a
|
|
1
|
+
import{Fragment as e,jsx as o,jsxs as a}from"react/jsx-runtime";import{CheckmarkIcon as p}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{CurlIcon as f}from"../../icons/CurlIcon/index.js";import{CSharpIcon as n}from"../../icons/CSharpIcon/index.js";import{NodeJSIcon as l}from"../../icons/NodeJSIcon/index.js";import{JavaScriptIcon as I}from"../../icons/JavaScriptIcon/index.js";import{PythonIcon as s}from"../../icons/PythonIcon/index.js";import{RIcon as g}from"../../icons/RIcon/index.js";import{RubyIcon as h}from"../../icons/RubyIcon/index.js";import{PHPIcon as u}from"../../icons/PHPIcon/index.js";import{GOIcon as d}from"../../icons/GOIcon/index.js";import{JavaIcon as m}from"../../icons/JavaIcon/index.js";import{PayloadIcon as P}from"../../icons/PayloadIcon/index.js";import{LanguageIcon as y,LanguageTitle as C,LanguageTitleContainer as J}from"./styled.js";const j={Payload:o(P,{}),curl:o(f,{}),"C#":o(n,{}),"C#+Newtonsoft":o(n,{}),"Node.js":o(l,{}),JavaScript:o(I,{}),Python:o(s,{}),R:o(g,{}),Ruby:o(h,{}),PHP:o(u,{}),Go:o(d,{}),Java:o(m,{}),"Java8+Apache":o(m,{})},A=({item:r,active:t,withCheckmark:c,withIcon:i})=>a(e,{children:[a(J,{children:[i&&o(y,{children:j[r.lang]}),o(C,{active:t,title:r.title,children:r.title})]}),c&&t&&o(p,{})]});export{A as LanguageItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as A,jsx as l}from"react/jsx-runtime";import g,{Fragment as h}from"react";import e from"@markdoc/markdoc";import{useAtomValue as b}from"jotai";import y from"dompurify";import{isString as _}from"@redocly/theme/core/openapi";import{Markdown as z}from"@redocly/theme/components/Markdown/Markdown";import{globalOptionsAtom as R}from"../../jotai/store.js";const S=["OpenApiResponse","OpenApiRequestBody"],W=({source:n,ast:m,htmlWrap:f,markdocOptions:c,...d})=>{const i=b(R);if(!n&&!m)return null;const s=Object.keys(i?.markdocOptions||{}).length?i?.markdocOptions:c,a=s&&{tags:s?.tags,nodes:s?.nodes,partials:s?.partials,variables:s?.variables,functions:s?.functions},u=s&&{components:s?.components};let r;if(n)if(_(n)){const t=i?.unstable_hooks?.sanitize?i.unstable_hooks?.sanitize?.(n):i?.sanitize?y.sanitize(n):n,o=e.parse(t);r=e.transform(o,a)}else{const t=e.Ast.fromJSON(typeof n.result=="object"?JSON.stringify(n.result):n.result);Array.isArray(t)?r=e.transform(t,a):r=e.transform(t,a)}else m&&(r=e.transform(m,a));const p=t=>{const o=e.renderers.react(t,g,u);return l(z,{...d,children:o,as:"div"})};if(!f)return p(r);const O=t=>t.attributes?.htmlWrap!==!1&&!S.includes(t?.name),k=(t,o)=>t?f(p(o)):p(o);return r=Array.isArray(r)?r:r.children,l(A,{children:r.map((t,o)=>l(h,{children:k(O(t),t)},t?.attributes?.id||o))})};export{W as Markdown};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OpenAPIMcp, OpenAPIServer } from '../../types/open-api.js';
|
|
2
|
-
export declare function McpOverview({ mcpInfo, mcpServers
|
|
2
|
+
export declare function McpOverview({ mcpInfo, mcpServers }: {
|
|
3
3
|
mcpInfo: OpenAPIMcp;
|
|
4
4
|
mcpServers: OpenAPIServer[];
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as t,jsxs as s
|
|
1
|
+
import{Fragment as l,jsx as t,jsxs as s}from"react/jsx-runtime";import*as h from"react";import{NewTabButton as u}from"@redocly/theme/components/Buttons/NewTabButton";import{PageActions as f}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 E,MCP_SERVER_EXPERIMENTAL_CAPABILITIES as P,PAGE_ACTIONS_MCP as C}from"../../utils/mcp.js";import{replaceVariables as _}from"../../utils/index.js";import{PanelItem as r}from"../PanelItem/PanelItem.js";import{PanelItemsList as j}from"../PanelItem/styled.js";import{useTranslate as x}from"../../hooks/index.js";import{styled as c}from"../../styled-components.js";function G({mcpInfo:e,mcpServers:a}){const o=x(),d=a[0]?_(a[0]):void 0;function m(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.listChanged}function b(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.subscribe}return s(j,{children:[e?.protocolVersion&&t(r,{header:o("openapi.mcp.protocolVersion","Protocol version"),title:e.protocolVersion}),e?.capabilities&&t(r,{header:o("openapi.mcp.capabilities","Capabilities"),title:t(l,{children:E.map(i=>e?.capabilities[i]?s(p,{size:"small",icon:t(g,{}),children:[i,m(i)?" (list changed)":"",b(i)?" (subscribe)":""]},i):null)})}),e?.capabilities[P]&&t(r,{header:o("openapi.mcp.experimentalCapabilities","Experimental capabilities"),title:t(T,{children:Object.entries(e?.capabilities.experimental||{}).map(([i,n])=>s(h.Fragment,{children:[s("span",{children:[i,":"]}),t(p,{children:typeof n=="object"?JSON.stringify(n):String(n)})]},i))})}),t(r,{header:o("openapi.mcp.endpoint","Endpoint"),title:t(l,{children:a[0]?.url}),actions:[t(u,{data:a[0]?.url},"NewTabButton")]}),t(r,{title:t(A,{children:t(f,{actions:C,mcpUrl:d})})})]})}const A=c.div`
|
|
2
2
|
& button {
|
|
3
3
|
width: 100%;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as t,jsxs as c
|
|
1
|
+
import{Fragment as T,jsx as t,jsxs as c}from"react/jsx-runtime";import{memo as k,useCallback as C,useMemo as u}from"react";import{useAtomValue as f}from"jotai";import{LayoutVariant as P}from"@redocly/config";import{getMediaContent as j,getSecurity as A}from"../../models/index.js";import{globalStoreAtom as g}from"../../jotai/store.js";import{Section as b,Row as q,SamplesMiddlePanel as v,SamplesPanel as F,CodeBlockPanel as L}from"../common/index.js";import{Schema as R}from"../Schema/index.js";import{layoutAtom as _}from"../../jotai/app.js";import{MediaTypeSamples as w}from"../PayloadSamples/MediaTypeSamples.js";import{useTranslate as D}from"../../hooks/index.js";import{Title as E}from"../common/OperationItemTitle.js";import{LinkToField as V}from"../common/LinkToField.js";import{makeDeepLink as B}from"../../services/index.js";import{Security as K}from"../Security/Security.js";import{styled as x}from"../../styled-components.js";function N({name:n,id:l}){const{parser:e}=f(g),i=D(),r=u(()=>(e.definition["x-mcp"]?.prompts||[]).find(p=>p.name===n),[e,n]),m=u(()=>r?A(r.security,e):null,[e,r]);return r?t(b,{children:t(z,{id:l,type:"input",prompt:r,title:i("openapi.mcp.inputSchema","Arguments"),exampleTitle:i("openapi.mcp.inputExample","Arguments example"),children:m&&t(K,{securities:m})})}):null}function z({id:n,type:l,prompt:e,title:i,exampleTitle:r,children:m}){const{parser:d,options:p}=f(g),y=f(_),h=y===P.STACKED,a=u(()=>{const S=e.arguments&&{type:"object",properties:e.arguments.reduce((o,s)=>(o[s.name]={type:"",example:s.example||"string",description:s.description,required:s.required},o),{}),required:e.arguments.filter(o=>o.required).map(o=>o.name)};return S?j({parser:d,info:{"application/json":{schema:S}},isRequestType:!1,options:p,data:{operation:{pointer:"McpPrompt"}}}):null},[p,d,e]),M=C(()=>{},[]);return c(G,{layout:y,children:[t(H,{isStacked:h,children:c("div",{children:[m,a&&c(T,{children:[" ",c(E,{children:[n&&t(V,{to:B(n,l)}),i]}),t(R,{schema:a.mediaTypes[0].schema})]})]})}),a&&t(F,{isStacked:h,children:t(L,{className:"panel-response-samples",header:r,children:t(w,{mediaType:a.mediaTypes[0],onChange:M})})})]})}const G=x(q)`
|
|
2
2
|
margin: calc(var(--spacing-unit) * 2) 0;
|
|
3
3
|
|
|
4
4
|
& + & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as o,jsxs as l}from"react/jsx-runtime";import{memo as k,useMemo as T}from"react";import*as M from"react";import{useAtomValue as h}from"jotai";import{LayoutVariant as b}from"@redocly/config";import{CodeBlock as v}from"@redocly/theme/components/CodeBlock/CodeBlock";import{Tag as P}from"@redocly/theme/components/Tag/Tag";import{getSecurity as w}from"../../models/index.js";import{globalStoreAtom as j}from"../../jotai/store.js";import{Section as A,Row as B,SamplesMiddlePanel as F,SamplesPanel as L,CodeBlockPanel as E}from"../common/index.js";import{layoutAtom as I}from"../../jotai/app.js";import{useTranslate as V}from"../../hooks/index.js";import{Security as _}from"../Security/Security.js";import{styled as s}from"../../styled-components.js";function D({name:i}){const{parser:t}=h(j),c=V(),e=T(()=>(t.definition["x-mcp"]?.resources||[]).find(p=>p.name===i),[t,i]),r=T(()=>e?w(e.security,t):null,[t,e]);return e?o(A,{children:o(K,{uriTitle:c("openapi.mcp.uriTitle","Resource URI"),mimeTypeTitle:c("openapi.mcp.mimeTypeTitle","Resource MIME type"),exampleTitle:c("openapi.mcp.exampleTitle","Resource content"),uri:e.uri,mimeType:e.mimeType,content:e.blob??e.text??"",children:r&&o(_,{securities:r})})}):l("div",{children:["Resource not found: ",i]})}function K({uriTitle:i,mimeTypeTitle:t,exampleTitle:c,uri:e,mimeType:r,content:a,children:p}){const m=h(I),d=m===b.STACKED,[u,f]=M.useState(null),y=async(n,x,C)=>{C.stopPropagation();try{await navigator.clipboard.writeText(n),f(x),setTimeout(()=>f(null),2e3)}catch(R){console.error("Failed to copy text: ",R)}};return l(N,{layout:m,children:[o(U,{isStacked:d,children:l("div",{children:[p,l(g,{children:[i,":"," ",o(S,{onClick:n=>y(e,"uri",n),title:"Click to copy",children:u==="uri"?"\u2713 Copied!":e})]}),l(g,{children:[t,":"," ",o(S,{onClick:n=>y(r,"mimeType",n),title:"Click to copy",children:u==="mimeType"?"\u2713 Copied!":r})]})]})}),a&&o(L,{isStacked:d,children:o(E,{className:"panel-response-samples",header:c,children:o(q,{source:a,header:{title:r,controls:{copy:{}}}})})})]})}const N=s(B)`
|
|
2
2
|
margin: calc(var(--spacing-unit) * 2) 0;
|
|
3
3
|
|
|
4
4
|
& + & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as o,jsxs as r}from"react/jsx-runtime";import{memo as j,useCallback as v,useMemo as l}from"react";import{useAtomValue as s}from"jotai";import{LayoutVariant as h}from"@redocly/config";import{getMediaContent as A,getSecurity as E}from"../../models/index.js";import{globalStoreAtom as f}from"../../jotai/store.js";import{Section as P,Row as b,SamplesMiddlePanel as R,SamplesPanel as w,CodeBlockPanel as D}from"../common/index.js";import{Schema as F}from"../Schema/index.js";import{getSchema as L}from"../../models/schema.js";import{layoutAtom as S}from"../../jotai/app.js";import{MediaTypeSamples as N}from"../PayloadSamples/MediaTypeSamples.js";import{useTranslate as O}from"../../hooks/index.js";import{Title as I}from"../common/OperationItemTitle.js";import{LinkToField as K}from"../common/LinkToField.js";import{makeDeepLink as V}from"../../services/index.js";import{Security as _}from"../Security/Security.js";import{Markdown as q}from"../Markdown/index.js";import{styled as T}from"../../styled-components.js";function B({name:i,id:m}){const{parser:p}=s(f),t=O(),a=s(S),u=a===h.STACKED,e=l(()=>(p.definition["x-mcp"]?.tools||[]).find(c=>c.name===i),[p,i]),n=l(()=>e?E(e.security,p):null,[p,e]);return e?r(P,{className:"mcp-tool",children:[o(x,{layout:a,children:o(M,{isStacked:u,children:r("div",{children:[r("p",{children:[t("openapi.mcp.toolName","Tool name"),": ",o("code",{children:e.name})]}),e.description&&o(q,{source:e.description})]})})}),o(y,{id:m,type:"input",schema:e.inputSchema,title:t("openapi.mcp.inputSchema","Input schema"),exampleTitle:t("openapi.mcp.inputExample","Input example"),children:n&&o(_,{securities:n})}),e.outputSchema&&o(y,{id:m,type:"output",schema:e.outputSchema,title:t("openapi.mcp.outputSchema","Output schema"),exampleTitle:t("openapi.mcp.outputExample","Output example")})]}):r("div",{children:["Tool not found: ",i]})}function y({schema:i,title:m,exampleTitle:p,id:t,type:a,children:u}){const{parser:e,options:n}=s(f),d=s(S),c=d===h.STACKED,k=l(()=>A({parser:e,info:{"application/json":{schema:i}},isRequestType:!1,options:n,data:{operation:{pointer:"McpTool"}}}),[n,e,i]),g=l(()=>i&&L({parser:e,schemaOrRef:i,pointer:"#",options:n,deps:{operation:{pointer:t},parentFieldFullPath:a+"-schema"}}),[n,e,i,t,a]),C=v(()=>{},[]);return r(x,{layout:d,children:[o(M,{isStacked:c,children:r("div",{children:[r(I,{children:[t&&o(K,{to:V(t,a)}),m]}),u,o(F,{schema:g})]})}),o(w,{isStacked:c,children:o(D,{className:"panel-response-samples",header:p,children:o(N,{mediaType:k.mediaTypes[0],onChange:C})})})]})}const x=T(b)`
|
|
2
2
|
margin: calc(var(--spacing-unit) * 2) 0;
|
|
3
3
|
|
|
4
4
|
& + & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as m,jsxs as p
|
|
1
|
+
import{Fragment as g,jsx as m,jsxs as p}from"react/jsx-runtime";import{memo as h,useCallback as C,useRef as T}from"react";import{useAtom as v}from"jotai";import{SelectLabel as M,SelectWrapper as w}from"../PayloadSamples/index.js";import{Container as x}from"../common/index.js";import{activeMimeNameAtom as A}from"../../jotai/app.js";import{getActiveMediaType as b}from"../../models/index.js";import{useTranslate as j}from"../../hooks/index.js";function S({children:e,withLabel:i,innerRef:r,translate:a}){return e?i?p(w,{ref:r,children:[m(M,{children:a("openapi.contentType","Content type")}),e]}):m(x,{ref:r,children:e}):null}function B({content:e,withLabel:i,renderSelect:r,children:a}){const u=j(),[c,s]=v(A),f=C(({value:o})=>{if(!e||!t.current)return null;const n=t.current.getBoundingClientRect().y;s(o),requestAnimationFrame(()=>{if(!t.current||n==null)return;const y=t.current.getBoundingClientRect().y;window.scrollBy(0,y-n)})},[e,s]),t=T(null);if(!e||!e.mediaTypes||!e.mediaTypes.length)return null;const d=e.mediaTypes.map((o,n)=>({value:o.name,idx:n})),l=b(e,c);return p(g,{children:[m(S,{innerRef:t,withLabel:i,translate:u,children:r({value:l.name,options:d,onChange:f,ariaLabel:"Content type"})}),a(l)]})}const q=h(B);export{q as MediaTypesSwitch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as t,jsx as o,jsxs as s}from"react/jsx-runtime";import{Markdown as e}from"../Markdown/index.js";import{ExternalDocumentation as m}from"../ExternalDocumentation/index.js";function x({description:r,externalDocs:n}){return r?s(t,{children:[o(e,{source:r}),n&&o(m,{externalDocs:n})]}):null}export{x as Description};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t
|
|
1
|
+
import{Fragment as V,jsx as e,jsxs as t}from"react/jsx-runtime";import{memo as K,useState as L,useCallback as j,useMemo as W}from"react";import{useAtomValue as g}from"jotai";import{LayoutVariant as $}from"@redocly/config";import{AfterOpenApiOperation as z}from"@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiOperation";import{BeforeOpenApiOperation as G}from"@redocly/theme/components/OpenApiDocs/hooks/BeforeOpenApiOperation";import{PageActions as J}from"@redocly/theme/components/PageActions/PageActions";import{Feedback as Q}from"@redocly/theme/components/Feedback/Feedback";import{SamplesMiddlePanel as s,SamplesPanel as U,ShareLink as X,Row as f,CustomBadges as Y}from"../common/index.js";import{CallbacksList as Z}from"../Callbacks/index.js";import{CallbackSamples as ee}from"../CallbackSamples/index.js";import{RequestSamples as ae}from"../RequestSamples/index.js";import{OperationResponseList as te}from"../Responses/index.js";import{ResponseSamples as oe}from"../ResponseSamples/index.js";import{makeDeepLink as ne,joinWithSeparator as se}from"../../services/index.js";import{layoutAtom as re,userClaimsAtom as ie}from"../../jotai/app.js";import{globalOptionsAtom as le,globalStoreAtom as ce}from"../../jotai/store.js";import{getOperation as pe}from"../../models/operation.js";import{RenderHook as B}from"../RenderHook/index.js";import{Heading as de,HeadingWrapper as me,Title as ge}from"../common/OperationItemTitle.js";import{LinkToField as ke}from"../common/LinkToField.js";import{RequestDetails as be}from"../Request/RequestDetails.js";import{StyledBadge as H}from"../common/Badges.js";import{useTranslate as he}from"../../hooks/index.js";import{styled as i}from"../../styled-components.js";import{createPanelToggleEvent as ue}from"../../events/index.js";import{SchemaCatalogLink as fe}from"../SchemaCatalogLink/SchemaCatalogLink.js";function Se({item:{operationDefinition:v,parent:x,href:b}}){const r=he(),{parser:y,options:l}=g(ce),{events:C}=g(le),T=g(ie),n=g(re),[c,I]=L(),{unstable_hooks:O,feedback:p}=l,a=W(()=>pe(y,v,x,l,b,void 0,T),[b,v,l,x,y,T]),{name:R,deprecated:_,isWebhook:q,badges:D}=a||{},o=n===$.STACKED,A=p?.type||"sentiment",P=p?.hide!==!0,h=se(l.routingBasePath,a.href),[u,E]=L(null),w=j(m=>{c!==m&&I(m)},[c]),d=j((m,F)=>{if(!F)return;const N=ue({operation:a,isExpanded:m,panelType:F});C?.panelToggle?.(N)},[C,a]),M=W(()=>P?e(ve,{children:e(Q,{type:A,settings:p.settings,path:h})}):null,[P,A,p.settings,h]);return t(xe,{layout:n,children:[e(k,{layout:n,children:t(s,{isStacked:o,children:[e(B,{Hook:G||O?.BeforeOperation,props:{operation:a}}),t(me,{children:[t(de,{"data-testid":"operation-item-header",children:[e(X,{to:b,"aria-label":`link to ${R}`}),e(Y,{badges:D,children:R}),_&&e(H,{deprecated:!0,children:r("openapi.badges.deprecated","Deprecated")}),q&&e(H,{children:r("openapi.badges.webhook","Webhook")})]}),e(J,{pageSlug:h})]})]})}),e(s,{isStacked:o,children:e(fe,{schemaRef:"#"+a.pointer})}),t(k,{layout:n,children:[e(s,{isStacked:o,children:e(be,{operation:a,translate:r,onPanelToggle:d})}),e(S,{isStacked:o,"data-testid":"samples-block",className:"panel-container-request-samples",children:e(ae,{operation:a,onPanelToggle:d})})]}),t(k,{layout:n,children:[e(s,{isStacked:o,children:a.responses?.length?e(te,{responses:a.responses,operationId:a.id,operationPointer:a.pointer,callbackId:a.callbackId,activeResponseTab:c,onTabChange:w,onPanelToggle:d}):null}),e(S,{isStacked:o,"data-testid":"samples-block",className:"panel-container-response-samples",children:e(oe,{operation:a,activeResponseTab:c,onTabChange:w,onPanelToggle:d})})]}),t(ye,{layout:n,children:[t(s,{isStacked:o,children:[a.callbacks?.length?t(V,{children:[t(ge,{children:[e(ke,{to:ne(a.id,"callbacks")}),r("openapi.callbacks","Callbacks")]}),e(Z,{callbacks:a.callbacks,onExpand:E,selectedCallback:u})]}):null,e(B,{Hook:z||O?.AfterOperation,props:{operation:a}})]}),u?e(S,{isStacked:o,"data-testid":"samples-block",children:e(ee,{callback:u,translate:r})}):null]}),e(k,{layout:n,children:e(s,{isStacked:o,fullWidth:!0,children:M})})]})}const Ue=K(Se),S=i(U)`
|
|
2
2
|
margin-left: auto;
|
|
3
3
|
--code-block-padding: var(--spacing-xs) 0 var(--spacing-xs) 20px;
|
|
4
4
|
`,ve=i.div`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as s,jsx as t,jsxs 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(s,{children:p(b,{children:[l,i,o,m]})})}export{S as Overview};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { ExampleProps } from './types.js';
|
|
3
|
-
export declare function Example({ example, mimeType, onCopyClick, onPanelToggle
|
|
3
|
+
export declare function Example({ example, mimeType, onCopyClick, onPanelToggle }: ExampleProps): ReactElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ExampleValueProps } from './types.js';
|
|
2
|
-
export declare function ExampleValue({ value, mimeType, encoding, onCopyClick, onPanelToggle
|
|
2
|
+
export declare function ExampleValue({ value, mimeType, encoding, onCopyClick, onPanelToggle }: ExampleValueProps): React.ReactNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as f,jsx as r,jsxs as y}from"react/jsx-runtime";import{memo as d}from"react";import u from"deepmerge";import{Markdown as h}from"../Markdown/index.js";import{Example as j}from"./Example.js";import{ExampleSwitch as k,useExampleKey as E}from"../Samples/index.js";import{arrayMergeStrategy as M}from"../../services/utils.js";import{StyledCodeBlock as S}from"./styled.js";import{useTranslate as v}from"../../hooks/index.js";import{styled as C}from"../../styled-components.js";function K({mediaType:o,properties:a,onChange:l,onCopyClick:c,onPanelToggle:i}){const e=o.examples||o.formExamples||{},x=o.name,s=Object.keys(e),g=v(),{exampleKey:n}=E(o.operation,e),m=s.length===1?Object.values(e)[0]:e[n];if(!s.length)return r(S,{lang:"clike",source:g("openapi.noResponseExample","No response example"),header:{controls:!1}});const t=a?{...m,value:u(m.value,a,{arrayMerge:M})}:m,p=t.description;return y(f,{children:[r(k,{examples:e,exampleKey:n,onChange:l}),p&&r(w,{source:p}),r(j,{example:t,mimeType:x,onCopyClick:c,onPanelToggle:i})]})}const w=C(h)`
|
|
2
2
|
margin: 0 var(--spacing-md) var(--spacing-sm);
|
|
3
3
|
`,z=d(K);export{z as MediaTypeSamples};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { DescriptionEnumsProps } from './types.js';
|
|
3
|
-
export declare function DescriptionEnumsComponent({ enums, toggle, showToggleButton, toggleButtonText, type, translate
|
|
3
|
+
export declare function DescriptionEnumsComponent({ enums, toggle, showToggleButton, toggleButtonText, type, translate }: DescriptionEnumsProps): ReactElement;
|
|
4
4
|
export declare const DescriptionEnums: import("react").NamedExoticComponent<DescriptionEnumsProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as s,jsx as e,jsxs as n}from"react/jsx-runtime";import{memo as a}from"react";import{Markdown as h}from"../Markdown/index.js";import{DescriptionEnumsBlock as u}from"./styled.js";import{ToggleButton as f}from"../common/index.js";import{styled as t}from"../../styled-components.js";const y=t.td`
|
|
2
2
|
word-wrap: break-word;
|
|
3
3
|
font-size: var(--md-table-font-size);
|
|
4
4
|
`,g=t.td`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as c,jsx as m}from"react/jsx-runtime";import{useState as f,memo as d,useCallback as h,useMemo as x}from"react";import{useAtomValue as y}from"jotai";import{SimpleEnums as E}from"./SimpleEnums.js";import{DescriptionEnums as T}from"./DescriptionEnums.js";import{globalOptionsAtom as A}from"../../jotai/store.js";import{useTranslate as B}from"../../hooks/index.js";function C(o){return Array.isArray(o)&&o||Object.entries(o||{}).map(([r,e])=>({value:r,description:e}))}function V({values:o,type:r}){const e=B(),[s,g]=f(!0),{maxDisplayedEnumValues:t}=y(A),l=h(()=>{g(!s)},[s]),p=!Array.isArray(o),n=C(o),a=x(()=>s&&t?n.slice(0,t):n,[n,s,t]);if(!n.length)return null;const i=t?n.length>t:!1,u=t?s?`+${n.length-t} ${e("openapi.actions.more","more")}`:e("openapi.actions.hide","Hide"):"";return m(c,{children:p?m(T,{enums:a,toggle:l,showToggleButton:i,toggleButtonText:u,type:r,translate:e}):m(E,{enums:a,type:r,toggle:l,toggleButtonText:u,showToggleButton:i,translate:e})})}const S=d(V);export{S as EnumValues};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as i,jsx as n,jsxs as t}from"react/jsx-runtime";import{ExampleValue as l,FieldLabel as p}from"../common/index.js";import{tryDecodeURIComponent as u,normalizeText as o,serializeParameterValue as c}from"../../utils/index.js";import{ExampleWrap as x,ExamplesList as d,ExampleSummary as f}from"./styled.js";import{useTranslate as h}from"../../hooks/index.js";import{Markdown as E}from"../Markdown/index.js";function b({field:e}){const r=h();return e.examples?t(i,{children:[t(p,{children:[" ",r("openapi.examples","Examples"),": "]}),n(d,{children:Object.entries(e.examples).map(([m,a])=>{const s=o(a.description);return t(x,{children:[t(f,{children:[o(a.summary)||m," "]}),s&&n(E,{source:s}),n(l,{children:j(e,a.value)})]},m)})})]}):null}function j(e,r){return e.in?u(c(e,r)):r}export{b as Examples,j as getSerializedValue};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as s,jsx as t,jsxs as n}from"react/jsx-runtime";import{memo as i}from"react";import{useAtomValue as a}from"jotai";import{Markdown as e}from"@redocly/theme/components/Markdown/Markdown";import{ExtensionValue as p,FieldLabel as l}from"../common/index.js";import{globalOptionsAtom as f}from"../../jotai/store.js";import{styled as c}from"../../styled-components.js";const d=c(e)`
|
|
2
2
|
margin: 2px 0;
|
|
3
|
-
`;function g({extensions:r}){const{showExtensions:m}=a(f);return m?
|
|
3
|
+
`;function g({extensions:r}){const{showExtensions:m}=a(f);return m?t(s,{children:Object.keys(r).map(o=>n(d,{children:[n(l,{children:[o.substring(2),": "]})," ",t(p,{children:typeof r[o]=="string"?r[o]:JSON.stringify(r[o])})]},o))}):null}const F=i(g);export{F as Extensions};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as l,jsxs as a}from"react/jsx-runtime";import{memo as s}from"react";import{FieldLabel as o,DefaultValue as p,FieldValueLabel as d,ExpandableExample as m}from"../common/index.js";import{styled as x}from"../../styled-components.js";function f({value:e,label:n,raw:t,type:r="other"}){if(e===void 0)return null;const i=t?String(e):JSON.stringify(e);return a(c,{children:[a(o,{children:[" ",n," "]}),r==="default"?l(p,{children:i}):r==="example"?l(m,{value:i}):l(d,{children:i})]})}const j=s(f),c=x.div`
|
|
2
2
|
margin-top: var(--spacing-xxs);
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: baseline;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s
|
|
1
|
+
import{Fragment as C,jsx as e,jsxs as s}from"react/jsx-runtime";import{memo as S,useMemo as L}from"react";import{useAtomValue as N}from"jotai";import{LinkIcon as j}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{RecursiveLabel as x,Tag as g,AccessLabel as q,RequiredLabel as A,StyledBadge as M,CustomBadges as R,renderBadge as y}from"../common/index.js";import{ExternalDocumentation as V}from"../ExternalDocumentation/index.js";import{Markdown as $}from"../Markdown/index.js";import{FieldDetail as m}from"./FieldDetail.js";import{Extensions as _}from"./Extensions.js";import{EnumValues as I}from"./EnumValues.js";import{Examples as O,getSerializedValue as G}from"./Examples.js";import{globalOptionsAtom as H}from"../../jotai/store.js";import{SchemaTypeInfo as n}from"./SchemaTypeInfo.js";import{LinkToField as J}from"../common/LinkToField.js";import{Pattern as K}from"./Pattern.js";import{getAccessModeLabelText as Q}from"../RenderHook/index.js";import{useTranslate as U}from"../../hooks/index.js";import{styled as i}from"../../styled-components.js";import{splitBadgesByPosition as W}from"../../utils/index.js";function X({field:r,renderDiscriminatorSwitch:v,deepLink:c,fieldParentsName:b=[]}){const t=U(),{hidePropertiesPrefix:w,hideSchemaTitles:D}=N(H),{schema:a,description:P,example:d,deprecated:B,examples:p,kind:f,required:F,name:l,badges:k}=r,z=r.in==="header",E=L(()=>{if(d!==void 0||p!==void 0){if(p!==void 0)return e(O,{field:r});{const o=!!r.in;return e(m,{label:`${t("openapi.example","Example")}:`,value:G(r,r.example),raw:o})}}else return null},[d,p,r,t]),h=Q(r.schema),{before:u,after:T}=W(k);return s(C,{children:[s(Y,{children:[l&&s(ee,{children:[c&&e(J,{to:c}),e(ae,{children:e(R,{badges:u,children:s(re,{children:[!w&&b.map(o=>o+".\u200B"),e(te,{className:"schema-name",children:l})]})})})]}),!l&&u.map(y),e(n,{type:a.typePrefix+a.displayType}),e(n,{type:a.displayFormat&&`(${a.displayFormat})`}),e(n,{type:a.contentEncoding}),e(n,{type:a.title&&!D?`(${a.title})`:""}),a.constraints?.map(o=>e(n,{type:o},o)),B&&e(M,{deprecated:!0,children:t("openapi.badges.deprecated","Deprecated")}),e(K,{pattern:a.pattern}),f==="additionalProperties"&&e(g,{children:t("openapi.additionalProperties","additional property")}),f==="patternProperties"&&e(g,{children:t("openapi.patternProperties","pattern property")}),h&&e(q,{children:h}),F&&e(A,{children:t("openapi.required","required")}),a.isCircular&&e(x,{children:t("openapi.recursive","Recursive")}),T.map(y)]}),a.isComplex&&e(x,{children:t("openapi.complex","Complex")}),e(Z,{source:P}),e(m,{raw:z,type:"default",label:t("openapi.default","Default"),value:a.default}),e(I,{type:a.type,values:a["x-enumDescriptions"]||a.enum}),E,e(_,{extensions:{...r.extensions,...a.extensions}}),a.externalDocs&&e(V,{externalDocs:a.externalDocs,compact:!0}),v?.(),e(m,{label:t("openapi.value","Value"),value:r.const||void 0})]})}const Pe=S(X),Y=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: calc(var(--spacing-xxs) / 4) var(--spacing-xxs);
|
|
@@ -27,7 +27,7 @@ import{jsx as e,jsxs as s,Fragment as C}from"react/jsx-runtime";import{memo as S
|
|
|
27
27
|
padding-right: var(--schema-nested-hyperlink-offset);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
&:hover {
|
|
31
31
|
${j} {
|
|
32
32
|
opacity: 1;
|
|
33
33
|
visibility: visible;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as i,jsx as r,jsxs as l}from"react/jsx-runtime";import{useState as c}from"react";import{Tag as h,ToggleButton as m}from"../common/index.js";import{useTranslate as g}from"../../hooks/index.js";const n=45;function T({pattern:t}){const o=g(),[e,s]=c(!1);if(!t)return null;const a=()=>{s(!e)};return l(i,{children:[r(h,{children:e||t.length<n?t:`${t.slice(0,n)}...`}),t.length>n&&r(m,{onClick:a,children:e?o("openapi.hidePattern","Hide pattern"):o("openapi.showPattern","Show pattern")})]})}export{T as Pattern};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { SimpleEnumsProps } from './types.js';
|
|
3
|
-
export declare function SimpleEnumsComponent({ enums, type, toggle, showToggleButton, toggleButtonText, translate
|
|
3
|
+
export declare function SimpleEnumsComponent({ enums, type, toggle, showToggleButton, toggleButtonText, translate }: SimpleEnumsProps): ReactElement;
|
|
4
4
|
export declare const SimpleEnums: import("react").NamedExoticComponent<SimpleEnumsProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as o,jsxs as p}from"react/jsx-runtime";import{memo as l}from"react";import{FieldLabel as x,Tag as c,ToggleButton as d}from"../common/index.js";import{styled as g}from"../../styled-components.js";function u({enums:i,type:m,toggle:r,showToggleButton:s,toggleButtonText:t,translate:e}){return p(f,{"data-testid":"simple-enums",children:[p(x,{children:[m==="array"?e("openapi.items","Items"):""," ",i.length===1?e("openapi.value","Value"):e("openapi.enum","Enum")]}),i.map((n,a)=>o(c,{children:JSON.stringify(n)},n+a)),s?o(d,{onClick:r,children:t}):null]})}const w=l(u),f=g.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
align-items: center;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
2
|
import type { RedoclyOpenAPIDocsProps } from './types.js';
|
|
3
|
-
export declare function RedoclyOpenAPIDocs({ onLoaded, children, store, withCommonStyles, router, telemetryConfig
|
|
3
|
+
export declare function RedoclyOpenAPIDocs({ onLoaded, children, store, withCommonStyles, router, telemetryConfig }: PropsWithChildren<Partial<RedoclyOpenAPIDocsProps>>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as c
|
|
1
|
+
import{Fragment as x,jsx as e,jsxs as c}from"react/jsx-runtime";import{memo as E,useRef as C,useEffect as O,useMemo as j}from"react";import{LayoutVariant as u}from"@redocly/config";import{useSetAtom as A}from"jotai";import{ThreePanelLayout as I}from"@redocly/theme/layouts/ThreePanelLayout";import{SidebarLogo as M}from"@redocly/theme/components/SidebarLogo/SidebarLogo";import{GlobalStyle as v,useMount as N}from"@redocly/theme/core/openapi";import{RedocTelemetry as _}from"../../telemetry/RedocTelemetry.js";import{StoreProvider as D}from"./Providers.js";import{Overlay as V}from"../Overlay.js";import{RedocWrap as k}from"./styled.js";import{StickyResponsiveSidebar as B}from"../StickySidebar/index.js";import{SideMenu as K}from"../SideMenu/index.js";import{Content as F}from"../Content/index.js";import{useContentItems as H,useUppercase2LowercaseRedirect as U,useTelemetry as Y,usePerformanceMetrics as G}from"../../hooks/index.js";import{withRouter as W}from"../../hoc/withRouter.js";import{withStore as q}from"../../hoc/withStore.js";import{compose as z}from"../../utils/index.js";import{useLicense as J}from"../../hooks/useLicense.js";import{allOperationsAtom as Q}from"../../jotai/replay.js";import{TelemetryContext as X}from"../../contexts/telemetry.js";const Z=z(W,q,E)(({licenseKey:a,onLoaded:l,children:o,options:t,layout:s,collapsedSidebar:i,parser:n,withCommonStyles:b})=>{const R=C(null),{isValid:f,licenseInfo:g}=J(a),h=A(Q),y=Y();U();const{contentItems:w,flatItems:p}=H({parser:n,options:t});G({sendTelemetry:d=>{const r=Object.fromEntries(Object.entries(d).map(([T,L])=>[T.toLowerCase(),L]));y.sendPerformanceMetricsMessage([{id:"metrics",object:"metrics",uri:typeof window<"u"?window.location.href:"",cls:r.cls,lcp:r.lcp,fcp:r.fcp,ttfb:r.ttfb}])}}),O(()=>{if(!t.hideReplay&&p.length>0){const d=p.filter(r=>r.type==="operation");h(d)}},[p,t.hideReplay,h]),N(()=>{l?.(),y.sendViewedMessage([{id:window.location.href,object:"page",uri:window.location.href,layout:s}])});const{hideSidebar:P,scrollYOffset:S}=t||{},m=n.definition?.info?.["x-logo"];return c(x,{children:[b&&e(v,{}),c(k,{className:"redoc-wrap",ref:R,children:[!f&&e(V,{licenseInfo:g}),!P&&c(B,{scrollYOffset:S,className:"menu-content",collapsedSidebar:!i,children:[e(M,{imageUrl:m?.url,href:m?.href||n.definition?.info?.contact?.url,altText:m?.altText,backgroundColor:m?.backgroundColor}),e(K,{items:f?w:[]})]}),c(I,{className:"api-content",id:"api-content",layout:s===u.THREE_PANEL?u.THREE_PANEL:u.STACKED,collapsedSidebar:i,children:[e(F,{items:f?w:[],routingBasePath:t.routingBasePath}),o]})]})]})});function ge({onLoaded:a,children:l,store:o,withCommonStyles:t,router:s,telemetryConfig:i}){const n=j(()=>new _({specType:"openapi",serviceName:"realm-ui",...i}),[i]);return o?.definition?e(X.Provider,{value:n,children:e(D,{...o,children:e(Z,{onLoaded:a,basePath:o.options?.routingBasePath,licenseKey:o.options?.licenseKey,disableRouter:o.options?.disableRouter,withCommonStyles:t,router:s,children:l})})}):null}export{ge as RedoclyOpenAPIDocs};
|
|
@@ -5,4 +5,4 @@ import type { RedocConfig } from '@redocly/config';
|
|
|
5
5
|
export declare function loadSingle(spec: any, specUrl: any, options?: RedocConfig): Promise<OpenAPIDefinition>;
|
|
6
6
|
export declare function loadAndBundleSpecOrMd(url: string, title?: string): Promise<OpenAPIDefinition>;
|
|
7
7
|
export declare const AppProvider: ({ options, definitionUrl, definition, activeSampleLanguage, children, }: PropsWithChildren<AppProviderProps>) => ReactElement | null;
|
|
8
|
-
export declare function RedoclyOpenAPIDocsStandalone({ definition, definitionUrl, options, activeItemId, activeSampleLanguage, activeDeepLink, router
|
|
8
|
+
export declare function RedoclyOpenAPIDocsStandalone({ definition, definitionUrl, options, activeItemId, activeSampleLanguage, activeDeepLink, router }: RedoclyOpenAPIDocsStandaloneProps): ReactElement;
|
|
@@ -6,6 +6,6 @@ export type ReplayProps = {
|
|
|
6
6
|
pointer: string;
|
|
7
7
|
hideOtherSecuritySchemes?: boolean;
|
|
8
8
|
};
|
|
9
|
-
declare function EmbeddedReplayComponent({ activeOperationId, corsProxyUrl, fullOpenApi, pointer, hideOtherSecuritySchemes
|
|
9
|
+
declare function EmbeddedReplayComponent({ activeOperationId, corsProxyUrl, fullOpenApi, pointer, hideOtherSecuritySchemes }: ReplayProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare const EmbeddedReplay: import("react").MemoExoticComponent<typeof EmbeddedReplayComponent>;
|
|
11
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as M,jsx as o,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 d,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 ue}from"./utils.js";import{useTranslate as fe,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 Ie,createTryItSentEvent as Oe}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:V,fullOpenApi:y}){const h=fe(),q=de(),I=W(null),O=p(ne),{oAuth2RedirectURI:E,routingBasePath:c}=O,R=p(se),{parser:g,options:{events:a}}=p(ae),v=p(ce),[s,N]=w(!1),[l,A]=d(ie),[u,S]=d(le),[[,j],T]=d(pe),{config:b,refresh:D}=re({userClaims:v,info:g?.definition.info,operation:{name:e.name,path:e.path,operationId:e.operationId||"",href:e.href,method:e.httpVerb},servers:e.servers},s);Z(I),$(s);const x=m(()=>D(),[D]),G=m(({operations:t,environment:i,environments:f})=>{const k=t.reduce((L,r)=>{r.requestValues.body=r.requestValues.body instanceof URLSearchParams?Object.fromEntries(r.requestValues.body.entries()):r.requestValues.body;const{path:B,method:F}=r.apiPath,P=ye.compile(["paths",B,F]);return L[P]=Q(me(P),r),L},{});S({...u,...k}),T({environment:i,environments:f})},[u,S,T]),C=()=>{if(l!==n.LOADING){if(!s&&(q.sendTryItOpenedMessage([{id:"tryItButton",object:"button",uri:"urn:redocly:redoc:ui:button:tryItButton"}]),a?.tryItOpen&&e)){const t=Ie({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&A(n.LOADING)},U=m(t=>{if(a?.tryItSent&&e){const i=Oe({operation:e,isSuccess:t});a.tryItSent(i)}},[a,e]),_=m(t=>{if(!t)return;const i=R.find(f=>f.operationId===t);return Re(c,i?.href)},[R,c]);return y?z(M,{children:[o(Y,{onClick:C,variant:"primary",iconPosition:"left",icon:l===n.LOADING?o(te,{}):o(ee,{}),children:l===n.LOADING?h("openapi.loading","Loading..."):h("openapi.tryIt","Try it")}),s&&o(K,{children:o(oe,{mountId:"api-content",children:o("div",{ref:I,children:o(X,{activeOperationId:e.operationId||e.pointer,api:y,onRequestChange:G,onClose:C,onLoad:()=>A(n.LOADED),settings:{corsProxyUrl:V,selectedEnvironment:j,apiId:g?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:E,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},HTTPSnippet:ge,convertOperationToReplayValue:ue(v,b,O,u),dynamicReplayValues:b,getOperationUrl:_,onRequestReset:x},onRequestSent:U})})})})]}):null}const He=J(ve);export{He as Replay};
|
|
@@ -25,7 +25,6 @@ export declare function convertOperationToReplayValue(path: string, method: stri
|
|
|
25
25
|
};
|
|
26
26
|
} | undefined;
|
|
27
27
|
export declare function convertOperationToReplayValueForRedoc(userClaims?: UserClaims, dynamicReplayValues?: ConfigureRequestValues | ConfigureServerRequestValues | null, options?: Options, operationStateByPointer?: Record<string, OperationStore>): (path: string, method: string, openAPI: OpenAPIDefinition) => {
|
|
28
|
-
operationId: string;
|
|
29
28
|
id: string;
|
|
30
29
|
name: string;
|
|
31
30
|
method: string;
|
|
@@ -42,5 +41,6 @@ export declare function convertOperationToReplayValueForRedoc(userClaims?: UserC
|
|
|
42
41
|
mediaTypes: {} | undefined;
|
|
43
42
|
};
|
|
44
43
|
};
|
|
44
|
+
operationId: string;
|
|
45
45
|
} | undefined;
|
|
46
46
|
export declare function convertRequestSecurity(security?: SecurityRequirement[]): any[] | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o
|
|
1
|
+
import{Fragment as T,jsx as e,jsxs as o}from"react/jsx-runtime";import{memo as j,useMemo as k}from"react";import{useAtomValue as A}from"jotai";import{Title as P}from"../common/OperationItemTitle.js";import{LinkToField as y}from"../common/LinkToField.js";import{makeDeepLink as D}from"../../services/index.js";import{Description as E}from"../OperationItem/Description.js";import{Security as F}from"../Security/index.js";import{hasNestedFields as M}from"../../utils/index.js";import{ExpandAllButton as N}from"../ExpandAllButton/index.js";import{RequestParameters as b}from"../RequestParameters/index.js";import{activeMimeNameAtom as C}from"../../jotai/app.js";import{getActiveMediaType as _}from"../../models/mediaContent.js";import{styled as n}from"../../styled-components.js";import{Extensions as w}from"../common/Extensions.js";function I({operation:{id:i,description:s,externalDocs:m,parameters:r,requestBody:t,pointer:u,security:f,extensions:a,callbackId:d},title:x,translate:h,onPanelToggle:g}){const p=A(C),v=k(()=>{const c=r.some(({schema:l})=>!l.isPrimitive&&!l.isCircular);if(!t?.content||c)return c;const{schema:R}=_(t.content,p)||{};return M(R)},[p,r,t?.content]),q=Object.keys(a||{}).length>0;return o(T,{children:[o(L,{children:[o(H,{children:[o(O,{children:[i&&e(y,{to:D(i,"request")}),x||h?.("openapi.request","Request"),v&&e(N,{operationPointer:u,type:"request",onPanelToggle:g})]}),e(E,{description:s||m?s:void 0,externalDocs:m})]}),q&&e(w,{extensions:a}),e(F,{securities:f})]}),e(b,{parameters:r,body:t,operationId:i,callbackId:d})]})}const L=n.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
`,H=n.div`
|
|
4
4
|
display: flex;
|
|
@@ -6,4 +6,4 @@ export interface ParametersProps {
|
|
|
6
6
|
operationId: string;
|
|
7
7
|
callbackId: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function RequestParameters({ body, parameters, operationId, callbackId
|
|
9
|
+
export declare function RequestParameters({ body, parameters, operationId, callbackId }: ParametersProps): ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as D,jsx as h}from"react/jsx-runtime";import{useMemo as C}from"react";import{useAtomValue as _}from"jotai";import{ParametersGroup as S}from"./ParametersGroup.js";import{Body as b}from"./Body.js";import{makeDeepLink as v}from"../../services/index.js";import{useTranslate as Q}from"../../hooks/index.js";import{globalStoreAtom as z}from"../../jotai/store.js";import{getMediaContent as F}from"../../models/mediaContent.js";import{getContentWithLegacyExamples as T}from"../../utils/openapi.js";const p=["path","query","querystring","cookie","header"];function Z({body:i,parameters:t=[],operationId:n,callbackId:u}){const c=Q(),{parser:a,options:q}=_(z),m=(e=>{const o={};return e.forEach(r=>{W(o,r.in,r)}),o})(t),P=m.querystring||[],d=P.filter(e=>e.serializationMime),f=P.filter(e=>!e.serializationMime),l=C(()=>!a||d.length===0?[]:d.map(e=>{const o=e.deps?.operation?.pointer;if(!o)return null;try{const r=a.byRef(o);if(!r?.parameters)return null;const s=r.parameters.find(x=>{const{resolved:M}=a.deref(x);return M.name===e.name&&M.in==="querystring"});if(!s)return null;const{resolved:E}=a.deref(s),L=T(E);return L?{content:F({parser:a,info:L,isRequestType:!0,options:q,data:{operation:e.deps?.operation||{pointer:o},type:"request",absolutePointer:e.absolutePointer||o}}),description:e.description,required:e.required,name:e.name}:null}catch{return null}}).filter(Boolean),[a,q,d]),R={[p[0]]:c("openapi.path","Path"),[p[1]]:c("openapi.query","Query"),[p[2]]:c("openapi.querystring","Query String"),[p[3]]:c("openapi.cookie","Cookies"),[p[4]]:c("openapi.header","Headers")},{content:y,description:k,required:A}=i||{},$=C(()=>{const e=[],o=f.length>0||l.length>0;return p.forEach(r=>{if(!(r==="query"&&o))if(r==="querystring")f.length>0&&e.push({type:"parameters",place:r,params:f});else{const s=m[r];s&&s.length>0&&e.push({type:"parameters",place:r,params:s})}}),l.forEach((r,s)=>{r&&e.push({type:"body",content:r.content,description:r.description,required:r.required,deepLink:g(n,u,`querystring-${r.name}`),key:`querystring-${r.name}-${s}`})}),y&&e.push({type:"body",content:y,description:k,required:A,deepLink:g(n,u),key:"body"}),e},[m,f,l,y,k,A,n,u]);return!i&&!t.length?null:h(D,{children:$.map(e=>e.type==="parameters"?h(S,{title:R[e.place],parameters:e.params,deepLink:g(n,u,e.place)},e.place):h(b,{content:e.content,description:e.description,required:e.required,deepLink:e.deepLink},e.key))})}function W(i,t="",n){i[t]||(i[t]=[]),i[t].push(n)}function g(i,t,n="body"){const u=`${t?`${t}/request/${n}`:`request/${n}`}`;return v(i,u)}export{Z as RequestParameters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as f,jsx as h,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 b}from"../Samples/index.js";import{useActivateExample as j,useTelemetry as K}from"../../hooks/index.js";import{operationStore as C}from"../../jotai/operation.js";function w({mediaType:e,mediaContent:l,renderSample:s}){const m=K(),p=e.operation.pointer,[n,i]=g(C(p)),r=e.examples||e.formExamples||{},t=Object.keys(r),x=j(l),{exampleKey:c}=b(e.operation,r),a=t[n.activeOneOf[e?.examplesPointer||e.operation.pointer]]||c;return!t.length||t.length===1?s():E(f,{children:[h(v,{examples:r,exampleKey:a,onChange:o=>{const u=e.examplesPointer&&e.examplesPointer.startsWith(e.operation.pointer)?e.examplesPointer:e.operation.pointer;m.sendExamplesSwitcherClickedMessage([{object:"button",id:"examplesSwitcherButton",uri:"urn:redocly:redoc:ui:button:examplesSwitcherButton",exampleNumber:t.indexOf(o),totalExamples:t.length}]),i({...n,activeExampleName:o,activeOneOf:{...n.activeOneOf,[u]:t.indexOf(o)},requestValues:{body:null}}),x(o)}}),s(a)]})}const q=O(w);export{q as Example};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Unstable_ExternalCodeSample } from '../../services/index.js';
|
|
2
2
|
import type { OperationModel } from '../../models/index.js';
|
|
3
3
|
import type { OpenAPIXCodeSample } from '../../types/index.js';
|
|
4
|
-
export declare function useCodeSamples({ payload, isWebhook, definitionSamples, pointer, envVariables
|
|
4
|
+
export declare function useCodeSamples({ payload, isWebhook, definitionSamples, pointer, envVariables }: OperationModel): {
|
|
5
5
|
samples: Array<{
|
|
6
6
|
key: string;
|
|
7
7
|
title: string;
|