@redocly/reference-docs 2.32.1 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli/commands/redocly-docs-cli.min.js +155 -155
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +5 -21
- package/dist/console.redocly-reference-docs.min.js +124 -127
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +629 -626
- package/lib/components/Endpoint/Endpoint.js +1 -1
- package/lib/components/Endpoint/styled.d.ts +1 -1
- package/lib/components/NextSectionButton.js +1 -1
- package/lib/components/Panel/Accordion.js +1 -1
- package/lib/components/Panel/ContentPanel.js +1 -1
- package/lib/components/Panel/PanelComponent.d.ts +1 -1
- package/lib/components/RedoclyReferenceDocs.d.ts +1 -9
- package/lib/components/RedoclyReferenceDocs.js +1 -1
- package/lib/components/RedoclyReferenceDocsMultiStandalone.d.ts +8 -0
- package/lib/components/RedoclyReferenceDocsMultiStandalone.js +2 -0
- package/lib/components/Samples/SamplesTabs.d.ts +2 -2
- package/lib/components/Samples/SamplesTabs.js +1 -1
- package/lib/components/Samples/use-example-key.js +1 -1
- package/lib/components/Search/ProSearchBox.js +1 -1
- package/lib/components/StoreProvider.d.ts +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.d.ts +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
- package/lib/components/common/CheckboxList.d.ts +1 -1
- package/lib/components/common/Dropdown/styled.d.ts +4 -4
- package/lib/components/common/FileUpload/FileUpload.d.ts +3 -2
- package/lib/components/common/FileUpload/FileUpload.js +1 -1
- package/lib/components/console/AuthPanel.js +1 -1
- package/lib/components/console/CodemirrorInput.d.ts +15 -11
- package/lib/components/console/CodemirrorInput.js +1 -1
- package/lib/components/console/Console.d.ts +2 -2
- package/lib/components/console/Console.js +1 -1
- package/lib/components/console/OpenIDConnect.d.ts +3 -0
- package/lib/components/console/OpenIDConnect.js +1 -1
- package/lib/components/console/RequestBody/RequestBody.d.ts +3 -0
- package/lib/components/console/RequestBody/RequestBody.js +2 -0
- package/lib/components/console/RequestBody/index.d.ts +2 -0
- package/lib/components/console/RequestBody/index.js +2 -0
- package/lib/components/console/RequestBody/types.d.ts +10 -0
- package/lib/components/console/RequestBody/types.js +2 -0
- package/lib/components/console/RequestBodyForm.d.ts +3 -2
- package/lib/components/console/styled.d.ts +1 -0
- package/lib/components/console/styled.js +1 -1
- package/lib/components/console/utils.d.ts +3 -1
- package/lib/components/console/utils.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -1
- package/lib/redoc-lib/src/common-elements/linkify.d.ts +1 -1
- package/lib/redoc-lib/src/common-elements/panels.d.ts +2 -3
- package/lib/redoc-lib/src/common-elements/panels.js +1 -1
- package/lib/redoc-lib/src/common-elements/perfect-scrollbar.d.ts +1 -1
- package/lib/redoc-lib/src/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/redoc-lib/src/components/CallbackSamples/CallbackReqSamples.js +1 -1
- package/lib/redoc-lib/src/components/Callbacks/CallbacksList.js +1 -1
- package/lib/redoc-lib/src/components/ContentItem/ContentItem.d.ts +10 -0
- package/lib/redoc-lib/src/components/ContentItem/ContentItem.js +2 -0
- package/lib/redoc-lib/src/components/ContentItem/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/ContentItem/index.js +2 -0
- package/lib/redoc-lib/src/components/ContentItems/ContentItems.d.ts +3 -20
- package/lib/redoc-lib/src/components/ContentItems/ContentItems.js +1 -1
- package/lib/redoc-lib/src/components/ContentItems/Skeleton.d.ts +2 -0
- package/lib/redoc-lib/src/components/ContentItems/Skeleton.js +2 -0
- package/lib/redoc-lib/src/components/ContentItems/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/ContentItems/index.js +2 -0
- package/lib/redoc-lib/src/components/ErrorBoundary.d.ts +1 -1
- package/lib/redoc-lib/src/components/Fields/EnumValues.js +1 -1
- package/lib/redoc-lib/src/components/Markdown/AdvancedMarkdown.js +1 -1
- package/lib/redoc-lib/src/components/Operation/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/Operation/index.js +2 -0
- package/lib/redoc-lib/src/components/OperationItem/OperationItem.d.ts +7 -0
- package/lib/redoc-lib/src/components/OperationItem/OperationItem.js +2 -0
- package/lib/redoc-lib/src/components/OperationItem/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/OperationItem/index.js +2 -0
- package/lib/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/CodeSample.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/languageSwitchEvent.d.ts +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponseSummary.js +1 -1
- package/lib/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
- package/lib/redoc-lib/src/components/SearchBox/SearchBox.d.ts +1 -1
- package/lib/redoc-lib/src/components/SectionItem/SectionItem.d.ts +7 -0
- package/lib/redoc-lib/src/components/SectionItem/SectionItem.js +2 -0
- package/lib/redoc-lib/src/components/SectionItem/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/SectionItem/index.js +2 -0
- package/lib/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.js +1 -1
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityDefs.js +1 -1
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.js +1 -1
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js +1 -1
- package/lib/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.js +1 -1
- package/lib/redoc-lib/src/components/SecuritySchemes/helpers.d.ts +1 -1
- package/lib/redoc-lib/src/components/SideMenu/MenuItems.js +1 -1
- package/lib/redoc-lib/src/components/SideMenu/styled.elements.d.ts +2 -2
- package/lib/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -1
- package/lib/redoc-lib/src/components/index.d.ts +4 -1
- package/lib/redoc-lib/src/components/index.js +1 -1
- package/lib/redoc-lib/src/services/MarkdownRenderer.js +1 -1
- package/lib/redoc-lib/src/services/MenuBuilder.d.ts +1 -1
- package/lib/redoc-lib/src/services/OpenAPIParser.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/MediaContent.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/MediaType.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/MediaType.js +1 -1
- package/lib/redoc-lib/src/services/models/Operation.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/RequestBody.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Response.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Schema.d.ts +1 -1
- package/lib/redoc-lib/src/services/types.d.ts +4 -1
- package/lib/redoc-lib/src/utils/openapi.d.ts +1 -1
- package/lib/services/ProStore.d.ts +4 -4
- package/lib/services/SearchStore.d.ts +1 -1
- package/lib/services/VersionedSpecStore.d.ts +1 -1
- package/lib/services/code-samples/generator.d.ts +1 -0
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/index.d.ts +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/javascript/index.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
- package/lib/standalone.d.ts +1 -1
- package/lib/standalone.js +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +1 -1
- package/lib-esm/components/Endpoint/Endpoint.js +1 -1
- package/lib-esm/components/Endpoint/styled.d.ts +1 -1
- package/lib-esm/components/NextSectionButton.js +1 -1
- package/lib-esm/components/Panel/Accordion.js +1 -1
- package/lib-esm/components/Panel/ContentPanel.js +1 -1
- package/lib-esm/components/Panel/PanelComponent.d.ts +1 -1
- package/lib-esm/components/RedoclyReferenceDocs.d.ts +1 -9
- package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
- package/lib-esm/components/RedoclyReferenceDocsMultiStandalone.d.ts +8 -0
- package/lib-esm/components/RedoclyReferenceDocsMultiStandalone.js +2 -0
- package/lib-esm/components/Samples/SamplesTabs.d.ts +2 -2
- package/lib-esm/components/Samples/SamplesTabs.js +1 -1
- package/lib-esm/components/Samples/use-example-key.js +1 -1
- package/lib-esm/components/Search/ProSearchBox.js +1 -1
- package/lib-esm/components/StoreProvider.d.ts +1 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabsBase.d.ts +1 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
- package/lib-esm/components/common/CheckboxList.d.ts +1 -1
- package/lib-esm/components/common/Dropdown/styled.d.ts +4 -4
- package/lib-esm/components/common/FileUpload/FileUpload.d.ts +3 -2
- package/lib-esm/components/common/FileUpload/FileUpload.js +1 -1
- package/lib-esm/components/console/AuthPanel.js +1 -1
- package/lib-esm/components/console/CodemirrorInput.d.ts +15 -11
- package/lib-esm/components/console/CodemirrorInput.js +1 -1
- package/lib-esm/components/console/Console.d.ts +2 -2
- package/lib-esm/components/console/Console.js +1 -1
- package/lib-esm/components/console/OpenIDConnect.d.ts +3 -0
- package/lib-esm/components/console/OpenIDConnect.js +1 -1
- package/lib-esm/components/console/RequestBody/RequestBody.d.ts +3 -0
- package/lib-esm/components/console/RequestBody/RequestBody.js +2 -0
- package/lib-esm/components/console/RequestBody/index.d.ts +2 -0
- package/lib-esm/components/console/RequestBody/index.js +2 -0
- package/lib-esm/components/console/RequestBody/types.d.ts +10 -0
- package/lib-esm/components/console/RequestBody/types.js +2 -0
- package/lib-esm/components/console/RequestBodyForm.d.ts +3 -2
- package/lib-esm/components/console/styled.d.ts +1 -0
- package/lib-esm/components/console/styled.js +1 -1
- package/lib-esm/components/console/utils.d.ts +3 -1
- package/lib-esm/components/console/utils.js +1 -1
- package/lib-esm/components/index.d.ts +1 -0
- package/lib-esm/components/index.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/linkify.d.ts +1 -1
- package/lib-esm/redoc-lib/src/common-elements/panels.d.ts +2 -3
- package/lib-esm/redoc-lib/src/common-elements/panels.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/perfect-scrollbar.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/redoc-lib/src/components/CallbackSamples/CallbackReqSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbacksList.js +1 -1
- package/lib-esm/redoc-lib/src/components/ContentItem/ContentItem.d.ts +10 -0
- package/lib-esm/redoc-lib/src/components/ContentItem/ContentItem.js +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItem/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/ContentItem/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/ContentItems.d.ts +3 -20
- package/lib-esm/redoc-lib/src/components/ContentItems/ContentItems.js +1 -1
- package/lib-esm/redoc-lib/src/components/ContentItems/Skeleton.d.ts +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/Skeleton.js +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/ErrorBoundary.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Fields/EnumValues.js +1 -1
- package/lib-esm/redoc-lib/src/components/Markdown/AdvancedMarkdown.js +1 -1
- package/lib-esm/redoc-lib/src/components/Operation/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/Operation/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/OperationItem.d.ts +7 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/OperationItem.js +2 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/CodeSample.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/languageSwitchEvent.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponseSummary.js +1 -1
- package/lib-esm/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
- package/lib-esm/redoc-lib/src/components/SearchBox/SearchBox.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/SectionItem/SectionItem.d.ts +7 -0
- package/lib-esm/redoc-lib/src/components/SectionItem/SectionItem.js +2 -0
- package/lib-esm/redoc-lib/src/components/SectionItem/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/SectionItem/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityDefs.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecuritySchemes/helpers.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItems.js +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/styled.elements.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/index.d.ts +4 -1
- package/lib-esm/redoc-lib/src/components/index.js +1 -1
- package/lib-esm/redoc-lib/src/services/MarkdownRenderer.js +1 -1
- package/lib-esm/redoc-lib/src/services/MenuBuilder.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/OpenAPIParser.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/MediaContent.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/MediaType.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/MediaType.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/Operation.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/RequestBody.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Response.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Schema.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/types.d.ts +4 -1
- package/lib-esm/redoc-lib/src/utils/openapi.d.ts +1 -1
- package/lib-esm/services/ProStore.d.ts +4 -4
- package/lib-esm/services/SearchStore.d.ts +1 -1
- package/lib-esm/services/VersionedSpecStore.d.ts +1 -1
- package/lib-esm/services/code-samples/generator.d.ts +1 -0
- package/lib-esm/services/code-samples/generator.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/csharp/httpclient.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/index.d.ts +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/javascript/index.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
- package/lib-esm/standalone.d.ts +1 -1
- package/lib-esm/standalone.js +1 -1
- package/lib-esm/utils.d.ts +1 -1
- package/lib-esm/utils.js +1 -1
- package/package.json +4 -4
- package/lib/components/console/RequestBody.d.ts +0 -12
- package/lib/components/console/RequestBody.js +0 -2
- package/lib-esm/components/console/RequestBody.d.ts +0 -12
- package/lib-esm/components/console/RequestBody.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign}from"tslib";import
|
|
1
|
+
import{__assign}from"tslib";import React from"react";import merge from"deepmerge";import{observer}from"mobx-react";import{NoSampleLabel}from"../../../../components/shared";import{ExampleSwitch,useExampleKey}from"../../../../components/Samples";import{arrayMergeStrategy}from"../../../../services/utils";import{Markdown}from"../Markdown";import{Example}from"./Example";import{ExampleWrapper}from"./styled";export var MediaTypeSamples=observer((function(e){var a=e.mediaType,r=e.onlyDefaultSample,t=e.properties,m=a.examples||{},l=a.name,p=Object.keys(m),o=useExampleKey(a.operation,m),n=o.exampleKey,c=o.defaultExampleName,i=1===p.length?Object.values(m)[0]:m[n];if(!p.length)return React.createElement(NoSampleLabel,null,"No sample");var s=t?__assign(__assign({},i),{value:merge(i.value,t,{arrayMerge:arrayMergeStrategy})}):i,u=s.description;if(c&&r)return React.createElement(React.Fragment,null,s.description&&React.createElement(Markdown,{source:s.description}),React.createElement(Example,{example:s,mimeType:l}));return React.createElement(React.Fragment,null,React.createElement(ExampleSwitch,{examples:m,exampleKey:n,onChange:function(e){var r;return null===(r=a.operation)||void 0===r?void 0:r.activateExampleName(e)}}),React.createElement(ExampleWrapper,null,u&&React.createElement(Markdown,{source:u}),React.createElement(Example,{example:s,mimeType:l})))}));
|
|
2
2
|
//# sourceMappingURL=MediaTypeSamples.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__rest}from"tslib";import{observer}from"mobx-react";import
|
|
1
|
+
import{__assign,__rest}from"tslib";import{observer}from"mobx-react";import React from"react";import{DropdownOrLabel}from"../DropdownOrLabel/DropdownOrLabel";import{MediaTypesSwitch}from"../MediaTypeSwitch/MediaTypesSwitch";import{MimeLabel}from"../../../../components/shared";import{Dropdown}from"../../../../components/common/Dropdown";import{MediaTypeSamples}from"./MediaTypeSamples";import{DropdownWrapper}from"./styled";export var PayloadSamples=observer((function(e){var r=e.onlyDefaultMimeType,o=e.operation,t=e.content,n=__rest(e,["onlyDefaultMimeType","operation","content"]),a=r&&(null==o?void 0:o.defaultMimeType);return React.createElement(MediaTypesSwitch,{content:t,renderDropdown:a?function(){return null}:function(e){return React.createElement(DropdownWrapper,null,React.createElement(DropdownOrLabel,__assign({Label:MimeLabel,Dropdown:Dropdown,variant:"dark",fullWidth:!0},e)))}},(function(e){return React.createElement(MediaTypeSamples,__assign({key:"samples",mediaType:e},n))}))}));
|
|
2
2
|
//# sourceMappingURL=PayloadSamples.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__rest}from"tslib";import*as React from"react";import{observer}from"mobx-react";import{DropdownOrLabel}from"../DropdownOrLabel/DropdownOrLabel";import{MediaTypesSwitch}from"../MediaTypeSwitch/MediaTypesSwitch";import{SourceCodeWithText}from"../SourceCode/SourceCode";import{MimeLabel}from"../../../../components/shared";import{Dropdown}from"../../../../components/common/Dropdown";import{DropdownWrapper}from"../../../src/components/PayloadSamples";import{ExampleSwitch,useExampleKey}from"../../../../components/Samples";export var CodeSample=observer((function(e){var r
|
|
1
|
+
import{__assign,__rest}from"tslib";import*as React from"react";import{observer}from"mobx-react";import{DropdownOrLabel}from"../DropdownOrLabel/DropdownOrLabel";import{MediaTypesSwitch}from"../MediaTypeSwitch/MediaTypesSwitch";import{SourceCodeWithText}from"../SourceCode/SourceCode";import{MimeLabel}from"../../../../components/shared";import{Dropdown}from"../../../../components/common/Dropdown";import{DropdownWrapper}from"../../../src/components/PayloadSamples";import{ExampleSwitch,useExampleKey}from"../../../../components/Samples";export var CodeSample=observer((function(e){var o,r=e.onlyDefaultSample,t=e.onlyDefaultMimeType,a=e.content,n=__rest(e,["onlyDefaultSample","onlyDefaultMimeType","content"]),l=function(e){return n.source?React.createElement(SourceCodeWithText,{lang:n.lang,source:n.source}):React.createElement(SourceCodeWithText,{lang:n.lang,externalSource:{sample:n.externalSample,exampleName:e,operation:n.operation,pathParams:n.pathParams,properties:n.properties}})};if(void 0===a||null!=n.source)return l();var p=t&&(null===(o=n.operation)||void 0===o?void 0:o.defaultMimeType),m=a&&a.mediaTypes.length>1&&!p,i=function(e){var o;return null===(o=n.operation)||void 0===o?void 0:o.activateExampleName(e)};return React.createElement(MediaTypesSwitch,{content:a,renderDropdown:m?function(e){return React.createElement(DropdownWrapper,null,React.createElement(DropdownOrLabel,__assign({Label:MimeLabel,Dropdown:Dropdown,variant:"dark",fullWidth:!0},e)))}:function(){return null}},(function(e){var o=e.examples||{},t=Object.keys(o),a=useExampleKey(e.operation,o),n=a.exampleKey,p=a.defaultExampleName;return t.length&&1!==t.length?p&&r?l(n):React.createElement(React.Fragment,null,React.createElement(ExampleSwitch,{examples:o,exampleKey:n,onChange:i}),l(n)):l()}))}));
|
|
2
2
|
//# sourceMappingURL=CodeSample.js.map
|
|
@@ -10,4 +10,4 @@ export interface RequestSamplesProps {
|
|
|
10
10
|
onlyDefaultMimeType?: boolean;
|
|
11
11
|
content?: MediaContentModel;
|
|
12
12
|
}
|
|
13
|
-
export declare const RequestSamples: ({ operation, defaultLanguage, disableHeader, content, ...props }: RequestSamplesProps) => JSX.Element | null;
|
|
13
|
+
export declare const RequestSamples: ({ operation, defaultLanguage, disableHeader, content: _content, ...props }: RequestSamplesProps) => JSX.Element | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__rest}from"tslib";import React,{useContext,useEffect
|
|
1
|
+
import{__assign,__rest}from"tslib";import React,{useContext,useEffect}from"react";import{observer}from"mobx-react";import{CodePanel}from"../../../../components/Panel";import{TabPanel}from"../../../../components/Tabs";import{SamplesTabs}from"../../../../components/Samples";import{isPayloadSample}from"../../services";import{PayloadSamples}from"../PayloadSamples";import{OptionsContext}from"../OptionsProvider";import{l}from"../../services/Labels";import{CodeSample}from"./CodeSample";import{useCodeSamples}from"./useCodeSamples";import{createLanguageSwitchEvent,creatPanelToggleEvent}from"./languageSwitchEvent";export var RequestSamples=observer((function(e){var a=e.operation,t=e.defaultLanguage,o=e.disableHeader,n=(e.content,__rest(e,["operation","defaultLanguage","disableHeader","content"])),r=useContext(OptionsContext),s=r.events,m=r.hideSingleRequestSampleTab;useEffect((function(){}),[a.activeServer,a.requestValues]);var i=useCodeSamples(a),p=i.samples,c=i.payload,d=1===p.length&&m;return p.length?React.createElement(CodePanel,{dataHeaderTestId:"request-samples",header:o?void 0:l("requestSamples"),onToggle:function(e){var t,o=creatPanelToggleEvent({operation:a,isExpanded:e,panelType:"request-samples"});null===(t=null==s?void 0:s.panelToggle)||void 0===t||t.call(s,o)}},React.createElement(SamplesTabs,{operation:a,tabs:p,onChange:function(e){var t,o=createLanguageSwitchEvent({operation:a,sample:e});null===(t=null==s?void 0:s.codeSamplesLanguageSwitch)||void 0===t||t.call(s,o)},hidden:d,defaultLanguage:t,id:a.id+"/request-tab"},p.map((function(e){return React.createElement(TabPanel,{key:e.key+a.id},isPayloadSample(e)?React.createElement(PayloadSamples,__assign({content:e.requestBodyContent,operation:a},n)):React.createElement(CodeSample,__assign({lang:e.lang,source:e.source,externalSample:e,content:null==c?void 0:c.requestBodyContent,operation:a},n)))})))):null}));
|
|
2
2
|
//# sourceMappingURL=RequestSamples.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnalyticsEvent, CodeSamplesLanguageSwitchedEvent, PanelToggleEvent } from '../../../../services/store-types';
|
|
2
|
-
import { AnalyticsEventType } from '../../../../services/store-types';
|
|
3
2
|
import type { OperationModel, Sample } from '../../services';
|
|
3
|
+
import { AnalyticsEventType } from '../../../../services/store-types';
|
|
4
4
|
export declare function createTrackingEvent<T extends AnalyticsEvent>(eventType: AnalyticsEventType): (payload: Omit<T, 'eventType'>) => T;
|
|
5
5
|
export interface LanguageSwitchProps {
|
|
6
6
|
operation: OperationModel;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from"react";import{Header,Title,Trigger}from"../../../../components/Panel";import{ShelfIcon}from"../../common-elements/icons";import{Markdown}from"../Markdown";export var ResponseSummary=function(e){var n=e.expanded,t=e.toggle,r=e.response,o=r.content,a=r.headers,l=r.description,c=(null==o?void 0:o.mediaTypes.filter((function(e){return void 0!==e.schema})))||[],m=0===a.length&&0===c.length&&!l;return React.createElement(Header,{onClick:t,disabled:m},React.createElement(Trigger,null,React.createElement(Title,null,React.createElement("span",null,r.code),r.summary&&React.createElement(Markdown,{inline:!0,source:r.summary})),m?null:React.createElement(ShelfIcon,{direction:n?"down":"right"})))};
|
|
2
2
|
//# sourceMappingURL=ResponseSummary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{
|
|
1
|
+
import{__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{strikethroughText}from"../../utils/string";import{Dropdown}from"../../../../components/common/Dropdown";var DiscriminatorDropdown=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"changeActiveChild",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0!==e.idx&&t.props.parent.activateOneOf(e.idx)}}),t}return __extends(t,e),Object.defineProperty(t.prototype,"sortOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(0!==t.length){var r={};t.forEach((function(e,t){r[e]=t})),e.sort((function(e,t){return r[e.value]>r[t.value]?1:-1}))}}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.parent,r=e.enumValues;if(void 0===t.oneOf)return null;var o=t.oneOf.map((function(e,t){return{value:e.schema.deprecated?strikethroughText(e.title)+" (deprecated)":e.title,idx:t}})),n=o[t.activeOneOf].value;return this.sortOptions(o,r),React.createElement(Dropdown,{dense:!0,value:n,options:o,onChange:this.changeActiveChild,ariaLabel:"Example"})}}),t=__decorate([observer],t)}(React.Component);export{DiscriminatorDropdown};
|
|
2
2
|
//# sourceMappingURL=DiscriminatorDropdown.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { IMenuItem, SearchResult } from '../../services/types';
|
|
3
3
|
import type { SearchStore } from '../../services/SearchStore';
|
|
4
|
-
import { MenuItem } from '../SideMenu/MenuItem';
|
|
5
4
|
import type { MarkerService } from '../../services/MarkerService';
|
|
5
|
+
import { MenuItem } from '../SideMenu/MenuItem';
|
|
6
6
|
export interface SearchBoxProps {
|
|
7
7
|
search: SearchStore<string>;
|
|
8
8
|
marker: MarkerService;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React,{useMemo}from"react";import{observer}from"mobx-react";import{H1,H2,H3,H4,H5,H6,MiddlePanel,Row,ShareLink}from"../../common-elements";import{AdvancedMarkdown}from"../Markdown/AdvancedMarkdown";import{ExternalDocumentation}from"../ExternalDocumentation/ExternalDocumentation";export var SectionItem=observer((function(e){var t=e.item,n=t.name,a=t.description,r=t.externalDocs,c=t.level,o=t.id,l=useMemo((function(){switch(c){case 1:default:return H1;case 2:return H2;case 3:return H3;case 4:return H4;case 5:return H5;case 6:return H6}}),[c]);return React.createElement(React.Fragment,null,React.createElement(Row,null,React.createElement(MiddlePanel,{compact:!1},React.createElement(l,null,React.createElement(ShareLink,{to:o}),n))),React.createElement(AdvancedMarkdown,{source:a||"",htmlWrap:function(e){return React.createElement(MiddlePanel,{compact:!0},e)}}),r&&React.createElement(Row,null,React.createElement(MiddlePanel,null,React.createElement(ExternalDocumentation,{externalDocs:r}))))}));
|
|
2
|
+
//# sourceMappingURL=SectionItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SectionItem } from './SectionItem';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from"react";import{SecurityRow}from"./SecurityRequirement";export var RequiredScopesRow=function(e){var t=e.scopes;return t.length?React.createElement(SecurityRow,null,React.createElement("b",null,"Required scopes: "),t.map((function(e
|
|
1
|
+
import React from"react";import{SecurityRow}from"./SecurityRequirement";export var RequiredScopesRow=function(e){var t=e.scopes;return t.length?React.createElement(SecurityRow,null,React.createElement("b",null,"Required scopes: "),t.map((function(e){return React.createElement(React.Fragment,{key:e},React.createElement("code",null,e)," ")}))):null};
|
|
2
2
|
//# sourceMappingURL=RequiredScopesRow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__extends,__makeTemplateObject}from"tslib";import React from"react";import{H2,MiddlePanel,Row,Section,ShareLink}from"../../common-elements";import{titleize}from"../../utils/helpers";import{Markdown,StyledMarkdownBlock}from"../Markdown";import{OAuthFlow}from"../SecuritySchemes/SecuritySchemes";import styled from"../../styled-components";import{AUTH_TYPES}from"./SecurityRequirement";var SecurityDefs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.props.securitySchemes.schemes.map((function(e){return React.createElement(Section,{
|
|
1
|
+
import{__extends,__makeTemplateObject}from"tslib";import React from"react";import{H2,MiddlePanel,Row,Section,ShareLink}from"../../common-elements";import{titleize}from"../../utils/helpers";import{Markdown,StyledMarkdownBlock}from"../Markdown";import{OAuthFlow}from"../SecuritySchemes/SecuritySchemes";import styled from"../../styled-components";import{AUTH_TYPES}from"./SecurityRequirement";var SecurityDefs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.props.securitySchemes.schemes.map((function(e){return React.createElement(Section,{sectionId:e.sectionId,key:e.id},React.createElement(Row,null,React.createElement(MiddlePanel,null,React.createElement(H2,null,React.createElement(ShareLink,{to:e.sectionId}),e.id),React.createElement(Description,{source:e.description||""}),React.createElement(StyledMarkdownBlock,null,React.createElement("div",{className:"security-details"},React.createElement("div",null,React.createElement("b",null,"Security Scheme Type: "),React.createElement("span",null,AUTH_TYPES[e.type]||e.type)),e.apiKey?React.createElement("div",null,React.createElement("b",null,titleize(e.apiKey.in||"")," parameter name: "),React.createElement("span",null,e.apiKey.name)):e.http?[React.createElement("div",{key:"scheme"},React.createElement("b",null,"HTTP Authorization Scheme "),React.createElement("span",null,e.http.scheme)),"bearer"===e.http.scheme&&e.http.bearerFormat&&React.createElement("div",{key:"bearer"},React.createElement("b",null,"Bearer format: "),React.createElement("span",null,'"',e.http.bearerFormat,'"'))]:e.openId?React.createElement("div",null,React.createElement("b",null,"Connect URL:"),React.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:e.openId.connectUrl},e.openId.connectUrl)):e.flows?Object.keys(e.flows).map((function(t){return React.createElement(OAuthFlow,{key:t,type:t,flow:e.flows[t]})})):null)))))}))}}),t}(React.PureComponent);export{SecurityDefs};var templateObject_1,Description=styled(Markdown)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n margin-bottom: 1em;\n"],["\n margin-bottom: 1em;\n"])));
|
|
2
2
|
//# sourceMappingURL=SecurityDefs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import React,{useState}from"react";import styled from"../../styled-components";import{useStore}from"../StoreBuilder";import{Markdown,StyledMarkdownBlock}from"../Markdown";import{titleize}from"../../utils";import{OAuthFlow}from"../SecuritySchemes/SecuritySchemes";import{l}from"../../services/Labels";import{ContentPanel}from"../../../../components/Panel";import{SecurityRequirementPanelDescription}from"./SecurityRequirementPanelDescription";import{SecurityRequirementElement}from"./SecurityRequirementElement";import{RequiredScopesRow}from"./RequiredScopesRow";export var AUTH_TYPES={oauth2:"OAuth2",apiKey:"API Key",http:"HTTP",openIdConnect:"OpenID Connect"};function getRequiredScopes(e,t){for(var n=[],r=t.length;r--;)for(var o=t[r],c=o.schemes.length;c--;){var a=o.schemes[c];a.id===e&&n.push.apply(n,a.scopes)}return Array.from(new Set(n))}export var SecurityRequirements=function(e){var t=e.securities,n=useStore(),r=null==n?void 0:n.options.showSecuritySchemeType,o=useState(!1),c=o[0],a=o[1];if(!t.length||(null==n?void 0:n.options.hideSecuritySection))return null;var i=null==n?void 0:n.definition.securitySchemes.schemes,m=null==i?void 0:i.filter((function(e){var n=e.id;return t.find((function(e){return e.schemes.find((function(e){return e.id===n}))}))}));return React.createElement(ContentPanel,{header:l("authorizations"),onToggle:function(e){return a(e)},description:!c&&React.createElement(SecurityRequirementPanelDescription,{securities:t,showSecuritySchemeType:r}),expanded:c},c&&m&&m.length>1?React.createElement(SecurityRequirementBlock,null,t.map((function(e,n){var o,c,a="";return t.length>1&&e.schemes.length>1&&(c=0===n?"(":"",a=")"),n!==t.length-1&&(a+=" or",o=React.createElement("br",null)),React.createElement(React.Fragment,{key:
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import React,{useState}from"react";import styled from"../../styled-components";import{useStore}from"../StoreBuilder";import{Markdown,StyledMarkdownBlock}from"../Markdown";import{titleize}from"../../utils";import{OAuthFlow}from"../SecuritySchemes/SecuritySchemes";import{l}from"../../services/Labels";import{ContentPanel}from"../../../../components/Panel";import{SecurityRequirementPanelDescription}from"./SecurityRequirementPanelDescription";import{SecurityRequirementElement}from"./SecurityRequirementElement";import{RequiredScopesRow}from"./RequiredScopesRow";export var AUTH_TYPES={oauth2:"OAuth2",apiKey:"API Key",http:"HTTP",openIdConnect:"OpenID Connect"};function getRequiredScopes(e,t){for(var n=[],r=t.length;r--;)for(var o=t[r],c=o.schemes.length;c--;){var a=o.schemes[c];a.id===e&&n.push.apply(n,a.scopes)}return Array.from(new Set(n))}export var SecurityRequirements=function(e){var t=e.securities,n=useStore(),r=null==n?void 0:n.options.showSecuritySchemeType,o=useState(!1),c=o[0],a=o[1];if(!t.length||(null==n?void 0:n.options.hideSecuritySection))return null;var i=null==n?void 0:n.definition.securitySchemes.schemes,m=null==i?void 0:i.filter((function(e){var n=e.id;return t.find((function(e){return e.schemes.find((function(e){return e.id===n}))}))}));return React.createElement(ContentPanel,{header:l("authorizations"),onToggle:function(e){return a(e)},description:!c&&React.createElement(SecurityRequirementPanelDescription,{securities:t,showSecuritySchemeType:r}),expanded:c},c&&m&&m.length>1?React.createElement(SecurityRequirementBlock,null,t.map((function(e,n){var o,c,a="";return t.length>1&&e.schemes.length>1&&(c=0===n?"(":"",a=")"),n!==t.length-1&&(a+=" or",o=React.createElement("br",null)),React.createElement(React.Fragment,{key:e.schemes.map((function(e){return e.id})).join("")},c,React.createElement(SecurityRequirementElement,{security:e,showSecuritySchemeType:r}),a,o)}))):null,c&&m?m.map((function(e){var n=getRequiredScopes(e.id,t),r=React.createElement(RequiredScopesRow,{scopes:n});return React.createElement(SecurityDetails,{key:e.id},React.createElement("h5",null,React.createElement(LockIcon,null)," ",AUTH_TYPES[e.type]||e.type,": ",e.id),React.createElement(Markdown,{source:e.description||""}),React.createElement(StyledMarkdownBlock,{key:e.id},e.apiKey?React.createElement(React.Fragment,null,React.createElement(SecurityRow,null,React.createElement("b",null,titleize(e.apiKey.in||"")," parameter name: "),React.createElement("code",null,e.apiKey.name)),r):e.http?React.createElement(React.Fragment,null,React.createElement(SecurityRow,null,React.createElement("b",null,"HTTP Authorization Scheme: "),React.createElement("code",null,e.http.scheme)),React.createElement(SecurityRow,null,"bearer"===e.http.scheme&&e.http.bearerFormat&&React.createElement(React.Fragment,null,React.createElement("b",null,"Bearer format: "),React.createElement("code",null,e.http.bearerFormat))),r):e.openId?React.createElement(React.Fragment,null,React.createElement(SecurityRow,null,React.createElement("b",null,"Connect URL: "),React.createElement("code",null,React.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:e.openId.connectUrl},e.openId.connectUrl))),r):e.flows?Object.keys(e.flows).map((function(t){return React.createElement(OAuthFlow,{key:t,type:t,RequiredScopes:r,flow:e.flows[t]})})):null))})):null)};var templateObject_1,templateObject_2,templateObject_3,SecurityDetails=styled.div(templateObject_1||(templateObject_1=__makeTemplateObject(["\n border-bottom: 1px solid ",";\n margin-bottom: 1.5em;\n padding-bottom: 0.7em;\n &:last-child {\n border-bottom: none;\n margin-bottom: 0;\n padding-bottom: 0;\n }\n h5 {\n line-height: 1em;\n margin: 0 0 0.6em;\n font-size: ",";\n }\n .redoc-markdown p:first-child {\n display: inline;\n }\n"],["\n border-bottom: 1px solid ",";\n margin-bottom: 1.5em;\n padding-bottom: 0.7em;\n &:last-child {\n border-bottom: none;\n margin-bottom: 0;\n padding-bottom: 0;\n }\n h5 {\n line-height: 1em;\n margin: 0 0 0.6em;\n font-size: ",";\n }\n .redoc-markdown p:first-child {\n display: inline;\n }\n"])),(function(e){return e.theme.colors.border.light}),(function(e){return e.theme.typography.fontSize})),SecurityRequirementBlock=styled.div(templateObject_2||(templateObject_2=__makeTemplateObject(["\n margin-bottom: 20px;\n background-color: ",";\n border-radius: ",";\n padding: ",";\n"],["\n margin-bottom: 20px;\n background-color: ",";\n border-radius: ",";\n padding: ",";\n"])),(function(e){return e.theme.colors.secondary.main}),(function(e){return e.theme.shape.borderRadius}),(function(e){var t=e.theme;return t.sidebar.spacing.unit+"px "+1.2*t.sidebar.spacing.unit+"px"})),LockIcon=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"11",height:"11"},React.createElement("path",{fill:"currentColor",d:"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z"}))};export var SecurityRow=styled.div(templateObject_3||(templateObject_3=__makeTemplateObject(["\n margin: 0.5em 0;\n"],["\n margin: 0.5em 0;\n"])));
|
|
2
2
|
//# sourceMappingURL=SecurityRequirement.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import React from"react";import styled,{mediaCSS}from"../../styled-components";import{linksCss}from"../Markdown/styled";import{Link}from"../../common-elements";import{AUTH_TYPES}from"./SecurityRequirement";export var SecurityRequirementElement=function(e){var t=e.showSecuritySchemeType,n=e.security;return React.createElement(SecurityRequirementOrWrap,null,n.schemes.map((function(e){var n=e.scopes.length>0;return React.createElement(SecurityRequirementAndWrap,{key:e.id},t?(AUTH_TYPES[e.type]||e.type)+": ":null,React.createElement(Link,{to:e.id,security:!0},React.createElement("b",null,e.id)),n?["(",e.scopes.map((function(e
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import React from"react";import styled,{mediaCSS}from"../../styled-components";import{linksCss}from"../Markdown/styled";import{Link}from"../../common-elements";import{AUTH_TYPES}from"./SecurityRequirement";export var SecurityRequirementElement=function(e){var t=e.showSecuritySchemeType,n=e.security;return React.createElement(SecurityRequirementOrWrap,null,n.schemes.map((function(e){var n=e.scopes.length>0;return React.createElement(SecurityRequirementAndWrap,{key:e.id},t?(AUTH_TYPES[e.type]||e.type)+": ":null,React.createElement(Link,{to:e.id,security:!0},React.createElement("b",null,e.id)),n?["(",e.scopes.map((function(e){return React.createElement(ScopeName,{key:e},e)})).reduce((function(e,t){return[e,", ",t]})),")"]:null)})))};var templateObject_1,templateObject_2,templateObject_3,SecurityRequirementAndWrap=styled.span(templateObject_1||(templateObject_1=__makeTemplateObject(["\n &:after {\n content: ' and ';\n font-weight: normal;\n }\n\n &:last-child:after {\n content: none;\n }\n\n ",";\n"],["\n &:after {\n content: ' and ';\n font-weight: normal;\n }\n\n &:last-child:after {\n content: none;\n }\n\n ",";\n"])),linksCss),SecurityRequirementOrWrap=styled.span(templateObject_2||(templateObject_2=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),linksCss),ScopeName=styled.code(templateObject_3||(templateObject_3=__makeTemplateObject(["\n border: 1px solid ",";\n margin: 0 3px;\n padding: 0.2em;\n line-height: 1;\n display: inline-block;\n word-break: break-word;\n ","\n"],["\n border: 1px solid ",";\n margin: 0 3px;\n padding: 0.2em;\n line-height: 1;\n display: inline-block;\n word-break: break-word;\n ","\n"])),(function(e){return e.theme.colors.border.light}),(function(e){var t=e.theme;return mediaCSS({fontFamily:t.typography.code.fontFamily,fontSize:t.typography.code.fontSize})}));
|
|
2
2
|
//# sourceMappingURL=SecurityRequirementElement.js.map
|
package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{useState}from"react";import{AUTH_TYPES}from"./SecurityRequirement";export var SecurityRequirementPanelDescription=function(e){var t=e.securities,
|
|
1
|
+
import React,{useRef,useState}from"react";import{AUTH_TYPES}from"./SecurityRequirement";export var SecurityRequirementPanelDescription=function(e){var t=e.securities,n=e.showSecuritySchemeType,r=useRef(null),u=useState(""),c=u[0],i=u[1];return React.useLayoutEffect((function(){var e;i((null===(e=r.current)||void 0===e?void 0:e.innerText)||"")}),[r]),React.createElement("span",{ref:r,title:c},t.map((function(e,r){var u="",c="",i=e.schemes.length;return t.length>1&&i>1&&(u=0===r?"(":"",c=")"),r!==t.length-1&&(c+=" or "),React.createElement(React.Fragment,{key:e.schemes.map((function(e){return e.id})).join("")},u,i?e.schemes.map((function(e){return React.createElement("b",{key:e.id},n?(AUTH_TYPES[e.type]||e.type)+": ":null,e.id)})).reduce((function(e,t){return[e," and ",t]})):null,c)})))};
|
|
2
2
|
//# sourceMappingURL=SecurityRequirementPanelDescription.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{memo}from"react";import{Markdown}from"../Markdown";import{SeeMore}from"../SeeMore/SeeMore";import{SecurityRow}from"../SecurityRequirement/SecurityRequirement";import{hasAuthorizationUrl,hasTokenUrl}from"./helpers";var OAuthFlowComponent=function(e){var t=e.type,l=e.flow,r=e.RequiredScopes,n=Object.keys((null==l?void 0:l.scopes)||{});return React.createElement(React.Fragment,null,React.createElement(SecurityRow,null,React.createElement("b",null,"Flow type: "),React.createElement("code",null,t)," "),hasAuthorizationUrl(t,l)?React.createElement(SecurityRow,null,React.createElement("b",null,"Authorization URL: "),React.createElement("code",null,React.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:null==l?void 0:l.authorizationUrl},null==l?void 0:l.authorizationUrl))):null,hasTokenUrl(t,l)?React.createElement(SecurityRow,null,React.createElement("b",null,"Token URL: "),React.createElement("code",null,null==l?void 0:l.tokenUrl)):null,(null==l?void 0:l.refreshUrl)&&React.createElement(SecurityRow,null,React.createElement("b",null,"Refresh URL: "),React.createElement("code",null,null==l?void 0:l.refreshUrl)),n.length?React.createElement(React.Fragment,null,r||null,React.createElement(SecurityRow,null,React.createElement("b",null,"Scopes:")),React.createElement(SeeMore,{height:"4em"},React.createElement("ul",null,n.map((function(e
|
|
1
|
+
import React,{memo}from"react";import{Markdown}from"../Markdown";import{SeeMore}from"../SeeMore/SeeMore";import{SecurityRow}from"../SecurityRequirement/SecurityRequirement";import{hasAuthorizationUrl,hasTokenUrl}from"./helpers";var OAuthFlowComponent=function(e){var t=e.type,l=e.flow,r=e.RequiredScopes,n=Object.keys((null==l?void 0:l.scopes)||{});return React.createElement(React.Fragment,null,React.createElement(SecurityRow,null,React.createElement("b",null,"Flow type: "),React.createElement("code",null,t)," "),hasAuthorizationUrl(t,l)?React.createElement(SecurityRow,null,React.createElement("b",null,"Authorization URL: "),React.createElement("code",null,React.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:null==l?void 0:l.authorizationUrl},null==l?void 0:l.authorizationUrl))):null,hasTokenUrl(t,l)?React.createElement(SecurityRow,null,React.createElement("b",null,"Token URL: "),React.createElement("code",null,null==l?void 0:l.tokenUrl)):null,(null==l?void 0:l.refreshUrl)&&React.createElement(SecurityRow,null,React.createElement("b",null,"Refresh URL: "),React.createElement("code",null,null==l?void 0:l.refreshUrl)),n.length?React.createElement(React.Fragment,null,r||null,React.createElement(SecurityRow,null,React.createElement("b",null,"Scopes:")),React.createElement(SeeMore,{height:"4em"},React.createElement("ul",null,n.map((function(e){return React.createElement("li",{key:e},React.createElement("code",null,e)," - ",React.createElement(Markdown,{inline:!0,source:(null==l?void 0:l.scopes[e])||""}))}))))):null)};export var OAuthFlow=memo(OAuthFlowComponent);
|
|
2
2
|
//# sourceMappingURL=SecuritySchemes.js.map
|
|
@@ -18,12 +18,12 @@ export declare const hasTokenUrl: (type: string, flow: OAuthFlowProps['flow']) =
|
|
|
18
18
|
scopes: Record<string, string>;
|
|
19
19
|
tokenUrl: string;
|
|
20
20
|
'x-defaultClientId'?: string | undefined;
|
|
21
|
+
'x-tokenEndpointAuthMethod'?: string | undefined;
|
|
21
22
|
} | {
|
|
22
23
|
refreshUrl?: string | undefined;
|
|
23
24
|
scopes: Record<string, string>;
|
|
24
25
|
tokenUrl: string;
|
|
25
26
|
'x-defaultClientId'?: string | undefined;
|
|
26
|
-
'x-tokenEndpointAuthMethod'?: string | undefined;
|
|
27
27
|
} | {
|
|
28
28
|
refreshUrl?: string | undefined;
|
|
29
29
|
scopes: Record<string, string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{MenuItem,MenuExternalLink}from"./MenuItem";import{MenuItemUl}from"./styled.elements";var MenuItems=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props,n=t.items,r=t.root,
|
|
1
|
+
import{__assign,__decorate,__extends}from"tslib";import{observer}from"mobx-react";import*as React from"react";import{MenuItem,MenuExternalLink}from"./MenuItem";import{MenuItemUl}from"./styled.elements";var MenuItems=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props,n=t.items,r=t.root,i=t.className,o=t.linksBefore,a=void 0===o?[]:o,s=t.linksAfter,m=void 0===s?[]:s,l=null==this.props.expanded||this.props.expanded;return React.createElement(MenuItemUl,__assign({className:i,style:this.props.style,expanded:l},r?{role:"navigation"}:{}),a.map((function(e){return React.createElement(MenuExternalLink,{key:JSON.stringify(e),link:e})})),n.map((function(t){return React.createElement(MenuItem,{key:t.id,item:t,onActivate:e.props.onActivate})})),m.map((function(e){return React.createElement(MenuExternalLink,{key:JSON.stringify(e),link:e})})))}}),t=__decorate([observer],t)}(React.Component);export{MenuItems};
|
|
2
2
|
//# sourceMappingURL=MenuItems.js.map
|
|
@@ -18,11 +18,11 @@ export interface MenuItemLabelType {
|
|
|
18
18
|
}
|
|
19
19
|
export declare const MenuItemLabel: import("styled-components").StyledComponent<"label", import("../../../../services/extendTheme").ProTheme, {
|
|
20
20
|
role: "menuitem";
|
|
21
|
-
className: `-depth${number}
|
|
21
|
+
className: `-depth${number} ` | `-depth${number} active`;
|
|
22
22
|
} & MenuItemLabelType, "className" | "role">;
|
|
23
23
|
export declare const MenuItemLink: import("styled-components").StyledComponent<"a", import("../../../../services/extendTheme").ProTheme, {
|
|
24
24
|
role: "menuitem";
|
|
25
|
-
className: `-depth${number}
|
|
25
|
+
className: `-depth${number} ` | `-depth${number} active`;
|
|
26
26
|
} & MenuItemLabelType, "className" | "role">;
|
|
27
27
|
export declare const MenuItemTitle: import("styled-components").StyledComponent<"span", import("../../../../services/extendTheme").ProTheme, {
|
|
28
28
|
width?: string | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { RedocRawOptions } from '../../services/types';
|
|
3
|
+
import type { ProMenu } from '../../../../services/ProMenu';
|
|
3
4
|
import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions';
|
|
4
5
|
import { OptionsContext } from '../OptionsProvider';
|
|
5
|
-
import type { ProMenu } from '../../../../services/ProMenu';
|
|
6
6
|
export interface StickySidebarProps {
|
|
7
7
|
className?: string;
|
|
8
8
|
scrollYOffset?: RedocRawOptions['scrollYOffset'];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './ApiInfo/ApiInfo';
|
|
2
2
|
export * from './ApiLogo/ApiLogo';
|
|
3
|
-
export
|
|
3
|
+
export { OperationItem } from './OperationItem';
|
|
4
|
+
export { SectionItem } from './SectionItem';
|
|
5
|
+
export { ContentItem } from './ContentItem';
|
|
6
|
+
export { ContentItems } from './ContentItems';
|
|
4
7
|
export * from './Schema/';
|
|
5
8
|
export * from './SearchBox/SearchBox';
|
|
6
9
|
export * from './Operation/Operation';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./ApiInfo/ApiInfo";export*from"./ApiLogo/ApiLogo";export
|
|
1
|
+
export*from"./ApiInfo/ApiInfo";export*from"./ApiLogo/ApiLogo";export{OperationItem}from"./OperationItem";export{SectionItem}from"./SectionItem";export{ContentItem}from"./ContentItem";export{ContentItems}from"./ContentItems";export*from"./Schema/";export*from"./SearchBox/SearchBox";export*from"./Operation/Operation";export*from"./Loading/Loading";export*from"./JsonViewer";export*from"./Markdown";export*from"./SecuritySchemes/SecuritySchemes";export*from"./Responses/Response";export*from"./Responses/ResponseDetails";export*from"./Responses/ResponseHeaders";export*from"./Responses/ResponsesList";export*from"./Responses/ResponseSummary";export*from"./ResponseSamples/ResponseSamples";export{PayloadSamples,ExampleValue,Example,DropdownWrapper}from"./PayloadSamples";export*from"./MediaTypeSwitch/MediaTypesSwitch";export*from"./Parameters/Parameters";export*from"./DropdownOrLabel/DropdownOrLabel";export*from"./ErrorBoundary";export*from"./StoreBuilder";export*from"./OptionsProvider";export*from"./SideMenu/";export*from"./StickySidebar/StickyResponsiveSidebar";export*from"./SchemaDefinition/SchemaDefinition";export*from"./SourceCode/SourceCode";export*from"./RequestSamples/RequestSamples";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign}from"tslib";import{marked}from"marked";import{highlight,safeSlugify,unescapeHTMLChars}from"../utils";import{COMPONENT_REGEXP}from"./constants";var renderer=new marked.Renderer;marked.setOptions({renderer:renderer,highlight:function(e,r){return highlight(e,r)}});export function buildComponentComment(e){return"\x3c!-- ReDoc-Inject: <"+e+"> --\x3e"}var MarkdownRenderer=function(){function e(e){var r=this;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"headings",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"currentTopHeading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingSectionLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingEnhanceRenderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"originalHeadingRule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingRule",{enumerable:!0,configurable:!0,writable:!0,value:function(e,n,i,t){var a,o;return 1===n?r.currentTopHeading=r.saveHeading(e,n):n<=r.headingSectionLevel&&r.saveHeading(e,n,null===(a=r.currentTopHeading)||void 0===a?void 0:a.items,null===(o=r.currentTopHeading)||void 0===o?void 0:o.id),r.originalHeadingRule(e,n,i,t)}}),this.headingEnhanceRenderer=new marked.Renderer,this.parser=new marked.Parser,this.originalHeadingRule=this.headingEnhanceRenderer.heading.bind(this.headingEnhanceRenderer),this.headingEnhanceRenderer.heading=this.headingRule,this.headingSectionLevel=(null==e?void 0:e.markdownHeadingsAnchorLevel)||2}return Object.defineProperty(e,"containsComponent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return new RegExp(COMPONENT_REGEXP.replace(/{component}/g,r),"gmi").test(e)}}),Object.defineProperty(e,"getTextBeforeHading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=e.search(new RegExp("^(>\\s
|
|
1
|
+
import{__assign}from"tslib";import{marked}from"marked";import{highlight,safeSlugify,unescapeHTMLChars}from"../utils";import{COMPONENT_REGEXP}from"./constants";var renderer=new marked.Renderer;marked.setOptions({renderer:renderer,highlight:function(e,r){return highlight(e,r)}});export function buildComponentComment(e){return"\x3c!-- ReDoc-Inject: <"+e+"> --\x3e"}var MarkdownRenderer=function(){function e(e){var r=this;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"headings",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"currentTopHeading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingSectionLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingEnhanceRenderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"originalHeadingRule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headingRule",{enumerable:!0,configurable:!0,writable:!0,value:function(e,n,i,t){var a,o;return 1===n?r.currentTopHeading=r.saveHeading(e,n):n<=r.headingSectionLevel&&r.saveHeading(e,n,null===(a=r.currentTopHeading)||void 0===a?void 0:a.items,null===(o=r.currentTopHeading)||void 0===o?void 0:o.id),r.originalHeadingRule(e,n,i,t)}}),this.headingEnhanceRenderer=new marked.Renderer,this.parser=new marked.Parser,this.originalHeadingRule=this.headingEnhanceRenderer.heading.bind(this.headingEnhanceRenderer),this.headingEnhanceRenderer.heading=this.headingRule,this.headingSectionLevel=(null==e?void 0:e.markdownHeadingsAnchorLevel)||2}return Object.defineProperty(e,"containsComponent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return new RegExp(COMPONENT_REGEXP.replace(/{component}/g,r),"gmi").test(e)}}),Object.defineProperty(e,"getTextBeforeHading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=e.search(new RegExp("^(>\\s+#+|#+)?\\s+"+r,"m"));return n>-1?e.substring(0,n):e}}),Object.defineProperty(e.prototype,"saveHeading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n,i){void 0===n&&(n=this.headings),e=unescapeHTMLChars(e);var t={id:i?i+"/"+safeSlugify(e):"section/"+safeSlugify(e),name:e,level:r,items:[]};return n.push(t),t}}),Object.defineProperty(e.prototype,"flattenHeadings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e)return[];for(var r=[],n=0,i=e;n<i.length;n++){var t=i[n];r.push(t),r.push.apply(r,this.flattenHeadings(t.items))}return r}}),Object.defineProperty(e.prototype,"attachHeadingsDescriptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=function(e){return new RegExp("##?\\s+"+e.name.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))},n=this.flattenHeadings(this.headings);if(!(n.length<1)){for(var i=n[0],t=r(i),a=e.search(t),o=1;o<n.length;o++){var s=n[o],l=r(s),u=e.substr(a+1).search(l)+a+1;i.description=e.substring(a,u).replace(t,"").trim(),i=s,t=l,a=u}i.description=e.substring(a).replace(t,"").trim()}}}),Object.defineProperty(e.prototype,"renderMd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){void 0===r&&(r=!1);var n=r?{renderer:this.headingEnhanceRenderer}:void 0;return marked(e.toString(),n)}}),Object.defineProperty(e.prototype,"extractHeadings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.renderMd(e,!0),this.attachHeadingsDescriptions(e);var r=this.headings;return this.headings=[],r}}),Object.defineProperty(e.prototype,"renderMdWithComponents",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.options&&this.options.allowedMdComponents;if(!r||0===Object.keys(r).length)return[this.renderMd(e)];for(var n=Object.keys(r).join("|"),i=new RegExp(COMPONENT_REGEXP.replace(/{component}/g,n),"mig"),t=[],a=[],o=i.exec(e),s=0;o;){t.push(e.substring(s,o.index)),s=i.lastIndex;var l=r[o[1]||o[2]||o[5]],u=o[3]||o[6],d=o[4];l&&a.push({component:l.component,propsSelector:l.propsSelector,props:__assign(__assign(__assign({},parseProps(u)),l.props),{children:d})}),o=i.exec(e)}t.push(e.substring(s));for(var c=[],g=0;g<t.length;g++){var p=t[g];p&&c.push(this.renderMd(p)),a[g]&&c.push(a[g])}return c}}),e}();export{MarkdownRenderer};function parseProps(e){if(!e)return{};for(var r,n=/([\w-]+)\s*=\s*(?:{([^}]+?)}|"([^"]+?)")/gim,i={};null!==(r=n.exec(e));)if(r[3])i[r[1]]=r[3];else if(r[2]){var t=void 0;try{t=JSON.parse(r[2])}catch(e){}i[r[1]]=t}return i}
|
|
2
2
|
//# sourceMappingURL=MarkdownRenderer.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { OpenAPITag } from '../types';
|
|
2
2
|
import type { RedocProNormalizedOptions } from '../../../services';
|
|
3
|
-
import { GroupModel, OperationModel } from './models';
|
|
4
3
|
import type { OpenAPIParser } from './OpenAPIParser';
|
|
5
4
|
import type { ContentItemModel, TagGroup, TagInfo, TagsInfoMap } from './types';
|
|
5
|
+
import { GroupModel, OperationModel } from './models';
|
|
6
6
|
export declare class MenuBuilder {
|
|
7
7
|
/**
|
|
8
8
|
* Builds page content structure based on tags
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OpenAPIRef, OpenAPIDefinition } from '../types';
|
|
2
|
-
import { RedocNormalizedOptions } from './RedocNormalizedOptions';
|
|
3
2
|
import type { MergedOpenAPISchema } from './types';
|
|
3
|
+
import { RedocNormalizedOptions } from './RedocNormalizedOptions';
|
|
4
4
|
/**
|
|
5
5
|
* Loads and keeps spec. Provides raw spec operations
|
|
6
6
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OpenAPIMediaType } from '../../types';
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
|
-
import { MediaTypeModel } from './MediaType';
|
|
5
4
|
import type { OperationModel } from './Operation';
|
|
6
5
|
import type { ResponseModel } from './Response';
|
|
6
|
+
import { MediaTypeModel } from './MediaType';
|
|
7
7
|
/**
|
|
8
8
|
* MediaContent model ready to be sued by React components
|
|
9
9
|
* Contains multiple MediaTypes and keeps track of the currently active one
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { OpenAPIMediaType } from '../../types';
|
|
2
2
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
3
3
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
-
import { SchemaModel } from './Schema';
|
|
5
|
-
import { ExampleModel } from './Example';
|
|
6
4
|
import type { OperationModel } from './Operation';
|
|
7
5
|
import type { ResponseModel } from './Response';
|
|
6
|
+
import { ExampleModel } from './Example';
|
|
7
|
+
import { SchemaModel } from './Schema';
|
|
8
8
|
export declare class MediaTypeModel {
|
|
9
9
|
options: RedocProNormalizedOptions;
|
|
10
10
|
examples?: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as Sampler from"openapi-sampler";import{isFormUrlEncoded,isJsonLike,mapValues}from"../../utils";import{
|
|
1
|
+
import*as Sampler from"openapi-sampler";import{isFormUrlEncoded,isJsonLike,mapValues}from"../../utils";import{ExampleModel}from"./Example";import{SchemaModel}from"./Schema";var MediaTypeModel=function(){function e(e,i,a,t,o,l){var r=void 0===l?{}:l,s=r.operation,n=r.type,p=r.response;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isRequestType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onlyRequiredInSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"operation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i,this.operation=s,this.isRequestType=a,this.schema=t.schema&&new SchemaModel(e,t.schema,"",o,void 0,void 0,{operation:s,type:n,response:p}),this.onlyRequiredInSamples=o.onlyRequiredInSamples,void 0!==t.examples?this.examples=mapValues(t.examples,(function(a){return new ExampleModel(e,a,i,t.encoding)})):void 0!==t.example?this.examples={default:new ExampleModel(e,{value:e.deref(t.example).resolved},i,t.encoding)}:(isJsonLike(i)||isFormUrlEncoded(i))&&this.generateExample(e,t)}return Object.defineProperty(e.prototype,"generateExample",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i){var a={skipReadOnly:this.isRequestType,skipWriteOnly:!this.isRequestType,skipNonRequired:this.isRequestType&&this.onlyRequiredInSamples,maxSampleDepth:this.options.generatedPayloadSamplesMaxDepth};if(this.schema&&this.schema.oneOf){this.examples={};for(var t=0,o=this.schema.oneOf;t<o.length;t++){var l=o[t],r=Sampler.sample(l.rawSchema,a,e.definition);this.schema.discriminatorProp&&"object"==typeof r&&r&&(r[this.schema.discriminatorProp]=l.title),this.examples[l.title]=new ExampleModel(e,{value:r},this.name,i.encoding)}}else this.schema&&(this.examples={default:new ExampleModel(e,{value:Sampler.sample(i.schema,a,e.definition)},this.name,i.encoding)})}}),e}();export{MediaTypeModel};
|
|
2
2
|
//# sourceMappingURL=MediaType.js.map
|
|
@@ -2,13 +2,13 @@ import type { IMenuItem, ContentItemModel, ExtendedOpenAPIOperation, Unstable_Ex
|
|
|
2
2
|
import type { OpenAPIExternalDocumentation, OpenAPIServer, OpenAPIXCodeSample, Server } from '../../types';
|
|
3
3
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
4
|
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
5
|
+
import type { MediaContentModel } from './MediaContent';
|
|
6
|
+
import type { GroupModel } from './Group.model';
|
|
5
7
|
import { CallbackModel } from './Callback';
|
|
6
8
|
import { FieldModel } from './Field';
|
|
7
|
-
import type { MediaContentModel } from './MediaContent';
|
|
8
9
|
import { RequestBodyModel } from './RequestBody';
|
|
9
10
|
import { ResponseModel } from './Response';
|
|
10
11
|
import { SecurityRequirementModel } from './SecurityRequirement';
|
|
11
|
-
import type { GroupModel } from './Group.model';
|
|
12
12
|
export interface Sample {
|
|
13
13
|
lang: string;
|
|
14
14
|
label?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { OpenAPIRequestBody, Referenced } from '../../types';
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
|
-
import { MediaContentModel } from './MediaContent';
|
|
5
4
|
import type { OperationModel } from './Operation';
|
|
5
|
+
import { MediaContentModel } from './MediaContent';
|
|
6
6
|
declare type RequestBodyProps = {
|
|
7
7
|
parser: OpenAPIParser;
|
|
8
8
|
infoOrRef: Referenced<OpenAPIRequestBody>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OpenAPIResponse, Referenced } from '../../types';
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
|
+
import type { OperationModel } from './Operation';
|
|
4
5
|
import { FieldModel } from './Field';
|
|
5
6
|
import { MediaContentModel } from './MediaContent';
|
|
6
|
-
import type { OperationModel } from './Operation';
|
|
7
7
|
declare type ResponseProps = {
|
|
8
8
|
parser: OpenAPIParser;
|
|
9
9
|
code: string;
|
|
@@ -2,8 +2,8 @@ import type { OpenAPIExternalDocumentation, OpenAPISchema, Referenced } from '..
|
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
4
4
|
import type { MergedOpenAPISchema, ResponseModel } from '../';
|
|
5
|
-
import { FieldModel } from './Field';
|
|
6
5
|
import type { OperationModel } from './Operation';
|
|
6
|
+
import { FieldModel } from './Field';
|
|
7
7
|
export declare type Deps = {
|
|
8
8
|
parentFieldFullPath?: string;
|
|
9
9
|
operation?: OperationModel;
|
|
@@ -3,7 +3,7 @@ import type { OpenAPIOperation, OpenAPIParameter, OpenAPIServer, OpenAPITag, Ref
|
|
|
3
3
|
import type { ProStore } from '../../../services';
|
|
4
4
|
import type { OAuth2 } from '../../../services/OAuth2';
|
|
5
5
|
import type { ThemeInterface } from '../theme';
|
|
6
|
-
import type { GroupModel, OperationModel, Sample } from './models';
|
|
6
|
+
import type { ApiInfoModel, GroupModel, OperationModel, Sample } from './models';
|
|
7
7
|
export declare type MenuItemGroupType = 'group' | 'tag' | 'section' | 'schema';
|
|
8
8
|
export declare type MenuItemType = MenuItemGroupType | 'operation';
|
|
9
9
|
/** Generic interface for MenuItems */
|
|
@@ -116,6 +116,9 @@ export interface HookRawHtml {
|
|
|
116
116
|
declare type HookResult = JSX.Element | HookRawHtml | null;
|
|
117
117
|
export declare type HookConfig<T> = (props: T) => HookResult;
|
|
118
118
|
export interface HooksConfig {
|
|
119
|
+
AfterApiTitle?: HookConfig<{
|
|
120
|
+
info: ApiInfoModel;
|
|
121
|
+
}>;
|
|
119
122
|
BeforeOperation?: HookConfig<{
|
|
120
123
|
operation: OperationModel;
|
|
121
124
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ExtendedOpenAPIOperation } from '../services';
|
|
2
1
|
import type { FieldModel } from '../services/models';
|
|
3
2
|
import type { OpenAPIParser } from '../services/OpenAPIParser';
|
|
4
3
|
import type { OpenAPIEncoding, OpenAPIMediaType, OpenAPIParameter, OpenAPIParameterStyle, OpenAPISchema, OpenAPIServer, Referenced, OpenAPIResponse, OpenAPIRequestBody } from '../types';
|
|
4
|
+
import type { ExtendedOpenAPIOperation } from '../services';
|
|
5
5
|
export declare function isStatusCode(statusCode: string): boolean;
|
|
6
6
|
export declare function getStatusCodeType(statusCode: string | number, defaultAsError?: boolean): string;
|
|
7
7
|
export declare function isOperationName(key: string): boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { IValueDidChange } from 'mobx';
|
|
2
2
|
import type { ContentItemModel, IMenuItem, OpenAPIDefinition, OpenAPIExternalDocumentation, OperationModel, RedocRawOptions, SearchStore } from '../redoc-lib';
|
|
3
|
-
import { MarkerService, RedocNormalizedOptions, SpecStore } from '../redoc-lib';
|
|
4
|
-
import { ProMenu } from './ProMenu';
|
|
5
3
|
import type { SearchResultMeta } from './SearchStore';
|
|
6
4
|
import type { SpecVersions } from './VersionedSpecStore';
|
|
7
|
-
import { VersionedSpecStore } from './VersionedSpecStore';
|
|
8
5
|
import type { LicenseInfo } from './check';
|
|
9
6
|
import type { CodeSamplesConfig, Languages } from './code-samples/';
|
|
10
7
|
import type { Events } from './store-types';
|
|
11
|
-
import { LayoutVariant } from './store-types';
|
|
12
8
|
import type { ExternalLink, MarkdownItemsPagination, Normalized, Pagination, RedocProTheme } from './types';
|
|
9
|
+
import { MarkerService, RedocNormalizedOptions, SpecStore } from '../redoc-lib';
|
|
10
|
+
import { ProMenu } from './ProMenu';
|
|
11
|
+
import { VersionedSpecStore } from './VersionedSpecStore';
|
|
12
|
+
import { LayoutVariant } from './store-types';
|
|
13
13
|
import { SideNavStyle } from './types';
|
|
14
14
|
export declare type RedocProUserOptionsExt = {
|
|
15
15
|
licenseKey?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IMenuItem, OperationModel, RedocNormalizedOptions, SearchResult } from '../redoc-lib';
|
|
2
|
-
import { SearchStore } from '../redoc-lib';
|
|
3
2
|
import type { RedocProUserOptionsExt } from './ProStore';
|
|
3
|
+
import { SearchStore } from '../redoc-lib';
|
|
4
4
|
export declare type SearchResultMeta = {
|
|
5
5
|
place?: string;
|
|
6
6
|
path?: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OpenAPIDefinition, ApiInfoModel, OpenAPIParser, OpenAPIExternalDocumentation, SecuritySchemesModel, ContentItemModel } from '../redoc-lib';
|
|
2
|
-
import { SpecStore } from '../redoc-lib';
|
|
3
2
|
import type { RedocProNormalizedOptions } from './ProStore';
|
|
3
|
+
import { SpecStore } from '../redoc-lib';
|
|
4
4
|
interface VersionInfo {
|
|
5
5
|
id: string;
|
|
6
6
|
title: string;
|
|
@@ -11,6 +11,7 @@ export declare type CustomHAR = HAR.Request & {
|
|
|
11
11
|
[key in string]: string;
|
|
12
12
|
};
|
|
13
13
|
serverVariables?: ServerVariables;
|
|
14
|
+
allResponseCodes?: string[];
|
|
14
15
|
};
|
|
15
16
|
export declare function getCodeSample({ lang, operation, exampleName, pathParams, properties, options, }: {
|
|
16
17
|
lang: Languages;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign}from"tslib";import{parse as parseQueryString,stringify as stringifyQueryString}from"query-string";import*as Sampler from"openapi-sampler";import merge from"deepmerge";import{toJS}from"mobx";import{deleteEmptyArrayItem,isArrayOfObjects,serializeParameterValue}from"../../redoc-lib";import{getSecurityDetails,getParameterValue}from"../../utils";import{normalizeMimeType,arrayMergeStrategy}from"../utils";import{MediaTypes}from"../../types";import{l}from"../../redoc-lib/src/services/Labels";import{HTTPSnippet}from"./httpsnippet";import StringUtility from"./httpsnippet/helpers/string-utility";function mapOperationToHAR(e,t){var a,r,i,n,s,o,l,u,p,d,c=t.exampleName,m=void 0===c?"":c,v=t.skipOptionalParameters,h=void 0!==v&&v,f=t.withOAuth2Call,y=void 0!==f&&f,g=t.spec,O=t.generatedPayloadSamplesMaxDepth,S=void 0===O?8:O,_=t.pathParams,T=void 0===_?{}:_,C=t.properties,E=void 0===C?{}:C,b=getSecurityData(null===(a=e.security)||void 0===a?void 0:a[0],y),A=b.securityHeaders,P=b.securityCookies,
|
|
1
|
+
import{__assign}from"tslib";import{parse as parseQueryString,stringify as stringifyQueryString}from"query-string";import*as Sampler from"openapi-sampler";import merge from"deepmerge";import{toJS}from"mobx";import{deleteEmptyArrayItem,isArrayOfObjects,serializeParameterValue}from"../../redoc-lib";import{getSecurityDetails,getParameterValue}from"../../utils";import{normalizeMimeType,arrayMergeStrategy}from"../utils";import{MediaTypes}from"../../types";import{l}from"../../redoc-lib/src/services/Labels";import{HTTPSnippet}from"./httpsnippet";import StringUtility from"./httpsnippet/helpers/string-utility";function mapOperationToHAR(e,t){var a,r,i,n,s,o,l,u,p,d,c=t.exampleName,m=void 0===c?"":c,v=t.skipOptionalParameters,h=void 0!==v&&v,f=t.withOAuth2Call,y=void 0!==f&&f,g=t.spec,O=t.generatedPayloadSamplesMaxDepth,S=void 0===O?8:O,_=t.pathParams,T=void 0===_?{}:_,C=t.properties,E=void 0===C?{}:C,b=getSecurityData(null===(a=e.security)||void 0===a?void 0:a[0],y),A=b.securityHeaders,P=b.securityCookies,R=b.securityQueries,w=b.securityOAuth2ExtraCalls,D=b.basicAuth,k=null===(i=null===(r=e.requestBody)||void 0===r?void 0:r.content)||void 0===i?void 0:i.active,q={skipNonRequired:h,skipReadOnly:!0,maxSampleDepth:S},H={path:toJS(null===(n=null==e?void 0:e.requestValues)||void 0===n?void 0:n.path),cookie:toJS(null===(s=null==e?void 0:e.requestValues)||void 0===s?void 0:s.cookie),header:toJS(null===(o=null==e?void 0:e.requestValues)||void 0===o?void 0:o.header),query:toJS(null===(l=null==e?void 0:e.requestValues)||void 0===l?void 0:l.query),body:toJS(null===(u=null==e?void 0:e.requestValues)||void 0===u?void 0:u.body)},x=!1,M=e.parameters.filter((function(e){return"header"===e.in})).filter((function(e){return!(h&&!e.required)})).map((function(e){var t;return{name:e.name,value:(null===(t=H.header)||void 0===t?void 0:t[e.name])||getParameterValue("header",e.name)||serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,q,g))}})).map((function(e){return(null==k?void 0:k.name)&&"content-type"===e.name.toLowerCase()&&(x=!0,e.value=k.name),e})).concat(A);!x&&(null==k?void 0:k.name)&&M.unshift({name:"Content-Type",value:null==k?void 0:k.name});var N=e.parameters.filter((function(e){return"cookie"===e.in})).filter((function(e){return!(h&&!e.required)})).map((function(e){return parseQueryString(serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,q,g)))})).reduce((function(e,t){for(var a,r=0,i=Object.entries(t);r<i.length;r++){var n=i[r],s=n[0],o=n[1];e.push({name:s,value:String((null===(a=H.cookie)||void 0===a?void 0:a[s])||o)})}return e}),[]).concat(P),U=e.parameters.filter((function(e){return"query"===e.in})).filter((function(e){return!(h&&!e.required)})).map((function(e){return parseQueryString(serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,q,g)))})).reduce((function(e,t){for(var a,r,i,n=0,s=Object.entries(t);n<s.length;n++){var o=s[n],l=o[0],u=o[1];e.push({name:l,value:isArrayOfObjects(null===(a=H.query)||void 0===a?void 0:a[l])&&JSON.stringify(deleteEmptyArrayItem(null===(r=H.query)||void 0===r?void 0:r[l]))||String((null===(i=H.query)||void 0===i?void 0:i[l])||u)})}return e}),[]).concat(R),z=(null===(p=e.activeServer)||void 0===p?void 0:p.url.replace(/\/$/,""))+"/"+e.path.replace(/^\//,""),V=e.parameters.filter((function(e){return"path"===e.in})).reduce((function(e,t){var a,r=t.in,i=t.name;return e[i]=(null===(a=H.path)||void 0===a?void 0:a[i])||T[i]||getParameterValue(r,i),e}),{}),j=null===(d=null==k?void 0:k.examples)||void 0===d?void 0:d[m],I=(null==k?void 0:k.examples)||{},J=Object.values(I)[0],L=H.body||(null==j?void 0:j.value)||(null==J?void 0:J.value)||(null==k?void 0:k.schema)&&Sampler.sample(null==k?void 0:k.schema.rawSchema,q,g),Y=null==k?void 0:k.name.toLowerCase(),Q="",B=[];switch(normalizeMimeType(Y)){case MediaTypes.JSON:Q=JSON.stringify(getDataRequest(L,E));break;case MediaTypes.URL_ENCODED:case MediaTypes.MULTIPART:Q=stringifyQueryString(getDataRequest(L,E)),B=objectToHarParams(getDataRequest(L,E));break;default:Q=String(L||"")}var K=Q?{mimeType:(null==k?void 0:k.name)||MediaTypes.OCTET_STREAM,text:Q,params:B}:void 0,F=e.responses.map((function(e){return e.code}));return{method:e.httpVerb,url:z,httpVersion:"HTTP/1.1",cookies:N,headers:M,queryString:U,postData:K,headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:w,basicAuth:D,pathParameters:V,serverVariables:e.activeServer.variables,allResponseCodes:F}}var defaultOptions={withImports:!0,withComments:!1},langToSnippetConfig={curl:{code:"shell",defaultTarget:"curl",defaultOptions:__assign(__assign({},defaultOptions),{short:!0})},JavaScript:{code:"javascript",defaultTarget:"fetch",defaultOptions:__assign(__assign({},defaultOptions),{withImports:!1})},"Node.js":{code:"node",defaultTarget:"fetch",defaultOptions:__assign({},defaultOptions)},Python:{code:"python",defaultTarget:"requests",defaultOptions:__assign({},defaultOptions)},"Java8+Apache":{code:"java8",defaultTarget:"apachehttp",defaultOptions:__assign({},defaultOptions)},Java:{code:"java",defaultTarget:"httpclient",defaultOptions:__assign({},defaultOptions)},"C#":{code:"csharp",defaultTarget:"httpclient",defaultOptions:__assign({},defaultOptions)},Go:{code:"go",defaultTarget:"http.DefaultClient",defaultOptions:__assign({},defaultOptions)},PHP:{code:"php",defaultTarget:"curl",defaultOptions:__assign({},defaultOptions)},Ruby:{code:"ruby",defaultTarget:"net::http",defaultOptions:__assign({},defaultOptions)},R:{code:"r",defaultTarget:"httr",defaultOptions:__assign({},defaultOptions)}};export function getCodeSample(e){var t=e.lang,a=e.operation,r=e.exampleName,i=e.pathParams,n=e.properties,s=e.options,o=void 0===s?{}:s;try{var l=mapOperationToHAR(a,{exampleName:r,pathParams:i,properties:n,skipOptionalParameters:o.skipOptionalParameters,withOAuth2Call:o.withOAuth2Call,spec:o.spec,generatedPayloadSamplesMaxDepth:o.generatedPayloadSamplesMaxDepth}),u=new HTTPSnippet(l);return langToSnippetConfig[t]?u.convert(langToSnippetConfig[t].code,langToSnippetConfig[t].defaultTarget,__assign(__assign({},langToSnippetConfig[t].defaultOptions),o)):"Language is not supported."}catch(e){return console.error(e),"Failed to generate code sample."}}function getSecurityData(e,t){for(var a,r,i,n,s={securityHeaders:[],securityCookies:[],securityQueries:[],securityOAuth2ExtraCalls:[],basicAuth:void 0},o=0,u=(null==e?void 0:e.schemes)||[];o<u.length;o++){var p=u[o],d=getSecurityDetails(p.id);switch(p.type){case"openIdConnect":null===(a=s.securityHeaders)||void 0===a||a.push({name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"});break;case"oauth2":var c=d.token?(d.token.token_type||"Bearer")+" "+d.token.access_token:"Bearer <YOUR_TOKEN_HERE>";p.flows.clientCredentials&&t?s.securityOAuth2ExtraCalls.push(getOAuth2ClientCredsCallHar(p.flows.clientCredentials,p.scopes,d)):p.flows.password&&t&&s.securityOAuth2ExtraCalls.push(getOAuth2PasswordCallHar(p.flows.password,p.scopes,d)),null===(r=s.securityHeaders)||void 0===r||r.push({name:"Authorization",value:c});break;case"apiKey":var m=d.raw||"YOUR_API_KEY_HERE";"header"===p.in&&(null===(i=s.securityHeaders)||void 0===i||i.push({name:p.name,value:m})),"cookie"===p.in&&s.securityCookies.push({name:p.name,value:m}),"query"===p.in&&s.securityQueries.push({name:p.name,value:m});break;case"http":"basic"===p.scheme?s.basicAuth={username:d.username||"<"+StringUtility.toSnakeCase(l("tryItAuthBasicUsername"))+">",password:d.password||"<"+StringUtility.toSnakeCase(l("tryItAuthBasicPassword"))+">"}:null===(n=s.securityHeaders)||void 0===n||n.push({name:"Authorization",value:capitalizeFirst(p.scheme||"bearer")+" <YOUR_"+(p.bearerFormat||"TOKEN")+"_HERE>"})}}return s}function getOAuth2PasswordCallHar(e,t,a){return{method:"POST",url:e.tokenUrl,httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:MediaTypes.URL_ENCODED},{name:"Accept",value:MediaTypes.JSON}],queryString:[],postData:{mimeType:MediaTypes.URL_ENCODED,text:"",params:[{name:"grant_type",value:"password"},{name:"client_id",value:a.client_id||"YOUR_CLIENT_ID"},{name:"client_secret",value:a.client_secret||"YOUR_CLIENT_SECRET"},{name:"username",value:a.username||"<username>"},{name:"password",value:a.password||"<password>"},t.length?{name:"scope",value:t.join(" ")}:void 0].filter(isDefined)},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}}function getOAuth2ClientCredsCallHar(e,t,a){return{method:"POST",url:e.tokenUrl,httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:MediaTypes.URL_ENCODED},{name:"Accept",value:MediaTypes.JSON}],queryString:[],postData:{mimeType:MediaTypes.URL_ENCODED,text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:a.client_id||"YOUR_CLIENT_ID"},{name:"client_secret",value:a.client_secret||"YOUR_CLIENT_SECRET"},t.length?{name:"scope",value:t.join(" ")}:void 0].filter(isDefined)},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}}function getDataRequest(e,t){if(e){if("object"==typeof e)return merge(e,t,{arrayMerge:arrayMergeStrategy});try{return merge(JSON.parse(e),t,{arrayMerge:arrayMergeStrategy})}catch(e){return!1}}return!1}function objectToHarParams(e){for(var t=[],a=0,r=Object.entries(e);a<r.length;a++){var i=r[a],n=i[0],s=i[1];t.push({name:n,value:String(s)})}return t}export function isDefined(e){return void 0!==e}export function capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}
|
|
2
2
|
//# sourceMappingURL=generator.js.map
|