@redocly/openapi-docs 3.0.0-alpha.13 → 3.0.0-alpha.14
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/console.redocly-openapi-docs.min.js +507 -0
- package/dist/oauth2-redirect.js +3 -3
- package/dist/redocly-openapi-docs.min.js +6792 -0
- package/lib/components/ApiInfo/ApiInfo.d.ts +1 -4
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/index.d.ts +0 -1
- package/lib/components/ApiInfo/styled.d.ts +3 -1
- package/lib/components/ApiInfo/styled.js +1 -1
- package/lib/components/ApiInfo/types.d.ts +9 -4
- package/lib/components/CallbackSamples/CallbackSamples.d.ts +2 -3
- package/lib/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib/components/Callbacks/CallbackDetails.d.ts +1 -1
- package/lib/components/Callbacks/CallbackDetails.js +1 -1
- package/lib/components/Callbacks/CallbackOperation.js +1 -1
- package/lib/components/Callbacks/CallbacksList.js +1 -1
- package/lib/components/ChangeViewButton/ChangeViewButton.d.ts +1 -0
- package/lib/components/ChangeViewButton/ChangeViewButton.js +2 -0
- package/lib/components/ChangeViewButton/index.d.ts +1 -0
- package/lib/components/ChangeViewButton/index.js +2 -0
- package/lib/components/ChangeViewButton/styled.d.ts +3 -0
- package/lib/components/ChangeViewButton/styled.js +18 -0
- package/lib/components/ContentItem/ContentItem.d.ts +6 -6
- package/lib/components/ContentItem/ContentItem.js +1 -1
- package/lib/components/ContentItems/ContentItems.d.ts +10 -4
- package/lib/components/ContentItems/ContentItems.js +1 -1
- package/lib/components/ContentItems/helpers.d.ts +11 -0
- package/lib/components/ContentItems/helpers.js +2 -0
- package/lib/components/ContentItems/useAutoScroll.d.ts +1 -0
- package/lib/components/ContentItems/useAutoScroll.js +2 -0
- package/lib/components/DiscriminatorDropdown/DiscriminatorDropdown.d.ts +2 -2
- package/lib/components/DiscriminatorDropdown/DiscriminatorDropdown.js +1 -1
- package/lib/components/Download/DownloadButtonWithLabel.d.ts +3 -4
- package/lib/components/Download/DownloadButtonWithLabel.js +1 -1
- package/lib/components/Download/types.d.ts +12 -0
- package/lib/components/Download/useDownloadInfo.d.ts +2 -0
- package/lib/components/Download/useDownloadInfo.js +2 -0
- package/lib/components/Endpoint/Endpoint.js +1 -1
- package/lib/components/Endpoint/ServerList.js +1 -1
- package/lib/components/ExternalDocumentation/ExternalDocumentation.d.ts +2 -2
- package/lib/components/ExternalDocumentation/ExternalDocumentation.js +2 -2
- package/lib/components/Fields/DescriptionEnums.js +1 -1
- package/lib/components/Fields/EnumValues.js +1 -1
- package/lib/components/Fields/Examples.js +1 -1
- package/lib/components/Fields/Extensions.js +2 -2
- package/lib/components/Fields/Field.d.ts +3 -2
- package/lib/components/Fields/Field.js +1 -1
- package/lib/components/Fields/FieldDetails.d.ts +2 -3
- package/lib/components/Fields/FieldDetails.js +1 -1
- package/lib/components/Fields/SimpleEnums.js +1 -1
- package/lib/components/Fields/types.d.ts +0 -1
- package/lib/components/GenericChildrenSwitcher/GenericChildrenSwitcher.js +1 -1
- package/lib/components/Markdown/Markdown.d.ts +1 -1
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/Markdown/index.d.ts +0 -2
- package/lib/components/Markdown/index.js +1 -1
- package/lib/components/Markdown/styled.js +1 -3
- package/lib/components/Markdown/types.d.ts +5 -13
- package/lib/components/MediaTypeSwitch/MediaTypesSwitch.d.ts +2 -2
- package/lib/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib/components/NextSectionButton/NextSectionButton.d.ts +8 -0
- package/lib/components/NextSectionButton/NextSectionButton.js +2 -0
- package/lib/components/NextSectionButton/index.d.ts +1 -0
- package/lib/components/NextSectionButton/index.js +2 -0
- package/lib/components/NextSectionButton/styled.d.ts +1 -0
- package/lib/components/NextSectionButton/styled.js +18 -0
- package/lib/components/OperationItem/OperationItem.d.ts +3 -0
- package/lib/components/OperationItem/OperationItem.js +9 -0
- package/lib/components/OperationItem/index.d.ts +2 -0
- package/lib/components/OperationItem/index.js +2 -0
- package/lib/components/OperationItem/types.d.ts +4 -0
- package/lib/components/{Operation → OperationItem}/types.js +0 -0
- package/lib/components/Overlay.d.ts +2 -7
- package/lib/components/Overlay.js +1 -1
- package/lib/components/Panel/ResponsePanel.js +2 -2
- package/lib/components/Parameters/BodyContent.d.ts +3 -2
- package/lib/components/Parameters/BodyContent.js +1 -1
- package/lib/components/Parameters/ParametersGroup.js +1 -1
- package/lib/components/PayloadSamples/MediaTypeSamples.d.ts +2 -3
- package/lib/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib/components/PayloadSamples/PayloadSamples.d.ts +2 -3
- package/lib/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib/components/PayloadSamples/types.d.ts +1 -2
- package/lib/components/PayloadSamples/useExternalExample.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/Providers.d.ts +6 -0
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +2 -0
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +4 -0
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +2 -0
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsMultiStandalone.d.ts +2 -0
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsMultiStandalone.js +2 -0
- package/lib/components/RedoclyOpenAPIDocs/index.d.ts +5 -0
- package/lib/components/RedoclyOpenAPIDocs/index.js +2 -0
- package/lib/components/RedoclyOpenAPIDocs/styled.d.ts +13 -0
- package/lib/components/RedoclyOpenAPIDocs/styled.js +170 -0
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +63 -0
- package/lib/components/{types.js → RedoclyOpenAPIDocs/types.js} +0 -0
- package/lib/components/RedoclyOpenAPIDocs/utils.d.ts +10 -0
- package/lib/components/RedoclyOpenAPIDocs/utils.js +2 -0
- package/lib/components/RequestSamples/CodeSample.d.ts +1 -1
- package/lib/components/RequestSamples/CodeSample.js +1 -1
- package/lib/components/RequestSamples/Example.d.ts +2 -2
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.d.ts +4 -1
- package/lib/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/components/Responses/Response.d.ts +1 -3
- package/lib/components/Responses/Response.js +1 -1
- package/lib/components/Responses/ResponseSummary.js +14 -1
- package/lib/components/Responses/styled.js +2 -2
- package/lib/components/Samples/SamplesTabs.d.ts +3 -2
- package/lib/components/Samples/SamplesTabs.js +1 -1
- package/lib/components/Samples/use-example-key.d.ts +1 -1
- package/lib/components/Samples/use-example-key.js +1 -1
- package/lib/components/Schema/ObjectSchema.d.ts +1 -1
- package/lib/components/Schema/ObjectSchema.js +1 -1
- package/lib/components/Schema/OneOfSchema.d.ts +1 -1
- package/lib/components/Schema/OneOfSchema.js +1 -1
- package/lib/components/Schema/RecursiveSchema.d.ts +1 -1
- package/lib/components/Schema/RecursiveSchema.js +1 -1
- package/lib/components/Schema/Schema.d.ts +1 -1
- package/lib/components/Schema/Schema.js +1 -1
- package/lib/components/SchemaDefinition/SchemaDefinition.d.ts +1 -7
- package/lib/components/SchemaDefinition/SchemaDefinition.js +1 -1
- package/lib/components/Search/MenuItemSearch.d.ts +2 -0
- package/lib/components/Search/MenuItemSearch.js +2 -0
- package/lib/components/Search/Search.d.ts +3 -0
- package/lib/components/Search/Search.js +2 -0
- package/lib/components/Search/SearchBox.d.ts +2 -8
- package/lib/components/Search/SearchBox.js +1 -1
- package/lib/components/Search/index.d.ts +1 -0
- package/lib/components/Search/index.js +1 -1
- package/lib/components/Search/types.d.ts +11 -8
- package/lib/components/Search/utils.js +1 -1
- package/lib/components/SectionContent/SectionContent.d.ts +15 -0
- package/lib/components/SectionContent/SectionContent.js +2 -0
- package/lib/components/SectionContent/index.d.ts +1 -0
- package/lib/components/SectionContent/index.js +2 -0
- package/lib/components/SectionItem/SectionItem.d.ts +2 -3
- package/lib/components/SectionItem/SectionItem.js +1 -1
- package/lib/components/SecurityRequirement/PanelDescription.d.ts +1 -6
- package/lib/components/SecurityRequirement/RequirementElement.d.ts +2 -7
- package/lib/components/SecurityRequirement/RequirementElement.js +3 -3
- package/lib/components/SecurityRequirement/SecurityDefs.d.ts +1 -7
- package/lib/components/SecurityRequirement/SecurityDefs.js +1 -1
- package/lib/components/SecurityRequirement/SecurityRequirement.d.ts +3 -6
- package/lib/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib/components/SecurityRequirement/constants.d.ts +6 -6
- package/lib/components/SecurityRequirement/constants.js +1 -1
- package/lib/components/SecurityRequirement/types.d.ts +19 -0
- package/lib/components/SecurityRequirement/types.js +2 -0
- package/lib/components/SecurityRequirement/useSecurityRequirements.d.ts +3 -0
- package/lib/components/SecurityRequirement/useSecurityRequirements.js +2 -0
- package/lib/components/SecuritySchemes/OAuthFlow.d.ts +3 -0
- package/lib/components/SecuritySchemes/OAuthFlow.js +2 -0
- package/lib/components/SecuritySchemes/helpers.d.ts +1 -1
- package/lib/components/SecuritySchemes/index.d.ts +1 -1
- package/lib/components/SecuritySchemes/index.js +1 -1
- package/lib/components/SecuritySchemes/types.d.ts +0 -1
- package/lib/components/SideMenu/MenuItem.d.ts +7 -5
- package/lib/components/SideMenu/MenuItem.js +1 -1
- package/lib/components/SideMenu/MenuItemEternalLink.d.ts +1 -2
- package/lib/components/SideMenu/MenuItemEternalLink.js +1 -1
- package/lib/components/SideMenu/MenuItemLink.d.ts +3 -0
- package/lib/components/SideMenu/MenuItemLink.js +2 -0
- package/lib/components/SideMenu/MenuItems.d.ts +2 -1
- package/lib/components/SideMenu/MenuItems.js +1 -1
- package/lib/components/SideMenu/MenuOperationItemContent.d.ts +5 -3
- package/lib/components/SideMenu/MenuOperationItemContent.js +2 -2
- package/lib/components/SideMenu/SideMenu.d.ts +8 -5
- package/lib/components/SideMenu/SideMenu.js +1 -1
- package/lib/components/SideMenu/styled.d.ts +10 -5
- package/lib/components/SideMenu/styled.js +12 -12
- package/lib/components/SideMenu/types.d.ts +10 -4
- package/lib/components/SideMenu/useMenuItemLink.d.ts +18 -0
- package/lib/components/SideMenu/useMenuItemLink.js +2 -0
- package/lib/components/StickySidebar/StickyResponsiveSidebar.d.ts +4 -6
- package/lib/components/StickySidebar/StickyResponsiveSidebar.js +2 -3
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabs.d.ts +2 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabs.js +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.d.ts +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
- package/lib/components/TagItem/TagItem.d.ts +2 -0
- package/lib/components/TagItem/TagItem.js +2 -0
- package/lib/components/TagItem/index.d.ts +1 -0
- package/lib/components/TagItem/index.js +2 -0
- package/lib/components/TagItems/TagItems.d.ts +13 -0
- package/lib/components/TagItems/TagItems.js +2 -0
- package/lib/components/TagItems/index.d.ts +1 -0
- package/lib/components/TagItems/index.js +2 -0
- package/lib/components/ToggleRightPanelButton/ToggleRightPanelButton.d.ts +1 -0
- package/lib/components/ToggleRightPanelButton/ToggleRightPanelButton.js +2 -0
- package/lib/components/ToggleRightPanelButton/index.d.ts +1 -0
- package/lib/components/ToggleRightPanelButton/index.js +2 -0
- package/lib/components/ToggleRightPanelButton/styled.d.ts +3 -0
- package/lib/components/ToggleRightPanelButton/styled.js +17 -0
- package/lib/components/VersionSwitcher.d.ts +4 -3
- package/lib/components/VersionSwitcher.js +1 -1
- package/lib/components/common/Dropdown/Dropdown.js +2 -2
- package/lib/components/common/Fields/fields-layout.d.ts +0 -1
- package/lib/components/common/Fields/fields-layout.js +1 -6
- package/lib/components/common/LinkToField.d.ts +11 -2
- package/lib/components/common/LinkToField.js +9 -22
- package/lib/components/common/Portal/Portal.d.ts +6 -0
- package/lib/components/common/Portal/Portal.js +2 -0
- package/lib/components/common/Portal/index.d.ts +1 -0
- package/lib/components/common/Portal/index.js +2 -0
- package/lib/components/{ContentItems → common/Skeleton}/Skeleton.d.ts +0 -0
- package/lib/components/{ContentItems → common/Skeleton}/Skeleton.js +2 -2
- package/lib/components/common/Skeleton/index.d.ts +1 -0
- package/lib/components/common/Skeleton/index.js +2 -0
- package/lib/components/common/headers.d.ts +0 -6
- package/lib/components/common/headers.js +1 -25
- package/lib/components/common/index.d.ts +4 -2
- package/lib/components/common/index.js +1 -1
- package/lib/components/common/linkify.d.ts +3 -7
- package/lib/components/common/linkify.js +6 -51
- package/lib/components/common/panels.js +7 -4
- package/lib/components/common/perfect-scrollbar.js +2 -2
- package/lib/components/icons/LockIcon.d.ts +1 -1
- package/lib/components/icons/Spinner.d.ts +1 -1
- package/lib/components/index.d.ts +8 -9
- package/lib/components/index.js +1 -1
- package/lib/components/pluggable/PullRight.d.ts +3 -2
- package/lib/components/pluggable/PullRight.js +1 -55
- package/lib/components/pluggable/RedocExample.d.ts +1 -3
- package/lib/components/pluggable/RedocExample.js +1 -1
- package/lib/components/pluggable/RedocRequestBody.d.ts +1 -3
- package/lib/components/pluggable/RedocRequestBody.js +1 -1
- package/lib/components/pluggable/RedocResponse.d.ts +1 -3
- package/lib/components/pluggable/RedocResponse.js +1 -1
- package/lib/components/pluggable/RedocSchema.d.ts +1 -3
- package/lib/components/pluggable/RedocSchema.js +1 -1
- package/lib/components/rightPanel/CodemirrorInput/CodemirrorInput.js +1 -1
- package/lib/components/rightPanel/CodemirrorInput/helpers.d.ts +1 -10
- package/lib/components/rightPanel/CodemirrorInput/helpers.js +1 -1
- package/lib/components/rightPanel/Console/Console.d.ts +2 -2
- package/lib/components/rightPanel/Console/Console.js +1 -1
- package/lib/components/rightPanel/Console/ConsoleLazy.js +1 -1
- package/lib/components/rightPanel/Console/ConsoleWrapper.d.ts +5 -2
- package/lib/components/rightPanel/Console/ConsoleWrapper.js +1 -1
- package/lib/components/rightPanel/Console/Request.d.ts +3 -12
- package/lib/components/rightPanel/Console/Request.js +1 -1
- package/lib/components/rightPanel/Console/types.d.ts +14 -3
- package/lib/components/rightPanel/OAuth2Flow/OAuth2Flow.js +1 -1
- package/lib/components/rightPanel/OpenIDConnect.d.ts +2 -2
- package/lib/components/rightPanel/RequestBody/Body.d.ts +1 -1
- package/lib/components/rightPanel/RequestBody/Body.js +1 -1
- package/lib/components/rightPanel/RequestBody/RequestBody.d.ts +1 -1
- package/lib/components/rightPanel/RequestBody/RequestBody.js +1 -1
- package/lib/components/rightPanel/RequestBody/types.d.ts +1 -0
- package/lib/components/rightPanel/RequestBodyForm.d.ts +6 -3
- package/lib/components/rightPanel/RequestBodyForm.js +1 -1
- package/lib/components/rightPanel/ResponseHeadersList.js +1 -1
- package/lib/components/rightPanel/ServerVariable.d.ts +1 -1
- package/lib/components/rightPanel/ServerVariable.js +1 -1
- package/lib/components/rightPanel/ServersDropdown/ServersDropdown.d.ts +2 -1
- package/lib/components/rightPanel/ServersDropdown/ServersDropdown.js +1 -1
- package/lib/components/rightPanel/utils.d.ts +3 -2
- package/lib/components/rightPanel/utils.js +1 -1
- package/lib/constants.d.ts +0 -2
- package/lib/constants.js +1 -1
- package/lib/events/codeSampleCopy.js +1 -1
- package/lib/events/types.d.ts +2 -2
- package/lib/hoc/types.d.ts +38 -0
- package/lib/hoc/types.js +2 -0
- package/lib/hoc/utils.d.ts +2 -0
- package/lib/hoc/utils.js +2 -0
- package/lib/hoc/withRouter.d.ts +3 -0
- package/lib/hoc/withRouter.js +2 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useActivateExample.d.ts +2 -0
- package/lib/hooks/useActivateExample.js +2 -0
- package/lib/hooks/useContentItems.d.ts +12 -0
- package/lib/hooks/useContentItems.js +2 -0
- package/lib/hooks/useLicense.d.ts +5 -0
- package/lib/hooks/useLicense.js +2 -0
- package/lib/hooks/useRouter.d.ts +11 -0
- package/lib/hooks/useRouter.js +2 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -1
- package/lib/models/callback.d.ts +5 -0
- package/lib/models/callback.js +2 -0
- package/lib/models/example.d.ts +10 -0
- package/lib/models/example.js +2 -0
- package/lib/models/field.d.ts +7 -0
- package/lib/models/field.js +2 -0
- package/lib/models/group.d.ts +4 -0
- package/lib/models/group.js +2 -0
- package/lib/models/index.d.ts +13 -14
- package/lib/models/index.js +1 -1
- package/lib/models/mediaContent.d.ts +7 -0
- package/lib/models/mediaContent.js +2 -0
- package/lib/models/mediaType.d.ts +20 -0
- package/lib/models/mediaType.js +2 -0
- package/lib/models/operation.d.ts +18 -0
- package/lib/models/operation.js +2 -0
- package/lib/models/request.d.ts +12 -0
- package/lib/models/request.js +2 -0
- package/lib/models/response.d.ts +15 -0
- package/lib/models/response.js +2 -0
- package/lib/models/schema.d.ts +14 -0
- package/lib/models/schema.js +2 -0
- package/lib/models/security.d.ts +13 -0
- package/lib/models/security.js +2 -0
- package/lib/models/types.d.ts +233 -3
- package/lib/recoil/app.d.ts +32 -0
- package/lib/recoil/app.js +2 -0
- package/lib/recoil/operation.d.ts +11 -0
- package/lib/recoil/operation.js +2 -0
- package/lib/recoil/store.d.ts +19 -0
- package/lib/recoil/store.js +2 -0
- package/lib/services/OpenAPIParser.d.ts +1 -1
- package/lib/services/OpenAPIParser.js +1 -1
- package/lib/services/Options/index.d.ts +1 -1
- package/lib/services/Options/index.js +1 -1
- package/lib/services/Options/{NormalizedOptions.d.ts → normalizeOptions.d.ts} +1 -1
- package/lib/services/Options/normalizeOptions.js +2 -0
- package/lib/services/Options/types.d.ts +31 -15
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/index.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/index.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/shell/curl.d.ts +2 -2
- package/lib/services/code-samples/types.d.ts +2 -2
- package/lib/services/history/helpers.d.ts +1 -1
- package/lib/services/history/helpers.js +1 -1
- package/lib/services/history/index.d.ts +1 -4
- package/lib/services/history/index.js +1 -1
- package/lib/services/index.d.ts +2 -7
- package/lib/services/index.js +1 -1
- package/lib/services/menu/builder.d.ts +9 -0
- package/lib/services/menu/builder.js +2 -0
- package/lib/services/menu/helpers.d.ts +6 -0
- package/lib/services/menu/helpers.js +2 -0
- package/lib/services/menu/index.d.ts +1 -0
- package/lib/services/menu/index.js +2 -0
- package/lib/services/menu/markdown.d.ts +11 -0
- package/lib/services/menu/markdown.js +2 -0
- package/lib/services/menu/operation.d.ts +13 -0
- package/lib/services/menu/operation.js +2 -0
- package/lib/services/menu/tags.d.ts +27 -0
- package/lib/services/menu/tags.js +2 -0
- package/lib/services/search/DeepSearchStore.d.ts +3 -3
- package/lib/services/search/DeepSearchStore.js +1 -1
- package/lib/services/search/SearchStore.d.ts +1 -1
- package/lib/services/search/useSearch.d.ts +13 -0
- package/lib/services/search/useSearch.js +2 -0
- package/lib/services/types.d.ts +42 -91
- package/lib/services/types.js +1 -1
- package/lib/services/utils.d.ts +1 -0
- package/lib/services/utils.js +1 -1
- package/lib/standalone.d.ts +5 -5
- package/lib/standalone.js +1 -1
- package/lib/testProviders.d.ts +2 -2
- package/lib/testProviders.js +1 -1
- package/lib/types/app.d.ts +1 -0
- package/lib/types/app.js +2 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -1
- package/lib/types/open-api.d.ts +15 -15
- package/lib/utils/compose.d.ts +1 -0
- package/lib/utils/compose.js +2 -0
- package/lib/utils/helpers.d.ts +2 -1
- package/lib/utils/helpers.js +1 -1
- package/lib/utils/index.d.ts +3 -2
- package/lib/utils/index.js +1 -1
- package/lib/utils/local-storage.js +1 -1
- package/lib/utils/openapi.d.ts +11 -7
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/saveTextBeforeHeading.d.ts +1 -0
- package/lib/utils/saveTextBeforeHeading.js +2 -0
- package/lib/utils/typeGuards.d.ts +3 -0
- package/lib/utils/typeGuards.js +2 -0
- package/lib-esm/components/ApiInfo/ApiInfo.d.ts +1 -4
- package/lib-esm/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/components/ApiInfo/index.d.ts +0 -1
- package/lib-esm/components/ApiInfo/styled.d.ts +3 -1
- package/lib-esm/components/ApiInfo/styled.js +1 -1
- package/lib-esm/components/ApiInfo/types.d.ts +9 -4
- package/lib-esm/components/CallbackSamples/CallbackSamples.d.ts +2 -3
- package/lib-esm/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib-esm/components/Callbacks/CallbackDetails.d.ts +1 -1
- package/lib-esm/components/Callbacks/CallbackDetails.js +1 -1
- package/lib-esm/components/Callbacks/CallbackOperation.js +1 -1
- package/lib-esm/components/Callbacks/CallbacksList.js +1 -1
- package/lib-esm/components/ChangeViewButton/ChangeViewButton.d.ts +1 -0
- package/lib-esm/components/ChangeViewButton/ChangeViewButton.js +2 -0
- package/lib-esm/components/ChangeViewButton/index.d.ts +1 -0
- package/lib-esm/components/ChangeViewButton/index.js +2 -0
- package/lib-esm/components/ChangeViewButton/styled.d.ts +3 -0
- package/lib-esm/components/ChangeViewButton/styled.js +18 -0
- package/lib-esm/components/ContentItem/ContentItem.d.ts +6 -6
- package/lib-esm/components/ContentItem/ContentItem.js +1 -1
- package/lib-esm/components/ContentItems/ContentItems.d.ts +10 -4
- package/lib-esm/components/ContentItems/ContentItems.js +1 -1
- package/lib-esm/components/ContentItems/helpers.d.ts +11 -0
- package/lib-esm/components/ContentItems/helpers.js +2 -0
- package/lib-esm/components/ContentItems/useAutoScroll.d.ts +1 -0
- package/lib-esm/components/ContentItems/useAutoScroll.js +2 -0
- package/lib-esm/components/DiscriminatorDropdown/DiscriminatorDropdown.d.ts +2 -2
- package/lib-esm/components/DiscriminatorDropdown/DiscriminatorDropdown.js +1 -1
- package/lib-esm/components/Download/DownloadButtonWithLabel.d.ts +3 -4
- package/lib-esm/components/Download/DownloadButtonWithLabel.js +1 -1
- package/lib-esm/components/Download/types.d.ts +12 -0
- package/lib-esm/components/Download/useDownloadInfo.d.ts +2 -0
- package/lib-esm/components/Download/useDownloadInfo.js +2 -0
- package/lib-esm/components/Endpoint/Endpoint.js +1 -1
- package/lib-esm/components/Endpoint/ServerList.js +1 -1
- package/lib-esm/components/ExternalDocumentation/ExternalDocumentation.d.ts +2 -2
- package/lib-esm/components/ExternalDocumentation/ExternalDocumentation.js +3 -3
- package/lib-esm/components/Fields/DescriptionEnums.js +1 -1
- package/lib-esm/components/Fields/EnumValues.js +1 -1
- package/lib-esm/components/Fields/Examples.js +1 -1
- package/lib-esm/components/Fields/Extensions.js +2 -2
- package/lib-esm/components/Fields/Field.d.ts +3 -2
- package/lib-esm/components/Fields/Field.js +1 -1
- package/lib-esm/components/Fields/FieldDetails.d.ts +2 -3
- package/lib-esm/components/Fields/FieldDetails.js +1 -1
- package/lib-esm/components/Fields/SimpleEnums.js +1 -1
- package/lib-esm/components/Fields/types.d.ts +0 -1
- package/lib-esm/components/GenericChildrenSwitcher/GenericChildrenSwitcher.js +1 -1
- package/lib-esm/components/Markdown/Markdown.d.ts +1 -1
- package/lib-esm/components/Markdown/Markdown.js +1 -1
- package/lib-esm/components/Markdown/index.d.ts +0 -2
- package/lib-esm/components/Markdown/index.js +1 -1
- package/lib-esm/components/Markdown/styled.js +1 -3
- package/lib-esm/components/Markdown/types.d.ts +5 -13
- package/lib-esm/components/MediaTypeSwitch/MediaTypesSwitch.d.ts +2 -2
- package/lib-esm/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib-esm/components/NextSectionButton/NextSectionButton.d.ts +8 -0
- package/lib-esm/components/NextSectionButton/NextSectionButton.js +2 -0
- package/lib-esm/components/NextSectionButton/index.d.ts +1 -0
- package/lib-esm/components/NextSectionButton/index.js +2 -0
- package/lib-esm/components/NextSectionButton/styled.d.ts +1 -0
- package/lib-esm/components/NextSectionButton/styled.js +18 -0
- package/lib-esm/components/OperationItem/OperationItem.d.ts +3 -0
- package/lib-esm/components/OperationItem/OperationItem.js +9 -0
- package/lib-esm/components/OperationItem/index.d.ts +2 -0
- package/lib-esm/components/OperationItem/index.js +2 -0
- package/lib-esm/components/OperationItem/types.d.ts +4 -0
- package/lib-esm/components/{Operation → OperationItem}/types.js +0 -0
- package/lib-esm/components/Overlay.d.ts +2 -7
- package/lib-esm/components/Overlay.js +1 -1
- package/lib-esm/components/Panel/ResponsePanel.js +1 -1
- package/lib-esm/components/Parameters/BodyContent.d.ts +3 -2
- package/lib-esm/components/Parameters/BodyContent.js +1 -1
- package/lib-esm/components/Parameters/ParametersGroup.js +1 -1
- package/lib-esm/components/PayloadSamples/MediaTypeSamples.d.ts +2 -3
- package/lib-esm/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib-esm/components/PayloadSamples/PayloadSamples.d.ts +2 -3
- package/lib-esm/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib-esm/components/PayloadSamples/types.d.ts +1 -2
- package/lib-esm/components/PayloadSamples/useExternalExample.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/Providers.d.ts +6 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/Providers.js +2 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +4 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +2 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsMultiStandalone.d.ts +2 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsMultiStandalone.js +2 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/index.d.ts +5 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/index.js +2 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.d.ts +13 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.js +170 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/types.d.ts +63 -0
- package/lib-esm/components/{types.js → RedoclyOpenAPIDocs/types.js} +0 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/utils.d.ts +10 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/utils.js +2 -0
- package/lib-esm/components/RequestSamples/CodeSample.d.ts +1 -1
- package/lib-esm/components/RequestSamples/CodeSample.js +1 -1
- package/lib-esm/components/RequestSamples/Example.d.ts +2 -2
- package/lib-esm/components/RequestSamples/Example.js +1 -1
- package/lib-esm/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib-esm/components/RequestSamples/RequestSamples.js +1 -1
- package/lib-esm/components/ResponseSamples/ResponseSamples.d.ts +4 -1
- package/lib-esm/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib-esm/components/Responses/Response.d.ts +1 -3
- package/lib-esm/components/Responses/Response.js +1 -1
- package/lib-esm/components/Responses/ResponseSummary.js +14 -1
- package/lib-esm/components/Responses/styled.js +2 -2
- package/lib-esm/components/Samples/SamplesTabs.d.ts +3 -2
- package/lib-esm/components/Samples/SamplesTabs.js +1 -1
- package/lib-esm/components/Samples/use-example-key.d.ts +1 -1
- package/lib-esm/components/Samples/use-example-key.js +1 -1
- package/lib-esm/components/Schema/ObjectSchema.d.ts +1 -1
- package/lib-esm/components/Schema/ObjectSchema.js +1 -1
- package/lib-esm/components/Schema/OneOfSchema.d.ts +1 -1
- package/lib-esm/components/Schema/OneOfSchema.js +1 -1
- package/lib-esm/components/Schema/RecursiveSchema.d.ts +1 -1
- package/lib-esm/components/Schema/RecursiveSchema.js +1 -1
- package/lib-esm/components/Schema/Schema.d.ts +1 -1
- package/lib-esm/components/Schema/Schema.js +1 -1
- package/lib-esm/components/SchemaDefinition/SchemaDefinition.d.ts +1 -7
- package/lib-esm/components/SchemaDefinition/SchemaDefinition.js +1 -1
- package/lib-esm/components/Search/MenuItemSearch.d.ts +2 -0
- package/lib-esm/components/Search/MenuItemSearch.js +2 -0
- package/lib-esm/components/Search/Search.d.ts +3 -0
- package/lib-esm/components/Search/Search.js +2 -0
- package/lib-esm/components/Search/SearchBox.d.ts +2 -8
- package/lib-esm/components/Search/SearchBox.js +1 -1
- package/lib-esm/components/Search/index.d.ts +1 -0
- package/lib-esm/components/Search/index.js +1 -1
- package/lib-esm/components/Search/types.d.ts +11 -8
- package/lib-esm/components/Search/utils.js +1 -1
- package/lib-esm/components/SectionContent/SectionContent.d.ts +15 -0
- package/lib-esm/components/SectionContent/SectionContent.js +2 -0
- package/lib-esm/components/SectionContent/index.d.ts +1 -0
- package/lib-esm/components/SectionContent/index.js +2 -0
- package/lib-esm/components/SectionItem/SectionItem.d.ts +2 -3
- package/lib-esm/components/SectionItem/SectionItem.js +1 -1
- package/lib-esm/components/SecurityRequirement/PanelDescription.d.ts +1 -6
- package/lib-esm/components/SecurityRequirement/RequirementElement.d.ts +2 -7
- package/lib-esm/components/SecurityRequirement/RequirementElement.js +1 -1
- package/lib-esm/components/SecurityRequirement/SecurityDefs.d.ts +1 -7
- package/lib-esm/components/SecurityRequirement/SecurityDefs.js +1 -1
- package/lib-esm/components/SecurityRequirement/SecurityRequirement.d.ts +3 -6
- package/lib-esm/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib-esm/components/SecurityRequirement/constants.d.ts +6 -6
- package/lib-esm/components/SecurityRequirement/constants.js +1 -1
- package/lib-esm/components/SecurityRequirement/types.d.ts +19 -0
- package/lib-esm/components/SecurityRequirement/types.js +2 -0
- package/lib-esm/components/SecurityRequirement/useSecurityRequirements.d.ts +3 -0
- package/lib-esm/components/SecurityRequirement/useSecurityRequirements.js +2 -0
- package/lib-esm/components/SecuritySchemes/OAuthFlow.d.ts +3 -0
- package/lib-esm/components/SecuritySchemes/OAuthFlow.js +2 -0
- package/lib-esm/components/SecuritySchemes/helpers.d.ts +1 -1
- package/lib-esm/components/SecuritySchemes/index.d.ts +1 -1
- package/lib-esm/components/SecuritySchemes/index.js +1 -1
- package/lib-esm/components/SecuritySchemes/types.d.ts +0 -1
- package/lib-esm/components/SideMenu/MenuItem.d.ts +7 -5
- package/lib-esm/components/SideMenu/MenuItem.js +1 -1
- package/lib-esm/components/SideMenu/MenuItemEternalLink.d.ts +1 -2
- package/lib-esm/components/SideMenu/MenuItemEternalLink.js +1 -1
- package/lib-esm/components/SideMenu/MenuItemLink.d.ts +3 -0
- package/lib-esm/components/SideMenu/MenuItemLink.js +2 -0
- package/lib-esm/components/SideMenu/MenuItems.d.ts +2 -1
- package/lib-esm/components/SideMenu/MenuItems.js +1 -1
- package/lib-esm/components/SideMenu/MenuOperationItemContent.d.ts +5 -3
- package/lib-esm/components/SideMenu/MenuOperationItemContent.js +2 -2
- package/lib-esm/components/SideMenu/SideMenu.d.ts +8 -5
- package/lib-esm/components/SideMenu/SideMenu.js +1 -1
- package/lib-esm/components/SideMenu/styled.d.ts +10 -5
- package/lib-esm/components/SideMenu/styled.js +12 -12
- package/lib-esm/components/SideMenu/types.d.ts +10 -4
- package/lib-esm/components/SideMenu/useMenuItemLink.d.ts +18 -0
- package/lib-esm/components/SideMenu/useMenuItemLink.js +2 -0
- package/lib-esm/components/StickySidebar/StickyResponsiveSidebar.d.ts +4 -6
- package/lib-esm/components/StickySidebar/StickyResponsiveSidebar.js +2 -3
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabs.d.ts +2 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabs.js +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/TagItem/TagItem.d.ts +2 -0
- package/lib-esm/components/TagItem/TagItem.js +2 -0
- package/lib-esm/components/TagItem/index.d.ts +1 -0
- package/lib-esm/components/TagItem/index.js +2 -0
- package/lib-esm/components/TagItems/TagItems.d.ts +13 -0
- package/lib-esm/components/TagItems/TagItems.js +2 -0
- package/lib-esm/components/TagItems/index.d.ts +1 -0
- package/lib-esm/components/TagItems/index.js +2 -0
- package/lib-esm/components/ToggleRightPanelButton/ToggleRightPanelButton.d.ts +1 -0
- package/lib-esm/components/ToggleRightPanelButton/ToggleRightPanelButton.js +2 -0
- package/lib-esm/components/ToggleRightPanelButton/index.d.ts +1 -0
- package/lib-esm/components/ToggleRightPanelButton/index.js +2 -0
- package/lib-esm/components/ToggleRightPanelButton/styled.d.ts +3 -0
- package/lib-esm/components/ToggleRightPanelButton/styled.js +17 -0
- package/lib-esm/components/VersionSwitcher.d.ts +4 -3
- package/lib-esm/components/VersionSwitcher.js +1 -1
- package/lib-esm/components/common/Dropdown/Dropdown.js +2 -2
- package/lib-esm/components/common/Fields/fields-layout.d.ts +0 -1
- package/lib-esm/components/common/Fields/fields-layout.js +0 -5
- package/lib-esm/components/common/LinkToField.d.ts +11 -2
- package/lib-esm/components/common/LinkToField.js +9 -22
- package/lib-esm/components/common/Portal/Portal.d.ts +6 -0
- package/lib-esm/components/common/Portal/Portal.js +2 -0
- package/lib-esm/components/common/Portal/index.d.ts +1 -0
- package/lib-esm/components/common/Portal/index.js +2 -0
- package/lib-esm/components/{ContentItems → common/Skeleton}/Skeleton.d.ts +0 -0
- package/lib-esm/components/{ContentItems → common/Skeleton}/Skeleton.js +1 -1
- package/lib-esm/components/common/Skeleton/index.d.ts +1 -0
- package/lib-esm/components/common/Skeleton/index.js +2 -0
- package/lib-esm/components/common/headers.d.ts +0 -6
- package/lib-esm/components/common/headers.js +1 -25
- package/lib-esm/components/common/index.d.ts +4 -2
- package/lib-esm/components/common/index.js +1 -1
- package/lib-esm/components/common/linkify.d.ts +3 -7
- package/lib-esm/components/common/linkify.js +6 -51
- package/lib-esm/components/common/panels.js +13 -10
- package/lib-esm/components/common/perfect-scrollbar.js +2 -2
- package/lib-esm/components/icons/LockIcon.d.ts +1 -1
- package/lib-esm/components/icons/Spinner.d.ts +1 -1
- package/lib-esm/components/index.d.ts +8 -9
- package/lib-esm/components/index.js +1 -1
- package/lib-esm/components/pluggable/PullRight.d.ts +3 -2
- package/lib-esm/components/pluggable/PullRight.js +1 -55
- package/lib-esm/components/pluggable/RedocExample.d.ts +1 -3
- package/lib-esm/components/pluggable/RedocExample.js +1 -1
- package/lib-esm/components/pluggable/RedocRequestBody.d.ts +1 -3
- package/lib-esm/components/pluggable/RedocRequestBody.js +1 -1
- package/lib-esm/components/pluggable/RedocResponse.d.ts +1 -3
- package/lib-esm/components/pluggable/RedocResponse.js +1 -1
- package/lib-esm/components/pluggable/RedocSchema.d.ts +1 -3
- package/lib-esm/components/pluggable/RedocSchema.js +1 -1
- package/lib-esm/components/rightPanel/CodemirrorInput/CodemirrorInput.js +1 -1
- package/lib-esm/components/rightPanel/CodemirrorInput/helpers.d.ts +1 -10
- package/lib-esm/components/rightPanel/CodemirrorInput/helpers.js +1 -1
- package/lib-esm/components/rightPanel/Console/Console.d.ts +2 -2
- package/lib-esm/components/rightPanel/Console/Console.js +1 -1
- package/lib-esm/components/rightPanel/Console/ConsoleLazy.js +1 -1
- package/lib-esm/components/rightPanel/Console/ConsoleWrapper.d.ts +5 -2
- package/lib-esm/components/rightPanel/Console/ConsoleWrapper.js +1 -1
- package/lib-esm/components/rightPanel/Console/Request.d.ts +3 -12
- package/lib-esm/components/rightPanel/Console/Request.js +1 -1
- package/lib-esm/components/rightPanel/Console/types.d.ts +14 -3
- package/lib-esm/components/rightPanel/OAuth2Flow/OAuth2Flow.js +1 -1
- package/lib-esm/components/rightPanel/OpenIDConnect.d.ts +2 -2
- package/lib-esm/components/rightPanel/RequestBody/Body.d.ts +1 -1
- package/lib-esm/components/rightPanel/RequestBody/Body.js +1 -1
- package/lib-esm/components/rightPanel/RequestBody/RequestBody.d.ts +1 -1
- package/lib-esm/components/rightPanel/RequestBody/RequestBody.js +1 -1
- package/lib-esm/components/rightPanel/RequestBody/types.d.ts +1 -0
- package/lib-esm/components/rightPanel/RequestBodyForm.d.ts +6 -3
- package/lib-esm/components/rightPanel/RequestBodyForm.js +1 -1
- package/lib-esm/components/rightPanel/ResponseHeadersList.js +1 -1
- package/lib-esm/components/rightPanel/ServerVariable.d.ts +1 -1
- package/lib-esm/components/rightPanel/ServerVariable.js +1 -1
- package/lib-esm/components/rightPanel/ServersDropdown/ServersDropdown.d.ts +2 -1
- package/lib-esm/components/rightPanel/ServersDropdown/ServersDropdown.js +1 -1
- package/lib-esm/components/rightPanel/utils.d.ts +3 -2
- package/lib-esm/components/rightPanel/utils.js +1 -1
- package/lib-esm/constants.d.ts +0 -2
- package/lib-esm/constants.js +1 -1
- package/lib-esm/events/codeSampleCopy.js +1 -1
- package/lib-esm/events/types.d.ts +2 -2
- package/lib-esm/hoc/types.d.ts +38 -0
- package/lib-esm/hoc/types.js +2 -0
- package/lib-esm/hoc/utils.d.ts +2 -0
- package/lib-esm/hoc/utils.js +2 -0
- package/lib-esm/hoc/withRouter.d.ts +3 -0
- package/lib-esm/hoc/withRouter.js +2 -0
- package/lib-esm/hooks/index.d.ts +4 -0
- package/lib-esm/hooks/index.js +1 -1
- package/lib-esm/hooks/useActivateExample.d.ts +2 -0
- package/lib-esm/hooks/useActivateExample.js +2 -0
- package/lib-esm/hooks/useContentItems.d.ts +12 -0
- package/lib-esm/hooks/useContentItems.js +2 -0
- package/lib-esm/hooks/useLicense.d.ts +5 -0
- package/lib-esm/hooks/useLicense.js +2 -0
- package/lib-esm/hooks/useRouter.d.ts +11 -0
- package/lib-esm/hooks/useRouter.js +2 -0
- package/lib-esm/index.d.ts +2 -1
- package/lib-esm/index.js +1 -1
- package/lib-esm/models/callback.d.ts +5 -0
- package/lib-esm/models/callback.js +2 -0
- package/lib-esm/models/example.d.ts +10 -0
- package/lib-esm/models/example.js +2 -0
- package/lib-esm/models/field.d.ts +7 -0
- package/lib-esm/models/field.js +2 -0
- package/lib-esm/models/group.d.ts +4 -0
- package/lib-esm/models/group.js +2 -0
- package/lib-esm/models/index.d.ts +13 -14
- package/lib-esm/models/index.js +1 -1
- package/lib-esm/models/mediaContent.d.ts +7 -0
- package/lib-esm/models/mediaContent.js +2 -0
- package/lib-esm/models/mediaType.d.ts +20 -0
- package/lib-esm/models/mediaType.js +2 -0
- package/lib-esm/models/operation.d.ts +18 -0
- package/lib-esm/models/operation.js +2 -0
- package/lib-esm/models/request.d.ts +12 -0
- package/lib-esm/models/request.js +2 -0
- package/lib-esm/models/response.d.ts +15 -0
- package/lib-esm/models/response.js +2 -0
- package/lib-esm/models/schema.d.ts +14 -0
- package/lib-esm/models/schema.js +2 -0
- package/lib-esm/models/security.d.ts +13 -0
- package/lib-esm/models/security.js +2 -0
- package/lib-esm/models/types.d.ts +233 -3
- package/lib-esm/recoil/app.d.ts +32 -0
- package/lib-esm/recoil/app.js +2 -0
- package/lib-esm/recoil/operation.d.ts +11 -0
- package/lib-esm/recoil/operation.js +2 -0
- package/lib-esm/recoil/store.d.ts +19 -0
- package/lib-esm/recoil/store.js +2 -0
- package/lib-esm/services/OpenAPIParser.d.ts +1 -1
- package/lib-esm/services/OpenAPIParser.js +1 -1
- package/lib-esm/services/Options/index.d.ts +1 -1
- package/lib-esm/services/Options/index.js +1 -1
- package/lib-esm/services/Options/{NormalizedOptions.d.ts → normalizeOptions.d.ts} +1 -1
- package/lib-esm/services/Options/normalizeOptions.js +2 -0
- package/lib-esm/services/Options/types.d.ts +31 -15
- package/lib-esm/services/code-samples/generator.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/index.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/javascript/index.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/shell/curl.d.ts +2 -2
- package/lib-esm/services/code-samples/types.d.ts +2 -2
- package/lib-esm/services/history/helpers.d.ts +1 -1
- package/lib-esm/services/history/helpers.js +1 -1
- package/lib-esm/services/history/index.d.ts +1 -4
- package/lib-esm/services/history/index.js +1 -1
- package/lib-esm/services/index.d.ts +2 -7
- package/lib-esm/services/index.js +1 -1
- package/lib-esm/services/menu/builder.d.ts +9 -0
- package/lib-esm/services/menu/builder.js +2 -0
- package/lib-esm/services/menu/helpers.d.ts +6 -0
- package/lib-esm/services/menu/helpers.js +2 -0
- package/lib-esm/services/menu/index.d.ts +1 -0
- package/lib-esm/services/menu/index.js +2 -0
- package/lib-esm/services/menu/markdown.d.ts +11 -0
- package/lib-esm/services/menu/markdown.js +2 -0
- package/lib-esm/services/menu/operation.d.ts +13 -0
- package/lib-esm/services/menu/operation.js +2 -0
- package/lib-esm/services/menu/tags.d.ts +27 -0
- package/lib-esm/services/menu/tags.js +2 -0
- package/lib-esm/services/search/DeepSearchStore.d.ts +3 -3
- package/lib-esm/services/search/DeepSearchStore.js +1 -1
- package/lib-esm/services/search/SearchStore.d.ts +1 -1
- package/lib-esm/services/search/useSearch.d.ts +13 -0
- package/lib-esm/services/search/useSearch.js +2 -0
- package/lib-esm/services/types.d.ts +42 -91
- package/lib-esm/services/types.js +1 -1
- package/lib-esm/services/utils.d.ts +1 -0
- package/lib-esm/services/utils.js +1 -1
- package/lib-esm/standalone.d.ts +5 -5
- package/lib-esm/standalone.js +1 -1
- package/lib-esm/testProviders.d.ts +2 -2
- package/lib-esm/testProviders.js +1 -1
- package/lib-esm/types/app.d.ts +1 -0
- package/lib-esm/types/app.js +2 -0
- package/lib-esm/types/index.d.ts +1 -0
- package/lib-esm/types/index.js +1 -1
- package/lib-esm/types/open-api.d.ts +15 -15
- package/lib-esm/utils/compose.d.ts +1 -0
- package/lib-esm/utils/compose.js +2 -0
- package/lib-esm/utils/helpers.d.ts +2 -1
- package/lib-esm/utils/helpers.js +1 -1
- package/lib-esm/utils/index.d.ts +3 -2
- package/lib-esm/utils/index.js +1 -1
- package/lib-esm/utils/local-storage.js +1 -1
- package/lib-esm/utils/openapi.d.ts +11 -7
- package/lib-esm/utils/openapi.js +1 -1
- package/lib-esm/utils/saveTextBeforeHeading.d.ts +1 -0
- package/lib-esm/utils/saveTextBeforeHeading.js +2 -0
- package/lib-esm/utils/typeGuards.d.ts +3 -0
- package/lib-esm/utils/typeGuards.js +2 -0
- package/package.json +11 -15
- package/bin/cli/assets/redoc-fast-scroll.js +0 -22
- package/bin/cli/assets/template.hbs +0 -24
- package/bin/cli/commands/redocly-docs-cli.min.js +0 -6187
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +0 -358
- package/dist/console.redocly-reference-docs.min.js +0 -507
- package/dist/redocly-reference-docs.min.js +0 -6289
- package/lib/cli/assets/redoc-fast-scroll.d.ts +0 -0
- package/lib/cli/assets/redoc-fast-scroll.js +0 -2
- package/lib/cli/cli.d.ts +0 -2
- package/lib/cli/cli.js +0 -3
- package/lib/cli/commands/bundle.d.ts +0 -1
- package/lib/cli/commands/bundle.js +0 -2
- package/lib/cli/commands/index.d.ts +0 -1
- package/lib/cli/commands/index.js +0 -2
- package/lib/cli/constants.d.ts +0 -3
- package/lib/cli/constants.js +0 -2
- package/lib/cli/utils.d.ts +0 -16
- package/lib/cli/utils.js +0 -2
- package/lib/components/Markdown/AdvancedMarkdown.d.ts +0 -2
- package/lib/components/Markdown/AdvancedMarkdown.js +0 -2
- package/lib/components/Markdown/SanitizedMarkdownHTML.d.ts +0 -6
- package/lib/components/Markdown/SanitizedMarkdownHTML.js +0 -2
- package/lib/components/NextSectionButton.d.ts +0 -13
- package/lib/components/NextSectionButton.js +0 -8
- package/lib/components/Operation/Operation.d.ts +0 -4
- package/lib/components/Operation/Operation.js +0 -8
- package/lib/components/Operation/index.d.ts +0 -2
- package/lib/components/Operation/index.js +0 -2
- package/lib/components/Operation/types.d.ts +0 -6
- package/lib/components/ProProviders.d.ts +0 -9
- package/lib/components/ProProviders.js +0 -2
- package/lib/components/RedoclyReferenceDocs.d.ts +0 -26
- package/lib/components/RedoclyReferenceDocs.js +0 -54
- package/lib/components/RedoclyReferenceDocsMultiStandalone.d.ts +0 -7
- package/lib/components/RedoclyReferenceDocsMultiStandalone.js +0 -2
- package/lib/components/Search/MenuItemProSearch.d.ts +0 -2
- package/lib/components/Search/MenuItemProSearch.js +0 -2
- package/lib/components/SecuritySchemes/SecuritySchemes.d.ts +0 -3
- package/lib/components/SecuritySchemes/SecuritySchemes.js +0 -2
- package/lib/components/SideMenu/MenuItemLinkOrLabel.d.ts +0 -7
- package/lib/components/SideMenu/MenuItemLinkOrLabel.js +0 -2
- package/lib/components/StoreProvider.d.ts +0 -22
- package/lib/components/StoreProvider.js +0 -2
- package/lib/components/styled.elements.d.ts +0 -19
- package/lib/components/styled.elements.js +0 -166
- package/lib/components/types.d.ts +0 -8
- package/lib/context/OptionsProvider.d.ts +0 -6
- package/lib/context/OptionsProvider.js +0 -2
- package/lib/context/StoreProvider.d.ts +0 -6
- package/lib/context/StoreProvider.js +0 -2
- package/lib/context/index.d.ts +0 -2
- package/lib/context/index.js +0 -2
- package/lib/models/ApiInfo.d.ts +0 -17
- package/lib/models/ApiInfo.js +0 -2
- package/lib/models/Callback.d.ts +0 -11
- package/lib/models/Callback.js +0 -2
- package/lib/models/Example.d.ts +0 -17
- package/lib/models/Example.js +0 -2
- package/lib/models/Field.d.ts +0 -34
- package/lib/models/Field.js +0 -2
- package/lib/models/Group.d.ts +0 -26
- package/lib/models/Group.js +0 -2
- package/lib/models/MediaContent.d.ts +0 -31
- package/lib/models/MediaContent.js +0 -2
- package/lib/models/MediaType.d.ts +0 -27
- package/lib/models/MediaType.js +0 -2
- package/lib/models/Operation.d.ts +0 -92
- package/lib/models/Operation.js +0 -2
- package/lib/models/RequestBody.d.ts +0 -18
- package/lib/models/RequestBody.js +0 -2
- package/lib/models/Response.d.ts +0 -28
- package/lib/models/Response.js +0 -2
- package/lib/models/Schema.d.ts +0 -78
- package/lib/models/Schema.js +0 -2
- package/lib/models/SecurityRequirement.d.ts +0 -12
- package/lib/models/SecurityRequirement.js +0 -2
- package/lib/models/SecuritySchemes.d.ts +0 -25
- package/lib/models/SecuritySchemes.js +0 -2
- package/lib/models/Webhook.d.ts +0 -8
- package/lib/models/Webhook.js +0 -2
- package/lib/services/MarkdownRenderer.d.ts +0 -23
- package/lib/services/MarkdownRenderer.js +0 -2
- package/lib/services/MenuBuilder.d.ts +0 -63
- package/lib/services/MenuBuilder.js +0 -2
- package/lib/services/Options/NormalizedOptions.js +0 -2
- package/lib/services/ProMenu.d.ts +0 -108
- package/lib/services/ProMenu.js +0 -2
- package/lib/services/ProStore.d.ts +0 -92
- package/lib/services/ProStore.js +0 -2
- package/lib/services/ScrollService.d.ts +0 -18
- package/lib/services/ScrollService.js +0 -2
- package/lib/services/SpecStore.d.ts +0 -18
- package/lib/services/SpecStore.js +0 -2
- package/lib/services/VersionedSpecStore.d.ts +0 -42
- package/lib/services/VersionedSpecStore.js +0 -2
- package/lib/services/history/FakeHistoryService.d.ts +0 -20
- package/lib/services/history/FakeHistoryService.js +0 -2
- package/lib/services/history/HistoryService.d.ts +0 -15
- package/lib/services/history/HistoryService.js +0 -2
- package/lib/services/history/ProHashHistoryService.d.ts +0 -25
- package/lib/services/history/ProHashHistoryService.js +0 -2
- package/lib/services/history/PushStateHistoryService.d.ts +0 -24
- package/lib/services/history/PushStateHistoryService.js +0 -2
- package/lib/utils/memoize.d.ts +0 -1
- package/lib/utils/memoize.js +0 -2
- package/lib/utils/store.d.ts +0 -3
- package/lib/utils/store.js +0 -2
- package/lib-esm/cli/assets/redoc-fast-scroll.d.ts +0 -0
- package/lib-esm/cli/assets/redoc-fast-scroll.js +0 -2
- package/lib-esm/cli/cli.d.ts +0 -2
- package/lib-esm/cli/cli.js +0 -3
- package/lib-esm/cli/commands/bundle.d.ts +0 -1
- package/lib-esm/cli/commands/bundle.js +0 -2
- package/lib-esm/cli/commands/index.d.ts +0 -1
- package/lib-esm/cli/commands/index.js +0 -2
- package/lib-esm/cli/constants.d.ts +0 -3
- package/lib-esm/cli/constants.js +0 -2
- package/lib-esm/cli/utils.d.ts +0 -16
- package/lib-esm/cli/utils.js +0 -2
- package/lib-esm/components/Markdown/AdvancedMarkdown.d.ts +0 -2
- package/lib-esm/components/Markdown/AdvancedMarkdown.js +0 -2
- package/lib-esm/components/Markdown/SanitizedMarkdownHTML.d.ts +0 -6
- package/lib-esm/components/Markdown/SanitizedMarkdownHTML.js +0 -2
- package/lib-esm/components/NextSectionButton.d.ts +0 -13
- package/lib-esm/components/NextSectionButton.js +0 -8
- package/lib-esm/components/Operation/Operation.d.ts +0 -4
- package/lib-esm/components/Operation/Operation.js +0 -8
- package/lib-esm/components/Operation/index.d.ts +0 -2
- package/lib-esm/components/Operation/index.js +0 -2
- package/lib-esm/components/Operation/types.d.ts +0 -6
- package/lib-esm/components/ProProviders.d.ts +0 -9
- package/lib-esm/components/ProProviders.js +0 -2
- package/lib-esm/components/RedoclyReferenceDocs.d.ts +0 -26
- package/lib-esm/components/RedoclyReferenceDocs.js +0 -54
- package/lib-esm/components/RedoclyReferenceDocsMultiStandalone.d.ts +0 -7
- package/lib-esm/components/RedoclyReferenceDocsMultiStandalone.js +0 -2
- package/lib-esm/components/Search/MenuItemProSearch.d.ts +0 -2
- package/lib-esm/components/Search/MenuItemProSearch.js +0 -2
- package/lib-esm/components/SecuritySchemes/SecuritySchemes.d.ts +0 -3
- package/lib-esm/components/SecuritySchemes/SecuritySchemes.js +0 -2
- package/lib-esm/components/SideMenu/MenuItemLinkOrLabel.d.ts +0 -7
- package/lib-esm/components/SideMenu/MenuItemLinkOrLabel.js +0 -2
- package/lib-esm/components/StoreProvider.d.ts +0 -22
- package/lib-esm/components/StoreProvider.js +0 -2
- package/lib-esm/components/styled.elements.d.ts +0 -19
- package/lib-esm/components/styled.elements.js +0 -166
- package/lib-esm/components/types.d.ts +0 -8
- package/lib-esm/context/OptionsProvider.d.ts +0 -6
- package/lib-esm/context/OptionsProvider.js +0 -2
- package/lib-esm/context/StoreProvider.d.ts +0 -6
- package/lib-esm/context/StoreProvider.js +0 -2
- package/lib-esm/context/index.d.ts +0 -2
- package/lib-esm/context/index.js +0 -2
- package/lib-esm/models/ApiInfo.d.ts +0 -17
- package/lib-esm/models/ApiInfo.js +0 -2
- package/lib-esm/models/Callback.d.ts +0 -11
- package/lib-esm/models/Callback.js +0 -2
- package/lib-esm/models/Example.d.ts +0 -17
- package/lib-esm/models/Example.js +0 -2
- package/lib-esm/models/Field.d.ts +0 -34
- package/lib-esm/models/Field.js +0 -2
- package/lib-esm/models/Group.d.ts +0 -26
- package/lib-esm/models/Group.js +0 -2
- package/lib-esm/models/MediaContent.d.ts +0 -31
- package/lib-esm/models/MediaContent.js +0 -2
- package/lib-esm/models/MediaType.d.ts +0 -27
- package/lib-esm/models/MediaType.js +0 -2
- package/lib-esm/models/Operation.d.ts +0 -92
- package/lib-esm/models/Operation.js +0 -2
- package/lib-esm/models/RequestBody.d.ts +0 -18
- package/lib-esm/models/RequestBody.js +0 -2
- package/lib-esm/models/Response.d.ts +0 -28
- package/lib-esm/models/Response.js +0 -2
- package/lib-esm/models/Schema.d.ts +0 -78
- package/lib-esm/models/Schema.js +0 -2
- package/lib-esm/models/SecurityRequirement.d.ts +0 -12
- package/lib-esm/models/SecurityRequirement.js +0 -2
- package/lib-esm/models/SecuritySchemes.d.ts +0 -25
- package/lib-esm/models/SecuritySchemes.js +0 -2
- package/lib-esm/models/Webhook.d.ts +0 -8
- package/lib-esm/models/Webhook.js +0 -2
- package/lib-esm/services/MarkdownRenderer.d.ts +0 -23
- package/lib-esm/services/MarkdownRenderer.js +0 -2
- package/lib-esm/services/MenuBuilder.d.ts +0 -63
- package/lib-esm/services/MenuBuilder.js +0 -2
- package/lib-esm/services/Options/NormalizedOptions.js +0 -2
- package/lib-esm/services/ProMenu.d.ts +0 -108
- package/lib-esm/services/ProMenu.js +0 -2
- package/lib-esm/services/ProStore.d.ts +0 -92
- package/lib-esm/services/ProStore.js +0 -2
- package/lib-esm/services/ScrollService.d.ts +0 -18
- package/lib-esm/services/ScrollService.js +0 -2
- package/lib-esm/services/SpecStore.d.ts +0 -18
- package/lib-esm/services/SpecStore.js +0 -2
- package/lib-esm/services/VersionedSpecStore.d.ts +0 -42
- package/lib-esm/services/VersionedSpecStore.js +0 -2
- package/lib-esm/services/history/FakeHistoryService.d.ts +0 -20
- package/lib-esm/services/history/FakeHistoryService.js +0 -2
- package/lib-esm/services/history/HistoryService.d.ts +0 -15
- package/lib-esm/services/history/HistoryService.js +0 -2
- package/lib-esm/services/history/ProHashHistoryService.d.ts +0 -25
- package/lib-esm/services/history/ProHashHistoryService.js +0 -2
- package/lib-esm/services/history/PushStateHistoryService.d.ts +0 -24
- package/lib-esm/services/history/PushStateHistoryService.js +0 -2
- package/lib-esm/utils/memoize.d.ts +0 -1
- package/lib-esm/utils/memoize.js +0 -2
- package/lib-esm/utils/store.d.ts +0 -3
- package/lib-esm/utils/store.js +0 -2
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { OpenAPISchema } from '../../types';
|
|
2
|
-
import type { ProStore } from '../../services';
|
|
3
2
|
interface RedocSchemaProps {
|
|
4
|
-
store: ProStore;
|
|
5
3
|
pointer?: string;
|
|
6
4
|
schema?: OpenAPISchema;
|
|
7
5
|
}
|
|
8
|
-
export declare const RedocSchema: ({
|
|
6
|
+
export declare const RedocSchema: ({ pointer, schema }: RedocSchemaProps) => JSX.Element;
|
|
9
7
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from"react";import{
|
|
1
|
+
import React from"react";import{useRecoilValue}from"recoil";import{getSchema}from"../../models";import{Row}from"../common";import{FullWidthPanel}from"./styled.components";import{Schema}from"../Schema";import{globalStoreSelector}from"../../recoil/store";export const RedocSchema=({pointer:e,schema:o})=>{const{options:t,parser:r}=useRecoilValue(globalStoreSelector),m=getSchema({parser:r,schemaOrRef:o||{$ref:e},pointer:e||"",options:t,deps:{operation:{pointer:"RedocSchema"}}});return React.createElement(Row,null,React.createElement(FullWidthPanel,null,React.createElement(Schema,{schema:m})))};
|
|
2
2
|
//# sourceMappingURL=RedocSchema.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from"react";import{useMount,useUnmount}from"@redocly/theme";import{asField}from"informed";import{Controlled as CodeMirror}from"react-codemirror2-react-17";import{MediaTypes}from"../../../constants";import"./helpers";import{CodeMirrorStyles}from"./styled";export const CodemirrorInputComponent=({fieldState:e,fieldApi:t,onChange:o,onBlur:r,forwardedRef:n,id:m,mode:a,schema:i})=>{let
|
|
1
|
+
import React from"react";import{useMount,useUnmount}from"@redocly/theme";import{asField}from"informed";import{Controlled as CodeMirror}from"react-codemirror2-react-17";import{MediaTypes}from"../../../constants";import"./helpers";import{CodeMirrorStyles}from"./styled";export const CodemirrorInputComponent=({fieldState:e,fieldApi:t,onChange:o,onBlur:r,forwardedRef:n,id:m,mode:a,schema:i})=>{let c;const s=(e,t)=>{/^[a-zA-Z0-9_":]$/.test(t.key)&&c.execCommand("autocomplete")},l=()=>{c.refresh()},d=()=>c.showHint({completeSingle:!0});useMount((()=>{setTimeout((()=>{c.refresh()}),0),document.addEventListener("click",l)})),useUnmount((()=>{document.removeEventListener("click",l)}));const{value:u}=e,{setValue:p,setTouched:f}=t;return React.createElement(React.Fragment,null,React.createElement(CodeMirrorStyles,null),React.createElement(CodeMirror,{editorDidMount:e=>{c=e,c.on("keyup",s)},value:u||"",ref:n,onBeforeChange:(e,t,r)=>{p(r),o&&o(r)},onBlur:e=>{f(!1),r&&r(e)},options:{mode:a||MediaTypes.JSON,theme:"material",matchBrackets:!0,autoCloseBrackets:!0,tabSize:2,foldGutter:!0,extraKeys:{"Cmd-Space":d,"Ctrl-Space":d},hintOptions:{id:m,completeSingle:!1,schema:i}}}))};export const CodemirrorInput=asField(CodemirrorInputComponent);
|
|
2
2
|
//# sourceMappingURL=CodemirrorInput.js.map
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import 'codemirror/addon/edit/matchbrackets';
|
|
3
|
-
import 'codemirror/addon/lint/lint';
|
|
4
|
-
import 'codemirror/addon/hint/show-hint';
|
|
5
|
-
import 'codemirror/addon/edit/closebrackets';
|
|
6
|
-
import 'codemirror/addon/search/searchcursor';
|
|
7
|
-
import 'codemirror/lib/codemirror.css';
|
|
8
|
-
import 'codemirror/theme/material.css';
|
|
9
|
-
import 'codemirror/addon/lint/lint.css';
|
|
10
|
-
import 'codemirror/addon/hint/show-hint.css';
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,r,t,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,r,t,i){return new(t||(t=Promise))((function(o,n){function a(e){try{s(i.next(e))}catch(e){n(e)}}function c(e){try{s(i.throw(e))}catch(e){n(e)}}function s(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,c)}s((i=i.apply(e,r||[])).next())}))};import{TextDocument,getLanguageService}from"@redocly/vscode-json-languageservice";import{IS_BROWSER}from"../../../utils";let CodeMirror=null;IS_BROWSER&&(CodeMirror=require("codemirror"),require("codemirror/mode/javascript/javascript"),require("codemirror/addon/edit/matchbrackets"),require("codemirror/addon/lint/lint"),require("codemirror/addon/hint/show-hint"),require("codemirror/addon/edit/closebrackets"),require("codemirror/addon/search/searchcursor"),require("codemirror/lib/codemirror.css"),require("codemirror/theme/material.css"),require("codemirror/addon/lint/lint.css"),require("codemirror/addon/hint/show-hint.css"));const serv=getLanguageService({});CodeMirror&&(CodeMirror.registerHelper("lint","json",(function(e,r){return __awaiter(this,void 0,void 0,(function*(){const{schema:t,setError:i}=r;serv.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:t}]});const o=TextDocument.create(r.id+".json","json",0,e),n=serv.parseJSONDocument(o),a=yield serv.doValidation(o,n);return a.length?i&&i(a[0].message):i&&i(void 0),a.map((e=>({from:CodeMirror.Pos(e.range.start.line,e.range.start.character),to:CodeMirror.Pos(e.range.end.line,e.range.end.character),message:e.message})))}))})),CodeMirror.registerHelper("hint","json",((e,r)=>__awaiter(void 0,void 0,void 0,(function*(){const t=r.schema;if(!t)return;serv.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:t}]});const i=e.getDoc().getCursor(),o=e.getTokenAt(i),n=TextDocument.create(r.id+".json","json",0,e.getValue()),a=serv.parseJSONDocument(n),c=yield serv.doComplete(n,{line:i.line,character:i.ch},a);let s=c?c.items.map((e=>({text:e.insertText,displayText:e.label,filter:e.filterText||e.label,from:{line:e.textEdit.range.start.line,ch:e.textEdit.range.start.character},to:{line:e.textEdit.range.end.line,ch:e.textEdit.range.end.character},hint:(e,r,t)=>{const i="_$__REDOC_CURSOR_HERE";let o=t.text.replace(/(\$1|\${1:[^}]+})/,i)||"";if(o=o.replace(/(\$\d+|\${[^}]+})/g,"")||"",e.setSelection(t.from,t.to),o.indexOf("\n")>-1){const r=e.getLine(e.getCursor().line).search(/(\S|$)/);o=o.replace(/\n/g,"\n"+(e=>{let r="";for(;e--;)r+=" ";return r})(r))}e.replaceSelection(o);const n=e.getSearchCursor(i,t.from);n.findNext()&&(e.setCursor(n.from()),n.replace(""))}}))):[];return/(property|string)/.test(o.type||"")&&(s=s.filter((e=>e.filter.replace(/(^"|"$)/g,"").startsWith(o.string.replace(/(^"|"$)/g,""))))),{from:CodeMirror.Pos(i.line,o.start),to:CodeMirror.Pos(i.line,i.ch),list:s}})))));
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { ConsoleProps } from './types';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const Console: ({ operation, store, onResponse, className, rootElement, properties, securityDefaults, onClose, }: ConsoleProps) => JSX.Element;
|
|
3
|
+
export declare const Console: React.NamedExoticComponent<ConsoleProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,r){return new(o||(o=Promise))((function(s,n){function a(e){try{l(r.next(e))}catch(e){n(e)}}function i(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,i)}l((r=r.apply(e,t||[])).next())}))},__rest=this&&this.__rest||function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(o[r[s]]=e[r[s]])}return o};import Swagger from"swagger-client";import React,{useEffect,useState,useRef,useCallback,memo}from"react";import{useMount}from"@redocly/theme";import{useRecoilValue,useRecoilState}from"recoil";import{unescapeFormId}from"../../../utils";import{StyledCodeHeader}from"../../Panel";import{isFileUploadMime}from"../../common/FileUpload/helper";import{AnalyticsEventType}from"../../../events";import{dereferenceDefinitionForTryIt,getFileNameFromHeaders,getParameters,makeRequestInterceptor,unescapeQueryParams,updateStorage}from"../utils";import{ResponsePanel}from"../ResponsePanel";import{ConsoleTabs}from"../ConsoleTabs";import{ActionPanel}from"../ActionPanel";import{Request}from"./Request";import{CloseButton,ConsoleBody}from"../styled";import{ConsoleWrapper}from"./ConsoleWrapper";import{usePrevious}from"../../../hooks";import{globalStoreSelector}from"../../../recoil/store";import{getActiveMediaType}from"../../../models";import{operationStore}from"../../../recoil/operation";function normalizeUrlProtocol(e){return e.startsWith("//")?"https:"+e:e}function ConsoleComponent({operation:e,onResponse:t,className:o,rootElement:r,properties:s,securityDefaults:n,onClose:a}){let i=useRef();const[l,c]=useRecoilState(operationStore(e.pointer)),[u,p]=useState(l.activeServer||e.activeServer),[d,m]=useState(0),[v,y]=useState(!1),[h,f]=useState(!1),[g,b]=useState({values:{path:getParameters(e.parameters,"path"),cookie:getParameters(e.parameters,"cookie"),header:getParameters(e.parameters,"header"),query:getParameters(e.parameters,"query")}}),[O,S]=useState(),[j,C]=useState(),[R,P]=useState(),[I,w]=useState(),T=usePrevious(e),{parser:q,options:E}=useRecoilValue(globalStoreSelector),_=useCallback(((e,t=e.getState())=>{var{values:o}=t,r=__rest(t,["values"]);i.current=e,setTimeout((()=>{b(Object.assign(Object.assign({},r),{values:Object.assign(Object.assign({},o),{query:unescapeQueryParams(o.query||{})})}))}),0)}),[]),k=useCallback((e=>{var{values:t}=e,o=__rest(e,["values"]);const r=Object.assign(Object.assign({},o),{values:Object.assign(Object.assign({},t),{query:unescapeQueryParams(t.query||{})})});c((e=>Object.assign(Object.assign({},e),{requestValues:JSON.parse(JSON.stringify(t))}))),b(r),updateStorage(r)}),[c]),F=useCallback((e=>{m(e)}),[]),A=useCallback((e=>{p(e),c((t=>Object.assign(Object.assign({},t),{activeServer:e})))}),[c]),V=useCallback((()=>__awaiter(this,void 0,void 0,(function*(){var o,r,s,n,a,l,c,p,d,v,h,b,S,j,R,I,T;const{values:q,invalid:_}=(null===(o=null==i?void 0:i.current)||void 0===o?void 0:o.getState())||g||{};if(null===(r=i.current)||void 0===r||r.submitForm(),_)return f(!0),setTimeout((()=>f(!1)),1e3),void(null===(n=null===(s=E.events)||void 0===s?void 0:s.tryItSent)||void 0===n||n.call(s,{eventType:AnalyticsEventType.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:e.operationId,operationPath:e.path,operationHttpVerb:e.httpVerb,operationSummary:e.description}));const{servers:k,requestBody:F}=e,A=F&&F.content&&(null===(a=getActiveMediaType(F.content))||void 0===a?void 0:a.name)||"";let V=q.body;if(/json/.test(A))try{V=JSON.parse(V)}catch(e){console.error(e)}y(!0);const x=O,B=(e.httpVerb||"").toLowerCase();if(!k)throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");const M=k.find((e=>u.url.endsWith(e.url.endsWith("/")?e.url.substring(0,e.url.length-1):e.url))),N=Date.now(),U=!!window.document.documentMode;let D,H=q.auth;if(q.auth){const e=Object.keys(q.auth)[0],t=unescapeFormId(e);D=Object.assign(Object.assign({},x),{components:Object.assign(Object.assign({},null==x?void 0:x.components),{securitySchemes:Object.assign(Object.assign({},null===(l=null==x?void 0:x.components)||void 0===l?void 0:l.securitySchemes),{[t]:Object.assign(Object.assign({},null===(p=null===(c=null==x?void 0:x.components)||void 0===c?void 0:c.securitySchemes)||void 0===p?void 0:p[t]),{type:"openIdConnect"===(null===(h=null===(v=null===(d=null==x?void 0:x.components)||void 0===d?void 0:d.securitySchemes)||void 0===v?void 0:v[t])||void 0===h?void 0:h.type)?"oauth2":(null===(S=null===(b=null==x?void 0:x.components)||void 0===b?void 0:b.securitySchemes)||void 0===S?void 0:S[t]).type})})})}),H=Object.assign(Object.assign({},H),{[t]:H[e]})}else D=Object.assign({},x);D.servers=k;const W=E.corsProxyUrl;W&&k.length&&(D.servers=k.map((e=>Object.assign(Object.assign({},e),{url:W+normalizeUrlProtocol(e.url)}))),D.paths=Object.assign(Object.assign({},D.paths),{[e.path]:Object.assign(Object.assign({},D.paths[e.path]),{[B]:Object.assign(Object.assign({},D.paths[e.path][B]),{servers:void 0}),servers:void 0})}));const z=(null==F?void 0:F.content)&&(null===(j=getActiveMediaType(F.content))||void 0===j?void 0:j.name)||null;if(z&&V&&isFileUploadMime(z)){const e=Object.values(V);V=e.length>1?e:e[0]}const J={userFetch:U&&require("cross-fetch").fetch,server:W?W+normalizeUrlProtocol(M.url):M.url,serverVariables:M.variables,spec:D,pathName:e.path,method:e.httpVerb,parameters:Object.assign(Object.assign(Object.assign(Object.assign({},q.path),q.query),q.header),q.cookie),securities:{authorized:H},requestBody:V,requestContentType:z,responseContentType:(null===(R=q.header)||void 0===R?void 0:R.Accept)||null,requestInterceptor:makeRequestInterceptor(E,e,null==H?void 0:H.Authorization)};try{const o=yield Swagger.execute(J),r=null==o?void 0:o.data;r instanceof Blob&&(isFileUploadMime(r.type)&&(o.fileInfo={rawData:r,fileName:getFileNameFromHeaders(o.headers)}),o.data=yield r.text()),null==t||t({request:J,response:o}),w(o),P(void 0)}catch(e){e&&e.response&&e.response.data instanceof Blob&&(e.response.data=yield e.response.data.text(),null==t||t({request:J,response:e.response})),w(void 0),P(e)}finally{y(!1),m(1),C(Date.now()-N),null===(T=null===(I=E.events)||void 0===I?void 0:I.tryItSent)||void 0===T||T.call(I,{eventType:AnalyticsEventType.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:e.operationId,operationPath:e.path,operationHttpVerb:e.httpVerb,operationSummary:e.description})}}))),[u.url,g,t,e,E,O]);useMount((()=>__awaiter(this,void 0,void 0,(function*(){var t;const o=yield dereferenceDefinitionForTryIt(e,q.definition);S(o),null===(t=i.current)||void 0===t||t.setValues({})})))),useEffect((()=>{T&&T!==e&&(w(void 0),P(void 0),m(0))}),[e,T]);const x=!(!I&&!R);return React.createElement(ConsoleWrapper,{shaking:h,className:o,rootElement:r},React.createElement(StyledCodeHeader,null,React.createElement(ConsoleTabs,{active:d,hasResponse:x,onChange:F}),a&&React.createElement(CloseButton,{onClick:a}," ✕ ")),React.createElement(ConsoleBody,{hidden:0!==d,"data-cy":"console-request-body"},React.createElement(Request,{operation:e,properties:s,securityDefaults:n,form:g,resolvedRawSpec:O,server:u,formApi:i.current,setFormApi:_,handleChange:k,handleServerChange:A})),React.createElement(ConsoleBody,{hidden:1!==d,"data-cy":"console-response-body"},React.createElement(ResponsePanel,{response:I,error:R,time:j}),";"),React.createElement(ActionPanel,{hasResponse:x,params:g.values,operation:e,loading:v,execute:V}))}export const Console=memo(ConsoleComponent);
|
|
2
2
|
//# sourceMappingURL=Console.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,n){return new(t||(t=Promise))((function(a,r){function i(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var o;e.done?a(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(i,s)}c((n=n.apply(e,o||[])).next())}))};import React from"react";import{useMount}from"@redocly/theme";import{useDimensions}from"../../../hooks";import{ConsoleWrap}from"../styled";import{CodeHeader}from"../../Panel";export function Console(e){const[o,t]=React.useState({}),[n]=useDimensions(e.rootElement);return useMount((()=>{(()=>{__awaiter(this,void 0,void 0,(function*(){const e=yield import("./Console");t({Console:e.Console})}))})()})),o.Console?React.createElement(o.Console,Object.assign({},e)):React.createElement(ConsoleWrap,{className:e.className,fullWidth:null==n?void 0:n.width},React.createElement(CodeHeader,null,"Loading..."))}
|
|
2
2
|
//# sourceMappingURL=ConsoleLazy.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
+
type ConsoleWrapperProps = PropsWithChildren<{
|
|
3
4
|
shaking: boolean;
|
|
4
5
|
className?: string;
|
|
5
6
|
rootElement?: HTMLElement | null;
|
|
6
|
-
}
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ConsoleWrapper: React.NamedExoticComponent<ConsoleWrapperProps>;
|
|
9
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{
|
|
1
|
+
import React,{memo}from"react";import{useRecoilValue}from"recoil";import{ConsoleWrap}from"../styled";import{useDimensions}from"../../../hooks";import{globalOptionsSelector}from"../../../recoil/store";function ConsoleWrapperComponent({shaking:o,className:e,children:l,rootElement:r}){const[s]=useDimensions(r),t=useRecoilValue(globalOptionsSelector);return React.createElement(ConsoleWrap,{scrollYOffset:t.scrollYOffset,shaking:o,className:e,"data-cy":"console",fullWidth:null==s?void 0:s.width},l)}export const ConsoleWrapper=memo(ConsoleWrapperComponent);
|
|
2
2
|
//# sourceMappingURL=ConsoleWrapper.js.map
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
securityDefaults: any;
|
|
5
|
-
form: any;
|
|
6
|
-
resolvedRawSpec: any;
|
|
7
|
-
server: any;
|
|
8
|
-
formApi: any;
|
|
9
|
-
setFormApi: any;
|
|
10
|
-
handleChange: any;
|
|
11
|
-
handleServerChange: any;
|
|
12
|
-
}) => JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RequestProps } from './types';
|
|
3
|
+
export declare const Request: React.NamedExoticComponent<RequestProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{
|
|
1
|
+
import React,{memo}from"react";import{Form,useField}from"informed";import{useRecoilValue}from"recoil";import{requiredValidator}from"../utils";import{JsonPointer}from"../../../utils";import{OAuth2}from"../../../services/OAuth2";import{l}from"../../../services";import{Accordion}from"../../Panel";import{ServersDropdown}from"../ServersDropdown";import{TryItPanel}from"../TryItPanel";import{RequestBody}from"../RequestBody";import{RenderHook}from"../../RenderHook";import{OperationParameters}from"../../OperationParameters";import{AuthPanel}from"../AuthPanel";import{globalOptionsSelector}from"../../../recoil/store";function RequestComponent({operation:e,properties:r,securityDefaults:t,form:o,resolvedRawSpec:a,server:n,formApi:i,setFormApi:s,handleChange:u,handleServerChange:c}){const d=o.errors||{},m=d.path||d.cookie||d.header||d.query,{hooks:p,authCorsProxyUrl:h}=useRecoilValue(globalOptionsSelector),y=a&&JsonPointer.get(a,e.pointer);let v=o.values&&o.values.auth&&Object.keys(o.values.auth)[0];v&&o.values.auth[v]||(v=void 0),!v||void 0===o.values.auth[v].token&&void 0===o.values.auth[v].client_id&&void 0===o.values.auth[v].client_secret||o.values.auth[v].token&&o.values.auth[v].token.access_token||(v=void 0),v&&null!=o.values.auth[v].username&&(o.values.auth[v].username&&o.values.auth[v].password||(v=void 0));const f=e.parameters||[];return!a&&React.createElement(React.Fragment,null,"Loading...")||React.createElement(Form,{onChange:u,getApi:s,style:{flex:1,display:"flex",flexDirection:"column",margin:0}},React.createElement(ServersDropdown,{operation:e,onChange:c}),React.createElement(Accordion,{initialActiveIdx:e.security.length&&v?1:0},e.security.length&&i&&React.createElement(TryItPanel,{header:l("tryItAuth"),"data-cy":"security-trigger",error:!v&&!!d.auth,success:!!v,renderChildrenHidden:!0},(null==p?void 0:p.ReplaceTryItSecurityPanel)?React.createElement(AuthPanelWrapper,{field:"auth",validate:requiredValidator},(r=>React.createElement(RenderHook,{Hook:null==p?void 0:p.ReplaceTryItSecurityPanel,props:{server:n,operation:e,onChange:r,OAuth2:OAuth2}}))):React.createElement(AuthPanel,{formApi:i,form:o,operation:e,activeServer:n.url,authCorsProxyUrl:h,securityDefaults:t}))||null,e.requestBody&&i&&React.createElement(TryItPanel,{header:l("tryItBody"),"data-cy":"body-trigger",error:!!d.body,renderChildrenHidden:!0},React.createElement(RequestBody,{validate:allowBodyErrors,formApi:i,body:e.requestBody,pointer:e.pointer,id:e.id,resolvedBody:null==y?void 0:y.requestBody,properties:r}))||null,f.length&&React.createElement(TryItPanel,{header:l("tryItParameters"),"data-cy":"parameters-trigger",error:m,renderChildrenHidden:!0},React.createElement(OperationParameters,{operation:e,values:o.values,errors:o.errors||{}}))||null))}function AuthPanelWrapper(e){const{fieldApi:r,render:t,userProps:o}=useField(Object.assign({},e)),{setValue:a}=r,{children:l}=o;return t(React.createElement(React.Fragment,null,l(a)))}function allowBodyErrors(){}export const Request=memo(RequestComponent);
|
|
2
2
|
//# sourceMappingURL=Request.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FormApi, FormState } from 'informed';
|
|
2
2
|
import type { OperationModel } from '../../../models';
|
|
3
|
-
import type { SecurityDetails } from '../../../types';
|
|
3
|
+
import type { SecurityDetails, Server } from '../../../types';
|
|
4
4
|
import type { OpenApiResponseData } from '../types';
|
|
5
5
|
export type RequestAndResponseType = {
|
|
6
6
|
request: Record<string, unknown>;
|
|
7
7
|
response: OpenApiResponseData;
|
|
8
8
|
};
|
|
9
9
|
export interface ConsoleProps {
|
|
10
|
-
store: ProStore;
|
|
11
10
|
operation: OperationModel;
|
|
12
11
|
className?: string;
|
|
13
12
|
rootElement?: HTMLElement | null;
|
|
@@ -16,3 +15,15 @@ export interface ConsoleProps {
|
|
|
16
15
|
securityDefaults?: Record<string, SecurityDetails | string>;
|
|
17
16
|
onResponse?: (arg: RequestAndResponseType) => void;
|
|
18
17
|
}
|
|
18
|
+
export interface RequestProps {
|
|
19
|
+
operation: OperationModel;
|
|
20
|
+
properties?: any;
|
|
21
|
+
securityDefaults: Record<string, string | SecurityDetails> | undefined;
|
|
22
|
+
form: any;
|
|
23
|
+
resolvedRawSpec: any;
|
|
24
|
+
server: Server;
|
|
25
|
+
formApi?: FormApi;
|
|
26
|
+
setFormApi: (formApi: FormApi) => void;
|
|
27
|
+
handleChange: (formState: FormState) => void;
|
|
28
|
+
handleServerChange: (server: Server) => void;
|
|
29
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,l){return new(o||(o=Promise))((function(n,r){function a(e){try{c(l.next(e))}catch(e){r(e)}}function i(e){try{c(l.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,i)}c((l=l.apply(e,t||[])).next())}))};import React,{useEffect,useState}from"react";import{Button}from"@redocly/theme";import{useRecoilValue}from"recoil";import{ButtonsWrapper,PkceOptionsWrapper,PkceDetails}from"./styled";import{LinearProgress}from"../../common/LinearProgress";import{FormControl,FormLabel,FormError,FormWrapper}from"../../common/form";import{FormDropdown,FormTextField,TextField}from"../../common/TextField";import{Checkbox}from"../../common/Checkbox";import{OAuth2,deriveCodeChallenge}from"../../../services/OAuth2";import{fromSessionStorage,getSecurityDetailsOptions}from"../../../utils";import{isEmptyObject,randString}from"../../../services/utils";import{getOAuth2TokenEndpointAuthHeader,normalizeUrlProtocol,validateTokenEndpointMethod}from"../utils";import Scope from"../Scope";import{Error}from"./Error";import{globalOptionsSelector}from"../../../recoil/store";function requiredValidator(e){if(!e)return"Field is required"}export const OAuth2Flow=({usePkce:e,form:t,id:o,formApi:l,flow:n,tokenUrl:r,authCorsProxyUrl:a,tokenEndpointAuthMethod:i,server:c,scopes:u,authorizationUrl:d,defaultValues:s,clientId:m})=>{var p,h,f,v;const{oAuth2RedirectURI:g,routingBasePath:E}=useRecoilValue(globalOptionsSelector),[k,C]=useState(null),[R,F]=useState(!1),[S,y]=useState(!1),[O,b]=useState(void 0),[_,A]=useState(void 0),[x,W]=useState(void 0),P=(null===(h=null===(p=t.values)||void 0===p?void 0:p.auth)||void 0===h?void 0:h[o])||{},T=(null===(v=null===(f=t.errors)||void 0===f?void 0:f.auth)||void 0===v?void 0:v[o])||{},V=void 0!==O&&_!==x?{label:"sync",onClick:()=>{O&&A(x)}}:void 0;useEffect((()=>{if(e){const e=randString(43);deriveCodeChallenge(e).then((t=>{b(e),A(t),W(t)}))}}),[e]);const w=()=>{l.setValue(`auth.${o}.token`,"")};if(!d)return React.createElement(FormError,null,"No flow info");let z=fromSessionStorage(`auth.${o}.token`)||JSON.stringify(null==s?void 0:s.token);z=z?JSON.parse(z):"";const B=getSecurityDetailsOptions(o,"client_id"),U={field:`auth.${o}.client_id`,fullWidth:!0,initialValue:fromSessionStorage(`auth.${o}.client_id`)||m||(null==s?void 0:s.client_id),initValue:fromSessionStorage(`auth.${o}.client_id`)||m||(null==s?void 0:s.client_id),placeholder:"Your OAuth2 app Client ID",validate:requiredValidator,validateOnBlur:!0,validateOnChange:!0};return React.createElement("div",null,React.createElement(FormWrapper,null,React.createElement(FormControl,null,React.createElement(FormLabel,null," Client ID: "),B?React.createElement(FormDropdown,Object.assign({},U,{options:B})):React.createElement(FormTextField,Object.assign({},U,{"data-cy":"client-id-input",panel:"try-it"}))),"authorizationCode"===n&&React.createElement(React.Fragment,null,(!(null==e?void 0:e.hideClientSecretInput)||!e)&&React.createElement(FormControl,null,React.createElement(FormLabel,null,"Client Secret:"),React.createElement(FormTextField,{type:"password",fullWidth:!0,field:`auth.${o}.client_secret`,initialValue:fromSessionStorage(`auth.${o}.client_secret`)||(null==s?void 0:s.client_secret),validateOnBlur:!0,validateOnChange:!0,panel:"try-it","data-cy":"client-secret-input"})),e&&!e.disableManualConfiguration&&React.createElement(PkceOptionsWrapper,null,React.createElement(Checkbox,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:S,onChange:()=>{y((e=>!e))},"data-cy":"pkce-options-toggle"}),S&&React.createElement(PkceDetails,null,React.createElement(FormControl,null,React.createElement(FormLabel,null,"Code Verifier"),React.createElement(TextField,{fullWidth:!0,value:O,onChange:({target:{value:e}})=>__awaiter(void 0,void 0,void 0,(function*(){const t=yield deriveCodeChallenge(e);b(e),W(t)})),panel:"try-it","data-cy":"code-verifier-input"})),React.createElement(FormControl,null,React.createElement(FormLabel,null,"Code Challenge"),React.createElement(TextField,{fullWidth:!0,value:_,onChange:({target:{value:e}})=>{A(e)},inputActionButton:V,panel:"try-it","data-cy":"code-challenge-input"}))))),React.createElement(FormTextField,{fullWidth:!0,field:`auth.${o}.token`,type:"hidden",initialValue:z,panel:"try-it"}),React.createElement(Scope,{id:o,scopes:u}),P.token&&P.token.access_token?React.createElement(FormControl,null,React.createElement(FormLabel,null," Access Token: "),React.createElement(TextField,{disabled:!0,type:"password",fullWidth:!0,value:P.token.access_token,panel:"try-it"})):null),React.createElement(ButtonsWrapper,null,P.token&&P.token.access_token?React.createElement(Button,{fullWidth:!0,onClick:()=>{w(),C(null)}},"Log out"):R?React.createElement(React.Fragment,null,React.createElement(Button,{fullWidth:!0,onClick:()=>{F(!1),C(null),OAuth2.clearRedirectData(n)}},"Cancel"),React.createElement(LinearProgress,null)):React.createElement(Button,{fullWidth:!0,disabled:!isEmptyObject(T),onClick:()=>{(t=>{if(!t)return;if(l.validate(),!isEmptyObject(T))return;F(!0),C(null);const u=a?a+normalizeUrlProtocol(t):t,d=a&&r?a+normalizeUrlProtocol(r):r,s=l.getValue(`auth.${o}.scopes`),m={authorizationUrl:u.startsWith("http")?u:c+u,clientId:P.client_id,scopes:s,redirectUri:g,routingBasePath:E,successCallback:e=>{l.setValue(`auth.${o}.token`,e),F(!1),C(null)},errorCallback:e=>{F(!1),C((null==e?void 0:e.message)||"Failed to retrieve the access token")}};"implicit"===n&&OAuth2.authorizeImplicit(m),validateTokenEndpointMethod(i)?"authorizationCode"===n&&OAuth2.authorizeAuthorizationCode(Object.assign(Object.assign(Object.assign({},m),{tokenUrl:(null==d?void 0:d.startsWith("http"))?d:c+d,clientSecret:P.client_secret,extraHeaders:getOAuth2TokenEndpointAuthHeader({authMethod:i,clientId:P.client_id,clientSecret:P.client_secret})}),e&&{codeVerifier:O,codeChallenge:_})):console.log(`Unsupported token endpoint auth method: ${i}`)})(d)}},"Authorize")),R||k||!P.token||!P.token.access_token&&React.createElement(Error,{loading:R,error:k,token:P.token}))};
|
|
2
2
|
//# sourceMappingURL=OAuth2Flow.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormApi, FormState } from 'informed';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedOpenAPISecurityScheme } from '../../models';
|
|
3
3
|
import type { SecurityDetails } from '../../types';
|
|
4
4
|
export interface OpenIDConnectProps {
|
|
5
5
|
server: string;
|
|
@@ -7,7 +7,7 @@ export interface OpenIDConnectProps {
|
|
|
7
7
|
id: string;
|
|
8
8
|
form: FormState;
|
|
9
9
|
formApi: FormApi;
|
|
10
|
-
scheme:
|
|
10
|
+
scheme: ExtendedOpenAPISecurityScheme;
|
|
11
11
|
clientId?: string;
|
|
12
12
|
defaultValues?: SecurityDetails;
|
|
13
13
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{useCallback}from"react";import{
|
|
1
|
+
import React,{memo,useCallback,useEffect}from"react";import{isRootFileUpload}from"../../common/FileUpload/helper";import{MediaTypes}from"../../../constants";import{ExampleSwitch,useExampleKey}from"../../Samples";import{fromSessionStorage,toSessionStorage}from"../../../utils";import{encodeSample,getStorageExampleKey}from"../utils";import{RequestBodyForm}from"../RequestBodyForm";import{CodemirrorInput}from"../CodemirrorInput";import{useActivateExample}from"../../../hooks";function BodyComponent({mediaType:e,mediaContent:o,properties:t,id:a,resolvedBody:m,formApi:l,getActiveSample:r,validate:n}){const i=useActivateExample(o),p=e.examples||{},s=Object.keys(p),c=e.schema,d=isRootFileUpload(c||{},e.name)||e.name===MediaTypes.MULTIPART||e.name===MediaTypes.URL_ENCODED,{exampleKey:u}=useExampleKey(e.operation,p),y=fromSessionStorage(getStorageExampleKey(a,e.name,u,p))||encodeSample(p[u],t);useEffect((()=>{l.setValue("body",y)}),[y,l]);const f=useCallback(((e="",o="",t=[])=>m=>{toSessionStorage(getStorageExampleKey(a,e,o,t),m)}),[a]),g=useCallback((e=>{i&&i(e),l.setValue("body",r(e))}),[l,r,i]),E=useCallback(((e,o)=>{l.setValue(`body.${e}`,o)}),[l]);return React.createElement(React.Fragment,null,s.length&&1!==s.length&&React.createElement(ExampleSwitch,{examples:p,onChange:g,exampleKey:u,panel:"try-it"})||null,d?React.createElement(RequestBodyForm,{mediaType:e,formApi:l,onChange:E}):React.createElement(CodemirrorInput,{id:"body"+a,field:"body",initialValue:y,schema:((null==m?void 0:m.content[e.name])||{}).schema,mode:e.name,validate:n,onChange:f(e.name,u,p)}))}export const Body=memo(BodyComponent);
|
|
2
2
|
//# sourceMappingURL=Body.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{useCallback,useEffect}from"react";import
|
|
1
|
+
import React,{memo,useCallback,useEffect}from"react";import merge from"deepmerge";import{useRecoilValue}from"recoil";import{DropdownOrLabel}from"../../DropdownOrLabel";import{MediaTypesSwitch}from"../../MediaTypeSwitch";import{arrayMergeStrategy}from"../../../services/utils";import{Dropdown}from"../../common";import{RequestMimeLabel}from"../RequestMimeLabel";import{getStorageExampleKey}from"../utils";import{fromSessionStorage}from"../../../utils";import{Body}from"./Body";import{getActiveMediaType}from"../../../models";import{activeMimeNameSelector}from"../../../recoil/app";import{operationStore}from"../../../recoil/operation";function RequestBodyComponent({body:e,formApi:o,resolvedBody:t,properties:r,id:a,validate:i,pointer:m}){const l=e.content,n=useRecoilValue(activeMimeNameSelector),{examples:p,name:s}=l&&getActiveMediaType(l,n)||{},c=useCallback((e=>{if(!l||!l.hasSample)return"";if(!(null==p?void 0:p[e]))return"";const o=s&&fromSessionStorage(getStorageExampleKey(a,s,e,p)),t=o?JSON.parse(o):null==p?void 0:p[e].value,i=r?merge(t,r,{arrayMerge:arrayMergeStrategy}):t;return JSON.stringify(i,null,2)}),[s,p,a,l,r]),{activeExampleName:d}=useRecoilValue(operationStore(m));useEffect((()=>{if(s){const e=getStorageExampleKey(a,s,d,p);o.setValue("body",fromSessionStorage(e)||c(d||""))}else o.setValue("body",JSON.stringify(r||{},null,2))}),[p,d,s,o,c,a,r]);return React.createElement(React.Fragment,null,React.createElement(MediaTypesSwitch,{content:e.content,renderDropdown:e=>React.createElement(DropdownOrLabel,Object.assign({},e,{variant:"dark",fullWidth:!0,Label:RequestMimeLabel,Dropdown:Dropdown}))},(e=>React.createElement(Body,{mediaType:e,mediaContent:l,resolvedBody:t,id:a,properties:r,getActiveSample:c,formApi:o,validate:i}))))}export const RequestBody=memo(RequestBodyComponent);
|
|
2
2
|
//# sourceMappingURL=RequestBody.js.map
|
|
@@ -3,6 +3,7 @@ import type { RequestBodyModel, MediaContentModel, MediaTypeModel } from '../../
|
|
|
3
3
|
import type { OpenAPIRequestBody } from '../../../types';
|
|
4
4
|
export interface RequestBodyProps {
|
|
5
5
|
body: RequestBodyModel;
|
|
6
|
+
pointer: string;
|
|
6
7
|
resolvedBody: OpenAPIRequestBody;
|
|
7
8
|
validate: () => string | undefined;
|
|
8
9
|
formApi: FormApi;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { FormApi } from 'informed';
|
|
2
3
|
import type { FieldModel, MediaTypeModel, UploadFileType } from '../../models';
|
|
3
|
-
|
|
4
|
+
interface RequestBodyFormProps {
|
|
4
5
|
mediaType: MediaTypeModel;
|
|
5
6
|
onChange(key: string, file: UploadFileType): void;
|
|
6
|
-
formApi?: FormApi
|
|
7
|
-
}
|
|
7
|
+
formApi?: FormApi;
|
|
8
|
+
}
|
|
9
|
+
export declare const RequestBodyForm: React.NamedExoticComponent<RequestBodyFormProps>;
|
|
8
10
|
export declare function getRequestBodyFormFields(mediaType: MediaTypeModel): FieldModel[];
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React,{useEffect}from"react";import
|
|
1
|
+
import React,{memo,useEffect}from"react";import styled from"styled-components";import{getRecoil}from"recoil-nexus";import{isMultipartFileUploadProperty,isRootFileUpload,mimeTypeToAccept}from"../common/FileUpload/helper";import{FormControl,FormLabel}from"../common/form";import{FileUpload}from"../common/FileUpload";import{FormTextField,getInvertedInputStyles}from"../common/TextField";import{DefinitionTypes}from"../../models";import{MediaTypes}from"../../constants";import{useExampleKey}from"../Samples";import{operationStore}from"../../recoil/operation";import{normalizeText}from"../../utils";function RequestBodyFormComponent({mediaType:e,onChange:o,formApi:t}){var l;const n=e.examples||{},{exampleKey:m}=useExampleKey(e.operation,n),i=null===(l=n[m])||void 0===l?void 0:l.rawValue,r=getRequestBodyFormFields(e);useEffect((()=>t&&r.forEach((e=>{var o,l;const n=null==i?void 0:i[e.name],m=null!==(l=null!==(o=e.example)&&void 0!==o?o:null==n?void 0:n.example)&&void 0!==l?l:n,r="object"==typeof m?JSON.stringify(m):m;void 0!==m&&t.setValue("body."+e.name,`${r}`)}))),[m]);const a=e.schema||{};return isRootFileUpload(a,e.name)?React.createElement(FileFormControlWrapper,null,React.createElement(FormControl,null,React.createElement(StyledFileUpload,{fullWidth:!0,id:`body.${e.name}`,name:`body.${e.name}`,accept:mimeTypeToAccept(e.name),schema:a,contentName:e.name,onChange:o}))):a.type===DefinitionTypes.OBJECT||r?React.createElement(FileFormControlWrapper,null,r.map((t=>{const l=t.schema||{contentMediaType:"",type:"",description:""},n=e.name===MediaTypes.MULTIPART&&isMultipartFileUploadProperty(l),m=l.contentMediaType||"",i=n?React.createElement(StyledFileUpload,{fullWidth:!0,id:"body."+t.name,name:"body."+t.name,accept:mimeTypeToAccept(m),multiple:"array"===l.type,schema:l,contentName:t.name,onChange:o}):React.createElement(FormTextField,{fullWidth:!0,id:"body."+t.name,field:"body."+t.name,placeholder:normalizeText(l.description)||t.name,panel:"try-it"});return React.createElement(FormControl,{key:t.name},React.createElement(FormLabel,null,t.name,":"),i)}))):(console.warn(`Invalid schema for request body and mime type: "${e.name}"`,a),null)}export const RequestBodyForm=memo(RequestBodyFormComponent);export function getRequestBodyFormFields(e){var o,t,l,n;const{activeOneOf:m}=getRecoil(operationStore(e.operation.pointer));return((null===(t=null===(o=e.schema)||void 0===o?void 0:o.oneOf)||void 0===t?void 0:t.length)?(null===(l=e.schema)||void 0===l?void 0:l.oneOf[m].fields)||[]:(null===(n=e.schema)||void 0===n?void 0:n.fields)||[]).filter((e=>!e.schema.readOnly))}const FileFormControlWrapper=styled.div`
|
|
2
2
|
> div {
|
|
3
3
|
margin-top: 10px;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React,{
|
|
1
|
+
import React,{useState}from"react";import styled from"styled-components";import{useRecoilValue}from"recoil";import{ResponseHeader,PanelPreCodeBlock}from"./styled";import{globalOptionsSelector}from"../../recoil/store";export function ResponseHeadersList({headers:e}){const t=useRecoilValue(globalOptionsSelector),[a,o]=useState(!0),{maxResponseHeadersToShowInTryIt:l}=t,r=Object.keys(e),n=!!l&&r.length>l,s=n&&a?[...r].splice(0,l):[...r];return React.createElement(React.Fragment,null,React.createElement(ResponseHeader,null," Headers: "),React.createElement(PanelPreCodeBlock,null,s.map((t=>React.createElement("div",{key:t},React.createElement(HeaderName,null,t,":"),React.createElement("code",null,e[t])))),n&&React.createElement(StyledShowMoreLabel,{onClick:()=>{o(!a)}},a?"Show more...":"Hide headers")))}const HeaderName=styled.strong`
|
|
2
2
|
text-transform: capitalize;
|
|
3
3
|
display: inline-block;
|
|
4
4
|
padding-right: 5px;
|
|
@@ -3,7 +3,7 @@ interface ServerVariableProps {
|
|
|
3
3
|
name: string;
|
|
4
4
|
value: string;
|
|
5
5
|
variableEnum?: string[];
|
|
6
|
-
description?: string;
|
|
6
|
+
description?: string | GenericObject;
|
|
7
7
|
defaultValue: string;
|
|
8
8
|
}
|
|
9
9
|
export default function ServerVariable({ name, value, description, variableEnum, onChange, defaultValue, }: ServerVariableProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React,{useCallback}from"react";import styled from"styled-components";import{Markdown}from"../Markdown";import{FormControl,FormLabel}from"../common/form";import{TextField}from"../common/TextField";import{TryItDropdown}from"./styled";export default function ServerVariable({name:e,value:t,description:o,variableEnum:a,onChange:r,defaultValue:l}){const n=useCallback((e=>r(e.target.value)),[r]),m=useCallback((e=>r(e.value)),[r]),
|
|
1
|
+
import React,{useCallback}from"react";import styled from"styled-components";import{Markdown}from"../Markdown";import{FormControl,FormLabel}from"../common/form";import{TextField}from"../common/TextField";import{TryItDropdown}from"./styled";export default function ServerVariable({name:e,value:t,description:o,variableEnum:a,onChange:r,defaultValue:l}){const n=useCallback((e=>r(e.target.value)),[r]),m=useCallback((e=>r(e.value)),[r]),d=a?a.map(((e,t)=>({value:e,idx:t}))):[];return React.createElement(FormControl,null,React.createElement(FormLabel,null,e,":"),d&&d.length?React.createElement(TryItDropdown,{fullWidth:!0,variant:"dark",value:t,options:d,onChange:m}):React.createElement(TextField,{fullWidth:!0,value:t,onChange:n,placeholder:l,panel:"try-it"}),o&&React.createElement(StyledMarkdown,{source:o}))}const StyledMarkdown=styled(Markdown)`
|
|
2
2
|
margin-top: 5px;
|
|
3
3
|
color: #d0d0d0;
|
|
4
4
|
`;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { ServersDropdownProps } from './types';
|
|
2
|
-
export declare const ServersDropdown:
|
|
3
|
+
export declare const ServersDropdown: React.NamedExoticComponent<ServersDropdownProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React,{useState}from"react";import
|
|
1
|
+
import React,{memo,useState}from"react";import styled from"styled-components";import{useMount}from"@redocly/theme";import{fromSessionStorage,toSessionStorage}from"../../../utils";import{FormControl,FormLabel}from"../../common/form";import{expandDefaultServerVariables,expandVariables,getServerWithVariables,getDefaultOrStoredVariables,updateVariablesStorage}from"../utils";import ServerVariable from"../ServerVariable";import{TryItDropdown}from"../styled";function ServersDropdownComponent({operation:e,onChange:r}){const t=fromSessionStorage("serverUrl"),a=e.servers.findIndex((e=>e.url===t)),[o,s]=useState(a<0?0:a),[n,l]=useState({});useMount((()=>{const t=getServerWithVariables(e.servers,o);r(t),l(t.variables)}));const i=e.servers.map(((e,r)=>({idx:r,serverUrl:e.url,value:`\n ${expandDefaultServerVariables(expandVariables(e.url,n),e.variables)}\n - ${e.description||"Default"}\n `}))),m=Object.keys(n);return React.createElement(ServerDropdownWrap,{"data-cy":"console-target-server"},React.createElement(FormLabel,{htmlFor:"server"},"Target server: "),React.createElement(FormControl,null,React.createElement(TryItDropdown,{variant:"dark",value:i[o].value,options:i,fullWidth:!0,onChange:t=>{const a=e.servers.find((e=>e.url===t.serverUrl)),o=e.servers.findIndex((e=>e.url===t.serverUrl)),n=getDefaultOrStoredVariables(a);r({url:t.serverUrl||"",variables:n}),toSessionStorage("serverUrl",t.serverUrl||""),s(o),l(n)}})),null==m?void 0:m.map((t=>{var a;const s=null===(a=e.servers[o].variables)||void 0===a?void 0:a[t];if(s)return React.createElement(ServerVariable,{key:t,name:t,value:n[t],defaultValue:s.default,onChange:a=>((t,a)=>{const s=e.servers[o],i=a||""===a?a:getDefaultOrStoredVariables(s)[t],m=Object.assign(Object.assign({},n),{[t]:i});l(m),updateVariablesStorage(t,i),r(Object.assign(Object.assign({},s),{variables:m}))})(t,a),variableEnum:s.enum,description:s.description})})))}export const ServersDropdown=memo(ServersDropdownComponent);const ServerDropdownWrap=styled.div`
|
|
2
2
|
margin-bottom: 20px;
|
|
3
3
|
`;
|
|
4
4
|
//# sourceMappingURL=ServersDropdown.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OpenAPIServer, Server, ServerVariables } from '../../types';
|
|
2
|
-
import type { FieldModel,
|
|
2
|
+
import type { FieldModel, ExtendedOpenAPISecurityScheme, OperationModel, ExampleModel } from '../../models';
|
|
3
3
|
import type { RequestBodyProps } from './RequestBody';
|
|
4
4
|
import type { Options } from 'src/services/Options';
|
|
5
5
|
export declare function normalizeUrlProtocol(url: string): string;
|
|
@@ -15,7 +15,7 @@ export declare function unescapeQueryParams(params: GenericObject): GenericObjec
|
|
|
15
15
|
export declare function getFileNameFromHeaders(headers: Record<string, string>): string;
|
|
16
16
|
export declare const makeRequestInterceptor: ({ requestInterceptor, sendXUserAgentInTryIt, disableTryItRequestUrlEncoding, }: Pick<Options, 'requestInterceptor' | 'sendXUserAgentInTryIt' | 'disableTryItRequestUrlEncoding'>, operation: OperationModel, securitySchemaAuth?: string) => (req: Request) => void | Request;
|
|
17
17
|
export declare function requiredValidator(value: unknown): string | undefined;
|
|
18
|
-
export declare function fromCookie(scheme:
|
|
18
|
+
export declare function fromCookie(scheme: ExtendedOpenAPISecurityScheme): string | undefined;
|
|
19
19
|
export declare const validateTokenEndpointMethod: (token: string[] | string | undefined) => boolean;
|
|
20
20
|
export declare const getOAuth2TokenEndpointAuthHeader: ({ authMethod, clientId, clientSecret, }: {
|
|
21
21
|
authMethod?: string | string[] | undefined;
|
|
@@ -26,3 +26,4 @@ export declare function encodeSample(sample: ExampleModel, properties: RequestBo
|
|
|
26
26
|
export declare const getStorageExampleKey: (operationId: string, activeMimeType: string, activeExample?: string | false, examples?: {
|
|
27
27
|
[name: string]: ExampleModel;
|
|
28
28
|
} | undefined) => string;
|
|
29
|
+
export declare function dereferenceDefinitionForTryIt(operation: OperationModel, definition: GenericObject): Promise<GenericObject>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import merge from"deepmerge";import{MediaTypes}from"../../constants";import{arrayMergeStrategy}from"../../services/utils";import{fromSessionStorage,getParameterValue,setParameterValue,setSecurityDetails,toSessionStorage,unescapeFormId}from"../../utils";export function normalizeUrlProtocol(e){return e.startsWith("//")?"https:"+e:e}export function updateStorage(e){if(e.values.auth)for(const t of Object.keys(e.values.auth)){const r=e.values.auth[t];setSecurityDetails(t,r)}updateParameterStorage(e)}function updateParameterStorage(e){var t;for(const r of["path","query","header","cookie"])if(null===(t=e.values)||void 0===t?void 0:t[r])for(const t of Object.keys(e.values[r]))setParameterValue(r,t,e.values[r][t])}export const getParameters=(e,t)=>e.filter((e=>e.in===t)).reduce(((e,t)=>{const{in:r,name:o}=t;return e[o]=getParameterValue(r||"",o),e}),{});const pathTemplateRegExp=/(?:{)(\w+)(?:})/g;export function getServerWithVariables(e,t=0){const r=e[t],o=getDefaultOrStoredVariables(r);return Object.assign(Object.assign({},r),{variables:o})}export function getInitialServerWithVariables(e){const t=fromSessionStorage("serverUrl"),r=e.find((e=>e.url===t))||e[0],o=getDefaultOrStoredVariables(r);return Object.assign(Object.assign({},r),{variables:o})}export function expandVariables(e,t={}){return e.replace(pathTemplateRegExp,((e,r)=>t[r]||e))}export function expandDefaultServerVariables(e,t={}){return e.replace(pathTemplateRegExp,((e,r)=>t[r]&&t[r].default||e))}export function getDefaultOrStoredVariables(e){if(!(null==e?void 0:e.variables))return{};const t=fromSessionStorage("variables"),r=t&&JSON.parse(t)||{},o={};return Object.entries(e.variables||{}).forEach((([e,t])=>{o[e]=r[e]||t.default||""})),o}export function updateVariablesStorage(e,t){const r=fromSessionStorage("variables"),o=r&&JSON.parse(r)||{};toSessionStorage("variables",JSON.stringify(Object.assign(Object.assign({},o),{[e]:t})))}export function unescapeQueryParams(e){return Object.entries(e).reduce(((e,[t,r])=>(e[unescapeFormId(t)]=r,e)),{})}export function getFileNameFromHeaders(e){const t="filename=";for(const[r,o]of Object.entries(e))if("content-disposition"===r.toLowerCase()){const e=o.split(";").find((e=>e.trim().startsWith(t)));if(e)return e.split(t)[1]}return""}export const makeRequestInterceptor=({requestInterceptor:e,sendXUserAgentInTryIt:t,disableTryItRequestUrlEncoding:r},o,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}c((o=o.apply(e,t||[])).next())}))};import merge from"deepmerge";import{bundle,Config}from"@redocly/openapi-core";import{getRecoil}from"recoil-nexus";import{MediaTypes}from"../../constants";import{arrayMergeStrategy}from"../../services/utils";import{createParsedDocument,fromSessionStorage,getParameterValue,setParameterValue,setSecurityDetails,toSessionStorage,unescapeFormId}from"../../utils";import{operationStore}from"../../recoil/operation";export function normalizeUrlProtocol(e){return e.startsWith("//")?"https:"+e:e}export function updateStorage(e){if(e.values.auth)for(const t of Object.keys(e.values.auth)){const r=e.values.auth[t];setSecurityDetails(t,r)}updateParameterStorage(e)}function updateParameterStorage(e){var t;for(const r of["path","query","header","cookie"])if(null===(t=e.values)||void 0===t?void 0:t[r])for(const t of Object.keys(e.values[r]))setParameterValue(r,t,e.values[r][t])}export const getParameters=(e,t)=>e.filter((e=>e.in===t)).reduce(((e,t)=>{const{in:r,name:o}=t;return e[o]=getParameterValue(r||"",o),e}),{});const pathTemplateRegExp=/(?:{)(\w+)(?:})/g;export function getServerWithVariables(e,t=0){const r=e[t],o=getDefaultOrStoredVariables(r);return Object.assign(Object.assign({},r),{variables:o})}export function getInitialServerWithVariables(e){const t=fromSessionStorage("serverUrl"),r=e.find((e=>e.url===t))||e[0],o=getDefaultOrStoredVariables(r);return Object.assign(Object.assign({},r),{variables:o})}export function expandVariables(e,t={}){return e.replace(pathTemplateRegExp,((e,r)=>t[r]||e))}export function expandDefaultServerVariables(e,t={}){return e.replace(pathTemplateRegExp,((e,r)=>t[r]&&t[r].default||e))}export function getDefaultOrStoredVariables(e){if(!(null==e?void 0:e.variables))return{};const t=fromSessionStorage("variables"),r=t&&JSON.parse(t)||{},o={};return Object.entries(e.variables||{}).forEach((([e,t])=>{o[e]=r[e]||t.default||""})),o}export function updateVariablesStorage(e,t){const r=fromSessionStorage("variables"),o=r&&JSON.parse(r)||{};toSessionStorage("variables",JSON.stringify(Object.assign(Object.assign({},o),{[e]:t})))}export function unescapeQueryParams(e){return Object.entries(e).reduce(((e,[t,r])=>(e[unescapeFormId(t)]=r,e)),{})}export function getFileNameFromHeaders(e){const t="filename=";for(const[r,o]of Object.entries(e))if("content-disposition"===r.toLowerCase()){const e=o.split(";").find((e=>e.trim().startsWith(t)));if(e)return e.split(t)[1]}return""}export const makeRequestInterceptor=({requestInterceptor:e,sendXUserAgentInTryIt:t,disableTryItRequestUrlEncoding:r},o,n)=>a=>{var i,s;const{requestValues:c}=getRecoil(operationStore(o.pointer));r&&(a=Object.assign(Object.assign({},a),{url:decodeURIComponent(a.url)})),t&&(a.headers["X-User-Agent"]="Redocly Try it API console");const u=(null===(i=null==c?void 0:c.header)||void 0===i?void 0:i.authorization)||(null===(s=null==c?void 0:c.header)||void 0===s?void 0:s.Authorization);return!n&&u&&(a.headers.Authorization=u),e?e(a,o):a};export function requiredValidator(e){if(!e)return"Field is required"}const getCookie=e=>{const t=document.cookie.match("\\b"+e+"=([^;]*)\\b");return t?t[1]:void 0};export function fromCookie(e){if("cookie"===e.in)return getCookie(e.name||"")}export const validateTokenEndpointMethod=e=>{if(!e)return!0;const t=Array.isArray(e)?e:[e];return!(t.length&&!t.includes("none")&&!t.includes("client_secret_basic"))};export const getOAuth2TokenEndpointAuthHeader=({authMethod:e,clientId:t,clientSecret:r})=>"client_secret_basic"===e||Array.isArray(e)&&e.includes("client_secret_basic")?{Authorization:`Basic ${btoa(t+":"+r)}`}:{};export function encodeSample(e,t){if(!e)return"";if(e.mime===MediaTypes.URL_ENCODED)return e.value;const r=e.value,o=t?merge(r,t,{arrayMerge:arrayMergeStrategy}):r;return JSON.stringify(o,null,2)}export const getStorageExampleKey=(e,t,r,o)=>{let n=e+"_"+t;return r&&o&&Object.keys(o).includes(r)&&(n+="_"+r),n};export function dereferenceDefinitionForTryIt(e,t){var r,o,n,a;return __awaiter(this,void 0,void 0,(function*(){const i=JSON.parse(JSON.stringify(t)),s=i.openapi?{openapi:i.openapi}:i.swagger?{swagger:i.swagger}:{},c=Object.assign(Object.assign({},s),{components:i.components,paths:{[e.path]:{[e.httpVerb]:null===(o=null===(r=i.paths)||void 0===r?void 0:r[e.path])||void 0===o?void 0:o[e.httpVerb],parameters:null===(a=null===(n=i.paths)||void 0===n?void 0:n[e.path])||void 0===a?void 0:a.parameters}}}),u={config:new Config({}),doc:createParsedDocument(c),dereference:!0};return yield bundle(u),i}))}
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
package/lib-esm/constants.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { RawOptions } from './services';
|
|
2
2
|
export declare const defaultTheme: Required<Pick<RawOptions, 'breakpoints' | 'showAtBreakpoint'>>;
|
|
3
3
|
export declare enum WindowReferenceOptions {
|
|
4
|
-
LINK_FOR_ID = "linkForId",
|
|
5
|
-
GENERATE_DEEP_LINK = "generateDeepLink",
|
|
6
4
|
ON_DEEP_LINK_CLICK = "onDeepLinkClick",
|
|
7
5
|
REQUEST_INTERCEPTOR = "requestInterceptor",
|
|
8
6
|
HOOKS = "hooks"
|
package/lib-esm/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const defaultTheme={breakpoints:{small:"50rem",medium:"85rem",large:"105rem"},showAtBreakpoint:{sidebar:"small",samplesPanel:"medium"}};export var WindowReferenceOptions;!function(e){e.
|
|
1
|
+
export const defaultTheme={breakpoints:{small:"50rem",medium:"85rem",large:"105rem"},showAtBreakpoint:{sidebar:"small",samplesPanel:"medium"}};export var WindowReferenceOptions;!function(e){e.ON_DEEP_LINK_CLICK="onDeepLinkClick",e.REQUEST_INTERCEPTOR="requestInterceptor",e.HOOKS="hooks"}(WindowReferenceOptions||(WindowReferenceOptions={}));export var MediaTypes;!function(e){e.OCTET_STREAM="application/octet-stream",e.MULTIPART="multipart/form-data",e.URL_ENCODED="application/x-www-form-urlencoded",e.JSON="application/json",e.XML="application/xml"}(MediaTypes||(MediaTypes={}));export var LayoutVariant;!function(e){e.STACKED="stacked",e.THREE_PANEL="three-panel"}(LayoutVariant||(LayoutVariant={}));export const DEFAULT_SEARCH_MAX_DEPTH=1;export const SECTION_ATTR="data-section-id";export const FIELD_ATTR="data-field-id";export const GROUP_DEPTH=0;export const LEGACY_REGEXP="^ {0,3}\x3c!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?--\x3e\\s*$";export const MDX_COMPONENT_REGEXP="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))";export const COMPONENT_REGEXP="(?:"+LEGACY_REGEXP+"|"+MDX_COMPONENT_REGEXP+")";
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createTrackingEvent}from"./creator";import{AnalyticsEventType}from"./types";const codeSampleCopyEvent=createTrackingEvent(AnalyticsEventType.CodeSampleCopied);export const createCodeSampleCopyEvent=({operation:e,type:
|
|
1
|
+
import{getRecoil}from"recoil-nexus";import{createTrackingEvent}from"./creator";import{AnalyticsEventType}from"./types";import{activeMimeNameSelector}from"../recoil/app";import{operationStore}from"../recoil/operation";const codeSampleCopyEvent=createTrackingEvent(AnalyticsEventType.CodeSampleCopied);export const createCodeSampleCopyEvent=({operation:e,type:o,lang:t="",label:a=""})=>{const{activeExampleName:p}=getRecoil(operationStore(e.pointer));return codeSampleCopyEvent({resource:"Redocly_CodeSample",action:"CodeSampleCopied",operationId:e.id,operationPath:e.path,operationHttpVerb:e.httpVerb,operationSummary:e.name,exampleId:p||e.activeExampleName,exampleMimeType:getRecoil(activeMimeNameSelector),label:a,lang:t,type:o})};
|
|
2
2
|
//# sourceMappingURL=codeSampleCopy.js.map
|
|
@@ -30,7 +30,7 @@ export interface AnalyticsEvent {
|
|
|
30
30
|
operationId?: string;
|
|
31
31
|
operationPath: string;
|
|
32
32
|
operationHttpVerb: string;
|
|
33
|
-
operationSummary?: string;
|
|
33
|
+
operationSummary?: string | GenericObject;
|
|
34
34
|
}
|
|
35
35
|
export interface CodeSamplesLanguageSwitchedEvent extends AnalyticsEvent {
|
|
36
36
|
lang: string;
|
|
@@ -51,7 +51,7 @@ export interface PanelToggleEvent extends AnalyticsEvent {
|
|
|
51
51
|
operationId: string;
|
|
52
52
|
operationPath: string;
|
|
53
53
|
operationHttpVerb: string;
|
|
54
|
-
operationSummary?: string;
|
|
54
|
+
operationSummary?: string | GenericObject;
|
|
55
55
|
}
|
|
56
56
|
export type Events = {
|
|
57
57
|
codeSamplesLanguageSwitch?: (event: CodeSamplesLanguageSwitchedEvent) => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { RouterType } from '../types';
|
|
2
|
+
export interface RoutingProps {
|
|
3
|
+
/**
|
|
4
|
+
* Only applies when using `history`-based routing. (See the `router` prop.) Specifies the base path under which
|
|
5
|
+
* all API component controlled pages are located. The host must route any location under this path to the API component.
|
|
6
|
+
*/
|
|
7
|
+
basePath?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Only applies when using `static`-based routing. (See the `router` prop.) Specifies the current static path
|
|
10
|
+
* that is being rendered by the StaticRouter, which allows us to properly render the currently active route
|
|
11
|
+
* on the server and already render the content instead of sending an empty page to the client.
|
|
12
|
+
*/
|
|
13
|
+
staticRouterPath?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Which routing solution to use when the user navigates using the table of contents.
|
|
16
|
+
* Only applies when using the *sidebar* layout.
|
|
17
|
+
*
|
|
18
|
+
* - **`history`** - The table of contents pushes entries onto the navigation stack, e.g. `location.pushState`.
|
|
19
|
+
* This requires that the host routes any location under `basePath` (see `basePath` prop) to the API component.
|
|
20
|
+
* - **`hash`** - Navigation happens using hash-fragments (`/some/page#these-fragments-here`).
|
|
21
|
+
* This still allows the user to link to individual pages without requiring the more complex routing setup `history` needs.
|
|
22
|
+
* - **`memory`** - Internal navigation does not change the host `location` at all.
|
|
23
|
+
* This works in every scenario, but it lacks the important feature of being able to link to individual pages.
|
|
24
|
+
* - **`static`** - Renders a single static page for the provided `staticRouterPath`.
|
|
25
|
+
* This can be used when the page is being rendered on the server (either SSR or SSG) to pre-generate the
|
|
26
|
+
* markup of the page, which can be rehydrated on the client. This can reduce the amount of time spent rendering
|
|
27
|
+
* the page on the client.
|
|
28
|
+
*
|
|
29
|
+
* @default "history"
|
|
30
|
+
*/
|
|
31
|
+
router?: RouterType;
|
|
32
|
+
/**
|
|
33
|
+
* Either uses the app's own or the parent router ex. (Portal).
|
|
34
|
+
*
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
enableRouter?: boolean;
|
|
38
|
+
}
|