@redocly/reference-docs 2.13.0 → 2.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli/commands/redocly-docs-cli.min.js +66 -66
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
- package/dist/console.redocly-reference-docs.min.js +2 -2
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +822 -822
- package/lib/components/Endpoint/Endpoint.d.ts +2 -2
- package/lib/components/Endpoint/ServerList.d.ts +2 -2
- package/lib/components/Endpoint/Summary.d.ts +3 -3
- package/lib/components/NextSectionButton.d.ts +2 -2
- package/lib/components/Overlay.d.ts +1 -1
- package/lib/components/Panel/PanelComponent.d.ts +2 -1
- package/lib/components/ProProviders.d.ts +2 -2
- package/lib/components/RedoclyReferenceDocs.d.ts +3 -3
- package/lib/components/Samples/ExampleSwitch.d.ts +1 -1
- package/lib/components/Samples/ExampleSwitch.js +1 -1
- package/lib/components/Samples/SamplesTabs.d.ts +1 -1
- package/lib/components/Samples/use-example-key.d.ts +1 -1
- package/lib/components/Search/MenuItemProSearch.d.ts +2 -2
- package/lib/components/Search/MenuItemProSearch.js +1 -1
- package/lib/components/Search/ProSearchBox.d.ts +5 -5
- package/lib/components/Search/SearchField.d.ts +1 -1
- package/lib/components/StoreProvider.d.ts +3 -2
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabs.d.ts +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.d.ts +2 -2
- package/lib/components/VersionSwitcher.d.ts +2 -2
- package/lib/components/common/CheckboxList.d.ts +3 -2
- package/lib/components/common/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/common/Dropdown/types.d.ts +1 -1
- package/lib/components/common/FileUpload/helper.d.ts +1 -1
- package/lib/components/common/TextField.d.ts +1 -1
- package/lib/components/console/ActionPanel.d.ts +2 -2
- package/lib/components/console/AuthPanel.d.ts +4 -4
- package/lib/components/console/CodemirrorInput.d.ts +1 -1
- package/lib/components/console/Console.d.ts +6 -6
- package/lib/components/console/OAuth2Flow.d.ts +4 -4
- package/lib/components/console/OAuth2TokenInput.d.ts +1 -1
- package/lib/components/console/OpenIDConnect.d.ts +3 -3
- package/lib/components/console/OperationParameters.d.ts +1 -1
- package/lib/components/console/RequestBody.d.ts +2 -2
- package/lib/components/console/RequestBody.js +1 -1
- package/lib/components/console/RequestBodyForm.d.ts +1 -1
- package/lib/components/console/ResponseBody.d.ts +1 -1
- package/lib/components/console/ResponsePanel.d.ts +1 -1
- package/lib/components/console/ServerDropdown.d.ts +1 -1
- package/lib/components/console/utils.d.ts +1 -1
- package/lib/components/pluggable/RedocExample.d.ts +2 -2
- package/lib/components/pluggable/RedocRequestBody.d.ts +1 -1
- package/lib/components/pluggable/RedocResponse.d.ts +1 -1
- package/lib/components/pluggable/RedocSchema.d.ts +2 -2
- package/lib/components/pluggable/styled.components.d.ts +1 -1
- package/lib/components/styled.elements.d.ts +3 -2
- package/lib/models/code-sample-options.d.ts +1 -1
- package/lib/redoc-lib/src/common-elements/LinkToField.d.ts +2 -2
- package/lib/redoc-lib/src/common-elements/Tooltip.d.ts +1 -1
- package/lib/redoc-lib/src/common-elements/linkify.d.ts +3 -2
- package/lib/redoc-lib/src/common-elements/perfect-scrollbar.d.ts +3 -2
- package/lib/redoc-lib/src/components/ApiInfo/ApiInfo.d.ts +1 -1
- package/lib/redoc-lib/src/components/ApiLogo/ApiLogo.d.ts +1 -1
- package/lib/redoc-lib/src/components/ApiLogo/styled.elements.d.ts +1 -1
- package/lib/redoc-lib/src/components/CallbackSamples/CallbackReqSamples.d.ts +1 -1
- package/lib/redoc-lib/src/components/CallbackSamples/CallbackSamples.d.ts +2 -2
- package/lib/redoc-lib/src/components/Callbacks/CallbackDetails.d.ts +1 -1
- package/lib/redoc-lib/src/components/Callbacks/CallbackOperation.d.ts +1 -1
- package/lib/redoc-lib/src/components/Callbacks/CallbackSummary.d.ts +2 -2
- package/lib/redoc-lib/src/components/Callbacks/CallbacksList.d.ts +1 -1
- package/lib/redoc-lib/src/components/ContentItems/ContentItems.d.ts +3 -3
- package/lib/redoc-lib/src/components/DownloadButton/DownloadButton.d.ts +1 -1
- package/lib/redoc-lib/src/components/DropdownOrLabel/DropdownOrLabel.d.ts +1 -1
- package/lib/redoc-lib/src/components/ErrorBoundary.d.ts +2 -1
- package/lib/redoc-lib/src/components/ExternalDocumentation/ExternalDocumentation.d.ts +1 -1
- package/lib/redoc-lib/src/components/Fields/Field.d.ts +3 -3
- package/lib/redoc-lib/src/components/Fields/FieldDetails.d.ts +1 -1
- package/lib/redoc-lib/src/components/GenericChildrenSwitcher/GenericChildrenSwitcher.d.ts +1 -1
- package/lib/redoc-lib/src/components/Markdown/AdvancedMarkdown.d.ts +3 -3
- package/lib/redoc-lib/src/components/Markdown/SanitizedMdBlock.d.ts +1 -1
- package/lib/redoc-lib/src/components/Markdown/styled.elements.d.ts +1 -1
- package/lib/redoc-lib/src/components/MediaTypeSwitch/MediaTypesSwitch.d.ts +2 -2
- package/lib/redoc-lib/src/components/Operation/Operation.d.ts +1 -1
- package/lib/redoc-lib/src/components/OptionsProvider.d.ts +1 -1
- package/lib/redoc-lib/src/components/Parameters/ParametersGroup.d.ts +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/Example.d.ts +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.d.ts +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/PayloadSamples.d.ts +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/exernalExampleHook.d.ts +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/CodeSample.d.ts +2 -2
- package/lib/redoc-lib/src/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/languageSwitchEvent.d.ts +3 -2
- package/lib/redoc-lib/src/components/RequestSamples/useCodeSamples.d.ts +1 -1
- package/lib/redoc-lib/src/components/Responses/Response.d.ts +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponseDetails.d.ts +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponseHeaders.d.ts +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponseSummary.d.ts +2 -2
- package/lib/redoc-lib/src/components/Responses/ResponsesList.d.ts +1 -1
- package/lib/redoc-lib/src/components/Schema/ArraySchema.d.ts +1 -1
- package/lib/redoc-lib/src/components/Schema/DiscriminatorDropdown.d.ts +2 -2
- package/lib/redoc-lib/src/components/Schema/ObjectSchema.d.ts +1 -1
- package/lib/redoc-lib/src/components/Schema/OneOfSchema.d.ts +1 -1
- package/lib/redoc-lib/src/components/Schema/Schema.d.ts +1 -1
- package/lib/redoc-lib/src/components/SchemaDefinition/SchemaDefinition.d.ts +2 -2
- package/lib/redoc-lib/src/components/SearchBox/SearchBox.d.ts +3 -3
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.d.ts +1 -1
- package/lib/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.d.ts +2 -2
- package/lib/redoc-lib/src/components/SideMenu/MenuItem.d.ts +3 -3
- package/lib/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib/redoc-lib/src/components/SideMenu/SideMenu.d.ts +3 -3
- package/lib/redoc-lib/src/components/SourceCode/SourceCode.d.ts +2 -2
- package/lib/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.d.ts +3 -2
- package/lib/redoc-lib/src/components/StoreBuilder.d.ts +1 -1
- package/lib/redoc-lib/src/components/helper.d.ts +1 -1
- package/lib/redoc-lib/src/services/MarkdownRenderer.d.ts +3 -3
- package/lib/redoc-lib/src/services/MenuBuilder.d.ts +3 -3
- package/lib/redoc-lib/src/services/OpenAPIParser.d.ts +1 -1
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.d.ts +7 -5
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib/redoc-lib/src/services/ScrollService.d.ts +1 -1
- package/lib/redoc-lib/src/services/SpecStore.d.ts +3 -3
- package/lib/redoc-lib/src/services/models/ApiInfo.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/Callback.d.ts +3 -3
- package/lib/redoc-lib/src/services/models/Example.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/Field.d.ts +5 -4
- package/lib/redoc-lib/src/services/models/Group.model.d.ts +4 -4
- package/lib/redoc-lib/src/services/models/MediaContent.d.ts +5 -5
- package/lib/redoc-lib/src/services/models/MediaType.d.ts +5 -5
- package/lib/redoc-lib/src/services/models/Operation.d.ts +8 -8
- package/lib/redoc-lib/src/services/models/RequestBody.d.ts +4 -4
- package/lib/redoc-lib/src/services/models/Response.d.ts +4 -4
- package/lib/redoc-lib/src/services/models/Schema.d.ts +5 -5
- package/lib/redoc-lib/src/services/models/SecurityRequirement.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/SecuritySchemes.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/Webhook.d.ts +3 -3
- package/lib/redoc-lib/src/styled-components.d.ts +2 -2
- package/lib/redoc-lib/src/types/open-api.d.ts +2 -2
- package/lib/redoc-lib/src/utils/helpers.d.ts +3 -1
- package/lib/redoc-lib/src/utils/helpers.js +1 -1
- package/lib/redoc-lib/src/utils/loadAndBundleSpec.d.ts +1 -1
- package/lib/redoc-lib/src/utils/media-css.d.ts +1 -1
- package/lib/redoc-lib/src/utils/openapi.d.ts +3 -3
- package/lib/services/ProMenu.d.ts +2 -2
- package/lib/services/ProStore.d.ts +13 -26
- package/lib/services/ProStore.js +1 -1
- package/lib/services/SearchStore.d.ts +3 -2
- package/lib/services/VersionedSpecStore.d.ts +3 -2
- package/lib/services/code-samples/generator.d.ts +3 -3
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/index.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/go/native.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/java/httpclient.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/php/curl.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/php/utils.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/python/requests.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/ruby/native.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/shell/curl.d.ts +2 -2
- package/lib/services/extendTheme.d.ts +2 -2
- package/lib/services/history/FakeHistoryService.d.ts +2 -2
- package/lib/services/history/ProHashHistoryService.d.ts +2 -2
- package/lib/services/history/PushStateHistoryService.d.ts +3 -2
- package/lib/services/history/helpers.d.ts +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.js +1 -1
- package/lib/services/types.d.ts +24 -0
- package/lib/services/types.js +2 -0
- package/lib/services/utils.d.ts +1 -1
- package/lib/services/utils.js +1 -1
- package/lib/standalone.d.ts +3 -3
- package/lib/utils.js +1 -1
- package/lib-esm/components/Endpoint/Endpoint.d.ts +2 -2
- package/lib-esm/components/Endpoint/ServerList.d.ts +2 -2
- package/lib-esm/components/Endpoint/Summary.d.ts +3 -3
- package/lib-esm/components/NextSectionButton.d.ts +2 -2
- package/lib-esm/components/Overlay.d.ts +1 -1
- package/lib-esm/components/Panel/PanelComponent.d.ts +2 -1
- package/lib-esm/components/ProProviders.d.ts +2 -2
- package/lib-esm/components/RedoclyReferenceDocs.d.ts +3 -3
- package/lib-esm/components/Samples/ExampleSwitch.d.ts +1 -1
- package/lib-esm/components/Samples/ExampleSwitch.js +1 -1
- package/lib-esm/components/Samples/SamplesTabs.d.ts +1 -1
- package/lib-esm/components/Samples/use-example-key.d.ts +1 -1
- package/lib-esm/components/Search/MenuItemProSearch.d.ts +2 -2
- package/lib-esm/components/Search/MenuItemProSearch.js +1 -1
- package/lib-esm/components/Search/ProSearchBox.d.ts +5 -5
- package/lib-esm/components/Search/SearchField.d.ts +1 -1
- package/lib-esm/components/StoreProvider.d.ts +3 -2
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabs.d.ts +1 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabsBase.d.ts +2 -2
- package/lib-esm/components/VersionSwitcher.d.ts +2 -2
- package/lib-esm/components/common/CheckboxList.d.ts +3 -2
- package/lib-esm/components/common/Dropdown/Dropdown.d.ts +1 -1
- package/lib-esm/components/common/Dropdown/types.d.ts +1 -1
- package/lib-esm/components/common/FileUpload/helper.d.ts +1 -1
- package/lib-esm/components/common/TextField.d.ts +1 -1
- package/lib-esm/components/console/ActionPanel.d.ts +2 -2
- package/lib-esm/components/console/AuthPanel.d.ts +4 -4
- package/lib-esm/components/console/CodemirrorInput.d.ts +1 -1
- package/lib-esm/components/console/Console.d.ts +6 -6
- package/lib-esm/components/console/OAuth2Flow.d.ts +4 -4
- package/lib-esm/components/console/OAuth2TokenInput.d.ts +1 -1
- package/lib-esm/components/console/OpenIDConnect.d.ts +3 -3
- package/lib-esm/components/console/OperationParameters.d.ts +1 -1
- package/lib-esm/components/console/RequestBody.d.ts +2 -2
- package/lib-esm/components/console/RequestBody.js +1 -1
- package/lib-esm/components/console/RequestBodyForm.d.ts +1 -1
- package/lib-esm/components/console/ResponseBody.d.ts +1 -1
- package/lib-esm/components/console/ResponsePanel.d.ts +1 -1
- package/lib-esm/components/console/ServerDropdown.d.ts +1 -1
- package/lib-esm/components/console/utils.d.ts +1 -1
- package/lib-esm/components/pluggable/RedocExample.d.ts +2 -2
- package/lib-esm/components/pluggable/RedocRequestBody.d.ts +1 -1
- package/lib-esm/components/pluggable/RedocResponse.d.ts +1 -1
- package/lib-esm/components/pluggable/RedocSchema.d.ts +2 -2
- package/lib-esm/components/pluggable/styled.components.d.ts +1 -1
- package/lib-esm/components/styled.elements.d.ts +3 -2
- package/lib-esm/models/code-sample-options.d.ts +1 -1
- package/lib-esm/redoc-lib/src/common-elements/LinkToField.d.ts +2 -2
- package/lib-esm/redoc-lib/src/common-elements/Tooltip.d.ts +1 -1
- package/lib-esm/redoc-lib/src/common-elements/linkify.d.ts +3 -2
- package/lib-esm/redoc-lib/src/common-elements/perfect-scrollbar.d.ts +3 -2
- package/lib-esm/redoc-lib/src/components/ApiInfo/ApiInfo.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/ApiLogo/ApiLogo.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/ApiLogo/styled.elements.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/CallbackSamples/CallbackReqSamples.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/CallbackSamples/CallbackSamples.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbackDetails.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbackOperation.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbackSummary.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbacksList.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/ContentItems/ContentItems.d.ts +3 -3
- package/lib-esm/redoc-lib/src/components/DownloadButton/DownloadButton.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/DropdownOrLabel/DropdownOrLabel.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/ErrorBoundary.d.ts +2 -1
- package/lib-esm/redoc-lib/src/components/ExternalDocumentation/ExternalDocumentation.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Fields/Field.d.ts +3 -3
- package/lib-esm/redoc-lib/src/components/Fields/FieldDetails.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/GenericChildrenSwitcher/GenericChildrenSwitcher.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Markdown/AdvancedMarkdown.d.ts +3 -3
- package/lib-esm/redoc-lib/src/components/Markdown/SanitizedMdBlock.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Markdown/styled.elements.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/MediaTypeSwitch/MediaTypesSwitch.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/Operation/Operation.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/OptionsProvider.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Parameters/ParametersGroup.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/Example.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/PayloadSamples.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/exernalExampleHook.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/CodeSample.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/languageSwitchEvent.d.ts +3 -2
- package/lib-esm/redoc-lib/src/components/RequestSamples/useCodeSamples.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/Response.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponseDetails.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponseHeaders.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponseSummary.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/Responses/ResponsesList.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Schema/ArraySchema.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Schema/DiscriminatorDropdown.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/Schema/ObjectSchema.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Schema/OneOfSchema.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Schema/Schema.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/SchemaDefinition/SchemaDefinition.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/SearchBox/SearchBox.d.ts +3 -3
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItem.d.ts +3 -3
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/SideMenu.d.ts +3 -3
- package/lib-esm/redoc-lib/src/components/SourceCode/SourceCode.d.ts +2 -2
- package/lib-esm/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.d.ts +3 -2
- package/lib-esm/redoc-lib/src/components/StoreBuilder.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/helper.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/MarkdownRenderer.d.ts +3 -3
- package/lib-esm/redoc-lib/src/services/MenuBuilder.d.ts +3 -3
- package/lib-esm/redoc-lib/src/services/OpenAPIParser.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.d.ts +7 -5
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib-esm/redoc-lib/src/services/ScrollService.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/SpecStore.d.ts +3 -3
- package/lib-esm/redoc-lib/src/services/models/ApiInfo.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/Callback.d.ts +3 -3
- package/lib-esm/redoc-lib/src/services/models/Example.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/Field.d.ts +5 -4
- package/lib-esm/redoc-lib/src/services/models/Group.model.d.ts +4 -4
- package/lib-esm/redoc-lib/src/services/models/MediaContent.d.ts +5 -5
- package/lib-esm/redoc-lib/src/services/models/MediaType.d.ts +5 -5
- package/lib-esm/redoc-lib/src/services/models/Operation.d.ts +8 -8
- package/lib-esm/redoc-lib/src/services/models/RequestBody.d.ts +4 -4
- package/lib-esm/redoc-lib/src/services/models/Response.d.ts +4 -4
- package/lib-esm/redoc-lib/src/services/models/Schema.d.ts +5 -5
- package/lib-esm/redoc-lib/src/services/models/SecurityRequirement.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/SecuritySchemes.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/Webhook.d.ts +3 -3
- package/lib-esm/redoc-lib/src/styled-components.d.ts +2 -2
- package/lib-esm/redoc-lib/src/types/open-api.d.ts +2 -2
- package/lib-esm/redoc-lib/src/utils/helpers.d.ts +3 -1
- package/lib-esm/redoc-lib/src/utils/helpers.js +1 -1
- package/lib-esm/redoc-lib/src/utils/loadAndBundleSpec.d.ts +1 -1
- package/lib-esm/redoc-lib/src/utils/media-css.d.ts +1 -1
- package/lib-esm/redoc-lib/src/utils/openapi.d.ts +3 -3
- package/lib-esm/services/ProMenu.d.ts +2 -2
- package/lib-esm/services/ProStore.d.ts +13 -26
- package/lib-esm/services/ProStore.js +1 -1
- package/lib-esm/services/SearchStore.d.ts +3 -2
- package/lib-esm/services/VersionedSpecStore.d.ts +3 -2
- package/lib-esm/services/code-samples/generator.d.ts +3 -3
- package/lib-esm/services/code-samples/generator.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/index.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/csharp/httpclient.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/go/native.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/java/httpclient.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/javascript/fetch.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/node/fetch.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/php/curl.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/php/utils.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/python/requests.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/ruby/native.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/shell/curl.d.ts +2 -2
- package/lib-esm/services/extendTheme.d.ts +2 -2
- package/lib-esm/services/history/FakeHistoryService.d.ts +2 -2
- package/lib-esm/services/history/ProHashHistoryService.d.ts +2 -2
- package/lib-esm/services/history/PushStateHistoryService.d.ts +3 -2
- package/lib-esm/services/history/helpers.d.ts +1 -1
- package/lib-esm/services/index.d.ts +1 -0
- package/lib-esm/services/index.js +1 -1
- package/lib-esm/services/types.d.ts +24 -0
- package/lib-esm/services/types.js +2 -0
- package/lib-esm/services/utils.d.ts +1 -1
- package/lib-esm/services/utils.js +1 -1
- package/lib-esm/standalone.d.ts +3 -3
- package/lib-esm/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPICallback, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPICallback, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import { OperationModel } from './Operation';
|
|
4
|
-
import { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
|
+
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
5
5
|
export declare class CallbackModel {
|
|
6
6
|
expanded: boolean;
|
|
7
7
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPIEncoding, OpenAPIExample, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPIEncoding, OpenAPIExample, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
export declare class ExampleModel {
|
|
4
4
|
mime: string;
|
|
5
5
|
value: any;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { OpenAPIParameter, OpenAPIParameterLocation, OpenAPIParameterStyle, Referenced } from '../../types';
|
|
2
|
-
import { RedocProNormalizedOptions } from '../../../../services';
|
|
3
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
-
import {
|
|
1
|
+
import type { OpenAPIParameter, OpenAPIParameterLocation, OpenAPIParameterStyle, Referenced } from '../../types';
|
|
2
|
+
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
3
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
+
import type { Deps } from './Schema';
|
|
5
|
+
import { SchemaModel } from './Schema';
|
|
5
6
|
import { ExampleModel } from './Example';
|
|
6
7
|
/**
|
|
7
8
|
* Field or Parameter model ready to be used by components
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPIExternalDocumentation, OpenAPITag } from '../../types';
|
|
2
|
-
import { MarkdownHeading } from '../MarkdownRenderer';
|
|
3
|
-
import { ContentItemModel } from '../MenuBuilder';
|
|
4
|
-
import { IMenuItem, MenuItemGroupType } from '../MenuStore';
|
|
1
|
+
import type { OpenAPIExternalDocumentation, OpenAPITag } from '../../types';
|
|
2
|
+
import type { MarkdownHeading } from '../MarkdownRenderer';
|
|
3
|
+
import type { ContentItemModel } from '../MenuBuilder';
|
|
4
|
+
import type { IMenuItem, MenuItemGroupType } from '../MenuStore';
|
|
5
5
|
/**
|
|
6
6
|
* Operations Group model ready to be used by components
|
|
7
7
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OpenAPIMediaType } from '../../types';
|
|
1
|
+
import type { OpenAPIMediaType } from '../../types';
|
|
2
2
|
import { MediaTypeModel } from './MediaType';
|
|
3
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
-
import { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
5
|
-
import { OperationModel } from './Operation';
|
|
6
|
-
import { ResponseModel } from './Response';
|
|
3
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
+
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
5
|
+
import type { OperationModel } from './Operation';
|
|
6
|
+
import type { ResponseModel } from './Response';
|
|
7
7
|
/**
|
|
8
8
|
* MediaContent model ready to be sued by React components
|
|
9
9
|
* Contains multiple MediaTypes and keeps track of the currently active one
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OpenAPIMediaType } from '../../types';
|
|
2
|
-
import { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
1
|
+
import type { OpenAPIMediaType } from '../../types';
|
|
2
|
+
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
3
3
|
import { SchemaModel } from './Schema';
|
|
4
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
5
5
|
import { ExampleModel } from './Example';
|
|
6
|
-
import { OperationModel } from './Operation';
|
|
7
|
-
import { ResponseModel } from './Response';
|
|
6
|
+
import type { OperationModel } from './Operation';
|
|
7
|
+
import type { ResponseModel } from './Response';
|
|
8
8
|
export declare class MediaTypeModel {
|
|
9
9
|
options: RedocProNormalizedOptions;
|
|
10
10
|
examples?: {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { IMenuItem } from '../MenuStore';
|
|
2
|
-
import { GroupModel } from './Group.model';
|
|
1
|
+
import type { IMenuItem } from '../MenuStore';
|
|
2
|
+
import type { GroupModel } from './Group.model';
|
|
3
3
|
import { SecurityRequirementModel } from './SecurityRequirement';
|
|
4
|
-
import { OpenAPIExternalDocumentation, OpenAPIServer, OpenAPIXCodeSample, Server } from '../../types';
|
|
5
|
-
import { ContentItemModel, ExtendedOpenAPIOperation } from '../MenuBuilder';
|
|
6
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
7
|
-
import { Unstable_ExternalCodeSample } from '../RedocNormalizedOptions';
|
|
4
|
+
import type { OpenAPIExternalDocumentation, OpenAPIServer, OpenAPIXCodeSample, Server } from '../../types';
|
|
5
|
+
import type { ContentItemModel, ExtendedOpenAPIOperation } from '../MenuBuilder';
|
|
6
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
7
|
+
import type { Unstable_ExternalCodeSample } from '../RedocNormalizedOptions';
|
|
8
8
|
import { CallbackModel } from './Callback';
|
|
9
9
|
import { FieldModel } from './Field';
|
|
10
|
-
import { MediaContentModel } from './MediaContent';
|
|
10
|
+
import type { MediaContentModel } from './MediaContent';
|
|
11
11
|
import { RequestBodyModel } from './RequestBody';
|
|
12
12
|
import { ResponseModel } from './Response';
|
|
13
|
-
import { RedocProNormalizedOptions } from '../../../../services';
|
|
13
|
+
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
14
14
|
export interface Sample {
|
|
15
15
|
lang: string;
|
|
16
16
|
label?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OpenAPIRequestBody, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
-
import { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
1
|
+
import type { OpenAPIRequestBody, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
4
|
import { MediaContentModel } from './MediaContent';
|
|
5
|
-
import { OperationModel } from './Operation';
|
|
5
|
+
import type { OperationModel } from './Operation';
|
|
6
6
|
declare type RequestBodyProps = {
|
|
7
7
|
parser: OpenAPIParser;
|
|
8
8
|
infoOrRef: Referenced<OpenAPIRequestBody>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OpenAPIResponse, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
-
import { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
1
|
+
import type { OpenAPIResponse, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
4
|
import { FieldModel } from './Field';
|
|
5
5
|
import { MediaContentModel } from './MediaContent';
|
|
6
|
-
import { OperationModel } from './Operation';
|
|
6
|
+
import type { OperationModel } from './Operation';
|
|
7
7
|
declare type ResponseProps = {
|
|
8
8
|
parser: OpenAPIParser;
|
|
9
9
|
code: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OpenAPIExternalDocumentation, OpenAPISchema, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
-
import { RedocProNormalizedOptions } from '../../../../services';
|
|
1
|
+
import type { OpenAPIExternalDocumentation, OpenAPISchema, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
4
4
|
import { FieldModel } from './Field';
|
|
5
|
-
import { MergedOpenAPISchema, ResponseModel } from '../';
|
|
6
|
-
import { OperationModel } from './Operation';
|
|
5
|
+
import type { MergedOpenAPISchema, ResponseModel } from '../';
|
|
6
|
+
import type { OperationModel } from './Operation';
|
|
7
7
|
export declare type Deps = {
|
|
8
8
|
parentFieldFullPath?: string;
|
|
9
9
|
operation?: OperationModel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPISecurityRequirement, OpenAPISecurityScheme } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPISecurityRequirement, OpenAPISecurityScheme } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
export interface SecurityScheme extends OpenAPISecurityScheme {
|
|
4
4
|
id: string;
|
|
5
5
|
sectionId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPISecurityScheme, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPISecurityScheme, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
export declare class SecuritySchemeModel {
|
|
4
4
|
id: string;
|
|
5
5
|
sectionId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPIPath, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPIPath, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import { OperationModel } from './Operation';
|
|
4
|
-
import { RedocProNormalizedOptions } from '../../../../services';
|
|
4
|
+
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
5
5
|
export declare class WebhookModel {
|
|
6
6
|
operations: OperationModel[];
|
|
7
7
|
constructor(parser: OpenAPIParser, options: RedocProNormalizedOptions, infoOrRef?: Referenced<OpenAPIPath>);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as styledComponents from 'styled-components';
|
|
2
|
-
import { ResolvedThemeInterface, MediaValue } from './theme';
|
|
3
|
-
import { ProTheme } from '../../services/extendTheme';
|
|
2
|
+
import type { ResolvedThemeInterface, MediaValue } from './theme';
|
|
3
|
+
import type { ProTheme } from '../../services/extendTheme';
|
|
4
4
|
export type { ResolvedThemeInterface, MediaValue };
|
|
5
5
|
declare const styled: styledComponents.ThemedStyledInterface<ProTheme>, css: styledComponents.ThemedCssFunction<ProTheme>, createGlobalStyle: <P extends object = {}>(first: TemplateStringsArray | styledComponents.CSSObject | styledComponents.InterpolationFunction<styledComponents.ThemedStyledProps<P, ProTheme>>, ...interpolations: styledComponents.Interpolation<styledComponents.ThemedStyledProps<P, ProTheme>>[]) => styledComponents.GlobalStyleComponent<P, ProTheme>, keyframes: (strings: TemplateStringsArray | styledComponents.CSSKeyframes, ...interpolations: styledComponents.SimpleInterpolation[]) => styledComponents.Keyframes, ThemeProvider: styledComponents.ThemeProviderComponent<ProTheme, ProTheme>;
|
|
6
6
|
export { css, createGlobalStyle, keyframes, ThemeProvider };
|
|
@@ -20,7 +20,9 @@ export declare function flattenByProp<T extends GenericObject, P extends keyof T
|
|
|
20
20
|
export declare function stripTrailingSlash(path: string): string;
|
|
21
21
|
export declare function isNumeric(value: unknown): value is number;
|
|
22
22
|
export declare function appendToMdHeading(md: string, heading: string, content: string): string;
|
|
23
|
-
export declare const mergeObjects: (target: GenericObject, ...sources: GenericObject[]) =>
|
|
23
|
+
export declare const mergeObjects: (target: GenericObject, ...sources: GenericObject[]) => GenericObject;
|
|
24
|
+
export declare const isObject: (item: unknown) => item is "object";
|
|
25
|
+
export declare const isMergeableObject: (item: unknown) => boolean;
|
|
24
26
|
/**
|
|
25
27
|
* slugify() returns empty string when failed to slugify.
|
|
26
28
|
* so try to return minimum slugified-string with failed one which keeps original value
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSchemaTitle=exports.sanitizeItemId=exports.unescapeHTMLChars=exports.removeQueryString=exports.titleize=exports.getBasePath=exports.resolveUrl=exports.isAbsoluteUrl=exports.safeSlugify=exports.mergeObjects=exports.appendToMdHeading=exports.isNumeric=exports.stripTrailingSlash=exports.flattenByProp=exports.mapValues=exports.mapWithLast=void 0;var tslib_1=require("tslib"),slugify_1=(0,tslib_1.__importDefault)(require("slugify")),url_1=require("url"),media_css_1=require("./media-css"),openapi_1=require("./openapi"),JsonPointer_1=(0,tslib_1.__importDefault)(require("./JsonPointer"));function mapWithLast(e,r){for(var t=[],s=0;s<e.length-1;s++)t.push(r(e[s],!1));return 0!==e.length&&t.push(r(e[e.length-1],!0)),t}function mapValues(e,r){var t={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=r(e[s],s,e));return t}function flattenByProp(e,r){var t=[],s=function(e){for(var i=0,n=e;i<n.length;i++){var a=n[i];t.push(a),a[r]&&s(a[r])}};return s(e),t}function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}function appendToMdHeading(e,r,t){var s=new RegExp("(^|\\n)#\\s?"+r+"\\s*\\n","i"),i=new RegExp("((\\n|^)#\\s*"+r+"\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)","i");if(s.test(e))return e.replace(i,"$1\n\n"+t+"\n$4");var n=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return""+e+n+"# "+r+"\n\n"+t}exports.mapWithLast=mapWithLast,exports.mapValues=mapValues,exports.flattenByProp=flattenByProp,exports.stripTrailingSlash=stripTrailingSlash,exports.isNumeric=isNumeric,exports.appendToMdHeading=appendToMdHeading;var mergeObjects=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];if(!r.length)return e;var s=r.shift();return void 0===s?e:(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSchemaTitle=exports.sanitizeItemId=exports.unescapeHTMLChars=exports.removeQueryString=exports.titleize=exports.getBasePath=exports.resolveUrl=exports.isAbsoluteUrl=exports.safeSlugify=exports.isMergeableObject=exports.isObject=exports.mergeObjects=exports.appendToMdHeading=exports.isNumeric=exports.stripTrailingSlash=exports.flattenByProp=exports.mapValues=exports.mapWithLast=void 0;var tslib_1=require("tslib"),slugify_1=(0,tslib_1.__importDefault)(require("slugify")),url_1=require("url"),media_css_1=require("./media-css"),openapi_1=require("./openapi"),JsonPointer_1=(0,tslib_1.__importDefault)(require("./JsonPointer"));function mapWithLast(e,r){for(var t=[],s=0;s<e.length-1;s++)t.push(r(e[s],!1));return 0!==e.length&&t.push(r(e[e.length-1],!0)),t}function mapValues(e,r){var t={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=r(e[s],s,e));return t}function flattenByProp(e,r){var t=[],s=function(e){for(var i=0,n=e;i<n.length;i++){var a=n[i];t.push(a),a[r]&&s(a[r])}};return s(e),t}function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}function appendToMdHeading(e,r,t){var s=new RegExp("(^|\\n)#\\s?"+r+"\\s*\\n","i"),i=new RegExp("((\\n|^)#\\s*"+r+"\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)","i");if(s.test(e))return e.replace(i,"$1\n\n"+t+"\n$4");var n=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return""+e+n+"# "+r+"\n\n"+t}exports.mapWithLast=mapWithLast,exports.mapValues=mapValues,exports.flattenByProp=flattenByProp,exports.stripTrailingSlash=stripTrailingSlash,exports.isNumeric=isNumeric,exports.appendToMdHeading=appendToMdHeading;var mergeObjects=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];if(!r.length)return e;var s=r.shift();return void 0===s?e:((0,exports.isMergeableObject)(e)&&(0,exports.isMergeableObject)(s)&&Object.keys(s).forEach((function(r){var t;(0,exports.isMergeableObject)(s[r])?(e[r]||(e[r]={}),["string","number"].includes(typeof e[r])&&(s[r][media_css_1.ZERO_BREAKPOINT]||0===s[r][media_css_1.ZERO_BREAKPOINT]||console.warn('Theme resolver: using default value of "'+e[r]+'" for "'+r+'". This is not recommended. Prefer adding default value by providing "'+media_css_1.ZERO_BREAKPOINT+'" property to '+JSON.stringify(s[r])+"."),e[r]=((t={})[media_css_1.ZERO_BREAKPOINT]=e[r],t)),(0,exports.mergeObjects)(e[r],s[r])):e[r]=s[r]})),exports.mergeObjects.apply(void 0,(0,tslib_1.__spreadArray)([e],r,!1)))};exports.mergeObjects=mergeObjects;var isObject=function(e){return null!==e&&"object"==typeof e};exports.isObject=isObject;var isMergeableObject=function(e){return(0,exports.isObject)(e)&&!Array.isArray(e)};function safeSlugify(e){return(0,slugify_1.default)(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function isAbsoluteUrl(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function resolveUrl(e,r){var t;if(r.startsWith("//"))t=""+((0,url_1.parse)(e).protocol||"https:")+r;else if(isAbsoluteUrl(r))t=r;else if(r.startsWith("/")){var s=(0,url_1.parse)(e);t=(0,url_1.format)((0,tslib_1.__assign)((0,tslib_1.__assign)({},s),{pathname:r}))}else t=stripTrailingSlash(e)+"/"+r;return stripTrailingSlash(t)}function getBasePath(e){try{return parseURL(e).pathname}catch(r){return e}}function titleize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function removeQueryString(e){try{var r=parseURL(e);return r.search="",r.toString()}catch(r){return e}}function parseURL(e){return"undefined"==typeof URL?new(require("url").URL)(e):new URL(e)}function unescapeHTMLChars(e){return e.replace(/&#(\d+);/g,(function(e,r){return String.fromCharCode(parseInt(r,10))})).replace(/&/g,"&")}function sanitizeItemId(e){return e&&e.replace(/#/g,"_")}function getSchemaTitle(e,r){return r||(0,openapi_1.isNamedDefinition)(e)&&JsonPointer_1.default.baseName(e)||""}exports.isMergeableObject=isMergeableObject,exports.safeSlugify=safeSlugify,exports.isAbsoluteUrl=isAbsoluteUrl,exports.resolveUrl=resolveUrl,exports.getBasePath=getBasePath,exports.titleize=titleize,exports.removeQueryString=removeQueryString,exports.unescapeHTMLChars=unescapeHTMLChars,exports.sanitizeItemId=sanitizeItemId,exports.getSchemaTitle=getSchemaTitle;
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Document } from '@redocly/openapi-core';
|
|
1
|
+
import type { Document } from '@redocly/openapi-core';
|
|
2
2
|
import type { OpenAPIDefinition } from '../types';
|
|
3
3
|
export declare function loadAndBundleDefinition(specUrlOrObject: GenericObject | string): Promise<OpenAPIDefinition>;
|
|
4
4
|
export declare function createParsedDocument(specUrlOrObject: GenericObject | string): Document;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FieldModel } from '../services/models';
|
|
2
|
-
import { OpenAPIParser } from '../services/OpenAPIParser';
|
|
3
|
-
import { OpenAPIEncoding, OpenAPIMediaType, OpenAPIOperation, OpenAPIParameter, OpenAPIParameterStyle, OpenAPISchema, OpenAPIServer, Referenced, OpenAPIResponse, OpenAPIRequestBody } from '../types';
|
|
1
|
+
import type { FieldModel } from '../services/models';
|
|
2
|
+
import type { OpenAPIParser } from '../services/OpenAPIParser';
|
|
3
|
+
import type { OpenAPIEncoding, OpenAPIMediaType, OpenAPIOperation, OpenAPIParameter, OpenAPIParameterStyle, OpenAPISchema, OpenAPIServer, Referenced, OpenAPIResponse, OpenAPIRequestBody } from '../types';
|
|
4
4
|
export declare function isStatusCode(statusCode: string): boolean;
|
|
5
5
|
export declare function getStatusCodeType(statusCode: string | number, defaultAsError?: boolean): string;
|
|
6
6
|
export declare function isOperationName(key: string): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMenuItem, ScrollService, HistoryService, MenuItemType, SchemaModel, SpecStore } from '../redoc-lib';
|
|
2
|
-
import { RedocProNormalizedOptions } from './ProStore';
|
|
1
|
+
import type { IMenuItem, ScrollService, HistoryService, MenuItemType, SchemaModel, SpecStore } from '../redoc-lib';
|
|
2
|
+
import type { RedocProNormalizedOptions } from './ProStore';
|
|
3
3
|
import { VersionedSpecStore } from './VersionedSpecStore';
|
|
4
4
|
export declare type ExtendedMenuItem = Omit<IMenuItem, 'type'> & {
|
|
5
5
|
type: MenuItemType | 'spec';
|
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
import { IValueDidChange } from 'mobx';
|
|
2
|
-
import { ContentItemModel, IMenuItem,
|
|
1
|
+
import type { IValueDidChange } from 'mobx';
|
|
2
|
+
import type { ContentItemModel, IMenuItem, OpenAPIDefinition, OpenAPIExternalDocumentation, OperationModel, RedocRawOptions, SearchStore } from '../redoc-lib';
|
|
3
|
+
import { MarkerService, RedocNormalizedOptions, SpecStore } from '../redoc-lib';
|
|
3
4
|
import { ProMenu } from './ProMenu';
|
|
4
|
-
import { SearchResultMeta } from './SearchStore';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { LicenseInfo } from './check';
|
|
8
|
-
import { CodeSamplesConfig, Languages } from './code-samples/';
|
|
9
|
-
import { Events
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export declare type RedocProTheme = RedocRawOptions['theme'] & ThemeExtension;
|
|
14
|
-
export declare type MarkdownItemsPagination = 'none' | 'section';
|
|
15
|
-
export declare type Pagination = 'none' | 'section' | 'item';
|
|
16
|
-
export declare type ExternalLink = ExternalLinkLink | ExternalLinkSeparator;
|
|
17
|
-
export declare type ExternalLinkLink = {
|
|
18
|
-
label: string;
|
|
19
|
-
link: string;
|
|
20
|
-
target?: string;
|
|
21
|
-
separatorLine?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare type ExternalLinkSeparator = {
|
|
24
|
-
separator?: string;
|
|
25
|
-
separatorLine?: boolean;
|
|
26
|
-
};
|
|
5
|
+
import type { SearchResultMeta } from './SearchStore';
|
|
6
|
+
import type { SpecVersions } from './VersionedSpecStore';
|
|
7
|
+
import { VersionedSpecStore } from './VersionedSpecStore';
|
|
8
|
+
import type { LicenseInfo } from './check';
|
|
9
|
+
import type { CodeSamplesConfig, Languages } from './code-samples/';
|
|
10
|
+
import type { Events } from './store-types';
|
|
11
|
+
import { LayoutVariant } from './store-types';
|
|
12
|
+
import type { ExternalLink, MarkdownItemsPagination, Normalized, Pagination, RedocProTheme } from './types';
|
|
13
|
+
import { SideNavStyle } from './types';
|
|
27
14
|
export declare type RedocProUserOptionsExt = {
|
|
28
15
|
licenseKey?: string;
|
|
29
16
|
searchMode?: 'default' | 'path-only';
|
|
@@ -31,7 +18,7 @@ export declare type RedocProUserOptionsExt = {
|
|
|
31
18
|
searchTagTitleBoost?: number | string;
|
|
32
19
|
searchFieldLevelBoost?: number | string;
|
|
33
20
|
searchAutoExpand?: boolean;
|
|
34
|
-
sideNavStyle?:
|
|
21
|
+
sideNavStyle?: SideNavStyle;
|
|
35
22
|
showConsole?: boolean;
|
|
36
23
|
hideLogo?: boolean;
|
|
37
24
|
whiteLabel?: boolean;
|
package/lib/services/ProStore.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProStore=exports.NestingGroup=void 0;var tslib_1=require("tslib"),mobx_1=require("mobx"),openapi_core_1=require("@redocly/openapi-core"),decko_1=require("decko"),redoc_lib_1=require("../redoc-lib"),history_1=require("./history"),ProMenu_1=require("./ProMenu"),SearchStore_1=require("./SearchStore"),extendTheme_1=require("./extendTheme"),pluggable_1=require("../components/pluggable"),VersionedSpecStore_1=require("./VersionedSpecStore"),check_1=(0,tslib_1.__importDefault)(require("./check")),utils_1=require("./utils"),utils_2=require("../utils"),store_types_1=require("./store-types"),global="undefined"==typeof window?{__REDOCLY_SEARCH_URL:void 0}:window,NestingGroup=function(){function e(e,t,i,o){var n=this;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"absoluteIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"linkable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"expanded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"depth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"level",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),(0,mobx_1.makeObservable)(this),this.id="section/"+e,this.type="nesting-group",this.name=i||"",this.level=1,this.depth=1,this.description="",this.parent=void 0,this.expanded=!1,this.items=t,this.linkable=!!o,t.forEach((function(e){return e.parent=n})),increaseDepthDeep(t)}return Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!0}}),Object.defineProperty(e.prototype,"expand",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!0,this.parent&&this.parent.expand()}}),Object.defineProperty(e.prototype,"collapse",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!1}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!1}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"active",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"expanded",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"expand",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"collapse",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"deactivate",null),e}();function increaseDepthDeep(e){Array.isArray(e)&&e.forEach((function(e){e.depth++,e.parent&&"group"===e.parent.type&&(e.depth=e.parent.depth),increaseDepthDeep(e.items)}))}exports.NestingGroup=NestingGroup;var ProStore=function(){function e(e,t,i,o){var n=this;void 0===i&&(i={}),void 0===o&&(o=!0),Object.defineProperty(this,"rawOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"marker",{enumerable:!0,configurable:!0,writable:!0,value:new redoc_lib_1.MarkerService}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"search",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tryItOperation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showRightPanel",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"layout",{enumerable:!0,configurable:!0,writable:!0,value:store_types_1.LayoutVariant.THREE_PANEL}),Object.defineProperty(this,"activeSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),(0,mobx_1.makeObservable)(this),this.initProOptions(i),redoc_lib_1.IS_BROWSER&&(this.l=(0,check_1.default)(i.licenseKey),this.l.then((function(e){e.valid&&e.allowed&&!e.expired||e.local||(n.menu.items=[],n.menu.flatItems=n.menu.flatItems.slice(0,1),n.menu.renderItems=[])})));var r="object"==typeof e&&"versions"in e,a=this.options.disableSidebar?new history_1.FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new history_1.PushStateHistoryService(this.options,r):new history_1.ProHashHistoryService(this.options,r);this.definition=r?new VersionedSpecStore_1.VersionedSpecStore(e,this.options,a.currentId.split("/")[0]):new redoc_lib_1.SpecStore(e,t,this.options),i.downloadDefinitionUrl&&(this.definition.info.downloadFileName=""),this.scroll=new redoc_lib_1.ScrollService(this.options),this.options.disableSidebar||ProMenu_1.ProMenu.updateOnHistory(a.currentId,this.scroll),this.menu=new ProMenu_1.ProMenu(this.definition,this.scroll,this.options,a),this.menu.initOnHistory(),this.options.disableSearch||this.initSearch(this.options,o),this.disposer=(0,mobx_1.observe)(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return n.updateMarkOnMenu(e.newValue)}))})),(0,utils_2.setGlobalStore)(this)}return Object.defineProperty(e.prototype,"initProOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n,r;e=deepClone(e),this.rawOptions=(0,extendTheme_1.extendTheme)(e),this.options=new redoc_lib_1.RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),this.options.showConsole=null===(t=this.rawOptions.showConsole)||void 0===t||t,this.options.hideRightPanel=null!==(i=this.rawOptions.hideRightPanel)&&void 0!==i&&i,this.showRightPanel=!this.options.hideRightPanel,this.options.showRightPanelToggle=null===(o=this.rawOptions.showRightPanelToggle)||void 0===o||o,this.options.showChangeLayoutButton=null===(n=this.rawOptions.showChangeLayoutButton)||void 0===n||n,this.options.layout=this.rawOptions.layout||store_types_1.LayoutVariant.THREE_PANEL,this.options.defaultSampleLanguage=this.rawOptions.defaultSampleLanguage||"",this.options.deepLinkSeparator=this.rawOptions.deepLinkSeparator||"/",this.options.deepLinkPrefix=this.rawOptions.deepLinkPrefix||"!",this.options.disableDeepLinks=this.rawOptions.disableDeepLinks||!1,this.options.sideNavStyle=this.rawOptions.sideNavStyle||"summary-only",this.options.whiteLabel=!!this.rawOptions.whiteLabel,this.options.hideLogo=!!this.rawOptions.hideLogo,this.options.hideInfoSection=!!this.rawOptions.hideInfoSection,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.events=this.rawOptions.events||{},this.options.corsProxyUrl=this.rawOptions.corsProxyUrl?addTrailingSlash(this.rawOptions.corsProxyUrl):null,this.options.authCorsProxyUrl=this.rawOptions.authCorsProxyUrl?addTrailingSlash(this.rawOptions.authCorsProxyUrl):null,this.options.theme.scrollYOffset=this.options.scrollYOffset,this.options.linkForId=this.rawOptions.linkForId||null,this.options.generateDeepLink=this.rawOptions.generateDeepLink||null,this.options.onDeepLinkClick=this.rawOptions.onDeepLinkClick||null,this.options.requestInterceptor=this.rawOptions.requestInterceptor||null,this.options.sidebarLinks=this.rawOptions.sidebarLinks||{};var a="object"==typeof this.rawOptions.layout?this.rawOptions.layout:null;if(this.options.pagination=this.rawOptions.pagination||"none",this.options.routingStrategy="none"===this.options.pagination?"hash":"browser",!(null===(r=this.rawOptions)||void 0===r?void 0:r.pagination)&&(null==a?void 0:a.scope))switch(console.warn('"layout.scope" and "routingStrategy" settings are deprecated. Please, use "pagination" instead.'),null==a?void 0:a.scope){case"all":default:this.options.pagination="none",this.options.routingStrategy="hash";break;case"section":this.options.pagination="section",this.options.routingStrategy="browser";break;case"item":this.options.pagination="item",this.options.routingStrategy="browser"}this.options.markdownItemsPagination="none",!1!==this.rawOptions.showNextButton&&(this.options.showNextButton=!0),this.options.disableSidebar=!!e.disableSidebar,this.options.disableSidebar&&(this.options.theme.sidebar.width="0px"),this.options.skipBundleAndConvert=!!e.skipBundleAndConvert,this.options.routingBasePath=e.routingBasePath&&(0,utils_1.normalizePath)(e.routingBasePath)||"",this.options.searchAutoExpand=!1!==e.searchAutoExpand,this.options.searchMode=e.searchMode||"default",this.options.ctrlFHijack=void 0===e.ctrlFHijack||e.ctrlFHijack,this.options.disablePaginationLoadingAnimation=!!e.disablePaginationLoadingAnimation||"none"===this.options.pagination,this.options.showConsole,this.options.generateCodeSamples=e.generateCodeSamples||{languages:[]},this.options.searchMaxDepth=this.rawOptions.searchMaxDepth||SearchStore_1.DEFAULT_SEARCH_MAX_DEPTH}}),Object.defineProperty(e.prototype,"initSearch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;global.__REDOCLY_SEARCH_URL?this.search=new SearchStore_1.RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new SearchStore_1.DeepSearchStore(e),t&&setTimeout((function(){var e;return null===(e=i.search)||void 0===e?void 0:e.indexItems(i.menu.items)}),50),this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&(0,mobx_1.observe)(this.definition,"activeVersionIdx",(function(t){var o,n,r=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new SearchStore_1.DeepSearchStore(e);var a=r.versions[t.newValue]._searchIndexName;if(redoc_lib_1.IS_BROWSER&&a){var s=r.versions[t.newValue]._searchIndexName,l=new URL(window.location.href);l.pathname=joinURLs(i.options.routingBasePath,s),null===(n=i.search)||void 0===n||n.fromExternalJS(l.toString(),__redoc_state.searchIndexExport),i.observeAllAndRemark()}else setTimeout((function(){var e;null===(e=i.search)||void 0===e||e.indexItems(i.menu.items)}),0)})),redoc_lib_1.IS_BROWSER&&this.observeAllAndRemark()}}),Object.defineProperty(e.prototype,"onDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.menu.updateOnHistory(),this.updateMarkOnMenu(this.menu.activeItemIdx),this.layout=(0,utils_2.fromLocalStorage)("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=(0,utils_2.fromLocalStorage)("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=(0,utils_2.fromSessionStorage)("showRightPanelToggleState");e&&(this.showRightPanel="true"===e)}}}),Object.defineProperty(e.prototype,"toggleRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.showRightPanel=null!=e?e:!this.showRightPanel,(0,utils_2.toSessionStorage)("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=store_types_1.LayoutVariant.THREE_PANEL),this.layout=e,(0,utils_2.toLocalStorage)("layoutVariant",e)}}),Object.defineProperty(e.prototype,"disableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!1}}),Object.defineProperty(e.prototype,"enableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!0}}),Object.defineProperty(e.prototype,"tryItOut",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.tryItOperation=e}}),Object.defineProperty(e.prototype,"setActiveSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.activeSampleLanguage===e)return this.stopLoader();this.activeSampleLanguage=e,(0,utils_2.toLocalStorage)("activeSampleLanguage",e)}}),Object.defineProperty(e.prototype,"activateSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setActiveSampleLanguage(e)}}),Object.defineProperty(e.prototype,"startLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading||(this.isLoading=!0)}}),Object.defineProperty(e.prototype,"stopLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading&&(this.isLoading=!1)}}),Object.defineProperty(e.prototype,"dereferenceSpecForTryIt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n;return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var r,a,s,l,p,u,c,d;return(0,tslib_1.__generator)(this,(function(h){switch(h.label){case 0:return r=this.definition.parser.definition,a=JSON.parse(JSON.stringify(r)),s=(0,tslib_1.__assign)((0,tslib_1.__assign)({},getSpecVersionObj(a)),{components:a.components,paths:(c={},c[e.path]=(d={},d[e.httpVerb]=null===(i=null===(t=a.paths)||void 0===t?void 0:t[e.path])||void 0===i?void 0:i[e.httpVerb],d.parameters=null===(n=null===(o=a.paths)||void 0===o?void 0:o[e.path])||void 0===n?void 0:n.parameters,d),c)}),l=new openapi_core_1.Config({}),p=(0,redoc_lib_1.createParsedDocument)(s),u={config:l,doc:p,dereference:!0},[4,(0,openapi_core_1.bundle)(u)];case 1:return h.sent(),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"observeAllAndRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=function(i){for(var o=0,n=i;o<n.length;o++){var r=n[o];if("operation"===r.type)for(var a=0,s=r.responses;a<s.length;a++){var l=s[a];(0,mobx_1.observe)(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===r.type&&t(r.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&(0,mobx_1.observe)(this.menu,"renderItems",(function(){return t(e.menu.renderItems)}))}}),Object.defineProperty(e.prototype,"remark",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.newValue&&setTimeout((function(){return t.marker.mark()}),0)}}),Object.defineProperty(e,"fromJS",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var i,o=new e(t.definition.data,t.definition.url,t.options,!1);(0,utils_2.setGlobalStore)(o),o.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,o.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&t.definition.activeVersionIdx&&(o.definition.activeVersionIdx=t.definition.activeVersionIdx||0);var n=o.menu.flatItems[o.menu.activeItemIdx];if(n&&o.menu.activate(n,!1),!o.options.disableSearch){var r=new URL(window.location.href);r.pathname=t.searchIndexPath&&t.searchIndexPath.startsWith("/")?t.searchIndexPath:r.pathname+(r.pathname.endsWith("/")?"":"/")+t.searchIndexPath,null===(i=o.search)||void 0===i||i.fromExternalJS(r.toString(),t.searchIndexExport)}return t.tryItOperationId&&(o.tryItOperation=o.menu.flatItems.find((function(e){return e.id===t.tryItOperationId}))),setTimeout((function(){return o.observeAllAndRemark()}),0),o}}),Object.defineProperty(e.prototype,"toJS",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var t,i;return(0,tslib_1.__generator)(this,(function(o){switch(o.label){case 0:return i={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof VersionedSpecStore_1.VersionedSpecStore?{url:void 0,data:this.definition.toJS()}:{url:this.definition.parser.definitionUrl,data:this.definition.parser.definition}},this.search?[4,this.search.toJS()]:[3,2];case 1:return t=o.sent(),[3,3];case 2:t=void 0,o.label=3;case 3:return[2,(i.searchIndex=t,i.options=this.rawOptions,i.tryItOperationId=null===(e=this.tryItOperation)||void 0===e?void 0:e.id,i)]}}))}))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.scroll.dispose(),this.menu.dispose(),this.search&&this.search.dispose(),this.disposer()}}),Object.defineProperty(e.prototype,"updateMarkOnMenu",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=Math.max(0,e),i=Math.min(this.menu.flatItems.length,t+5),o=[],n=t;n<i;n++){(r=this.menu.getElementAt(n))&&(r&&o.push(r))}if("item"===this.options.pagination){var r,a=(this.menu.flatItems[e]||{}).parent;if(null==a?void 0:a.absoluteIdx)(r=this.menu.getElementAt(a.absoluteIdx))&&o.push(r)}this.marker.addOnly(o),this.marker.mark()}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"search",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"tryItOperation",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"showRightPanel",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"layout",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeSampleLanguage",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"isLoading",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"onDidMount",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleRightPanel",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleLayout",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"disableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"enableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"tryItOut",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"setActiveSampleLanguage",null),(0,tslib_1.__decorate)([decko_1.bind,(0,decko_1.debounce)(500)],e.prototype,"activateSampleLanguage",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"startLoader",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"stopLoader",null),e}();exports.ProStore=ProStore;var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:pluggable_1.RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:pluggable_1.PullRight,propsSelector:function(){return{}}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_COMPONENT_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_JSX_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SCHEMA_DEFINITION_JSX_NAME]={component:redoc_lib_1.SchemaDefinition,propsSelector:function(e){return{parser:e.definition.parser,options:e.options,layout:e.layout,showRightPanel:e.showRightPanel}}},_a)};function joinURLs(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")&&(t=t.substring(1)),e+"/"+t}function addTrailingSlash(e){return e.endsWith("/")?e:e+"/"}function getSpecVersionObj(e){return e.openapi?{openapi:e.openapi}:e.swagger?{swagger:e.swagger}:void 0}function deepClone(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var i in e){var o=e[i];t[i]=deepClone(o)}return t}
|
|
1
|
+
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProStore=exports.NestingGroup=void 0;var tslib_1=require("tslib"),mobx_1=require("mobx"),openapi_core_1=require("@redocly/openapi-core"),decko_1=require("decko"),redoc_lib_1=require("../redoc-lib"),history_1=require("./history"),ProMenu_1=require("./ProMenu"),SearchStore_1=require("./SearchStore"),extendTheme_1=require("./extendTheme"),pluggable_1=require("../components/pluggable"),VersionedSpecStore_1=require("./VersionedSpecStore"),check_1=(0,tslib_1.__importDefault)(require("./check")),utils_1=require("./utils"),utils_2=require("../utils"),store_types_1=require("./store-types"),types_1=require("./types"),global="undefined"==typeof window?{__REDOCLY_SEARCH_URL:void 0}:window,NestingGroup=function(){function e(e,t,i,o){var n=this;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"absoluteIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"linkable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"expanded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"depth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"level",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),(0,mobx_1.makeObservable)(this),this.id="section/"+e,this.type="nesting-group",this.name=i||"",this.level=1,this.depth=1,this.description="",this.parent=void 0,this.expanded=!1,this.items=t,this.linkable=!!o,t.forEach((function(e){return e.parent=n})),increaseDepthDeep(t)}return Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!0}}),Object.defineProperty(e.prototype,"expand",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!0,this.parent&&this.parent.expand()}}),Object.defineProperty(e.prototype,"collapse",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!1}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!1}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"active",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"expanded",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"expand",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"collapse",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"deactivate",null),e}();function increaseDepthDeep(e){Array.isArray(e)&&e.forEach((function(e){e.depth++,e.parent&&"group"===e.parent.type&&(e.depth=e.parent.depth),increaseDepthDeep(e.items)}))}exports.NestingGroup=NestingGroup;var ProStore=function(){function e(e,t,i,o){var n=this;void 0===i&&(i={}),void 0===o&&(o=!0),Object.defineProperty(this,"rawOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"marker",{enumerable:!0,configurable:!0,writable:!0,value:new redoc_lib_1.MarkerService}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"search",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tryItOperation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showRightPanel",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"layout",{enumerable:!0,configurable:!0,writable:!0,value:store_types_1.LayoutVariant.THREE_PANEL}),Object.defineProperty(this,"activeSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),(0,mobx_1.makeObservable)(this),this.initProOptions(i),redoc_lib_1.IS_BROWSER&&(this.l=(0,check_1.default)(i.licenseKey),this.l.then((function(e){e.valid&&e.allowed&&!e.expired||e.local||(n.menu.items=[],n.menu.flatItems=n.menu.flatItems.slice(0,1),n.menu.renderItems=[])})));var r="object"==typeof e&&"versions"in e,a=this.options.disableSidebar?new history_1.FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new history_1.PushStateHistoryService(this.options,r):new history_1.ProHashHistoryService(this.options,r);this.definition=r?new VersionedSpecStore_1.VersionedSpecStore(e,this.options,a.currentId.split("/")[0]):new redoc_lib_1.SpecStore(e,t,this.options),i.downloadDefinitionUrl&&(this.definition.info.downloadFileName=""),this.scroll=new redoc_lib_1.ScrollService(this.options),this.options.disableSidebar||ProMenu_1.ProMenu.updateOnHistory(a.currentId,this.scroll),this.menu=new ProMenu_1.ProMenu(this.definition,this.scroll,this.options,a),this.menu.initOnHistory(),this.options.disableSearch||this.initSearch(this.options,o),this.disposer=(0,mobx_1.observe)(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return n.updateMarkOnMenu(e.newValue)}))})),(0,utils_2.setGlobalStore)(this)}return Object.defineProperty(e.prototype,"initProOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n,r;e=deepClone(e),this.rawOptions=(0,extendTheme_1.extendTheme)(e),this.options=new redoc_lib_1.RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),this.options.showConsole=null===(t=this.rawOptions.showConsole)||void 0===t||t,this.options.hideRightPanel=null!==(i=this.rawOptions.hideRightPanel)&&void 0!==i&&i,this.showRightPanel=!this.options.hideRightPanel,this.options.showRightPanelToggle=null===(o=this.rawOptions.showRightPanelToggle)||void 0===o||o,this.options.showChangeLayoutButton=null===(n=this.rawOptions.showChangeLayoutButton)||void 0===n||n,this.options.layout=this.rawOptions.layout||store_types_1.LayoutVariant.THREE_PANEL,this.options.defaultSampleLanguage=this.rawOptions.defaultSampleLanguage||"",this.options.deepLinkSeparator=this.rawOptions.deepLinkSeparator||"/",this.options.deepLinkPrefix=this.rawOptions.deepLinkPrefix||"!",this.options.disableDeepLinks=this.rawOptions.disableDeepLinks||!1,this.options.sideNavStyle=this.rawOptions.sideNavStyle||types_1.SideNavStyle.SummaryOnly,this.options.whiteLabel=!!this.rawOptions.whiteLabel,this.options.hideLogo=!!this.rawOptions.hideLogo,this.options.hideInfoSection=!!this.rawOptions.hideInfoSection,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.events=this.rawOptions.events||{},this.options.corsProxyUrl=this.rawOptions.corsProxyUrl?addTrailingSlash(this.rawOptions.corsProxyUrl):null,this.options.authCorsProxyUrl=this.rawOptions.authCorsProxyUrl?addTrailingSlash(this.rawOptions.authCorsProxyUrl):null,this.options.theme.scrollYOffset=this.options.scrollYOffset,this.options.linkForId=this.rawOptions.linkForId||null,this.options.generateDeepLink=this.rawOptions.generateDeepLink||null,this.options.onDeepLinkClick=this.rawOptions.onDeepLinkClick||null,this.options.requestInterceptor=this.rawOptions.requestInterceptor||null,this.options.sidebarLinks=this.rawOptions.sidebarLinks||{};var a="object"==typeof this.rawOptions.layout?this.rawOptions.layout:null;if(this.options.pagination=this.rawOptions.pagination||"none",this.options.routingStrategy="none"===this.options.pagination?"hash":"browser",!(null===(r=this.rawOptions)||void 0===r?void 0:r.pagination)&&(null==a?void 0:a.scope))switch(console.warn('"layout.scope" and "routingStrategy" settings are deprecated. Please, use "pagination" instead.'),null==a?void 0:a.scope){case"all":default:this.options.pagination="none",this.options.routingStrategy="hash";break;case"section":this.options.pagination="section",this.options.routingStrategy="browser";break;case"item":this.options.pagination="item",this.options.routingStrategy="browser"}this.options.markdownItemsPagination="none",!1!==this.rawOptions.showNextButton&&(this.options.showNextButton=!0),this.options.disableSidebar=!!e.disableSidebar,this.options.disableSidebar&&(this.options.theme.sidebar.width="0px"),this.options.skipBundleAndConvert=!!e.skipBundleAndConvert,this.options.routingBasePath=e.routingBasePath&&(0,utils_1.normalizePath)(e.routingBasePath)||"",this.options.searchAutoExpand=!1!==e.searchAutoExpand,this.options.searchMode=e.searchMode||"default",this.options.ctrlFHijack=void 0===e.ctrlFHijack||e.ctrlFHijack,this.options.disablePaginationLoadingAnimation=!!e.disablePaginationLoadingAnimation||"none"===this.options.pagination,this.options.showConsole,this.options.generateCodeSamples=e.generateCodeSamples||{languages:[]},this.options.searchMaxDepth=this.rawOptions.searchMaxDepth||SearchStore_1.DEFAULT_SEARCH_MAX_DEPTH}}),Object.defineProperty(e.prototype,"initSearch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;global.__REDOCLY_SEARCH_URL?this.search=new SearchStore_1.RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new SearchStore_1.DeepSearchStore(e),t&&setTimeout((function(){var e;return null===(e=i.search)||void 0===e?void 0:e.indexItems(i.menu.items)}),50),this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&(0,mobx_1.observe)(this.definition,"activeVersionIdx",(function(t){var o,n,r=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new SearchStore_1.DeepSearchStore(e);var a=r.versions[t.newValue]._searchIndexName;if(redoc_lib_1.IS_BROWSER&&a){var s=r.versions[t.newValue]._searchIndexName,l=new URL(window.location.href);l.pathname=joinURLs(i.options.routingBasePath,s),null===(n=i.search)||void 0===n||n.fromExternalJS(l.toString(),__redoc_state.searchIndexExport),i.observeAllAndRemark()}else setTimeout((function(){var e;null===(e=i.search)||void 0===e||e.indexItems(i.menu.items)}),0)})),redoc_lib_1.IS_BROWSER&&this.observeAllAndRemark()}}),Object.defineProperty(e.prototype,"onDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.menu.updateOnHistory(),this.updateMarkOnMenu(this.menu.activeItemIdx),this.layout=(0,utils_2.fromLocalStorage)("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=(0,utils_2.fromLocalStorage)("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=(0,utils_2.fromSessionStorage)("showRightPanelToggleState");e&&(this.showRightPanel="true"===e)}}}),Object.defineProperty(e.prototype,"toggleRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.showRightPanel=null!=e?e:!this.showRightPanel,(0,utils_2.toSessionStorage)("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=store_types_1.LayoutVariant.THREE_PANEL),this.layout=e,(0,utils_2.toLocalStorage)("layoutVariant",e)}}),Object.defineProperty(e.prototype,"disableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!1}}),Object.defineProperty(e.prototype,"enableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!0}}),Object.defineProperty(e.prototype,"tryItOut",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.tryItOperation=e}}),Object.defineProperty(e.prototype,"setActiveSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.activeSampleLanguage===e)return this.stopLoader();this.activeSampleLanguage=e,(0,utils_2.toLocalStorage)("activeSampleLanguage",e)}}),Object.defineProperty(e.prototype,"activateSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setActiveSampleLanguage(e)}}),Object.defineProperty(e.prototype,"startLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading||(this.isLoading=!0)}}),Object.defineProperty(e.prototype,"stopLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading&&(this.isLoading=!1)}}),Object.defineProperty(e.prototype,"dereferenceSpecForTryIt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,n;return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var r,a,s,l,p,u,c,d;return(0,tslib_1.__generator)(this,(function(h){switch(h.label){case 0:return r=this.definition.parser.definition,a=JSON.parse(JSON.stringify(r)),s=(0,tslib_1.__assign)((0,tslib_1.__assign)({},getSpecVersionObj(a)),{components:a.components,paths:(c={},c[e.path]=(d={},d[e.httpVerb]=null===(i=null===(t=a.paths)||void 0===t?void 0:t[e.path])||void 0===i?void 0:i[e.httpVerb],d.parameters=null===(n=null===(o=a.paths)||void 0===o?void 0:o[e.path])||void 0===n?void 0:n.parameters,d),c)}),l=new openapi_core_1.Config({}),p=(0,redoc_lib_1.createParsedDocument)(s),u={config:l,doc:p,dereference:!0},[4,(0,openapi_core_1.bundle)(u)];case 1:return h.sent(),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"observeAllAndRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=function(i){for(var o=0,n=i;o<n.length;o++){var r=n[o];if("operation"===r.type)for(var a=0,s=r.responses;a<s.length;a++){var l=s[a];(0,mobx_1.observe)(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===r.type&&t(r.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&(0,mobx_1.observe)(this.menu,"renderItems",(function(){return t(e.menu.renderItems)}))}}),Object.defineProperty(e.prototype,"remark",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.newValue&&setTimeout((function(){return t.marker.mark()}),0)}}),Object.defineProperty(e,"fromJS",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var i,o=new e(t.definition.data,t.definition.url,t.options,!1);(0,utils_2.setGlobalStore)(o),o.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,o.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&t.definition.activeVersionIdx&&(o.definition.activeVersionIdx=t.definition.activeVersionIdx||0);var n=o.menu.flatItems[o.menu.activeItemIdx];if(n&&o.menu.activate(n,!1),!o.options.disableSearch){var r=new URL(window.location.href);r.pathname=t.searchIndexPath&&t.searchIndexPath.startsWith("/")?t.searchIndexPath:r.pathname+(r.pathname.endsWith("/")?"":"/")+t.searchIndexPath,null===(i=o.search)||void 0===i||i.fromExternalJS(r.toString(),t.searchIndexExport)}return t.tryItOperationId&&(o.tryItOperation=o.menu.flatItems.find((function(e){return e.id===t.tryItOperationId}))),setTimeout((function(){return o.observeAllAndRemark()}),0),o}}),Object.defineProperty(e.prototype,"toJS",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var t,i;return(0,tslib_1.__generator)(this,(function(o){switch(o.label){case 0:return i={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof VersionedSpecStore_1.VersionedSpecStore?{url:void 0,data:this.definition.toJS()}:{url:this.definition.parser.definitionUrl,data:this.definition.parser.definition}},this.search?[4,this.search.toJS()]:[3,2];case 1:return t=o.sent(),[3,3];case 2:t=void 0,o.label=3;case 3:return[2,(i.searchIndex=t,i.options=this.rawOptions,i.tryItOperationId=null===(e=this.tryItOperation)||void 0===e?void 0:e.id,i)]}}))}))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.scroll.dispose(),this.menu.dispose(),this.search&&this.search.dispose(),this.disposer()}}),Object.defineProperty(e.prototype,"updateMarkOnMenu",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=Math.max(0,e),i=Math.min(this.menu.flatItems.length,t+5),o=[],n=t;n<i;n++){(r=this.menu.getElementAt(n))&&(r&&o.push(r))}if("item"===this.options.pagination){var r,a=(this.menu.flatItems[e]||{}).parent;if(null==a?void 0:a.absoluteIdx)(r=this.menu.getElementAt(a.absoluteIdx))&&o.push(r)}this.marker.addOnly(o),this.marker.mark()}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"search",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"tryItOperation",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"showRightPanel",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"layout",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeSampleLanguage",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"isLoading",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"onDidMount",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleRightPanel",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleLayout",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"disableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"enableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"tryItOut",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"setActiveSampleLanguage",null),(0,tslib_1.__decorate)([decko_1.bind,(0,decko_1.debounce)(500)],e.prototype,"activateSampleLanguage",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"startLoader",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"stopLoader",null),e}();exports.ProStore=ProStore;var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:pluggable_1.RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:pluggable_1.PullRight,propsSelector:function(){return{}}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_COMPONENT_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_JSX_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SCHEMA_DEFINITION_JSX_NAME]={component:redoc_lib_1.SchemaDefinition,propsSelector:function(e){return{parser:e.definition.parser,options:e.options,layout:e.layout,showRightPanel:e.showRightPanel}}},_a)};function joinURLs(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")&&(t=t.substring(1)),e+"/"+t}function addTrailingSlash(e){return e.endsWith("/")?e:e+"/"}function getSpecVersionObj(e){return e.openapi?{openapi:e.openapi}:e.swagger?{swagger:e.swagger}:void 0}function deepClone(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var i in e){var o=e[i];t[i]=deepClone(o)}return t}
|
|
2
2
|
//# sourceMappingURL=ProStore.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IMenuItem, OperationModel, RedocNormalizedOptions, SearchResult
|
|
2
|
-
import {
|
|
1
|
+
import type { IMenuItem, OperationModel, RedocNormalizedOptions, SearchResult } from '../redoc-lib';
|
|
2
|
+
import { SearchStore } from '../redoc-lib';
|
|
3
|
+
import type { RedocProUserOptionsExt } from './ProStore';
|
|
3
4
|
export declare type SearchResultMeta = {
|
|
4
5
|
place?: string;
|
|
5
6
|
path?: string[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { OpenAPIDefinition, ApiInfoModel, OpenAPIParser, OpenAPIExternalDocumentation, SecuritySchemesModel, ContentItemModel } from '../redoc-lib';
|
|
2
|
+
import { SpecStore } from '../redoc-lib';
|
|
3
|
+
import type { RedocProNormalizedOptions } from './ProStore';
|
|
3
4
|
interface VersionInfo {
|
|
4
5
|
id: string;
|
|
5
6
|
title: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OperationModel, ServerVariables } from '../../redoc-lib';
|
|
2
|
-
import * as HAR from './har';
|
|
3
|
-
import { Languages } from './types';
|
|
1
|
+
import type { OperationModel, ServerVariables } from '../../redoc-lib';
|
|
2
|
+
import type * as HAR from './har';
|
|
3
|
+
import type { Languages } from './types';
|
|
4
4
|
export declare type CustomHAR = HAR.Request & {
|
|
5
5
|
securityOAuth2ExtraCalls?: HAR.Request[];
|
|
6
6
|
basicAuth?: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalizeFirst=exports.isDefined=exports.getCodeSample=void 0;var tslib_1=require("tslib"),query_string_1=require("query-string"),Sampler=(0,tslib_1.__importStar)(require("openapi-sampler")),deepmerge_1=(0,tslib_1.__importDefault)(require("deepmerge")),redoc_lib_1=require("../../redoc-lib"),utils_1=require("../../utils"),utils_2=require("../utils"),httpsnippet_1=require("./httpsnippet");function mapOperationToHAR(e,t){var a,r,i,s,n,l=t.exampleName,o=void 0===l?"":l,u=t.skipOptionalParameters,p=void 0!==u&&u,c=t.withOAuth2Call,d=void 0!==c&&c,m=t.spec,_=t.generatedPayloadSamplesMaxDepth,h=void 0===_?8:_,f=t.pathParams,v=void 0===f?{}:f,g=t.properties,y=void 0===g?{}:g,O=getSecurityData(null===(a=e.security)||void 0===a?void 0:a[0],d),b=O.securityHeaders,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalizeFirst=exports.isDefined=exports.getCodeSample=void 0;var tslib_1=require("tslib"),query_string_1=require("query-string"),Sampler=(0,tslib_1.__importStar)(require("openapi-sampler")),deepmerge_1=(0,tslib_1.__importDefault)(require("deepmerge")),redoc_lib_1=require("../../redoc-lib"),utils_1=require("../../utils"),utils_2=require("../utils"),httpsnippet_1=require("./httpsnippet");function mapOperationToHAR(e,t){var a,r,i,s,n,l=t.exampleName,o=void 0===l?"":l,u=t.skipOptionalParameters,p=void 0!==u&&u,c=t.withOAuth2Call,d=void 0!==c&&c,m=t.spec,_=t.generatedPayloadSamplesMaxDepth,h=void 0===_?8:_,f=t.pathParams,v=void 0===f?{}:f,g=t.properties,y=void 0===g?{}:g,O=getSecurityData(null===(a=e.security)||void 0===a?void 0:a[0],d),b=O.securityHeaders,S=O.securityCookies,C=O.securityQueries,T=O.securityOAuth2ExtraCalls,w=O.basicAuth,x=null===(i=null===(r=e.requestBody)||void 0===r?void 0:r.content)||void 0===i?void 0:i.active,P={skipNonRequired:p,skipReadOnly:!0,maxSampleDepth:h},A=!1,E=e.parameters.filter((function(e){return"header"===e.in})).filter((function(e){return!(p&&!e.required)})).map((function(e){return{name:e.name,value:(0,utils_1.getParameterValue)("header",e.name)||(0,redoc_lib_1.serializeParameterValue)(e,Sampler.sample(e.schema.rawSchema,P,m))}})).map((function(e){return(null==x?void 0:x.name)&&"content-type"===e.name.toLowerCase()&&(A=!0,e.value=x.name),e})).concat(b);!A&&(null==x?void 0:x.name)&&E.unshift({name:"Content-Type",value:null==x?void 0:x.name});var k=e.parameters.filter((function(e){return"cookie"===e.in})).filter((function(e){return!(p&&!e.required)})).map((function(e){return(0,query_string_1.parse)((0,redoc_lib_1.serializeParameterValue)(e,Sampler.sample(e.schema.rawSchema,P,m)))})).reduce((function(e,t){for(var a=0,r=Object.entries(t);a<r.length;a++){var i=r[a],s=i[0],n=i[1];e.push({name:s,value:String(n)})}return e}),[]).concat(S),q=e.parameters.filter((function(e){return"query"===e.in})).filter((function(e){return!(p&&!e.required)})).map((function(e){return(0,query_string_1.parse)((0,redoc_lib_1.serializeParameterValue)(e,Sampler.sample(e.schema.rawSchema,P,m)))})).reduce((function(e,t){for(var a=0,r=Object.entries(t);a<r.length;a++){var i=r[a],s=i[0],n=i[1];e.push({name:s,value:String(n)})}return e}),[]).concat(C),H=(null===(s=e.activeServer)||void 0===s?void 0:s.url.replace(/\/$/,""))+"/"+e.path.replace(/^\//,""),D=e.parameters.filter((function(e){return"path"===e.in})).reduce((function(e,t){var a=t.in,r=t.name;return e[r]=v[r]||(0,utils_1.getParameterValue)(a,r),e}),{}),R=null===(n=null==x?void 0:x.examples)||void 0===n?void 0:n[o],z=(null==x?void 0:x.examples)||{},j=Object.values(z)[0],N=(null==R?void 0:R.value)||(null==j?void 0:j.value)||(null==x?void 0:x.schema)&&Sampler.sample(null==x?void 0:x.schema.rawSchema,P,m),U=N&&"object"==typeof N&&(0,deepmerge_1.default)(N,y,{arrayMerge:utils_2.arrayMergeStrategy}),I=null==x?void 0:x.name.toLowerCase(),V="",Y=[];switch((0,utils_2.normalizeMimeType)(I)){case"application/json":V=JSON.stringify(U);break;case"application/x-www-form-urlencoded":case"multipart/form-data":V=(0,query_string_1.stringify)(U),Y=objectToHarParams(U);break;default:V=String(N||"")}var F=V?{mimeType:(null==x?void 0:x.name)||"application/octet-stream",text:V,params:Y}:void 0;return{method:e.httpVerb,url:H,httpVersion:"HTTP/1.1",cookies:k,headers:E,queryString:q,postData:F,headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:T,basicAuth:w,pathParameters:D,serverVariables:e.activeServer.variables}}var defaultOptions={withImports:!0,withComments:!1},langToSnippetConfig={curl:{code:"shell",defaultTarget:"curl",defaultOptions:(0,tslib_1.__assign)((0,tslib_1.__assign)({},defaultOptions),{short:!0})},JavaScript:{code:"javascript",defaultTarget:"fetch",defaultOptions:(0,tslib_1.__assign)((0,tslib_1.__assign)({},defaultOptions),{withImports:!1})},"Node.js":{code:"node",defaultTarget:"fetch",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},Python:{code:"python",defaultTarget:"requests",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},"Java8+Apache":{code:"java8",defaultTarget:"apachehttp",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},Java:{code:"java",defaultTarget:"httpclient",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},"C#":{code:"csharp",defaultTarget:"httpclient",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},Go:{code:"go",defaultTarget:"http.DefaultClient",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},PHP:{code:"php",defaultTarget:"curl",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},Ruby:{code:"ruby",defaultTarget:"net::http",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)},R:{code:"r",defaultTarget:"httr",defaultOptions:(0,tslib_1.__assign)({},defaultOptions)}};function getCodeSample(e){var t=e.lang,a=e.operation,r=e.exampleName,i=e.pathParams,s=e.properties,n=e.options,l=void 0===n?{}:n;try{var o=mapOperationToHAR(a,{exampleName:r,pathParams:i,properties:s,skipOptionalParameters:l.skipOptionalParameters,withOAuth2Call:l.withOAuth2Call,spec:l.spec,generatedPayloadSamplesMaxDepth:l.generatedPayloadSamplesMaxDepth}),u=new httpsnippet_1.HTTPSnippet(o);return langToSnippetConfig[t]?u.convert(langToSnippetConfig[t].code,langToSnippetConfig[t].defaultTarget,(0,tslib_1.__assign)((0,tslib_1.__assign)({},langToSnippetConfig[t].defaultOptions),l)):"Language is not supported."}catch(e){return console.error(e),"Failed to generate code sample."}}function getSecurityData(e,t){for(var a,r,i,s,n={securityHeaders:[],securityCookies:[],securityQueries:[],securityOAuth2ExtraCalls:[],basicAuth:void 0},l=0,o=(null==e?void 0:e.schemes)||[];l<o.length;l++){var u=o[l],p=(0,utils_1.getSecurityDetails)(u.id);switch(u.type){case"openIdConnect":null===(a=n.securityHeaders)||void 0===a||a.push({name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"});break;case"oauth2":var c=p.token?(p.token.token_type||"Bearer")+" "+p.token.access_token:"Bearer <YOUR_TOKEN_HERE>";u.flows.clientCredentials&&t?n.securityOAuth2ExtraCalls.push(getOAuth2ClientCredsCallHar(u.flows.clientCredentials,u.scopes,p)):u.flows.password&&t&&n.securityOAuth2ExtraCalls.push(getOAuth2PasswordCallHar(u.flows.password,u.scopes,p)),null===(r=n.securityHeaders)||void 0===r||r.push({name:"Authorization",value:c});break;case"apiKey":var d=p.raw||"YOUR_API_KEY_HERE";"header"===u.in&&(null===(i=n.securityHeaders)||void 0===i||i.push({name:u.name,value:d})),"cookie"===u.in&&n.securityCookies.push({name:u.name,value:d}),"query"===u.in&&n.securityQueries.push({name:u.name,value:d});break;case"http":"basic"===u.scheme?n.basicAuth={username:p.username||"<username>",password:p.password||"<password>"}:null===(s=n.securityHeaders)||void 0===s||s.push({name:"Authorization",value:capitalizeFirst(u.scheme||"bearer")+" <YOUR_"+(u.bearerFormat||"TOKEN")+"_HERE>"})}}return n}function getOAuth2PasswordCallHar(e,t,a){return{method:"POST",url:e.tokenUrl,httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",text:"",params:[{name:"grant_type",value:"password"},{name:"client_id",value:a.client_id||"YOUR_CLIENT_ID"},{name:"client_secret",value:a.client_secret||"YOUR_CLIENT_SECRET"},{name:"username",value:a.username||"<username>"},{name:"password",value:a.password||"<password>"},t.length?{name:"scope",value:t.join(" ")}:void 0].filter(isDefined)},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}}function getOAuth2ClientCredsCallHar(e,t,a){return{method:"POST",url:e.tokenUrl,httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:a.client_id||"YOUR_CLIENT_ID"},{name:"client_secret",value:a.client_secret||"YOUR_CLIENT_SECRET"},t.length?{name:"scope",value:t.join(" ")}:void 0].filter(isDefined)},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}}function objectToHarParams(e){for(var t=[],a=0,r=Object.entries(e);a<r.length;a++){var i=r[a],s=i[0],n=i[1];t.push({name:s,value:String(n)})}return t}function isDefined(e){return void 0!==e}function capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}exports.getCodeSample=getCodeSample,exports.isDefined=isDefined,exports.capitalizeFirst=capitalizeFirst;
|
|
2
2
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SnippetRequest } from '../index';
|
|
2
|
-
import { CodeBuilder } from './code-builder';
|
|
1
|
+
import type { SnippetRequest } from '../index';
|
|
2
|
+
import type { CodeBuilder } from './code-builder';
|
|
3
3
|
export declare function getPreserveTransformer({ body, authorizationHeader, }: {
|
|
4
4
|
body?: boolean;
|
|
5
5
|
authorizationHeader?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CustomHAR } from '..';
|
|
2
|
-
import { PostData } from '../har';
|
|
1
|
+
import type { CustomHAR } from '..';
|
|
2
|
+
import type { PostData } from '../har';
|
|
3
3
|
interface ParsedUrlQueryInput {
|
|
4
4
|
[key: string]: string | number | boolean | string[] | number[] | boolean[] | undefined | null;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CSharpCodeSampleConfig } from '../../../types';
|
|
2
|
-
import { LanguageHandler } from '../..';
|
|
1
|
+
import type { CSharpCodeSampleConfig } from '../../../types';
|
|
2
|
+
import type { LanguageHandler } from '../..';
|
|
3
3
|
declare const handler: LanguageHandler<CSharpCodeSampleConfig['options']>;
|
|
4
4
|
export declare const info: {
|
|
5
5
|
key: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LanguageHandler } from '../..';
|
|
2
|
-
import { GoCodeSampleConfig } from '../../../types';
|
|
1
|
+
import type { LanguageHandler } from '../..';
|
|
2
|
+
import type { GoCodeSampleConfig } from '../../../types';
|
|
3
3
|
declare const handler: LanguageHandler<GoCodeSampleConfig['options']>;
|
|
4
4
|
export declare const info: {
|
|
5
5
|
key: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JavaCodeSampleConfig } from '../../../types';
|
|
2
|
-
import { LanguageHandler } from '../..';
|
|
1
|
+
import type { JavaCodeSampleConfig } from '../../../types';
|
|
2
|
+
import type { LanguageHandler } from '../..';
|
|
3
3
|
declare const handler: LanguageHandler<JavaCodeSampleConfig['options']>;
|
|
4
4
|
export declare const info: {
|
|
5
5
|
key: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Java8CodeSampleConfig } from '../../../types';
|
|
2
|
-
import { LanguageHandler } from '../..';
|
|
1
|
+
import type { Java8CodeSampleConfig } from '../../../types';
|
|
2
|
+
import type { LanguageHandler } from '../..';
|
|
3
3
|
declare const handler: LanguageHandler<Java8CodeSampleConfig['options']>;
|
|
4
4
|
export declare const info: {
|
|
5
5
|
key: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LanguageHandler } from '../..';
|
|
2
|
-
import { JavaScriptCodeSampleConfig } from '../../../types';
|
|
1
|
+
import type { LanguageHandler } from '../..';
|
|
2
|
+
import type { JavaScriptCodeSampleConfig } from '../../../types';
|
|
3
3
|
declare const handler: LanguageHandler<JavaScriptCodeSampleConfig['options']>;
|
|
4
4
|
export declare const info: {
|
|
5
5
|
key: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LanguageHandler } from '../..';
|
|
2
|
-
import { NodeJsCodeSampleConfig } from '../../../types';
|
|
1
|
+
import type { LanguageHandler } from '../..';
|
|
2
|
+
import type { NodeJsCodeSampleConfig } from '../../../types';
|
|
3
3
|
declare const handler: LanguageHandler<NodeJsCodeSampleConfig['options']>;
|
|
4
4
|
export declare const info: {
|
|
5
5
|
key: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LanguageHandler } from '../..';
|
|
2
|
-
import { PHPCodeSampleConfig } from '../../../types';
|
|
1
|
+
import type { LanguageHandler } from '../..';
|
|
2
|
+
import type { PHPCodeSampleConfig } from '../../../types';
|
|
3
3
|
declare const handler: LanguageHandler<PHPCodeSampleConfig['options']>;
|
|
4
4
|
export declare const info: {
|
|
5
5
|
key: string;
|