@redocly/openapi-docs 3.3.24 → 3.4.0-rc.11
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 +1334 -1548
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/Metadata.d.ts +1 -3
- package/lib/components/ApiInfo/Metadata.js +1 -1
- package/lib/components/CallbackSamples/CallbackSamples.d.ts +0 -2
- package/lib/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib/components/Callbacks/CallbackDetails.d.ts +0 -2
- package/lib/components/Callbacks/CallbackDetails.js +1 -1
- package/lib/components/Callbacks/CallbackOperation.js +1 -1
- package/lib/components/Callbacks/CallbackSummary.d.ts +2 -3
- package/lib/components/Callbacks/CallbackSummary.js +1 -1
- package/lib/components/Discriminator/Discriminator.d.ts +0 -2
- package/lib/components/Discriminator/Discriminator.js +1 -1
- package/lib/components/ExpandAllButton/ExpandAllButton.js +1 -1
- package/lib/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib/components/OperationItem/OperationItem.js +2 -2
- package/lib/components/Overview/Overview.d.ts +3 -8
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/PayloadSamples/Example.js +1 -1
- package/lib/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib/components/PayloadSamples/PayloadSamples.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/FieldDetail.d.ts +0 -1
- package/lib/components/PropertyDetails/FieldDetail.js +1 -1
- package/lib/components/PropertyDetails/FieldDetails.js +3 -4
- package/lib/components/PropertyDetails/Pattern.js +1 -1
- package/lib/components/PropertyDetails/SimpleEnums.d.ts +1 -1
- package/lib/components/PropertyDetails/SimpleEnums.js +1 -1
- package/lib/components/PropertyDetails/types.d.ts +0 -3
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/styled.d.ts +4 -0
- package/lib/components/RedoclyOpenAPIDocs/styled.js +30 -1
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +3 -0
- package/lib/components/Replay/EmbeddedReplay.js +1 -1
- package/lib/components/Replay/Replay.js +9 -2
- package/lib/components/Request/RequestDetails.js +1 -1
- package/lib/components/Request/types.d.ts +0 -2
- package/lib/components/RequestParameters/RequestParameters.js +1 -1
- package/lib/components/RequestSamples/useCodeSamples.js +1 -1
- package/lib/components/ResponseSamples/Summary.js +1 -1
- package/lib/components/Responses/OperationResponseList.js +1 -1
- package/lib/components/Responses/ResponseHeaders.js +1 -1
- package/lib/components/RightPanel/RightPanel.js +1 -1
- package/lib/components/Schema/ObjectSchema.js +1 -1
- package/lib/components/Schema/OneOfSchema.js +1 -1
- package/lib/components/Schema/RecursiveSchema.js +1 -1
- package/lib/components/Schema/SubSchema.js +1 -1
- package/lib/components/Schema/helpers.d.ts +1 -1
- package/lib/components/Schema/helpers.js +1 -1
- package/lib/components/Security/OAuthFlow.js +1 -1
- package/lib/components/Security/SecurityFlow.js +1 -1
- package/lib/components/Security/SecurityModal.js +1 -1
- package/lib/components/ServerList/ServerList.d.ts +1 -1
- package/lib/components/ServerList/ServerList.js +1 -1
- package/lib/components/ServerList/types.d.ts +1 -4
- package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/components/TagItem/OperationsNavigation.d.ts +6 -1
- package/lib/components/TagItem/OperationsNavigation.js +40 -1
- package/lib/components/TagItem/TagItem.js +1 -1
- package/lib/components/common/BodyContent/BodyContent.js +1 -1
- package/lib/components/common/ExpandableExample/ExpandableExample.js +1 -1
- package/lib/components/common/panels.js +2 -2
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks/index.js +1 -1
- package/lib/jotai/app.js +1 -1
- package/lib/models/mediaType.js +1 -1
- package/lib/models/tab.d.ts +1 -1
- package/lib/services/code-samples/generator.d.ts +1 -3
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib/services/types.d.ts +3 -0
- package/lib/setupTests.d.ts +2 -0
- package/lib/setupTests.js +2 -0
- package/lib/testProviders.d.ts +3 -0
- package/lib/testProviders.js +2 -0
- package/lib/utils/helpers.d.ts +1 -1
- package/lib/utils/openapi.d.ts +0 -1
- package/lib/utils/openapi.js +1 -1
- package/lib-esm/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/components/ApiInfo/Metadata.d.ts +1 -3
- package/lib-esm/components/ApiInfo/Metadata.js +1 -1
- package/lib-esm/components/CallbackSamples/CallbackSamples.d.ts +0 -2
- package/lib-esm/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib-esm/components/Callbacks/CallbackDetails.d.ts +0 -2
- package/lib-esm/components/Callbacks/CallbackDetails.js +1 -1
- package/lib-esm/components/Callbacks/CallbackOperation.js +1 -1
- package/lib-esm/components/Callbacks/CallbackSummary.d.ts +2 -3
- package/lib-esm/components/Callbacks/CallbackSummary.js +1 -1
- package/lib-esm/components/Discriminator/Discriminator.d.ts +0 -2
- package/lib-esm/components/Discriminator/Discriminator.js +1 -1
- package/lib-esm/components/ExpandAllButton/ExpandAllButton.js +1 -1
- package/lib-esm/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib-esm/components/OperationItem/OperationItem.js +2 -2
- package/lib-esm/components/Overview/Overview.d.ts +3 -8
- package/lib-esm/components/Overview/Overview.js +1 -1
- package/lib-esm/components/PayloadSamples/Example.js +1 -1
- package/lib-esm/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib-esm/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib-esm/components/PropertyDetails/DescriptionEnums.d.ts +1 -1
- package/lib-esm/components/PropertyDetails/DescriptionEnums.js +1 -1
- package/lib-esm/components/PropertyDetails/EnumValues.js +1 -1
- package/lib-esm/components/PropertyDetails/Examples.js +1 -1
- package/lib-esm/components/PropertyDetails/FieldDetail.d.ts +0 -1
- package/lib-esm/components/PropertyDetails/FieldDetail.js +1 -1
- package/lib-esm/components/PropertyDetails/FieldDetails.js +3 -4
- package/lib-esm/components/PropertyDetails/Pattern.js +1 -1
- package/lib-esm/components/PropertyDetails/SimpleEnums.d.ts +1 -1
- package/lib-esm/components/PropertyDetails/SimpleEnums.js +1 -1
- package/lib-esm/components/PropertyDetails/types.d.ts +0 -3
- package/lib-esm/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.d.ts +4 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.js +30 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/types.d.ts +3 -0
- package/lib-esm/components/Replay/EmbeddedReplay.js +1 -1
- package/lib-esm/components/Replay/Replay.js +9 -2
- package/lib-esm/components/Request/RequestDetails.js +1 -1
- package/lib-esm/components/Request/types.d.ts +0 -2
- package/lib-esm/components/RequestParameters/RequestParameters.js +1 -1
- package/lib-esm/components/RequestSamples/useCodeSamples.js +1 -1
- package/lib-esm/components/ResponseSamples/Summary.js +1 -1
- package/lib-esm/components/Responses/OperationResponseList.js +1 -1
- package/lib-esm/components/Responses/ResponseHeaders.js +1 -1
- package/lib-esm/components/RightPanel/RightPanel.js +1 -1
- package/lib-esm/components/Schema/ObjectSchema.js +1 -1
- package/lib-esm/components/Schema/OneOfSchema.js +1 -1
- package/lib-esm/components/Schema/RecursiveSchema.js +1 -1
- package/lib-esm/components/Schema/SubSchema.js +1 -1
- package/lib-esm/components/Schema/helpers.d.ts +1 -1
- package/lib-esm/components/Schema/helpers.js +1 -1
- package/lib-esm/components/Security/OAuthFlow.js +1 -1
- package/lib-esm/components/Security/SecurityFlow.js +1 -1
- package/lib-esm/components/Security/SecurityModal.js +1 -1
- package/lib-esm/components/ServerList/ServerList.d.ts +1 -1
- package/lib-esm/components/ServerList/ServerList.js +1 -1
- package/lib-esm/components/ServerList/types.d.ts +1 -4
- package/lib-esm/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib-esm/components/TagItem/OperationsNavigation.d.ts +6 -1
- package/lib-esm/components/TagItem/OperationsNavigation.js +40 -1
- package/lib-esm/components/TagItem/TagItem.js +2 -2
- package/lib-esm/components/common/BodyContent/BodyContent.js +1 -1
- package/lib-esm/components/common/ExpandableExample/ExpandableExample.js +1 -1
- package/lib-esm/components/common/panels.js +2 -2
- package/lib-esm/hooks/index.d.ts +0 -1
- package/lib-esm/hooks/index.js +1 -1
- package/lib-esm/jotai/app.js +1 -1
- package/lib-esm/models/mediaType.js +1 -1
- package/lib-esm/models/tab.d.ts +1 -1
- package/lib-esm/services/code-samples/generator.d.ts +1 -3
- package/lib-esm/services/code-samples/generator.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/java/httpclient.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib-esm/services/types.d.ts +3 -0
- package/lib-esm/setupTests.d.ts +2 -0
- package/lib-esm/setupTests.js +2 -0
- package/lib-esm/testProviders.d.ts +3 -0
- package/lib-esm/testProviders.js +2 -0
- package/lib-esm/utils/helpers.d.ts +1 -1
- package/lib-esm/utils/openapi.d.ts +0 -1
- package/lib-esm/utils/openapi.js +1 -1
- package/package.json +11 -12
- package/lib/components/TagItem/OperationNavigationItems.d.ts +0 -10
- package/lib/components/TagItem/OperationNavigationItems.js +0 -37
- package/lib/components/TagItem/styled.d.ts +0 -2
- package/lib/components/TagItem/styled.js +0 -6
- package/lib/components/TagItem/types.d.ts +0 -5
- package/lib/components/TagItem/types.js +0 -2
- package/lib/hooks/useTranslate.d.ts +0 -2
- package/lib/hooks/useTranslate.js +0 -2
- package/lib/utils/convertExamplesFormat.d.ts +0 -2
- package/lib/utils/convertExamplesFormat.js +0 -2
- package/lib-esm/components/TagItem/OperationNavigationItems.d.ts +0 -10
- package/lib-esm/components/TagItem/OperationNavigationItems.js +0 -37
- package/lib-esm/components/TagItem/styled.d.ts +0 -2
- package/lib-esm/components/TagItem/styled.js +0 -6
- package/lib-esm/components/TagItem/types.d.ts +0 -5
- package/lib-esm/components/TagItem/types.js +0 -2
- package/lib-esm/hooks/useTranslate.d.ts +0 -2
- package/lib-esm/hooks/useTranslate.js +0 -2
- package/lib-esm/utils/convertExamplesFormat.d.ts +0 -2
- package/lib-esm/utils/convertExamplesFormat.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __rest=this&&this.__rest||function(e,t){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(o[a[r]]=e[a[r]])}return o};import{jsx as _jsx}from"react/jsx-runtime";import{memo,useCallback}from"react";import{useAtomValue}from"jotai";import{SelectOrLabel}from"../SelectOrLabel";import{MediaTypesSwitch}from"../MediaTypeSwitch";import{MimeLabel,Select}from"../common";import{MediaTypeSamples}from"./MediaTypeSamples";import{SelectWrapper,StyledCodeBlock}from"./styled";import{activeMimeNameAtom}from"../../jotai/app";import{useActivateExample
|
|
1
|
+
var __rest=this&&this.__rest||function(e,t){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(o[a[r]]=e[a[r]])}return o};import{jsx as _jsx}from"react/jsx-runtime";import{memo,useCallback}from"react";import{useAtomValue}from"jotai";import{SelectOrLabel}from"../SelectOrLabel";import{MediaTypesSwitch}from"../MediaTypeSwitch";import{MimeLabel,Select}from"../common";import{MediaTypeSamples}from"./MediaTypeSamples";import{SelectWrapper,StyledCodeBlock}from"./styled";import{activeMimeNameAtom}from"../../jotai/app";import{useActivateExample}from"../../hooks";function PayloadSamplesComponent(e){var{onlyDefaultMimeType:t,content:o}=e,a=__rest(e,["onlyDefaultMimeType","content"]);const r=useActivateExample(o),l=useAtomValue(activeMimeNameAtom),m=t&&l,i=useCallback((e=>m?null:_jsx(SelectWrapper,{children:_jsx(SelectOrLabel,Object.assign({Label:MimeLabel,Select:Select,variant:"dark",fullWidth:!0},e))})),[m]),p=e=>r(e);return o?_jsx(MediaTypesSwitch,{content:o,renderSelect:i,children:e=>_jsx(MediaTypeSamples,Object.assign({mediaType:e},a,{onChange:p}),"samples")}):_jsx(StyledCodeBlock,{lang:"text",source:"No request payload",header:{controls:!1}})}export const PayloadSamples=memo(PayloadSamplesComponent);
|
|
2
2
|
//# sourceMappingURL=PayloadSamples.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { DescriptionEnumsProps } from './types';
|
|
3
|
-
export declare function DescriptionEnumsComponent({ enums, toggle, showToggleButton, toggleButtonText, type,
|
|
3
|
+
export declare function DescriptionEnumsComponent({ enums, toggle, showToggleButton, toggleButtonText, type, }: DescriptionEnumsProps): ReactElement;
|
|
4
4
|
export declare const DescriptionEnums: import("react").NamedExoticComponent<DescriptionEnumsProps>;
|
|
@@ -6,5 +6,5 @@ import{jsxs as _jsxs,jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";i
|
|
|
6
6
|
p:only-of-type {
|
|
7
7
|
margin: 0;
|
|
8
8
|
}
|
|
9
|
-
`;export function DescriptionEnumsComponent({enums:e,toggle:t,showToggleButton:n,toggleButtonText:o,type:
|
|
9
|
+
`;export function DescriptionEnumsComponent({enums:e,toggle:t,showToggleButton:n,toggleButtonText:o,type:r}){return _jsx(_Fragment,{children:_jsx(DescriptionEnumsBlock,{children:_jsxs("table",{className:"md",children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsxs("th",{style:{width:"30%"},children:["array"===r?"Items":""," ",1===e.length?"Value":"Enum Value"]}),_jsx("th",{children:"Description"})]})}),_jsx("tbody",{children:e.map((({description:e,value:t})=>_jsxs("tr",{children:[_jsx(EnumValueStyled,{children:t}),_jsx(DescriptionValueStyled,{children:_jsx(Markdown,{source:e})})]},t)))}),n?_jsx("tfoot",{children:_jsx("tr",{children:_jsx("td",{colSpan:2,children:_jsx(ToggleButton,{onClick:t,children:o})})})}):null]})})})}export const DescriptionEnums=memo(DescriptionEnumsComponent);
|
|
10
10
|
//# sourceMappingURL=DescriptionEnums.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{useState,memo,useCallback,useMemo}from"react";import{useAtomValue}from"jotai";import{SimpleEnums}from"./SimpleEnums";import{DescriptionEnums}from"./DescriptionEnums";import{globalOptionsAtom}from"../../jotai/store";
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{useState,memo,useCallback,useMemo}from"react";import{useAtomValue}from"jotai";import{SimpleEnums}from"./SimpleEnums";import{DescriptionEnums}from"./DescriptionEnums";import{globalOptionsAtom}from"../../jotai/store";function getEnums(e){return Array.isArray(e)&&e||Object.entries(e||{}).map((([e,t])=>({value:e,description:t})))}function EnumValuesComponent({values:e,type:t}){const[o,m]=useState(!0),{maxDisplayedEnumValues:n}=useAtomValue(globalOptionsAtom),s=useCallback((()=>{m(!o)}),[o]),r=!Array.isArray(e),u=getEnums(e),l=useMemo((()=>o&&n?u.slice(0,n):u),[u,o,n]);if(!u.length)return null;const a=!!n&&u.length>n,i=n?o?`+${u.length-n} more`:"Hide":"";return _jsx(_Fragment,{children:r?_jsx(DescriptionEnums,{enums:l,toggle:s,showToggleButton:a,toggleButtonText:i,type:t}):_jsx(SimpleEnums,{enums:l,type:t,toggle:s,toggleButtonText:i,showToggleButton:a})})}export const EnumValues=memo(EnumValuesComponent);
|
|
2
2
|
//# sourceMappingURL=EnumValues.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{ExampleValue,FieldLabel}from"../common";import{normalizeText,serializeParameterValue}from"../../utils";import{ExampleWrap,ExamplesList,ExampleSummary,ExampleDescription}from"./styled";export function Examples({field:e}){return e.examples?_jsxs(_Fragment,{children:[_jsx(FieldLabel,{children:" Examples: "}),_jsx(ExamplesList,{children:Object.entries(e.examples).map((([r,a])=>{const l=normalizeText(a.description);return _jsxs(ExampleWrap,{children:[_jsxs(ExampleSummary,{children:[normalizeText(a.summary)||r," "]}),l&&_jsxs(ExampleDescription,{children:[l," "]}),_jsx(ExampleValue,{children:getSerializedValue(e,a.value)})]},r)}))})]}):null}export function getSerializedValue(e,r){return e.in?decodeURIComponent(serializeParameterValue(e,r)):r}
|
|
2
2
|
//# sourceMappingURL=Examples.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{FieldLabel,DefaultValue,FieldValueLabel,ExpandableExample}from"../common";function FieldDetailComponent({value:e,label:l,raw:a
|
|
1
|
+
import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{FieldLabel,DefaultValue,FieldValueLabel,ExpandableExample}from"../common";function FieldDetailComponent({value:e,label:l,raw:a}){if(void 0===e)return null;const i=a?String(e):JSON.stringify(e);return _jsxs(Wrapper,{children:[_jsxs(FieldLabel,{children:[" ",l," "]}),"Default"===l?_jsx(DefaultValue,{children:i}):"Example:"===l?_jsx(ExpandableExample,{value:i}):_jsx(FieldValueLabel,{children:i})]})}export const FieldDetail=memo(FieldDetailComponent);const Wrapper=styled.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 _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo,useMemo}from"react";import{useAtomValue}from"jotai";import styled from"styled-components";import{LinkIcon}from"@redocly/theme";import{RecursiveLabel,Tag,AccessLabel,RequiredLabel,StyledBadge}from"../common";import{ExternalDocumentation}from"../ExternalDocumentation";import{Markdown}from"../Markdown";import{FieldDetail}from"./FieldDetail";import{Extensions}from"./Extensions";import{EnumValues}from"./EnumValues";import{Examples,getSerializedValue}from"./Examples";import{globalOptionsAtom}from"../../jotai/store";import{SchemaTypeInfo}from"./SchemaTypeInfo";import{LinkToField}from"../common/LinkToField";import{Pattern}from"./Pattern";import{getAccessModeLabelText}from"../RenderHook";
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo,useMemo}from"react";import{useAtomValue}from"jotai";import styled from"styled-components";import{LinkIcon}from"@redocly/theme";import{RecursiveLabel,Tag,AccessLabel,RequiredLabel,StyledBadge}from"../common";import{ExternalDocumentation}from"../ExternalDocumentation";import{Markdown}from"../Markdown";import{FieldDetail}from"./FieldDetail";import{Extensions}from"./Extensions";import{EnumValues}from"./EnumValues";import{Examples,getSerializedValue}from"./Examples";import{globalOptionsAtom}from"../../jotai/store";import{SchemaTypeInfo}from"./SchemaTypeInfo";import{LinkToField}from"../common/LinkToField";import{Pattern}from"./Pattern";import{getAccessModeLabelText}from"../RenderHook";function FieldDetailsComponent({field:e,renderDiscriminatorSwitch:t,deepLink:i,fieldParentsName:a=[]}){var o;const{hidePropertiesPrefix:r,hideSchemaTitles:s}=useAtomValue(globalOptionsAtom),{schema:n,description:l,example:m,deprecated:p,examples:c,kind:d,required:x,name:f}=e,h="header"===e.in,u=useMemo((()=>{if(void 0!==m||void 0!==c){if(void 0!==c)return _jsx(Examples,{field:e});{const t=!!e.in;return _jsx(FieldDetail,{label:"Example:",value:getSerializedValue(e,e.example),raw:t})}}return null}),[m,c,e]),y=getAccessModeLabelText(e.schema);return _jsxs(_Fragment,{children:[_jsxs(Row,{children:[f&&_jsxs(Name,{children:[i&&_jsx(LinkToField,{to:i}),!r&&a.map((e=>e+".")),_jsx(SchemaName,{className:"schema-name",children:f})]}),_jsx(SchemaTypeInfo,{type:n.typePrefix+n.displayType}),_jsx(SchemaTypeInfo,{type:n.displayFormat&&`(${n.displayFormat})`}),_jsx(SchemaTypeInfo,{type:n.contentEncoding}),_jsx(SchemaTypeInfo,{type:n.title&&!s?`(${n.title})`:""}),null===(o=n.constraints)||void 0===o?void 0:o.map((e=>_jsx(SchemaTypeInfo,{type:e},e))),p&&_jsx(StyledBadge,{deprecated:!0,children:"Deprecated"}),_jsx(Pattern,{pattern:n.pattern}),"additionalProperties"===d&&_jsx(Tag,{children:"additional property"}),"patternProperties"===d&&_jsx(Tag,{children:"pattern property"}),y&&_jsx(AccessLabel,{children:y}),x&&_jsx(RequiredLabel,{children:"required"}),n.isCircular&&_jsx(RecursiveLabel,{children:"Recursive"})]}),_jsx(StyledDescription,{source:l}),_jsx(FieldDetail,{raw:h,label:"Default",value:n.default}),_jsx(EnumValues,{type:n.type,values:n["x-enumDescriptions"]||n.enum}),u,_jsx(Extensions,{extensions:Object.assign(Object.assign({},e.extensions),n.extensions)}),n.externalDocs&&_jsx(ExternalDocumentation,{externalDocs:n.externalDocs,compact:!0}),null==t?void 0:t(),_jsx(FieldDetail,{label:"Value",value:e.const||void 0})]})}export const FieldDetails=memo(FieldDetailsComponent);const Row=styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: calc(var(--spacing-xxs) / 4) var(--spacing-xxs);
|
|
@@ -19,9 +19,8 @@ import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";i
|
|
|
19
19
|
font-size: var(--font-size-base);
|
|
20
20
|
color: var(--text-color-description);
|
|
21
21
|
max-width: 100%;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
white-space: pre-wrap;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-wrap: wrap;
|
|
25
24
|
|
|
26
25
|
:hover {
|
|
27
26
|
${LinkIcon} {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{useState}from"react";import{Tag,ToggleButton}from"../common";
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{useState}from"react";import{Tag,ToggleButton}from"../common";const MAX_PATTERN_LENGTH=45;export function Pattern({pattern:t}){const[e,n]=useState(!1);if(!t)return null;return _jsxs(_Fragment,{children:[_jsx(Tag,{children:e||t.length<MAX_PATTERN_LENGTH?t:`${t.slice(0,MAX_PATTERN_LENGTH)}...`}),t.length>MAX_PATTERN_LENGTH&&_jsx(ToggleButton,{onClick:()=>{n(!e)},children:e?"Hide pattern":"Show pattern"})]})}
|
|
2
2
|
//# sourceMappingURL=Pattern.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { SimpleEnumsProps } from './types';
|
|
3
|
-
export declare function SimpleEnumsComponent({ enums, type, toggle, showToggleButton, toggleButtonText,
|
|
3
|
+
export declare function SimpleEnumsComponent({ enums, type, toggle, showToggleButton, toggleButtonText, }: SimpleEnumsProps): ReactElement;
|
|
4
4
|
export declare const SimpleEnums: import("react").NamedExoticComponent<SimpleEnumsProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{FieldLabel,Tag,ToggleButton}from"../common";export function SimpleEnumsComponent({enums:e,type:
|
|
1
|
+
import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{FieldLabel,Tag,ToggleButton}from"../common";export function SimpleEnumsComponent({enums:e,type:o,toggle:t,showToggleButton:n,toggleButtonText:s}){return _jsxs(Row,{children:[_jsxs(FieldLabel,{children:["array"===o?"Items":""," ",1===e.length?"Value":"Enum"]}),e.map(((e,o)=>_jsx(Tag,{children:JSON.stringify(e)},e+o))),n?_jsx(ToggleButton,{onClick:t,children:s}):null]})}export const SimpleEnums=memo(SimpleEnumsComponent);const Row=styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TFunction } from '@redocly/theme';
|
|
2
1
|
import type { ReactElement } from 'react';
|
|
3
2
|
import type { SchemaOptions } from '../Schema';
|
|
4
3
|
import type { FieldModel } from '../../models';
|
|
@@ -14,7 +13,6 @@ export interface SimpleEnumsProps {
|
|
|
14
13
|
showToggleButton: boolean;
|
|
15
14
|
toggleButtonText: string;
|
|
16
15
|
type: string | string[];
|
|
17
|
-
translate: TFunction;
|
|
18
16
|
}
|
|
19
17
|
export type DescriptionEnumProp = Array<{
|
|
20
18
|
value: string;
|
|
@@ -26,7 +24,6 @@ export interface DescriptionEnumsProps {
|
|
|
26
24
|
showToggleButton: boolean;
|
|
27
25
|
toggleButtonText: string;
|
|
28
26
|
type: string | string[];
|
|
29
|
-
translate: TFunction;
|
|
30
27
|
}
|
|
31
28
|
export interface ExtensionsProps {
|
|
32
29
|
extensions: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,i){return new(o||(o=Promise))((function(n,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{cloneElement,isValidElement,memo,useCallback,useEffect,useMemo,useState}from"react";import{Tag}from"@markdoc/markdoc";import{
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,i){return new(o||(o=Promise))((function(n,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{cloneElement,isValidElement,memo,useCallback,useEffect,useMemo,useState}from"react";import{Tag}from"@markdoc/markdoc";import{Loading,markdoc}from"@redocly/theme";import{createStore,Provider}from"jotai";import{normalizeOptions,OpenAPIParser}from"../../services";import{getMarkdownHeaderId,loadSingle,useDeepCompareMemoize}from"./utils";import{argValueToBoolean,normalizeServers}from"../../utils";import{SchemaDefinition}from"../SchemaDefinition";import{appStore,appStoreOverrideAtom,environmentAtom,layoutAtom}from"../../jotai/app";import JotaiNexus from"../../jotai/nexus";import{mapObject}from"../../utils/object";import{mergeInMockServer}from"../../models/operation";import{getDefaultOperationStore,operationStore}from"../../jotai/operation";import{getServerEnvName}from"../../utils/environments";import{globalStoreAtom}from"../../jotai/store";export const AppProvider=({options:e,definitionUrl:t,definition:o,activeSampleLanguage:i,children:n})=>{const[,r]=useState(),[a,s]=useState(!0),[l,m]=useState(null);useEffect((()=>{!function(){__awaiter(this,void 0,void 0,(function*(){s(!0);try{m(yield loadSingle(o,t,e))}catch(e){r((()=>{throw e}))}}))}()}),[o,t,e]);const u=useMemo((()=>{var o,n,r;if(l)return(null===(o=null==e?void 0:e.unstable_hooks)||void 0===o?void 0:o.onInit)&&(null===(r=null===(n=e.unstable_hooks)||void 0===n?void 0:n.onInit)||void 0===r||r.call(n,{store:{definition:l,options:e,definitionUrl:t,activeSampleLanguage:i}})),{definition:l,options:e,definitionUrl:t,activeSampleLanguage:i}}),useDeepCompareMemoize([l,e,t]));return useEffect((()=>{u&&s(!1)}),[u]),u?a?argValueToBoolean(null==e?void 0:e.hideLoading,!1)?null:_jsx(Loading,{color:"--loading-spinner-color"}):isValidElement(n)?cloneElement(n,{store:u}):null:null};const DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],maxDisplayedEnumValues:10,markdocOptions:{tags:{schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean},htmlWrap:{type:String,default:!1}}}},nodes:{heading:{children:["inline"],attributes:{id:{type:String},level:{type:Number,required:!0,default:1}},transform(e,t){const o=e.transformAttributes(t),i=e.transformChildren(t),n="string"==typeof o.id?o.id:getMarkdownHeaderId(i);return new Tag("Heading",Object.assign(Object.assign({},o),{id:n,level:e.attributes.level}),i)}}},components:{SchemaDefinition:SchemaDefinition,Heading:markdoc.components.Heading}}};export const StoreProvider=memo((({children:e,options:t,definitionUrl:o,definition:i,withState:n})=>{const r=useCallback((()=>{const e=normalizeOptions(t,DEFAULT_OPTIONS);return{options:e,parser:new OpenAPIParser(i,o,e)}}),[i,o,t]),a=useMemo((()=>{var e;const t=createStore(),o=r();t.set(globalStoreAtom,o);const i=normalizeServers(o.parser.definitionUrl,mergeInMockServer((null===(e=o.parser.definition)||void 0===e?void 0:e.servers)||[],o.options.mockServer)),a=Object.fromEntries(i.map((e=>[getServerEnvName(e),Object.assign({server:e.url},mapObject(e.variables||{},(e=>e.default||"")))])));return t.sub(appStore,(()=>{})),t.set(environmentAtom,{environments:a}),n&&t.set(appStoreOverrideAtom,{environment:n.environment,environments:n.environments,activeMimeName:n.activeMimeName}),(null==n?void 0:n.operation)&&t.set(operationStore(n.operation.pointer),getDefaultOperationStore(n.operation.pointer,n.operation.state.requestValues)),t}),[r,n]);return useEffect((()=>{(null==n?void 0:n.layout)&&a.set(layoutAtom,null==n?void 0:n.layout)}),[a,null==n?void 0:n.layout]),_jsxs(Provider,{store:a,children:[_jsx(JotaiNexus,{}),e]})}));
|
|
2
2
|
//# sourceMappingURL=Providers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useRef,memo}from"react";import{SidebarLogo,GlobalStyle as ThemeCommonStyle,useMount,LayoutVariant,ThreePanelLayout}from"@redocly/theme";import{UnsupportedFeatureScreen}from"../UnsupportedFeatureScreen";import{AppProvider,StoreProvider}from"./Providers";import{Overlay}from"../Overlay";import{RedocWrap}from"./styled";import{StickyResponsiveSidebar}from"../StickySidebar";import{SideMenu}from"../SideMenu";import{Content}from"../Content";import{useContentItems,useUppercase2LowercaseRedirect}from"../../hooks";import{withRouter}from"../../hoc/withRouter";import{withStore}from"../../hoc/withStore";import{compose}from"../../utils";import{useLicense}from"../../hooks/useLicense";const RedoclyOpenAPIDocsComponent=compose(withRouter,withStore,memo)((({licenseKey:e,onLoaded:o,children:t,options:i,layout:n,collapsedSidebar:r,parser:s,withCommonStyles:a})=>{var l,d,c,m,u;const p=useRef(null),{isValid:v,licenseInfo:f}=useLicense(e);useUppercase2LowercaseRedirect(),useMount((()=>{null==o||o()}));const{hideSidebar:h,scrollYOffset:S}=i||{},{contentItems:y}=useContentItems({parser:s,options:i}),x=null===(d=null===(l=s.definition)||void 0===l?void 0:l.info)||void 0===d?void 0:d["x-logo"];return _jsxs(_Fragment,{children:[a&&_jsx(ThemeCommonStyle,{}),_jsxs(RedocWrap,{className:"redoc-wrap",ref:p,children:[_jsx(UnsupportedFeatureScreen,{}),!v&&_jsx(Overlay,{licenseInfo:f}),!h&&_jsxs(StickyResponsiveSidebar,{scrollYOffset:S,className:"menu-content",collapsedSidebar:!r,children:[_jsx(SidebarLogo,{imageUrl:null==x?void 0:x.url,href:(null==x?void 0:x.href)||(null===(u=null===(m=null===(c=s.definition)||void 0===c?void 0:c.info)||void 0===m?void 0:m.contact)||void 0===u?void 0:u.url),altText:null==x?void 0:x.altText,backgroundColor:null==x?void 0:x.backgroundColor}),_jsx(SideMenu,{items:v?y:[]})]}),_jsxs(ThreePanelLayout,{className:"api-content",id:"api-content",layout:n===LayoutVariant.THREE_PANEL?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED,collapsedSidebar:r,children:[_jsx(Content,{items:v?y:[],routingBasePath:i.routingBasePath}),t]})]})]})}));export function RedoclyOpenAPIDocs({onLoaded:e,children:o,store:t,withCommonStyles:i}){var n,r,s;return(null==t?void 0:t.definition)?_jsx(StoreProvider,Object.assign({},t,{children:_jsx(RedoclyOpenAPIDocsComponent,{onLoaded:e,basePath:null===(n=t.options)||void 0===n?void 0:n.routingBasePath,licenseKey:null===(r=t.options)||void 0===r?void 0:r.licenseKey,disableRouter:null===(s=t.options)||void 0===s?void 0:s.disableRouter,withCommonStyles:i,children:o})})):null}export function RedoclyOpenAPIDocsStandalone({definition:e,definitionUrl:o,options:t={},activeItemId:i,activeSampleLanguage:n,activeDeepLink:r}){return _jsx(AppProvider,{definition:e,definitionUrl:o,options:t,activeItemId:i,activeSampleLanguage:n,activeDeepLink:r,children:_jsx(RedoclyOpenAPIDocs,{withCommonStyles:!0})})}
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useRef,memo}from"react";import{SidebarLogo,GlobalStyle as ThemeCommonStyle,useMount,LayoutVariant,ThreePanelLayout}from"@redocly/theme";import{UnsupportedFeatureScreen}from"../UnsupportedFeatureScreen";import{AppProvider,StoreProvider}from"./Providers";import{Overlay}from"../Overlay";import{RedocWrap,CssFixes}from"./styled";import{StickyResponsiveSidebar}from"../StickySidebar";import{SideMenu}from"../SideMenu";import{Content}from"../Content";import{useContentItems,useUppercase2LowercaseRedirect}from"../../hooks";import{withRouter}from"../../hoc/withRouter";import{withStore}from"../../hoc/withStore";import{compose}from"../../utils";import{useLicense}from"../../hooks/useLicense";const RedoclyOpenAPIDocsComponent=compose(withRouter,withStore,memo)((({licenseKey:e,onLoaded:o,children:t,options:i,layout:n,collapsedSidebar:r,parser:s,withCommonStyles:a})=>{var l,d,c,m,u;const p=useRef(null),{isValid:v,licenseInfo:f}=useLicense(e);useUppercase2LowercaseRedirect(),useMount((()=>{null==o||o()}));const{hideSidebar:h,scrollYOffset:S}=i||{},{contentItems:y}=useContentItems({parser:s,options:i}),x=null===(d=null===(l=s.definition)||void 0===l?void 0:l.info)||void 0===d?void 0:d["x-logo"];return _jsxs(_Fragment,{children:[a&&_jsx(ThemeCommonStyle,{}),_jsxs(RedocWrap,{className:"redoc-wrap",ref:p,children:[_jsx(UnsupportedFeatureScreen,{}),!v&&_jsx(Overlay,{licenseInfo:f}),_jsx(CssFixes,{layout:n}),!h&&_jsxs(StickyResponsiveSidebar,{scrollYOffset:S,className:"menu-content",collapsedSidebar:!r,children:[_jsx(SidebarLogo,{imageUrl:null==x?void 0:x.url,href:(null==x?void 0:x.href)||(null===(u=null===(m=null===(c=s.definition)||void 0===c?void 0:c.info)||void 0===m?void 0:m.contact)||void 0===u?void 0:u.url),altText:null==x?void 0:x.altText,backgroundColor:null==x?void 0:x.backgroundColor}),_jsx(SideMenu,{items:v?y:[]})]}),_jsxs(ThreePanelLayout,{className:"api-content",id:"api-content",layout:n===LayoutVariant.THREE_PANEL?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED,collapsedSidebar:r,children:[_jsx(Content,{items:v?y:[],routingBasePath:i.routingBasePath}),t]})]})]})}));export function RedoclyOpenAPIDocs({onLoaded:e,children:o,store:t,withCommonStyles:i}){var n,r,s;return(null==t?void 0:t.definition)?_jsx(StoreProvider,Object.assign({},t,{children:_jsx(RedoclyOpenAPIDocsComponent,{onLoaded:e,basePath:null===(n=t.options)||void 0===n?void 0:n.routingBasePath,licenseKey:null===(r=t.options)||void 0===r?void 0:r.licenseKey,disableRouter:null===(s=t.options)||void 0===s?void 0:s.disableRouter,withCommonStyles:i,children:o})})):null}export function RedoclyOpenAPIDocsStandalone({definition:e,definitionUrl:o,options:t={},activeItemId:i,activeSampleLanguage:n,activeDeepLink:r}){return _jsx(AppProvider,{definition:e,definitionUrl:o,options:t,activeItemId:i,activeSampleLanguage:n,activeDeepLink:r,children:_jsx(RedoclyOpenAPIDocs,{withCommonStyles:!0})})}
|
|
2
2
|
//# sourceMappingURL=RedoclyOpenAPIDocs.js.map
|
|
@@ -1 +1,5 @@
|
|
|
1
|
+
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
2
|
+
import type { CssFixesProps } from './types';
|
|
1
3
|
export declare const RedocWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const getMarginFixesByName: (variableName: string) => FlattenSimpleInterpolation;
|
|
5
|
+
export declare const CssFixes: import("styled-components").GlobalStyleComponent<CssFixesProps, import("styled-components").DefaultTheme>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled
|
|
1
|
+
import{breakpoints,LayoutVariant}from"@redocly/theme";import styled,{createGlobalStyle,css}from"styled-components";import{SamplesMiddlePanel,SamplesPanel}from"../common";export const RedocWrap=styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
text-align: left;
|
|
@@ -18,5 +18,34 @@ import styled from"styled-components";export const RedocWrap=styled.div`
|
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
|
20
20
|
}
|
|
21
|
+
`;export const getMarginFixesByName=a=>css`
|
|
22
|
+
margin: 0 max(calc((100% - var(--panel-samples-width) - var(${a})) / 2), 0);
|
|
23
|
+
`;export const CssFixes=createGlobalStyle`
|
|
24
|
+
${SamplesPanel} {
|
|
25
|
+
${({layout:a})=>{if(a===LayoutVariant.STACKED)return css`
|
|
26
|
+
width: 100%;
|
|
27
|
+
padding-left: var(--panel-gap-horizontal);
|
|
28
|
+
`}}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${SamplesMiddlePanel} {
|
|
32
|
+
${({layout:a})=>a===LayoutVariant.THREE_PANEL?css`
|
|
33
|
+
margin: 0;
|
|
34
|
+
@media screen and (min-width: ${breakpoints.small}) {
|
|
35
|
+
${getMarginFixesByName("--layout-panel-schemas-small-max-width")};
|
|
36
|
+
}
|
|
37
|
+
@media screen and (min-width: ${breakpoints.medium}) {
|
|
38
|
+
max-width: var(--layout-panel-schemas-medium-max-width);
|
|
39
|
+
${getMarginFixesByName("--layout-panel-schemas-medium-max-width")};
|
|
40
|
+
}
|
|
41
|
+
@media screen and (min-width: ${breakpoints.large}) {
|
|
42
|
+
max-width: var(--layout-panel-schemas-large-max-width);
|
|
43
|
+
${getMarginFixesByName("--layout-panel-schemas-large-max-width")};
|
|
44
|
+
}
|
|
45
|
+
`:a===LayoutVariant.STACKED?css`
|
|
46
|
+
width: 100%;
|
|
47
|
+
padding-right: var(--panel-gap-horizontal);
|
|
48
|
+
`:void 0};
|
|
49
|
+
}
|
|
21
50
|
`;
|
|
22
51
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,r,t){return new(r||(r=Promise))((function(n,a){function i(e){try{l(t.next(e))}catch(e){a(e)}}function p(e){try{l(t.throw(e))}catch(e){a(e)}}function l(e){var o;e.done?n(e.value):(o=e.value,o instanceof r?o:new r((function(e){e(o)}))).then(i,p)}l((t=t.apply(e,o||[])).next())}))};import{jsx as _jsx}from"react/jsx-runtime";import{Suspense,memo,useEffect,useState,lazy}from"react";import styled from"styled-components";import{useAtomValue}from"jotai";import{convertOperationToReplayValue}from"./utils";import{globalOptionsAtom}from"../../jotai/store";import{operationStore}from"../../jotai/operation";import{appStore,environmentsAtom}from"../../jotai/app";
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,r,t){return new(r||(r=Promise))((function(n,a){function i(e){try{l(t.next(e))}catch(e){a(e)}}function p(e){try{l(t.throw(e))}catch(e){a(e)}}function l(e){var o;e.done?n(e.value):(o=e.value,o instanceof r?o:new r((function(e){e(o)}))).then(i,p)}l((t=t.apply(e,o||[])).next())}))};import{jsx as _jsx}from"react/jsx-runtime";import{Suspense,memo,useEffect,useState,lazy}from"react";import styled from"styled-components";import{useAtomValue}from"jotai";import{convertOperationToReplayValue}from"./utils";import{globalOptionsAtom}from"../../jotai/store";import{operationStore}from"../../jotai/operation";import{appStore,environmentsAtom}from"../../jotai/app";const EmbeddedReplayOrig=lazy((()=>__awaiter(void 0,void 0,void 0,(function*(){return import("@redocly/replay").then((e=>({default:e.EmbeddedReplay})))}))));function EmbeddedReplayComponent({operation:e,corsProxyUrl:o,fullOpenApi:r}){const{routingBasePath:t,mockServer:n}=useAtomValue(globalOptionsAtom),a=useAtomValue(operationStore(e.pointer)),i=useAtomValue(appStore),p=useAtomValue(environmentsAtom),[l,s]=useState(!1);return useEffect((()=>{s(!0)}),[]),_jsx(CompactWrapper,{children:l?_jsx(Suspense,{fallback:_jsx(LoadingWrapper,{children:"Loading..."}),children:_jsx(EmbeddedReplayOrig,{value:convertOperationToReplayValue(e,r,a,i),environment:i.environment,predefinedEnvValues:p,corsProxyUrl:o,operationUrl:t+e.href,mockServer:n,disableCollectionsTab:!0})}):_jsx(LoadingWrapper,{children:"Loading..."})})}export const EmbeddedReplay=memo(EmbeddedReplayComponent);const LoadingWrapper=styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,r){return new(t||(t=Promise))((function(a
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,r){return new(t||(t=Promise))((function(n,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var o;e.done?n(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(i,s)}l((r=r.apply(e,o||[])).next())}))};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Suspense,memo,useCallback,useState,useRef,lazy}from"react";import{Button,RocketIcon,CircleDashIcon,Portal,useFocusTrap,useModalScrollLock}from"@redocly/theme";import styled from"styled-components";import{useAtom,useAtomValue,useSetAtom}from"jotai";const ReplayOverlay=lazy((()=>__awaiter(void 0,void 0,void 0,(function*(){return import("@redocly/replay").then((e=>({default:e.ReplayOverlay})))}))));import{globalOptionsAtom,globalStoreAtom}from"../../jotai/store";import{replayStateAtom}from"../../jotai/replay";import{operationStore}from"../../jotai/operation";import{LOADING_STATE}from"../../constants";import{activeMimeNameAtom,unsupportedFeatureScreenAtom,environmentAtom}from"../../jotai/app";import{isMobile}from"../../utils";import{convertOperationToReplayValue}from"./utils";function ReplayComponent({operation:e,corsProxyUrl:o,fullOpenApi:t}){var r,n;const a=useRef(null),{routingBasePath:i,mockServer:s,oAuth2RedirectURI:l}=useAtomValue(globalOptionsAtom),{parser:m}=useAtomValue(globalStoreAtom),[c,p]=useState(!1),[u,d]=useAtom(replayStateAtom),[,A]=useAtom(unsupportedFeatureScreenAtom),v=useSetAtom(operationStore(e.pointer)),[f,y]=useAtom(activeMimeNameAtom),[[,S],h]=useAtom(environmentAtom);useFocusTrap(a),useModalScrollLock(c);const x=useCallback((({requestValues:e,activeExampleName:o,activeMimeName:t,environment:r,environments:n,activeSecuritySchemeIds:a})=>{v((t=>Object.assign(Object.assign({},t),{requestValues:e,activeExampleName:o,activeSecuritySchemeIds:a}))),y(t||f),h({environment:r,environments:n})}),[v,y,f,h]),_=()=>{isMobile({tablet:!0})?A(!0):(u!==LOADING_STATE.LOADING&&p(!c),u===LOADING_STATE.NOT_LOADED&&d(LOADING_STATE.LOADING))};return _jsxs(Wrapper,{children:[_jsx("span",{children:"Experience it firsthand in the API Explorer!"}),_jsx(Button,{onClick:_,variant:"primary",iconPosition:"left",icon:u===LOADING_STATE.LOADING?_jsx(CircleDashIcon,{}):_jsx(RocketIcon,{}),children:u===LOADING_STATE.LOADING?"Loading...":"Try it"}),c&&_jsx(Suspense,{children:_jsx(Portal,{mountId:"api-content",children:_jsx("div",{ref:a,children:_jsx(ReplayOverlay,{value:convertOperationToReplayValue(e,t),onRequestChange:x,onClose:_,corsProxyUrl:o,operationUrl:i+e.href,onLoad:()=>d(LOADING_STATE.LOADED),mockServer:s,environment:S,apiId:null===(n=null===(r=null==m?void 0:m.definition.info)||void 0===r?void 0:r["x-metadata"])||void 0===n?void 0:n.apiId,oAuth2RedirectURI:l,definitionUrl:null==m?void 0:m.definitionUrl,disableCollectionsTab:!0})})})})]})}export const Replay=memo(ReplayComponent);const Wrapper=styled.div`
|
|
2
2
|
display: flex;
|
|
3
|
-
justify-content:
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 10px;
|
|
4
6
|
border-top: var(--panel-border);
|
|
5
7
|
padding: var(--spacing-base) var(--spacing-md) var(--spacing-md);
|
|
8
|
+
|
|
9
|
+
& > span {
|
|
10
|
+
font-weight: var(--font-weight-regular);
|
|
11
|
+
color: var(--text-color-primary);
|
|
12
|
+
}
|
|
6
13
|
`;
|
|
7
14
|
//# sourceMappingURL=Replay.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{Row}from"../common";import{Title}from"../common/OperationItemTitle";import{LinkToField}from"../common/LinkToField";import{makeDeepLink}from"../../services";import{Description}from"../OperationItem/Description";import{Security}from"../Security";import{ExpandAllButton,useUpdateExpandedFields}from"../ExpandAllButton";import{RequestParameters}from"../RequestParameters";function RequestDetailsComponent({operation:{id:e,description:t,externalDocs:o,parameters:r,requestBody:i,pointer:s,security:n,extensions:
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{Row}from"../common";import{Title}from"../common/OperationItemTitle";import{LinkToField}from"../common/LinkToField";import{makeDeepLink}from"../../services";import{Description}from"../OperationItem/Description";import{Security}from"../Security";import{ExpandAllButton,useUpdateExpandedFields}from"../ExpandAllButton";import{RequestParameters}from"../RequestParameters";function RequestDetailsComponent({operation:{id:e,description:t,externalDocs:o,parameters:r,requestBody:i,pointer:s,security:n,extensions:m,callbackId:a},title:p}){return useUpdateExpandedFields("request",r,null==i?void 0:i.content,s),_jsxs(_Fragment,{children:[_jsx(Row,{children:_jsxs(HeadingWrapper,{children:[_jsxs(Title,{children:[e&&_jsx(LinkToField,{to:makeDeepLink(e,"request")}),p||"Request",_jsx(ExpandAllButton,{operationPointer:s,type:"request"})]}),_jsx(Description,{description:t||o?t:void 0,externalDocs:o,extensions:m}),_jsx(Security,{securities:n})]})}),_jsx(RequestParameters,{parameters:r,body:i,operationId:e,callbackId:a})]})}const HeadingWrapper=styled.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
`;export const RequestDetails=memo(RequestDetailsComponent);
|
|
4
4
|
//# sourceMappingURL=RequestDetails.js.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { TFunction } from '@redocly/theme';
|
|
2
1
|
import type { ReactNode } from 'react';
|
|
3
2
|
import type { OperationModel } from '../../models';
|
|
4
3
|
export interface RequestProps {
|
|
5
4
|
operation: Pick<OperationModel, 'security' | 'pointer' | 'description' | 'externalDocs' | 'extensions' | 'parameters' | 'requestBody' | 'id' | 'callbackId'>;
|
|
6
5
|
title?: string | ReactNode;
|
|
7
|
-
translate?: TFunction;
|
|
8
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{ParametersGroup}from"./ParametersGroup";import{Body}from"./Body";import{makeDeepLink}from"../../services";
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{ParametersGroup}from"./ParametersGroup";import{Body}from"./Body";import{makeDeepLink}from"../../services";const PARAM_PLACES=["path","query","cookie","header"],PARAM_NAMES_MAP={[PARAM_PLACES[0]]:"Path",[PARAM_PLACES[1]]:"Query",[PARAM_PLACES[2]]:"Cookies",[PARAM_PLACES[3]]:"Headers"};export function RequestParameters({body:e,parameters:r=[],operationId:t,callbackId:n}){if(!e&&!r.length)return null;const s=(e=>{const r={};return e.forEach((e=>{safePush(r,e.in,e)})),r})(r),a=r.length>0?PARAM_PLACES:[],{content:o,description:i,required:A}=e||{};return _jsxs(_Fragment,{children:[a.map((e=>_jsx(ParametersGroup,{title:PARAM_NAMES_MAP[e],parameters:s[e],deepLink:generateDeepLink(t,n,e)},e))),o&&_jsx(Body,{content:o,description:i,required:A,deepLink:generateDeepLink(t,n)})]})}function safePush(e,r="",t){e[r]||(e[r]=[]),e[r].push(t)}function generateDeepLink(e,r,t="body"){return makeDeepLink(e,""+(r?`${r}/request/${t}`:`request/${t}`))}
|
|
2
2
|
//# sourceMappingURL=RequestParameters.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useAtomValue}from"jotai";import{getCodeSample}from"../../services";import{globalStoreAtom}from"../../jotai/store";import{operationStore}from"../../jotai/operation";import{environmentAtom,getLangKey,languageAtom}from"../../jotai/app";
|
|
1
|
+
import{useAtomValue}from"jotai";import{getCodeSample}from"../../services";import{globalStoreAtom}from"../../jotai/store";import{operationStore}from"../../jotai/operation";import{environmentAtom,getLangKey,languageAtom}from"../../jotai/app";export function useCodeSamples({payload:e,isWebhook:a,definitionSamples:t,pointer:o}){var n;const{parser:r,options:{codeSamples:l,generatedSamplesMaxDepth:s}}=useAtomValue(globalStoreAtom),i=useAtomValue(operationStore(o)),{languages:g}=useAtomValue(languageAtom),[m]=useAtomValue(environmentAtom),p=new Map(null==g?void 0:g.map((({key:e,order:a})=>[e,a]))),u=t.filter((e=>p.has(getLangKey(e)))),d=new Set(u.map(getLangKey));let c=[];if(!a){c=createCodeSamples((null===(n=l.languages)||void 0===n?void 0:n.filter((({lang:e,label:a})=>"Payload"!==e&&!d.has(getLangKey({lang:e,label:a})))))||[],l,r.definition,s,i,m)}const b=[...u,...c];e&&p.has(e.lang.toLowerCase())&&b.push(Object.assign(Object.assign({},e),{order:p.get(e.lang.toLowerCase())}));const S=b.map((e=>{var a;const t=null!==(a=e.label)&&void 0!==a?a:e.lang;return Object.assign({key:getLangKey(e),title:t,order:"number"==typeof p.get(t.toLowerCase())?p.get(t.toLowerCase()):9999},e)})).sort(((e,a)=>e.order-a.order));return{samples:S}}function createCodeSamples(e,{skipOptionalParameters:a,withOAuth2Call:t},o,n,r,l){return e.map((({lang:e,label:s,options:i})=>({lang:e,label:s,get:s=>getCodeSample(Object.assign(Object.assign({},s),{lang:e,options:Object.assign(Object.assign({},i),{skipOptionalParameters:a,withOAuth2Call:t,spec:o,generatedPayloadSamplesMaxDepth:n,store:r}),environment:l}))})))}
|
|
2
2
|
//# sourceMappingURL=useCodeSamples.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{PanelHeader,PanelHeaderTitle}from"@redocly/theme";
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{PanelHeader,PanelHeaderTitle}from"@redocly/theme";export const Summary=({tabs:e})=>_jsxs(PanelHeader,{isExpandable:!1,children:[_jsx(PanelHeaderTitle,{"data-testid":"title",children:"Response"}),e]});
|
|
2
2
|
//# sourceMappingURL=Summary.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import{useLocation}from"react-router-dom";import styled from"styled-components";import{Tabs,useTabsState}from"../Tabs";import{ResponseDetails}from"./ResponseDetails";import{makeDeepLink}from"../../services";import{Row,StyledTitle}from"./styled";import{LinkToField}from"../common/LinkToField";import{pathIncludesLink}from"../../utils";import{ExpandAllButton}from"../ExpandAllButton";
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import{useLocation}from"react-router-dom";import styled from"styled-components";import{Tabs,useTabsState}from"../Tabs";import{ResponseDetails}from"./ResponseDetails";import{makeDeepLink}from"../../services";import{Row,StyledTitle}from"./styled";import{LinkToField}from"../common/LinkToField";import{pathIncludesLink}from"../../utils";import{ExpandAllButton}from"../ExpandAllButton";export const OperationResponseList=memo((({responses:e,renderTitle:o,operationId:t,operationPointer:s,activeResponseTab:n,onTabChange:a,callbackId:i})=>{const r=useLocation(),l=e.map((({code:e})=>({key:e,title:e}))),p=l.find((({key:e})=>e===n||pathIncludesLink(r,t)&&pathIncludesLink(r,`c=${e}`))),{activeTab:m,handleTabChange:d}=useTabsState({tabs:l,defaultTab:null==p?void 0:p.key,onChange:a}),c=l.find((e=>e.key===(n||m)));return c?_jsxs(_Fragment,{children:[_jsxs(TitleWrap,{children:[(null==o?void 0:o(c))||_jsxs(StyledTitle,{children:[_jsx(LinkToField,{to:makeDeepLink(t,`response&c=${c.key}`)}),"Responses"]}),_jsx(Tabs,{tabs:l,activeTab:c,onChange:d}),_jsx(ExpandAllButton,{type:"response",operationPointer:s})]}),e.map((e=>e.code===c.key?_jsx("div",{children:_jsx(ResponseDetails,{response:e,operationId:t,operationPointer:s,callbackId:i})},e.code):null))]}):null}));const TitleWrap=styled(Row)`
|
|
2
2
|
flex-wrap: wrap;
|
|
3
3
|
gap: var(--spacing-unit);
|
|
4
4
|
`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{HeadersCaption,StyledHeadersProperties}from"./styled";import{PropertyDetails}from"../PropertyDetails";import{LinkToField}from"../common/LinkToField";
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{HeadersCaption,StyledHeadersProperties}from"./styled";import{PropertyDetails}from"../PropertyDetails";import{LinkToField}from"../common/LinkToField";function ResponseHeadersComponent({headers:e,deepLink:s}){return void 0===e||0===e.length?null:_jsxs(StyledHeadersProperties,{children:[_jsxs(HeadersCaption,{children:[s&&_jsx(LinkToField,{to:s}),"Headers"]}),e.map(((e,r)=>_jsx(PropertyDetails,{isFirst:0===r,field:e,disableDeepLinks:!s},e.name)))]})}export const ResponseHeaders=memo(ResponseHeadersComponent);
|
|
2
2
|
//# sourceMappingURL=ResponseHeaders.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{Markdown as MarkdownWrapper,Panel}from"@redocly/theme";import{useAtomValue}from"jotai";import{DownloadSpecification}from"../Download";import{Overview}from"../Overview";import{LanguageList}from"../Language";import{ServerList}from"../ServerList";import{globalStoreAtom}from"../../jotai/store";import{normalizeServers}from"../../utils";import{mergeInMockServer}from"../../models/operation";import{languageAtom}from"../../jotai/app";
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{Markdown as MarkdownWrapper,Panel}from"@redocly/theme";import{useAtomValue}from"jotai";import{DownloadSpecification}from"../Download";import{Overview}from"../Overview";import{LanguageList}from"../Language";import{ServerList}from"../ServerList";import{globalStoreAtom}from"../../jotai/store";import{normalizeServers}from"../../utils";import{mergeInMockServer}from"../../models/operation";import{languageAtom}from"../../jotai/app";export const RightPanel=({item:{infoDefinition:e}})=>{const{options:{hideDownloadButtons:r,mockServer:a},parser:{definition:o,definitionUrl:n}}=useAtomValue(globalStoreAtom),{languages:i,activeLanguage:s}=useAtomValue(languageAtom),t=normalizeServers(n,mergeInMockServer(o.servers||[],a));return _jsxs(_Fragment,{children:[!r&&_jsx(Panel,{className:"panel-download",header:"Download OpenAPI description",isExpandable:!1,children:_jsx(DownloadSpecification,{})}),((null==e?void 0:e.license)||(null==e?void 0:e.contact)||(null==e?void 0:e.termsOfService))&&_jsx(Panel,{className:"panel-overview",header:"Overview",isExpandable:!1,children:_jsx(MarkdownWrapper,{children:_jsx(Overview,{info:e})})}),!!(null==i?void 0:i.length)&&_jsx(Panel,{className:"panel-language-list",header:"Languages",isExpandable:!1,children:_jsx(LanguageList,{languages:i,activeLanguage:s})}),!!t.length&&_jsx(Panel,{className:"panel-servers-list",header:"Servers",isExpandable:!1,children:_jsx(ServerList,{servers:t,path:"/"})})]})};
|
|
2
2
|
//# sourceMappingURL=RightPanel.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{useAtomValue}from"jotai";import{PropertiesTableCaption}from"../common";import{Discriminator}from"../Discriminator";import{globalOptionsAtom}from"../../jotai/store";import{PropertyDetails}from"../PropertyDetails";import{SubSchema}from"./SubSchema";import{getExpandByDefault}from"./helpers";
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{useAtomValue}from"jotai";import{PropertiesTableCaption}from"../common";import{Discriminator}from"../Discriminator";import{globalOptionsAtom}from"../../jotai/store";import{PropertyDetails}from"../PropertyDetails";import{SubSchema}from"./SubSchema";import{getExpandByDefault}from"./helpers";function ObjectSchemaComponent({schema:e,showTitle:i,discriminator:t,level:r,skipWriteOnly:a,skipReadOnly:o,fieldParentsName:n,expandable:m,deepLink:s,required:l,disableDeepLinks:p,oneOfLevel:c}){const{fields:d=[],title:h}=e,{schemasExpansionLevel:f}=useAtomValue(globalOptionsAtom),x=o||a?d.filter((e=>!(o&&e.schema.readOnly||a&&e.schema.writeOnly))):d,u=getExpandByDefault({required:l,level:r,schemasExpansionLevel:f});return _jsx(SubSchema,{expandable:m,expandByDefault:u,level:r,propertyLength:x.length,deepLink:s,operationPointer:e.operationPointer,children:_jsxs(_Fragment,{children:[i&&_jsx(PropertiesTableCaption,{children:h}),x.map(((e,m)=>_jsx(PropertyDetails,{isFirst:0===m,field:e,fieldParentsName:Number(r)>1?n:[],renderDiscriminatorSwitch:(null==t?void 0:t.fieldName)===e.name&&(null==t?void 0:t.parentSchema)?()=>_jsx(Discriminator,{parent:t.parentSchema,onChange:null==t?void 0:t.onChange,activeOneOfIdx:t.activeOneOfIdx}):void 0,skipReadOnly:o,skipWriteOnly:a,showTitle:i,level:r,disableDeepLinks:p,oneOfLevel:c},e.name)))]})})}export const ObjectSchema=memo(ObjectSchemaComponent);
|
|
2
2
|
//# sourceMappingURL=ObjectSchema.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __rest=this&&this.__rest||function(e,t){var o={};for(var
|
|
1
|
+
var __rest=this&&this.__rest||function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import{useAtom}from"jotai";import styled from"styled-components";import{StyledBadge,SelectionTitle}from"../common";import{Markdown}from"../Markdown";import{ConstraintsView}from"../common/ConstraintsView";import{Schema}from"./Schema";import{operationStore}from"../../jotai/operation";import{SchemaSelection}from"../common/SchemaSelection";import{useOneOfLocationIdx}from"./useOneOfLocationIdx";function OneOfSchemaComponent(e){var{schema:{oneOf:t},schema:o,oneOfLevel:n=1}=e,r=__rest(e,["schema","schema","oneOfLevel"]);const[i]=useAtom(operationStore(o.operationPointer)),s=useOneOfLocationIdx(t,n),a=-1===s?0:s,c=t[void 0!==i.activeOneOf[o.pointer]?i.activeOneOf[o.pointer]:a];if(!c)return null;const m=t.map(((e,t)=>({label:e.title||e.typePrefix+e.displayType,value:t})));return _jsxs(Wrapper,{children:[_jsxs(SelectionTitle,{children:[o.oneOfType,":"]}),_jsx(SchemaSelection,{options:m,pointer:o.operationPointer,schema:o,defaultOneOfIdx:a}),c.deprecated&&_jsx(StyledBadge,{deprecated:!0,children:"Deprecated"}),c.description&&_jsx(StyledDescription,{source:c.description}),_jsx(ConstraintsView,{constraints:c.constraints}),_jsx(Schema,Object.assign({},r,{schema:c,oneOfLevel:n+1}))]})}export const OneOfSchema=memo(OneOfSchemaComponent);const StyledDescription=styled(Markdown)`
|
|
2
2
|
margin-top: var(--spacing-xs);
|
|
3
3
|
font-size: var(--font-size-base);
|
|
4
4
|
line-height: var(--line-height-base);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{RecursiveLabel,TypeName,TypeTitle}from"../common";
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{RecursiveLabel,TypeName,TypeTitle}from"../common";function RecursiveSchemaComponent({schema:e}){return _jsxs("div",{children:[_jsx(TypeName,{children:e.displayType}),e.title&&_jsxs(TypeTitle,{children:[" ",e.title," "]}),_jsx(RecursiveLabel,{children:" Recursive "})]})}export const RecursiveSchema=memo(RecursiveSchemaComponent);
|
|
2
2
|
//# sourceMappingURL=RecursiveSchema.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import{useLocation}from"react-router-dom";import{useAtom}from"jotai/index";import{useMount}from"@redocly/theme";import{pathIncludesLink}from"../../utils";import{operationStore}from"../../jotai/operation";import{extractTypeFromDeepLink}from"./helpers";import{ViewNested}from"../ViewNested";
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import{useLocation}from"react-router-dom";import{useAtom}from"jotai/index";import{useMount}from"@redocly/theme";import{pathIncludesLink}from"../../utils";import{operationStore}from"../../jotai/operation";import{extractTypeFromDeepLink}from"./helpers";import{ViewNested}from"../ViewNested";function SubSchemaComponent({expandByDefault:e,deepLink:o,level:t,expandable:r=!1,isArray:n="",propertyLength:i="",children:a,operationPointer:p}){var m;const s=useLocation(),d=pathIncludesLink(s,o),u=extractTypeFromDeepLink(o),[c,l]=useAtom(operationStore(p)),x=null===(m=c[u])||void 0===m?void 0:m.expandedFields[o||""],f=e=>{u&&o&&l((t=>{var r;return Object.assign(Object.assign({},t),{[u]:{expandedFields:Object.assign(Object.assign({},(null===(r=t[u])||void 0===r?void 0:r.expandedFields)||{}),{[o]:e})}})}))};useMount((()=>{r&&(e||d)&&f(!0)}));const h=`Show ${1===Number(i)?"":i} ${n&&"array "}${1!==i?"properties":"property"}`;return _jsx(ViewNested,{expandByDefault:e||d,isExpandedFromParent:x,level:t,expandable:r,onChange:()=>{f(!x)},expandText:h,children:a})}export const SubSchema=memo(SubSchemaComponent);
|
|
2
2
|
//# sourceMappingURL=SubSchema.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaProps } from './types';
|
|
2
2
|
export declare const extractTypeFromDeepLink: (str?: string) => string;
|
|
3
|
-
export declare function getExpandByDefault(
|
|
3
|
+
export declare function getExpandByDefault(options: Pick<SchemaProps, 'level' | 'required'> & {
|
|
4
4
|
schemasExpansionLevel?: number;
|
|
5
5
|
}): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export const extractTypeFromDeepLink=e=>{if(!e)return"";const r=e.match(/t=(request|response)/);return r?r[1]:""};export function getExpandByDefault(e){return void 0!==e.schemasExpansionLevel?e.schemasExpansionLevel>=Number(e.level)-1:!!e.required}
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{Markdown}from"../Markdown";import{SecuritySchemeItem}from"./SecuritySchemeItem";import{StyledLink,Tag}from"./styled";
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{Markdown}from"../Markdown";import{SecuritySchemeItem}from"./SecuritySchemeItem";import{StyledLink,Tag}from"./styled";function OAuthFlowComponent({flow:e}){const t=Object.keys((null==e?void 0:e.scopes)||{});return _jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:"Authorization URL:",value:(null==e?void 0:e.authorizationUrl)&&_jsx(StyledLink,{target:"_blank",rel:"noopener noreferrer",href:null==e?void 0:e.authorizationUrl,children:null==e?void 0:e.authorizationUrl})}),_jsx(SecuritySchemeItem,{label:"Token URL:",value:null==e?void 0:e.tokenUrl}),_jsx(SecuritySchemeItem,{label:"Refresh URL:",value:null==e?void 0:e.refreshUrl}),t.length&&_jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:"Scopes",value:" "}),t.map((t=>_jsx(SecuritySchemeItem,{label:_jsx(StyledTag,{className:"tag-grey",children:t}),value:_jsx(Markdown,{source:(null==e?void 0:e.scopes[t])||""})},t)))]})||null]})}const StyledTag=styled(Tag)`
|
|
2
2
|
margin-left: var(--spacing-xs);
|
|
3
3
|
`;export const OAuthFlow=memo(OAuthFlowComponent);
|
|
4
4
|
//# sourceMappingURL=OAuthFlow.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import styled from"styled-components";import{SecuritySchemeItem}from"./SecuritySchemeItem";import{titleize}from"../../utils";import{OAuthFlow}from"./OAuthFlow";import{StyledLink,Tag}from"./styled";import{Markdown}from"../Markdown";import{getRequiredScopes}from"./helper";
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import styled from"styled-components";import{SecuritySchemeItem}from"./SecuritySchemeItem";import{titleize}from"../../utils";import{OAuthFlow}from"./OAuthFlow";import{StyledLink,Tag}from"./styled";import{Markdown}from"../Markdown";import{getRequiredScopes}from"./helper";export function SecurityFlow({type:e,bearerFormat:r,name:t,flows:a,openIdConnectUrl:i,description:s,id:o,securities:l,in:n}){if(!e||!o)return null;const m=getRequiredScopes(o,l),c={http:_jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:"HTTP Authorization Scheme",value:e}),_jsx(SecuritySchemeItem,{label:"Bearer Format",value:r})]}),apiKey:_jsx(SecuritySchemeItem,{label:`${titleize(n||"")} parameter name:`,value:t}),oauth2:_jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:"Flow type:",value:e}),a&&Object.keys(a).map((e=>_jsx(OAuthFlow,{flow:a[e]},e)))]}),openIdConnect:_jsx(SecuritySchemeItem,{label:"Connect URL:",value:i&&_jsx(StyledLink,{target:"_blank",rel:"noopener noreferrer",href:i,children:i})})};return _jsxs(Wrapper,{children:[_jsx(TitleSchema,{children:o}),_jsx(Markdown,{source:s}),_jsxs(List,{children:[c[e]||null,_jsx(SecuritySchemeItem,{label:"Required scopes",value:m.length&&_jsx(Row,{children:m.map((e=>_jsx(Tag,{className:"tag-grey",children:e},e)))})})]})]})}const Wrapper=styled.div`
|
|
2
2
|
background: var(--layer-color);
|
|
3
3
|
padding: var(--spacing-base);
|
|
4
4
|
border-radius: var(--border-radius);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment,useState,useRef}from"react";import styled from"styled-components";import{useOutsideClick,Typography,CloseIcon,SecurityIcon,Segmented,Button,useFocusTrap}from"@redocly/theme";import{SecurityFlow}from"./SecurityFlow";import{Divider}from"./Divider";
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment,useState,useRef}from"react";import styled from"styled-components";import{useOutsideClick,Typography,CloseIcon,SecurityIcon,Segmented,Button,useFocusTrap}from"@redocly/theme";import{SecurityFlow}from"./SecurityFlow";import{Divider}from"./Divider";export function SecurityModal({securities:e,onClose:t}){const[s,i]=useState(0),o=useRef(null),{schemes:r}=e[s]||{};useOutsideClick(o,t),useFocusTrap(o);const a=e.map((({schemes:e},t)=>({label:e.map((({id:e})=>e)).join(" and "),value:t})));return _jsx(StyledBackground,{children:_jsxs(Wrapper,{ref:o,tabIndex:0,children:[_jsx(Close,{onClick:t,"data-testid":"close",variant:"ghost",icon:_jsx(CloseIcon,{})}),_jsxs(Title,{children:[_jsx(SecurityIcon,{size:"24px"}),"Security"]}),_jsx(Segmented,{value:s,onChange:({value:e})=>i(e),options:a}),r.map(((t,s)=>_jsxs(Fragment,{children:[_jsx(SecurityFlow,Object.assign({},t,{securities:e})),s!==r.length-1&&_jsx(Divider,{label:"and"})]},t.id)))]})})}const Wrapper=styled.div`
|
|
2
2
|
background: var(--bg-color);
|
|
3
3
|
box-shadow: var(--bg-raised-shadow);
|
|
4
4
|
border-radius: var(--border-radius-lg);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { ServerListProps } from './types';
|
|
3
|
-
export declare const ServerList: ({ servers, path
|
|
3
|
+
export declare const ServerList: ({ servers, path }: ServerListProps) => ReactElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{CopyButton}from"@redocly/theme";import styled from"styled-components";import{PanelItemDescription,Title}from"../PanelItem";import{ViewNested}from"../ViewNested";import{Tag}from"../common";import{Markdown}from"../Markdown";export const ServerList=({servers:e,path:r
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{CopyButton}from"@redocly/theme";import styled from"styled-components";import{PanelItemDescription,Title}from"../PanelItem";import{ViewNested}from"../ViewNested";import{Tag}from"../common";import{Markdown}from"../Markdown";export const ServerList=({servers:e,path:r})=>_jsx(ItemsList,{children:e.map((e=>{const i=e.url+r,a=Object.keys(e.variables||{}).length,t=`${1===Number(a)?"":a} ${1!==a?"variables":"variable"}`;return _jsxs("div",{children:[_jsx(PanelItemDescription,{children:e.description}),_jsxs(TitleWrap,{children:[_jsx(Title,{suppressHydrationWarning:!0,children:i}),_jsx(CopyButton,{data:i},i)]}),e.variables&&_jsx(ViewNested,{expandText:`Show ${t}`,hideText:`Hide ${t}`,expandByDefault:!1,expandable:!0,hideDivider:!0,children:_jsx(ServerVariablesContainer,{children:Object.entries(e.variables||{}).map((([e,r])=>_jsxs(ServerVariableContainer,{children:[_jsx(ServerVariableName,{children:e}),_jsxs(Variable,{children:["Default ",_jsx(StyledTag,{children:r.default})]}),_jsx(Description,{source:r.description}),r.enum&&_jsxs(Variable,{children:["Enum",_jsx(TagWrapper,{children:r.enum.map((e=>_jsx(StyledTag,{children:e},e)))})]})]},e)))})})]},e.url)}))});const ItemsList=styled.div`
|
|
2
2
|
& > div {
|
|
3
3
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
4
4
|
margin-bottom: var(--spacing-xs);
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import type { TFunction } from '@redocly/theme';
|
|
2
1
|
import type { OperationModel } from '../../models';
|
|
3
|
-
export type ServerListProps = Pick<OperationModel, 'servers' | 'path'
|
|
4
|
-
translate: TFunction;
|
|
5
|
-
};
|
|
2
|
+
export type ServerListProps = Pick<OperationModel, 'servers' | 'path'>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo,useCallback}from"react";import{Dropdown,DropdownMenu}from"@redocly/theme";import{useAtom}from"jotai";import{HttpVerb}from"../common";import{PathWrapper,Path,StyledCopyButton,StyledDropdownMenuItem}from"./styled";import{PanelItem}from"../PanelItem";import{joinWithSeparator}from"../../services";import{replaceVariables}from"../../utils";import{environmentAtom}from"../../jotai/app";import{useActiveWithFallback}from"../../hooks";import{getServerEnvName}from"../../utils/environments";export const ServerListDropdown=({operation:e,className:r})=>{const[[t],o]=useAtom(environmentAtom),
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo,useCallback}from"react";import{Dropdown,DropdownMenu}from"@redocly/theme";import{useAtom}from"jotai";import{HttpVerb}from"../common";import{PathWrapper,Path,StyledCopyButton,StyledDropdownMenuItem}from"./styled";import{PanelItem}from"../PanelItem";import{joinWithSeparator}from"../../services";import{replaceVariables}from"../../utils";import{environmentAtom}from"../../jotai/app";import{useActiveWithFallback}from"../../hooks";import{getServerEnvName}from"../../utils/environments";export const ServerListDropdown=({operation:e,className:r})=>{const[[t],o]=useAtom(environmentAtom),a=useActiveWithFallback(e.servers.map((e=>Object.assign(Object.assign({},e),{key:e.url}))),t.server),s=useCallback((e=>{e.stopPropagation()}),[]),n=useCallback((r=>()=>{1!==e.servers.length&&o({environment:getServerEnvName(r)})}),[e.servers.length,o]),i=useMemo((()=>e.servers.map((r=>{const t=replaceVariables(r),o=joinWithSeparator(t,e.path);return _jsx(StyledDropdownMenuItem,{onAction:n(r),children:_jsx(PanelItem,{header:r.description,title:replaceVariables(r),actions:[_jsx(StyledCopyButton,{data:o,toasterPlacement:"left",onCopyClick:s},o)],active:r.url===a,withCheckmark:!0})},o)}))),[e.servers,e.path,n,s,a]);return _jsx(Dropdown,{className:r,trigger:_jsxs(PathWrapper,{variant:"ghost",children:[_jsx(HttpVerb,{color:e.httpVerb,children:e.httpVerb}),_jsx(Path,{children:e.path})]}),withArrow:!0,children:_jsx(DropdownMenu,{children:i})})};
|
|
2
2
|
//# sourceMappingURL=ServerListDropdown.js.map
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { OperationMenuItem } from '../../models';
|
|
3
|
+
type OperationsNavigationProps = {
|
|
4
|
+
items: OperationMenuItem[];
|
|
5
|
+
routingBasePath: string;
|
|
6
|
+
};
|
|
3
7
|
export declare function OperationsNavigationComponent({ items, routingBasePath, }: OperationsNavigationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
8
|
export declare const OperationsNavigation: import("react").NamedExoticComponent<OperationsNavigationProps>;
|
|
9
|
+
export {};
|