@redocly/openapi-docs 3.10.0-next.6 → 3.10.0-next.8
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 +1843 -1684
- package/lib/components/Download/DownloadSpecification.js +1 -1
- package/lib/components/ExpandAllButton/ExpandAllButton.js +1 -1
- package/lib/components/Language/LanguageList.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/components/Samples/ExampleSwitch.js +1 -1
- package/lib/components/Security/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/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/hooks/useOtelTelemetry.d.ts +2 -3
- package/lib-esm/components/Download/DownloadSpecification.js +1 -1
- package/lib-esm/components/ExpandAllButton/ExpandAllButton.js +1 -1
- package/lib-esm/components/Language/LanguageList.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib-esm/components/Replay/Replay.js +1 -1
- package/lib-esm/components/RequestSamples/Example.js +1 -1
- package/lib-esm/components/RequestSamples/RequestSamples.js +1 -1
- package/lib-esm/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib-esm/components/Samples/ExampleSwitch.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/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib-esm/hooks/useOtelTelemetry.d.ts +2 -3
- package/package.json +4 -4
|
@@ -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`
|
|
@@ -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,useOtelTelemetry}from"../../hooks";import{getServerEnvName}from"../../utils/environments";export const ServerListDropdown=({operation:e,className:r})=>{const t=useOtelTelemetry(),[[o],s]=useAtom(environmentAtom),a=useActiveWithFallback(e.servers.map((e=>Object.assign(Object.assign({},e),{key:e.url}))),o.server),n=useCallback((e=>{e.stopPropagation()}),[]),i=useCallback((r=>()=>{1!==e.servers.length&&(s({environment:getServerEnvName(r)}),t.send("openapi_docs.switch_servers.clicked",{server:getServerEnvName(r)}))}),[e.servers.length,s,t]),m=useMemo((()=>e.servers.map((r=>{const t=joinWithSeparator(replaceVariables(r),e.path);return _jsx(StyledDropdownMenuItem,{onAction:i(r),children:_jsx(PanelItem,{header:r.description,title:t,actions:[_jsx(StyledCopyButton,{data:t,toasterPlacement:"left",onCopyClick:n},t)],active:r.url===a,withCheckmark:!0})},t)}))),[e.servers,e.path,i,n,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:m})})};
|
|
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,useOtelTelemetry}from"../../hooks";import{getServerEnvName}from"../../utils/environments";export const ServerListDropdown=({operation:e,className:r})=>{const t=useOtelTelemetry(),[[o],s]=useAtom(environmentAtom),a=useActiveWithFallback(e.servers.map((e=>Object.assign(Object.assign({},e),{key:e.url}))),o.server),n=useCallback((e=>{e.stopPropagation()}),[]),i=useCallback((r=>()=>{1!==e.servers.length&&(s({environment:getServerEnvName(r)}),t.send({type:"openapi_docs.switch_servers.clicked",payload:{server:getServerEnvName(r)}}))}),[e.servers.length,s,t]),m=useMemo((()=>e.servers.map((r=>{const t=joinWithSeparator(replaceVariables(r),e.path);return _jsx(StyledDropdownMenuItem,{onAction:i(r),children:_jsx(PanelItem,{header:r.description,title:t,actions:[_jsx(StyledCopyButton,{data:t,toasterPlacement:"left",onCopyClick:n},t)],active:r.url===a,withCheckmark:!0})},t)}))),[e.servers,e.path,i,n,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:m})})};
|
|
2
2
|
//# sourceMappingURL=ServerListDropdown.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
1
|
+
import { useThemeHooks } from '@redocly/theme';
|
|
2
|
+
export declare function useOtelTelemetry(): ReturnType<ReturnType<typeof useThemeHooks>['useOtelTelemetry']>;
|
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.8",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -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.25.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",
|