@redocly/openapi-docs 3.10.0-next.7 → 3.10.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/redocly-openapi-docs.min.js +753 -738
- package/lib/components/Security/OAuthFlow.js +1 -3
- package/lib/components/Security/OAuthScopes.d.ts +13 -0
- package/lib/components/Security/OAuthScopes.js +34 -0
- package/lib/components/Security/SecurityButton.js +22 -19
- package/lib/components/Security/SecurityFlow.js +1 -6
- package/lib/components/Security/SecuritySchemeItem.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib-esm/components/Security/OAuthFlow.js +1 -3
- package/lib-esm/components/Security/OAuthScopes.d.ts +13 -0
- package/lib-esm/components/Security/OAuthScopes.js +34 -0
- package/lib-esm/components/Security/SecurityButton.js +22 -19
- package/lib-esm/components/Security/SecurityFlow.js +1 -6
- package/lib-esm/components/Security/SecuritySchemeItem.js +1 -1
- package/lib-esm/index.d.ts +1 -0
- package/lib-esm/index.js +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
margin-left: var(--spacing-xs);
|
|
3
|
-
`;exports.OAuthFlow=(0,react_1.memo)(OAuthFlowComponent);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OAuthFlow=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),SecuritySchemeItem_1=require("./SecuritySchemeItem"),styled_1=require("./styled"),hooks_1=require("../../hooks");function OAuthFlowComponent({flow:e}){const r=(0,hooks_1.useTranslate)();return(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:`${r("openapi.authorizationUrl","Authorization URL")}:`,value:(null==e?void 0:e.authorizationUrl)&&(0,jsx_runtime_1.jsx)(styled_1.StyledLink,{target:"_blank",rel:"noopener noreferrer",href:null==e?void 0:e.authorizationUrl,children:null==e?void 0:e.authorizationUrl})}),(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:`${r("openapi.tokenUrl","Token URL")}:`,value:null==e?void 0:e.tokenUrl}),(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:`${r("openapi.refreshUrl","Refresh URL")}:`,value:null==e?void 0:e.refreshUrl})]})}exports.OAuthFlow=(0,react_1.memo)(OAuthFlowComponent);
|
|
4
2
|
//# sourceMappingURL=OAuthFlow.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { OpenAPISecurityScheme } from '../../types';
|
|
3
|
+
import type { SecurityRequirement } from '../../models';
|
|
4
|
+
export interface OAuthOptionalScopesProps {
|
|
5
|
+
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
|
|
6
|
+
}
|
|
7
|
+
export interface OAuthRequiredScopesProps {
|
|
8
|
+
id: string;
|
|
9
|
+
securities: SecurityRequirement[];
|
|
10
|
+
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
|
|
11
|
+
}
|
|
12
|
+
export declare const OAuthOptionalScopes: import("react").NamedExoticComponent<PropsWithChildren<OAuthOptionalScopesProps>>;
|
|
13
|
+
export declare const OAuthRequiredScopes: import("react").NamedExoticComponent<PropsWithChildren<OAuthRequiredScopesProps>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.OAuthRequiredScopes=exports.OAuthOptionalScopes=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),theme_1=require("@redocly/theme"),Markdown_1=require("../Markdown"),SecuritySchemeItem_1=require("./SecuritySchemeItem"),styled_1=require("./styled"),hooks_1=require("../../hooks"),helper_1=require("./helper");function OAuthOptionalScopesComponent({flow:e}){const t=Object.keys((null==e?void 0:e.scopes)||{}),r=(0,hooks_1.useTranslate)(),[s,o]=(0,react_1.useState)(!1);if(!t.length)return null;return(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:(0,jsx_runtime_1.jsxs)(ScopeHeader,{onClick:()=>{o((e=>!e))},children:[r(s?"openapi.hideOptionalScopes":"openapi.showOptionalScopes",s?"Hide optional scopes":"Show optional scopes"),(0,jsx_runtime_1.jsx)(AnimatedChevronWrapper,{isOpen:s,children:(0,jsx_runtime_1.jsx)(theme_1.ChevronRightIcon,{size:"var(--font-size-base)",color:"var(--tree-content-color-default)"})})]}),value:" "}),(0,jsx_runtime_1.jsx)(ScopesListWrapper,{isOpen:s,children:t.map((t=>(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:(0,jsx_runtime_1.jsx)(StyledTag,{className:"tag-grey",children:t}),value:(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:(null==e?void 0:e.scopes[t])||""})},t)))})]})}function OAuthRequiredScopesComponent({id:e,securities:t,flow:r}){const s=(0,helper_1.getRequiredScopes)(e,t),o=(0,hooks_1.useTranslate)();return s.length?(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:o("openapi.requiredScopes","Required scopes"),value:" "}),(0,jsx_runtime_1.jsx)(Row,{children:s.map((e=>(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:(0,jsx_runtime_1.jsx)(StyledTag,{className:"tag-grey",children:e}),value:(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:(null==r?void 0:r.scopes[e])||""})},e)))})]}):null}const StyledTag=(0,styled_components_1.default)(styled_1.Tag)`
|
|
2
|
+
font-family: var(--font-family-base);
|
|
3
|
+
font-size: var(--font-size-base);
|
|
4
|
+
line-height: var(--line-height-base);
|
|
5
|
+
align-self: flex-start;
|
|
6
|
+
padding: 0 var(--spacing-xs);
|
|
7
|
+
border: var(--tag-border-width) var(--tag-border-style) var(--tag-bg-color);
|
|
8
|
+
border-radius: var(--tag-border-radius);
|
|
9
|
+
`,ScopeHeader=styled_components_1.default.div`
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: var(--spacing-xxs);
|
|
13
|
+
align-items: center;
|
|
14
|
+
user-select: none;
|
|
15
|
+
`,Row=styled_components_1.default.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
gap: var(--spacing-xxs);
|
|
19
|
+
word-break: normal;
|
|
20
|
+
`,ScopesListWrapper=styled_components_1.default.div`
|
|
21
|
+
max-height: ${e=>e.isOpen?"1000px":"0"};
|
|
22
|
+
opacity: ${e=>e.isOpen?"1":"0"};
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
transition:
|
|
25
|
+
max-height 0.5s ease-in-out,
|
|
26
|
+
opacity 0.5s ease-in-out;
|
|
27
|
+
`,AnimatedChevronWrapper=styled_components_1.default.span`
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
transform: ${e=>e.isOpen?"rotate(90deg)":"rotate(0deg)"};
|
|
32
|
+
transition: transform 0.5s ease-in-out;
|
|
33
|
+
`;exports.OAuthOptionalScopes=(0,react_1.memo)(OAuthOptionalScopesComponent),exports.OAuthRequiredScopes=(0,react_1.memo)(OAuthRequiredScopesComponent);
|
|
34
|
+
//# sourceMappingURL=OAuthScopes.js.map
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SecurityButton=SecurityButton;const jsx_runtime_1=require("react/jsx-runtime"),styled_components_1=__importDefault(require("styled-components")),theme_1=require("@redocly/theme");function SecurityButton({securities:e,onClick:t}){return(0,jsx_runtime_1.
|
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SecurityButton=SecurityButton;const jsx_runtime_1=require("react/jsx-runtime"),styled_components_1=__importDefault(require("styled-components")),theme_1=require("@redocly/theme"),react_1=require("react"),hooks_1=require("../../hooks");function SecurityButton({securities:e,onClick:t}){const r=(0,hooks_1.useTranslate)();return(0,jsx_runtime_1.jsx)(SecurityPanel,{header:()=>(0,jsx_runtime_1.jsxs)(SecurityHeader,{children:[(0,jsx_runtime_1.jsx)(theme_1.SecurityIcon,{}),(0,jsx_runtime_1.jsx)(Title,{children:"Security"}),(0,jsx_runtime_1.jsx)(ViewDetailsButton,{onClick:t,variant:"link",children:r("openapi.viewDetails","View details")})]}),isExpandable:!1,children:(0,jsx_runtime_1.jsx)(SecurityList,{children:e.map(((t,r)=>{const n=e.length>1&&t.schemes.length>1,i=t.schemes.map((({id:e},r)=>(0,jsx_runtime_1.jsxs)(react_1.Fragment,{children:[e,r<t.schemes.length-1&&(0,jsx_runtime_1.jsx)(Conjunction,{children:" and "})]},e)));return(0,jsx_runtime_1.jsxs)(react_1.Fragment,{children:[n?"(":"",i,n?")":"",r<e.length-1&&(0,jsx_runtime_1.jsx)(Conjunction,{children:" or "})]},r)}))})})}const SecurityPanel=(0,styled_components_1.default)(theme_1.Panel)`
|
|
2
|
+
margin-top: var(--spacing-base);
|
|
3
|
+
border: var(--panel-border);
|
|
4
|
+
border-radius: var(--panel-border-radius);
|
|
5
|
+
`,SecurityHeader=styled_components_1.default.div`
|
|
2
6
|
display: flex;
|
|
3
7
|
align-items: center;
|
|
4
|
-
|
|
5
|
-
gap: var(--spacing-
|
|
6
|
-
min-height: 32px;
|
|
7
|
-
background: var(--color-info-bg);
|
|
8
|
-
padding: 0 var(--spacing-xs);
|
|
9
|
-
margin-top: var(--spacing-base);
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
gap: var(--spacing-xs);
|
|
10
10
|
color: var(--link-color-primary);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
12
|
+
background-color: var(--layer-color);
|
|
13
|
+
border-bottom: var(--panel-border);
|
|
14
|
+
border-radius: var(--panel-border-radius) var(--panel-border-radius) 0 0;
|
|
15
|
+
`,ViewDetailsButton=(0,styled_components_1.default)(theme_1.Button)`
|
|
16
|
+
margin-left: auto;
|
|
17
|
+
font-size: var(--font-size-sm);
|
|
17
18
|
`,Title=styled_components_1.default.span`
|
|
18
|
-
font-family: var(--font-family-
|
|
19
|
-
font-weight: var(--font-weight-
|
|
20
|
-
|
|
21
|
-
`,SecurityList=styled_components_1.default.
|
|
19
|
+
font-family: var(--font-family-base);
|
|
20
|
+
font-weight: var(--font-weight-medium);
|
|
21
|
+
color: var(--text-color-primary);
|
|
22
|
+
`,SecurityList=styled_components_1.default.div`
|
|
22
23
|
flex: 1;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
white-space: nowrap;
|
|
25
24
|
text-overflow: ellipsis;
|
|
26
25
|
overflow: hidden;
|
|
26
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
27
|
+
color: var(--text-color-primary);
|
|
28
|
+
`,Conjunction=styled_components_1.default.span`
|
|
29
|
+
color: var(--text-color-description);
|
|
27
30
|
`;
|
|
28
31
|
//# sourceMappingURL=SecurityButton.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SecurityFlow=SecurityFlow;const jsx_runtime_1=require("react/jsx-runtime"),styled_components_1=__importDefault(require("styled-components")),SecuritySchemeItem_1=require("./SecuritySchemeItem"),utils_1=require("../../utils"),OAuthFlow_1=require("./OAuthFlow"),styled_1=require("./styled"),Markdown_1=require("../Markdown"),
|
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SecurityFlow=SecurityFlow;const jsx_runtime_1=require("react/jsx-runtime"),styled_components_1=__importDefault(require("styled-components")),SecuritySchemeItem_1=require("./SecuritySchemeItem"),utils_1=require("../../utils"),OAuthFlow_1=require("./OAuthFlow"),styled_1=require("./styled"),Markdown_1=require("../Markdown"),hooks_1=require("../../hooks"),OAuthScopes_1=require("./OAuthScopes");function SecurityFlow({type:e,bearerFormat:t,name:r,flows:i,openIdConnectUrl:s,description:n,id:o,securities:u,in:a}){const c=(0,hooks_1.useTranslate)();if(!e||!o)return null;const l={http:(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:c("openapi.httpAuthorizationScheme","HTTP Authorization Scheme"),value:e}),(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:c("openapi.bearerFormat","Bearer Format"),value:t})]}),apiKey:(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:`${(0,utils_1.titleize)(a||"")} ${c("openapi.parameterName","parameter name")}:`,value:r}),oauth2:(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:c("openapi.flowType","Flow type"),value:e}),i&&Object.keys(i).map((e=>(0,jsx_runtime_1.jsx)(OAuthFlow_1.OAuthFlow,{flow:i[e]},e)))]}),openIdConnect:(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:c("openapi.connectUrl","Connect URL"),value:s&&(0,jsx_runtime_1.jsx)(styled_1.StyledLink,{target:"_blank",rel:"noopener noreferrer",href:s,children:s})})},m=i&&Object.keys(i).map((e=>(0,jsx_runtime_1.jsx)(OAuthScopes_1.OAuthRequiredScopes,{id:o,securities:u,flow:i[e]},e))),_=i&&Object.keys(i).map((e=>(0,jsx_runtime_1.jsx)(OAuthScopes_1.OAuthOptionalScopes,{flow:i[e]},e)));return(0,jsx_runtime_1.jsxs)(Wrapper,{children:[(0,jsx_runtime_1.jsx)(TitleSchema,{children:o}),(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:n}),(0,jsx_runtime_1.jsxs)(List,{children:[l[e]||null,m,_]})]})}const Wrapper=styled_components_1.default.div`
|
|
2
2
|
background: var(--layer-color);
|
|
3
3
|
padding: var(--spacing-base);
|
|
4
4
|
border-radius: var(--border-radius);
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
`,List=styled_components_1.default.div`
|
|
9
9
|
width: 100%;
|
|
10
10
|
margin-top: var(--spacing-md);
|
|
11
|
-
`,Row=styled_components_1.default.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-wrap: wrap;
|
|
14
|
-
gap: var(--spacing-xxs);
|
|
15
|
-
word-break: normal;
|
|
16
11
|
`,TitleSchema=styled_components_1.default.p`
|
|
17
12
|
font-size: var(--font-size-base);
|
|
18
13
|
margin: 0 0 var(--spacing-xs);
|
package/lib/index.d.ts
CHANGED
|
@@ -39,5 +39,6 @@ export { addMarkdownItems } from './services/menu/markdown';
|
|
|
39
39
|
export { getValueFromMdParsedExtension } from './utils/helpers';
|
|
40
40
|
export { ContentItem } from './components/ContentItem';
|
|
41
41
|
export { ExampleSwitch } from './components/Samples/ExampleSwitch';
|
|
42
|
+
export { CustomBadges } from './components/common/Badges';
|
|
42
43
|
export { useDownloadInfo } from './components/Download/useDownloadInfo';
|
|
43
44
|
export { SECTION_ATTR } from './constants';
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SECTION_ATTR=exports.useDownloadInfo=exports.ExampleSwitch=exports.ContentItem=exports.getValueFromMdParsedExtension=exports.addMarkdownItems=exports.PropertyDetails=exports.ExternalDocumentation=exports.OperationSamplesPanel=exports.CodeBlockPanel=exports.FieldLabel=exports.FieldValueLabel=exports.Markdown=exports.Dropdown=exports.Heading=exports.SamplesPanel=exports.Section=exports.SamplesMiddlePanel=exports.Overview=exports.RightPanelContainer=exports.Row=exports.SectionContainer=exports.convertOperationToReplayValue=exports.EmbeddedReplay=exports.makeDeepLink=exports.normalizeOptions=exports.buildContentItems=exports.OpenAPIParser=exports.pathIncludesLink=exports.isOperationName=exports.JsonPointer=exports.getMarkdownHeaderId=exports.StoreProvider=exports.AppProvider=exports.RedoclyOpenAPIDocsStandalone=exports.RedoclyOpenAPIDocs=exports.RedocExample=exports.RedocSchema=exports.ResponseSamples=exports.RequestSamples=exports.generateDeepLink=exports.getTagOrGroup=exports.getServerEnvName=exports.getOperation=exports.simplifyAstStructure=void 0,exports.useOpenapiDocsOptions=useOpenapiDocsOptions;const jotai_1=require("jotai"),store_1=require("./jotai/store");var simplifyAstStructure_1=require("./utils/simplifyAstStructure");Object.defineProperty(exports,"simplifyAstStructure",{enumerable:!0,get:function(){return simplifyAstStructure_1.simplifyAstStructure}});var operation_1=require("./models/operation");Object.defineProperty(exports,"getOperation",{enumerable:!0,get:function(){return operation_1.getOperation}});var environments_1=require("./utils/environments");Object.defineProperty(exports,"getServerEnvName",{enumerable:!0,get:function(){return environments_1.getServerEnvName}});var group_1=require("./models/group");Object.defineProperty(exports,"getTagOrGroup",{enumerable:!0,get:function(){return group_1.getTagOrGroup}});var common_1=require("./components/common");Object.defineProperty(exports,"generateDeepLink",{enumerable:!0,get:function(){return common_1.generateDeepLink}});var RequestSamples_1=require("./components/RequestSamples");Object.defineProperty(exports,"RequestSamples",{enumerable:!0,get:function(){return RequestSamples_1.RequestSamples}});var ResponseSamples_1=require("./components/ResponseSamples");Object.defineProperty(exports,"ResponseSamples",{enumerable:!0,get:function(){return ResponseSamples_1.ResponseSamples}});var pluggable_1=require("./components/pluggable");Object.defineProperty(exports,"RedocSchema",{enumerable:!0,get:function(){return pluggable_1.RedocSchema}}),Object.defineProperty(exports,"RedocExample",{enumerable:!0,get:function(){return pluggable_1.RedocExample}});var RedoclyOpenAPIDocs_1=require("./components/RedoclyOpenAPIDocs");Object.defineProperty(exports,"RedoclyOpenAPIDocs",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.RedoclyOpenAPIDocs}}),Object.defineProperty(exports,"RedoclyOpenAPIDocsStandalone",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.RedoclyOpenAPIDocsStandalone}}),Object.defineProperty(exports,"AppProvider",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.AppProvider}}),Object.defineProperty(exports,"StoreProvider",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.StoreProvider}}),Object.defineProperty(exports,"getMarkdownHeaderId",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.getMarkdownHeaderId}});var JsonPointer_1=require("./utils/JsonPointer");Object.defineProperty(exports,"JsonPointer",{enumerable:!0,get:function(){return JsonPointer_1.JsonPointer}});var openapi_1=require("./utils/openapi");Object.defineProperty(exports,"isOperationName",{enumerable:!0,get:function(){return openapi_1.isOperationName}});var path_1=require("./utils/path");Object.defineProperty(exports,"pathIncludesLink",{enumerable:!0,get:function(){return path_1.pathIncludesLink}});var services_1=require("./services");Object.defineProperty(exports,"OpenAPIParser",{enumerable:!0,get:function(){return services_1.OpenAPIParser}});var services_2=require("./services");function useOpenapiDocsOptions(){return(0,jotai_1.useAtomValue)(store_1.globalOptionsAtom)}Object.defineProperty(exports,"buildContentItems",{enumerable:!0,get:function(){return services_2.buildContentItems}}),Object.defineProperty(exports,"normalizeOptions",{enumerable:!0,get:function(){return services_2.normalizeOptions}}),Object.defineProperty(exports,"makeDeepLink",{enumerable:!0,get:function(){return services_2.makeDeepLink}});var EmbeddedReplay_1=require("./components/Replay/EmbeddedReplay");Object.defineProperty(exports,"EmbeddedReplay",{enumerable:!0,get:function(){return EmbeddedReplay_1.EmbeddedReplay}});var utils_1=require("./components/Replay/utils");Object.defineProperty(exports,"convertOperationToReplayValue",{enumerable:!0,get:function(){return utils_1.convertOperationToReplayValue}});var SectionContent_1=require("./components/SectionContent");Object.defineProperty(exports,"SectionContainer",{enumerable:!0,get:function(){return SectionContent_1.SectionContainer}});var common_2=require("./components/common");Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return common_2.Row}});var SectionContent_2=require("./components/SectionContent");Object.defineProperty(exports,"RightPanelContainer",{enumerable:!0,get:function(){return SectionContent_2.RightPanelContainer}});var Overview_1=require("./components/Overview");Object.defineProperty(exports,"Overview",{enumerable:!0,get:function(){return Overview_1.Overview}});var common_3=require("./components/common");Object.defineProperty(exports,"SamplesMiddlePanel",{enumerable:!0,get:function(){return common_3.SamplesMiddlePanel}}),Object.defineProperty(exports,"Section",{enumerable:!0,get:function(){return common_3.Section}}),Object.defineProperty(exports,"SamplesPanel",{enumerable:!0,get:function(){return common_3.SamplesPanel}});var OperationItemTitle_1=require("./components/common/OperationItemTitle");Object.defineProperty(exports,"Heading",{enumerable:!0,get:function(){return OperationItemTitle_1.Heading}});var Dropdown_1=require("./components/common/Dropdown");Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return Dropdown_1.Dropdown}});var Markdown_1=require("./components/Markdown");Object.defineProperty(exports,"Markdown",{enumerable:!0,get:function(){return Markdown_1.Markdown}});var common_4=require("./components/common");Object.defineProperty(exports,"FieldValueLabel",{enumerable:!0,get:function(){return common_4.FieldValueLabel}}),Object.defineProperty(exports,"FieldLabel",{enumerable:!0,get:function(){return common_4.FieldLabel}});var common_5=require("./components/common");Object.defineProperty(exports,"CodeBlockPanel",{enumerable:!0,get:function(){return common_5.CodeBlockPanel}});var OperationItem_1=require("./components/OperationItem/OperationItem");Object.defineProperty(exports,"OperationSamplesPanel",{enumerable:!0,get:function(){return OperationItem_1.OperationSamplesPanel}});var ExternalDocumentation_1=require("./components/ExternalDocumentation");Object.defineProperty(exports,"ExternalDocumentation",{enumerable:!0,get:function(){return ExternalDocumentation_1.ExternalDocumentation}});var PropertyDetails_1=require("./components/PropertyDetails");Object.defineProperty(exports,"PropertyDetails",{enumerable:!0,get:function(){return PropertyDetails_1.PropertyDetails}});var markdown_1=require("./services/menu/markdown");Object.defineProperty(exports,"addMarkdownItems",{enumerable:!0,get:function(){return markdown_1.addMarkdownItems}});var helpers_1=require("./utils/helpers");Object.defineProperty(exports,"getValueFromMdParsedExtension",{enumerable:!0,get:function(){return helpers_1.getValueFromMdParsedExtension}});var ContentItem_1=require("./components/ContentItem");Object.defineProperty(exports,"ContentItem",{enumerable:!0,get:function(){return ContentItem_1.ContentItem}});var ExampleSwitch_1=require("./components/Samples/ExampleSwitch");Object.defineProperty(exports,"ExampleSwitch",{enumerable:!0,get:function(){return ExampleSwitch_1.ExampleSwitch}});var useDownloadInfo_1=require("./components/Download/useDownloadInfo");Object.defineProperty(exports,"useDownloadInfo",{enumerable:!0,get:function(){return useDownloadInfo_1.useDownloadInfo}});var constants_1=require("./constants");Object.defineProperty(exports,"SECTION_ATTR",{enumerable:!0,get:function(){return constants_1.SECTION_ATTR}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SECTION_ATTR=exports.useDownloadInfo=exports.CustomBadges=exports.ExampleSwitch=exports.ContentItem=exports.getValueFromMdParsedExtension=exports.addMarkdownItems=exports.PropertyDetails=exports.ExternalDocumentation=exports.OperationSamplesPanel=exports.CodeBlockPanel=exports.FieldLabel=exports.FieldValueLabel=exports.Markdown=exports.Dropdown=exports.Heading=exports.SamplesPanel=exports.Section=exports.SamplesMiddlePanel=exports.Overview=exports.RightPanelContainer=exports.Row=exports.SectionContainer=exports.convertOperationToReplayValue=exports.EmbeddedReplay=exports.makeDeepLink=exports.normalizeOptions=exports.buildContentItems=exports.OpenAPIParser=exports.pathIncludesLink=exports.isOperationName=exports.JsonPointer=exports.getMarkdownHeaderId=exports.StoreProvider=exports.AppProvider=exports.RedoclyOpenAPIDocsStandalone=exports.RedoclyOpenAPIDocs=exports.RedocExample=exports.RedocSchema=exports.ResponseSamples=exports.RequestSamples=exports.generateDeepLink=exports.getTagOrGroup=exports.getServerEnvName=exports.getOperation=exports.simplifyAstStructure=void 0,exports.useOpenapiDocsOptions=useOpenapiDocsOptions;const jotai_1=require("jotai"),store_1=require("./jotai/store");var simplifyAstStructure_1=require("./utils/simplifyAstStructure");Object.defineProperty(exports,"simplifyAstStructure",{enumerable:!0,get:function(){return simplifyAstStructure_1.simplifyAstStructure}});var operation_1=require("./models/operation");Object.defineProperty(exports,"getOperation",{enumerable:!0,get:function(){return operation_1.getOperation}});var environments_1=require("./utils/environments");Object.defineProperty(exports,"getServerEnvName",{enumerable:!0,get:function(){return environments_1.getServerEnvName}});var group_1=require("./models/group");Object.defineProperty(exports,"getTagOrGroup",{enumerable:!0,get:function(){return group_1.getTagOrGroup}});var common_1=require("./components/common");Object.defineProperty(exports,"generateDeepLink",{enumerable:!0,get:function(){return common_1.generateDeepLink}});var RequestSamples_1=require("./components/RequestSamples");Object.defineProperty(exports,"RequestSamples",{enumerable:!0,get:function(){return RequestSamples_1.RequestSamples}});var ResponseSamples_1=require("./components/ResponseSamples");Object.defineProperty(exports,"ResponseSamples",{enumerable:!0,get:function(){return ResponseSamples_1.ResponseSamples}});var pluggable_1=require("./components/pluggable");Object.defineProperty(exports,"RedocSchema",{enumerable:!0,get:function(){return pluggable_1.RedocSchema}}),Object.defineProperty(exports,"RedocExample",{enumerable:!0,get:function(){return pluggable_1.RedocExample}});var RedoclyOpenAPIDocs_1=require("./components/RedoclyOpenAPIDocs");Object.defineProperty(exports,"RedoclyOpenAPIDocs",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.RedoclyOpenAPIDocs}}),Object.defineProperty(exports,"RedoclyOpenAPIDocsStandalone",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.RedoclyOpenAPIDocsStandalone}}),Object.defineProperty(exports,"AppProvider",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.AppProvider}}),Object.defineProperty(exports,"StoreProvider",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.StoreProvider}}),Object.defineProperty(exports,"getMarkdownHeaderId",{enumerable:!0,get:function(){return RedoclyOpenAPIDocs_1.getMarkdownHeaderId}});var JsonPointer_1=require("./utils/JsonPointer");Object.defineProperty(exports,"JsonPointer",{enumerable:!0,get:function(){return JsonPointer_1.JsonPointer}});var openapi_1=require("./utils/openapi");Object.defineProperty(exports,"isOperationName",{enumerable:!0,get:function(){return openapi_1.isOperationName}});var path_1=require("./utils/path");Object.defineProperty(exports,"pathIncludesLink",{enumerable:!0,get:function(){return path_1.pathIncludesLink}});var services_1=require("./services");Object.defineProperty(exports,"OpenAPIParser",{enumerable:!0,get:function(){return services_1.OpenAPIParser}});var services_2=require("./services");function useOpenapiDocsOptions(){return(0,jotai_1.useAtomValue)(store_1.globalOptionsAtom)}Object.defineProperty(exports,"buildContentItems",{enumerable:!0,get:function(){return services_2.buildContentItems}}),Object.defineProperty(exports,"normalizeOptions",{enumerable:!0,get:function(){return services_2.normalizeOptions}}),Object.defineProperty(exports,"makeDeepLink",{enumerable:!0,get:function(){return services_2.makeDeepLink}});var EmbeddedReplay_1=require("./components/Replay/EmbeddedReplay");Object.defineProperty(exports,"EmbeddedReplay",{enumerable:!0,get:function(){return EmbeddedReplay_1.EmbeddedReplay}});var utils_1=require("./components/Replay/utils");Object.defineProperty(exports,"convertOperationToReplayValue",{enumerable:!0,get:function(){return utils_1.convertOperationToReplayValue}});var SectionContent_1=require("./components/SectionContent");Object.defineProperty(exports,"SectionContainer",{enumerable:!0,get:function(){return SectionContent_1.SectionContainer}});var common_2=require("./components/common");Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return common_2.Row}});var SectionContent_2=require("./components/SectionContent");Object.defineProperty(exports,"RightPanelContainer",{enumerable:!0,get:function(){return SectionContent_2.RightPanelContainer}});var Overview_1=require("./components/Overview");Object.defineProperty(exports,"Overview",{enumerable:!0,get:function(){return Overview_1.Overview}});var common_3=require("./components/common");Object.defineProperty(exports,"SamplesMiddlePanel",{enumerable:!0,get:function(){return common_3.SamplesMiddlePanel}}),Object.defineProperty(exports,"Section",{enumerable:!0,get:function(){return common_3.Section}}),Object.defineProperty(exports,"SamplesPanel",{enumerable:!0,get:function(){return common_3.SamplesPanel}});var OperationItemTitle_1=require("./components/common/OperationItemTitle");Object.defineProperty(exports,"Heading",{enumerable:!0,get:function(){return OperationItemTitle_1.Heading}});var Dropdown_1=require("./components/common/Dropdown");Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return Dropdown_1.Dropdown}});var Markdown_1=require("./components/Markdown");Object.defineProperty(exports,"Markdown",{enumerable:!0,get:function(){return Markdown_1.Markdown}});var common_4=require("./components/common");Object.defineProperty(exports,"FieldValueLabel",{enumerable:!0,get:function(){return common_4.FieldValueLabel}}),Object.defineProperty(exports,"FieldLabel",{enumerable:!0,get:function(){return common_4.FieldLabel}});var common_5=require("./components/common");Object.defineProperty(exports,"CodeBlockPanel",{enumerable:!0,get:function(){return common_5.CodeBlockPanel}});var OperationItem_1=require("./components/OperationItem/OperationItem");Object.defineProperty(exports,"OperationSamplesPanel",{enumerable:!0,get:function(){return OperationItem_1.OperationSamplesPanel}});var ExternalDocumentation_1=require("./components/ExternalDocumentation");Object.defineProperty(exports,"ExternalDocumentation",{enumerable:!0,get:function(){return ExternalDocumentation_1.ExternalDocumentation}});var PropertyDetails_1=require("./components/PropertyDetails");Object.defineProperty(exports,"PropertyDetails",{enumerable:!0,get:function(){return PropertyDetails_1.PropertyDetails}});var markdown_1=require("./services/menu/markdown");Object.defineProperty(exports,"addMarkdownItems",{enumerable:!0,get:function(){return markdown_1.addMarkdownItems}});var helpers_1=require("./utils/helpers");Object.defineProperty(exports,"getValueFromMdParsedExtension",{enumerable:!0,get:function(){return helpers_1.getValueFromMdParsedExtension}});var ContentItem_1=require("./components/ContentItem");Object.defineProperty(exports,"ContentItem",{enumerable:!0,get:function(){return ContentItem_1.ContentItem}});var ExampleSwitch_1=require("./components/Samples/ExampleSwitch");Object.defineProperty(exports,"ExampleSwitch",{enumerable:!0,get:function(){return ExampleSwitch_1.ExampleSwitch}});var Badges_1=require("./components/common/Badges");Object.defineProperty(exports,"CustomBadges",{enumerable:!0,get:function(){return Badges_1.CustomBadges}});var useDownloadInfo_1=require("./components/Download/useDownloadInfo");Object.defineProperty(exports,"useDownloadInfo",{enumerable:!0,get:function(){return useDownloadInfo_1.useDownloadInfo}});var constants_1=require("./constants");Object.defineProperty(exports,"SECTION_ATTR",{enumerable:!0,get:function(){return constants_1.SECTION_ATTR}});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import
|
|
2
|
-
margin-left: var(--spacing-xs);
|
|
3
|
-
`;export const OAuthFlow=memo(OAuthFlowComponent);
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{SecuritySchemeItem}from"./SecuritySchemeItem";import{StyledLink}from"./styled";import{useTranslate}from"../../hooks";function OAuthFlowComponent({flow:e}){const r=useTranslate();return _jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:`${r("openapi.authorizationUrl","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:`${r("openapi.tokenUrl","Token URL")}:`,value:null==e?void 0:e.tokenUrl}),_jsx(SecuritySchemeItem,{label:`${r("openapi.refreshUrl","Refresh URL")}:`,value:null==e?void 0:e.refreshUrl})]})}export const OAuthFlow=memo(OAuthFlowComponent);
|
|
4
2
|
//# sourceMappingURL=OAuthFlow.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { OpenAPISecurityScheme } from '../../types';
|
|
3
|
+
import type { SecurityRequirement } from '../../models';
|
|
4
|
+
export interface OAuthOptionalScopesProps {
|
|
5
|
+
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
|
|
6
|
+
}
|
|
7
|
+
export interface OAuthRequiredScopesProps {
|
|
8
|
+
id: string;
|
|
9
|
+
securities: SecurityRequirement[];
|
|
10
|
+
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
|
|
11
|
+
}
|
|
12
|
+
export declare const OAuthOptionalScopes: import("react").NamedExoticComponent<PropsWithChildren<OAuthOptionalScopesProps>>;
|
|
13
|
+
export declare const OAuthRequiredScopes: import("react").NamedExoticComponent<PropsWithChildren<OAuthRequiredScopesProps>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo,useState}from"react";import styled from"styled-components";import{ChevronRightIcon}from"@redocly/theme";import{Markdown}from"../Markdown";import{SecuritySchemeItem}from"./SecuritySchemeItem";import{Tag}from"./styled";import{useTranslate}from"../../hooks";import{getRequiredScopes}from"./helper";function OAuthOptionalScopesComponent({flow:e}){const t=Object.keys((null==e?void 0:e.scopes)||{}),o=useTranslate(),[r,s]=useState(!1);if(!t.length)return null;return _jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:_jsxs(ScopeHeader,{onClick:()=>{s((e=>!e))},children:[o(r?"openapi.hideOptionalScopes":"openapi.showOptionalScopes",r?"Hide optional scopes":"Show optional scopes"),_jsx(AnimatedChevronWrapper,{isOpen:r,children:_jsx(ChevronRightIcon,{size:"var(--font-size-base)",color:"var(--tree-content-color-default)"})})]}),value:" "}),_jsx(ScopesListWrapper,{isOpen:r,children: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)))})]})}function OAuthRequiredScopesComponent({id:e,securities:t,flow:o}){const r=getRequiredScopes(e,t),s=useTranslate();return r.length?_jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:s("openapi.requiredScopes","Required scopes"),value:" "}),_jsx(Row,{children:r.map((e=>_jsx(SecuritySchemeItem,{label:_jsx(StyledTag,{className:"tag-grey",children:e}),value:_jsx(Markdown,{source:(null==o?void 0:o.scopes[e])||""})},e)))})]}):null}const StyledTag=styled(Tag)`
|
|
2
|
+
font-family: var(--font-family-base);
|
|
3
|
+
font-size: var(--font-size-base);
|
|
4
|
+
line-height: var(--line-height-base);
|
|
5
|
+
align-self: flex-start;
|
|
6
|
+
padding: 0 var(--spacing-xs);
|
|
7
|
+
border: var(--tag-border-width) var(--tag-border-style) var(--tag-bg-color);
|
|
8
|
+
border-radius: var(--tag-border-radius);
|
|
9
|
+
`,ScopeHeader=styled.div`
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: var(--spacing-xxs);
|
|
13
|
+
align-items: center;
|
|
14
|
+
user-select: none;
|
|
15
|
+
`,Row=styled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
gap: var(--spacing-xxs);
|
|
19
|
+
word-break: normal;
|
|
20
|
+
`,ScopesListWrapper=styled.div`
|
|
21
|
+
max-height: ${e=>e.isOpen?"1000px":"0"};
|
|
22
|
+
opacity: ${e=>e.isOpen?"1":"0"};
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
transition:
|
|
25
|
+
max-height 0.5s ease-in-out,
|
|
26
|
+
opacity 0.5s ease-in-out;
|
|
27
|
+
`,AnimatedChevronWrapper=styled.span`
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
transform: ${e=>e.isOpen?"rotate(90deg)":"rotate(0deg)"};
|
|
32
|
+
transition: transform 0.5s ease-in-out;
|
|
33
|
+
`;export const OAuthOptionalScopes=memo(OAuthOptionalScopesComponent);export const OAuthRequiredScopes=memo(OAuthRequiredScopesComponent);
|
|
34
|
+
//# sourceMappingURL=OAuthScopes.js.map
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import styled from"styled-components";import{SecurityIcon}from"@redocly/theme";export function SecurityButton({securities:e,onClick:
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import styled from"styled-components";import{SecurityIcon,Panel,Button}from"@redocly/theme";import{Fragment}from"react";import{useTranslate}from"../../hooks";export function SecurityButton({securities:e,onClick:r}){const t=useTranslate();return _jsx(SecurityPanel,{header:()=>_jsxs(SecurityHeader,{children:[_jsx(SecurityIcon,{}),_jsx(Title,{children:"Security"}),_jsx(ViewDetailsButton,{onClick:r,variant:"link",children:t("openapi.viewDetails","View details")})]}),isExpandable:!1,children:_jsx(SecurityList,{children:e.map(((r,t)=>{const i=e.length>1&&r.schemes.length>1,n=r.schemes.map((({id:e},t)=>_jsxs(Fragment,{children:[e,t<r.schemes.length-1&&_jsx(Conjunction,{children:" and "})]},e)));return _jsxs(Fragment,{children:[i?"(":"",n,i?")":"",t<e.length-1&&_jsx(Conjunction,{children:" or "})]},t)}))})})}const SecurityPanel=styled(Panel)`
|
|
2
|
+
margin-top: var(--spacing-base);
|
|
3
|
+
border: var(--panel-border);
|
|
4
|
+
border-radius: var(--panel-border-radius);
|
|
5
|
+
`,SecurityHeader=styled.div`
|
|
2
6
|
display: flex;
|
|
3
7
|
align-items: center;
|
|
4
|
-
|
|
5
|
-
gap: var(--spacing-
|
|
6
|
-
min-height: 32px;
|
|
7
|
-
background: var(--color-info-bg);
|
|
8
|
-
padding: 0 var(--spacing-xs);
|
|
9
|
-
margin-top: var(--spacing-base);
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
gap: var(--spacing-xs);
|
|
10
10
|
color: var(--link-color-primary);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
12
|
+
background-color: var(--layer-color);
|
|
13
|
+
border-bottom: var(--panel-border);
|
|
14
|
+
border-radius: var(--panel-border-radius) var(--panel-border-radius) 0 0;
|
|
15
|
+
`,ViewDetailsButton=styled(Button)`
|
|
16
|
+
margin-left: auto;
|
|
17
|
+
font-size: var(--font-size-sm);
|
|
17
18
|
`,Title=styled.span`
|
|
18
|
-
font-family: var(--font-family-
|
|
19
|
-
font-weight: var(--font-weight-
|
|
20
|
-
|
|
21
|
-
`,SecurityList=styled.
|
|
19
|
+
font-family: var(--font-family-base);
|
|
20
|
+
font-weight: var(--font-weight-medium);
|
|
21
|
+
color: var(--text-color-primary);
|
|
22
|
+
`,SecurityList=styled.div`
|
|
22
23
|
flex: 1;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
white-space: nowrap;
|
|
25
24
|
text-overflow: ellipsis;
|
|
26
25
|
overflow: hidden;
|
|
26
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
27
|
+
color: var(--text-color-primary);
|
|
28
|
+
`,Conjunction=styled.span`
|
|
29
|
+
color: var(--text-color-description);
|
|
27
30
|
`;
|
|
28
31
|
//# sourceMappingURL=SecurityButton.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
|
|
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}from"./styled";import{Markdown}from"../Markdown";import{useTranslate}from"../../hooks";import{OAuthRequiredScopes,OAuthOptionalScopes}from"./OAuthScopes";export function SecurityFlow({type:e,bearerFormat:r,name:t,flows:o,openIdConnectUrl:a,description:i,id:s,securities:n,in:l}){const m=useTranslate();if(!e||!s)return null;const c={http:_jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:m("openapi.httpAuthorizationScheme","HTTP Authorization Scheme"),value:e}),_jsx(SecuritySchemeItem,{label:m("openapi.bearerFormat","Bearer Format"),value:r})]}),apiKey:_jsx(SecuritySchemeItem,{label:`${titleize(l||"")} ${m("openapi.parameterName","parameter name")}:`,value:t}),oauth2:_jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:m("openapi.flowType","Flow type"),value:e}),o&&Object.keys(o).map((e=>_jsx(OAuthFlow,{flow:o[e]},e)))]}),openIdConnect:_jsx(SecuritySchemeItem,{label:m("openapi.connectUrl","Connect URL"),value:a&&_jsx(StyledLink,{target:"_blank",rel:"noopener noreferrer",href:a,children:a})})},p=o&&Object.keys(o).map((e=>_jsx(OAuthRequiredScopes,{id:s,securities:n,flow:o[e]},e))),d=o&&Object.keys(o).map((e=>_jsx(OAuthOptionalScopes,{flow:o[e]},e)));return _jsxs(Wrapper,{children:[_jsx(TitleSchema,{children:s}),_jsx(Markdown,{source:i}),_jsxs(List,{children:[c[e]||null,p,d]})]})}const Wrapper=styled.div`
|
|
2
2
|
background: var(--layer-color);
|
|
3
3
|
padding: var(--spacing-base);
|
|
4
4
|
border-radius: var(--border-radius);
|
|
@@ -8,11 +8,6 @@ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";i
|
|
|
8
8
|
`,List=styled.div`
|
|
9
9
|
width: 100%;
|
|
10
10
|
margin-top: var(--spacing-md);
|
|
11
|
-
`,Row=styled.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-wrap: wrap;
|
|
14
|
-
gap: var(--spacing-xxs);
|
|
15
|
-
word-break: normal;
|
|
16
11
|
`,TitleSchema=styled.p`
|
|
17
12
|
font-size: var(--font-size-base);
|
|
18
13
|
margin: 0 0 var(--spacing-xs);
|
|
@@ -2,7 +2,7 @@ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import styled from"styl
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
justify-content: flex-start;
|
|
5
|
-
margin-bottom: var(--spacing-
|
|
5
|
+
margin-bottom: var(--spacing-xs);
|
|
6
6
|
font-size: var(--font-size-sm);
|
|
7
7
|
color: var(--text-color-secondary);
|
|
8
8
|
`,Label=styled.div`
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -39,5 +39,6 @@ export { addMarkdownItems } from './services/menu/markdown';
|
|
|
39
39
|
export { getValueFromMdParsedExtension } from './utils/helpers';
|
|
40
40
|
export { ContentItem } from './components/ContentItem';
|
|
41
41
|
export { ExampleSwitch } from './components/Samples/ExampleSwitch';
|
|
42
|
+
export { CustomBadges } from './components/common/Badges';
|
|
42
43
|
export { useDownloadInfo } from './components/Download/useDownloadInfo';
|
|
43
44
|
export { SECTION_ATTR } from './constants';
|
package/lib-esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useAtomValue}from"jotai";import{globalOptionsAtom}from"./jotai/store";export{simplifyAstStructure}from"./utils/simplifyAstStructure";export{getOperation}from"./models/operation";export{getServerEnvName}from"./utils/environments";export{getTagOrGroup}from"./models/group";export{generateDeepLink}from"./components/common";export{RequestSamples}from"./components/RequestSamples";export{ResponseSamples}from"./components/ResponseSamples";export{RedocSchema,RedocExample}from"./components/pluggable";export{RedoclyOpenAPIDocs,RedoclyOpenAPIDocsStandalone,AppProvider,StoreProvider,getMarkdownHeaderId}from"./components/RedoclyOpenAPIDocs";export{JsonPointer}from"./utils/JsonPointer";export{isOperationName}from"./utils/openapi";export{pathIncludesLink}from"./utils/path";export{OpenAPIParser}from"./services";export{buildContentItems,normalizeOptions,makeDeepLink}from"./services";export function useOpenapiDocsOptions(){return useAtomValue(globalOptionsAtom)}export{EmbeddedReplay}from"./components/Replay/EmbeddedReplay";export{convertOperationToReplayValue}from"./components/Replay/utils";export{SectionContainer}from"./components/SectionContent";export{Row}from"./components/common";export{RightPanelContainer}from"./components/SectionContent";export{Overview}from"./components/Overview";export{SamplesMiddlePanel,Section,SamplesPanel}from"./components/common";export{Heading}from"./components/common/OperationItemTitle";export{Dropdown}from"./components/common/Dropdown";export{Markdown}from"./components/Markdown";export{FieldValueLabel,FieldLabel}from"./components/common";export{CodeBlockPanel}from"./components/common";export{OperationSamplesPanel}from"./components/OperationItem/OperationItem";export{ExternalDocumentation}from"./components/ExternalDocumentation";export{PropertyDetails}from"./components/PropertyDetails";export{addMarkdownItems}from"./services/menu/markdown";export{getValueFromMdParsedExtension}from"./utils/helpers";export{ContentItem}from"./components/ContentItem";export{ExampleSwitch}from"./components/Samples/ExampleSwitch";export{useDownloadInfo}from"./components/Download/useDownloadInfo";export{SECTION_ATTR}from"./constants";
|
|
1
|
+
import{useAtomValue}from"jotai";import{globalOptionsAtom}from"./jotai/store";export{simplifyAstStructure}from"./utils/simplifyAstStructure";export{getOperation}from"./models/operation";export{getServerEnvName}from"./utils/environments";export{getTagOrGroup}from"./models/group";export{generateDeepLink}from"./components/common";export{RequestSamples}from"./components/RequestSamples";export{ResponseSamples}from"./components/ResponseSamples";export{RedocSchema,RedocExample}from"./components/pluggable";export{RedoclyOpenAPIDocs,RedoclyOpenAPIDocsStandalone,AppProvider,StoreProvider,getMarkdownHeaderId}from"./components/RedoclyOpenAPIDocs";export{JsonPointer}from"./utils/JsonPointer";export{isOperationName}from"./utils/openapi";export{pathIncludesLink}from"./utils/path";export{OpenAPIParser}from"./services";export{buildContentItems,normalizeOptions,makeDeepLink}from"./services";export function useOpenapiDocsOptions(){return useAtomValue(globalOptionsAtom)}export{EmbeddedReplay}from"./components/Replay/EmbeddedReplay";export{convertOperationToReplayValue}from"./components/Replay/utils";export{SectionContainer}from"./components/SectionContent";export{Row}from"./components/common";export{RightPanelContainer}from"./components/SectionContent";export{Overview}from"./components/Overview";export{SamplesMiddlePanel,Section,SamplesPanel}from"./components/common";export{Heading}from"./components/common/OperationItemTitle";export{Dropdown}from"./components/common/Dropdown";export{Markdown}from"./components/Markdown";export{FieldValueLabel,FieldLabel}from"./components/common";export{CodeBlockPanel}from"./components/common";export{OperationSamplesPanel}from"./components/OperationItem/OperationItem";export{ExternalDocumentation}from"./components/ExternalDocumentation";export{PropertyDetails}from"./components/PropertyDetails";export{addMarkdownItems}from"./services/menu/markdown";export{getValueFromMdParsedExtension}from"./utils/helpers";export{ContentItem}from"./components/ContentItem";export{ExampleSwitch}from"./components/Samples/ExampleSwitch";export{CustomBadges}from"./components/common/Badges";export{useDownloadInfo}from"./components/Download/useDownloadInfo";export{SECTION_ATTR}from"./constants";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.10.0-next.
|
|
3
|
+
"version": "3.10.0-next.9",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@markdoc/markdoc": "0.5.1",
|
|
27
27
|
"@redocly/openapi-core": "1.34.2",
|
|
28
28
|
"deepmerge": "^4.2.2",
|
|
29
|
-
"dompurify": "3.2.
|
|
29
|
+
"dompurify": "3.2.6",
|
|
30
30
|
"fast-deep-equal": "^3.1.3",
|
|
31
31
|
"jotai": "^2.4.2",
|
|
32
32
|
"json-pointer": "^0.6.2",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"url-template": "^2.0.8",
|
|
46
46
|
"util": "~0.12.5",
|
|
47
47
|
"web-vitals": "3.3.1",
|
|
48
|
-
"@redocly/config": "0.
|
|
49
|
-
"@redocly/replay": "0.13.0-next.
|
|
48
|
+
"@redocly/config": "0.26.0",
|
|
49
|
+
"@redocly/replay": "0.13.0-next.7"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@shikijs/transformers": "1.24.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"webpack": "5.94.0",
|
|
93
93
|
"webpack-cli": "5.1.4",
|
|
94
94
|
"webpack-dev-server": "5.1.0",
|
|
95
|
-
"@redocly/theme": "0.54.0-next.
|
|
95
|
+
"@redocly/theme": "0.54.0-next.7"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|
|
98
98
|
"start": "npm run copy-highlight-hook && webpack serve --mode=development --hot",
|