@redocly/openapi-docs 3.12.0-rc.7 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/redocly-openapi-docs.min.js +2153 -1963
- package/lib/components/ApiInfo/ApiInfo.js +29 -1
- package/lib/components/ApiInfo/Metadata.js +29 -1
- package/lib/components/ApiInfo/index.js +2 -1
- package/lib/components/ApiInfo/styled.js +17 -8
- package/lib/components/CallbackSamples/CallbackSamples.js +25 -4
- package/lib/components/CallbackSamples/index.js +2 -1
- package/lib/components/Callbacks/CallbackDetails.js +17 -3
- package/lib/components/Callbacks/CallbackOperation.js +24 -3
- package/lib/components/Callbacks/CallbackSummary.js +19 -3
- package/lib/components/Callbacks/CallbacksList.js +16 -1
- package/lib/components/Callbacks/index.js +4 -1
- package/lib/components/Callbacks/styled.js +6 -3
- package/lib/components/Content/Content.js +10 -1
- package/lib/components/Content/index.js +2 -1
- package/lib/components/Content/useAutoScroll.js +50 -1
- package/lib/components/ContentItem/ContentItem.js +31 -1
- package/lib/components/ContentItem/index.js +2 -1
- package/lib/components/ContentItem/useIsExpanded.js +33 -1
- package/lib/components/ContentItems/ContentItems.js +19 -1
- package/lib/components/ContentItems/Items.js +13 -1
- package/lib/components/ContentItems/VirtualList.js +35 -1
- package/lib/components/ContentItems/helpers.js +49 -1
- package/lib/components/ContentItems/index.js +2 -1
- package/lib/components/ContentItems/useScrollOnRender.js +26 -1
- package/lib/components/Discriminator/Discriminator.js +27 -2
- package/lib/components/Discriminator/index.js +2 -1
- package/lib/components/Download/DownloadSpecification.js +46 -4
- package/lib/components/Download/index.js +2 -1
- package/lib/components/Download/types.js +2 -0
- package/lib/components/Download/useDownloadInfo.js +42 -1
- package/lib/components/ErrorBoundary/ErrorBoundary.js +22 -2
- package/lib/components/ErrorBoundary/index.js +2 -1
- package/lib/components/ExpandAllButton/ExpandAllButton.js +31 -2
- package/lib/components/ExpandAllButton/index.js +2 -1
- package/lib/components/ExternalDocumentation/ExternalDocumentation.js +18 -4
- package/lib/components/ExternalDocumentation/index.js +2 -1
- package/lib/components/Language/LanguageDropdown.js +21 -1
- package/lib/components/Language/LanguageItem.js +33 -1
- package/lib/components/Language/LanguageList.js +93 -1
- package/lib/components/Language/_tests_/LanguageDropdown.test.js +23 -1
- package/lib/components/Language/constants.js +3 -1
- package/lib/components/Language/index.js +4 -1
- package/lib/components/Language/styled.js +29 -15
- package/lib/components/Markdown/Markdown.js +64 -1
- package/lib/components/Markdown/index.js +3 -1
- package/lib/components/Markdown/types.js +2 -0
- package/lib/components/MediaTypeSwitch/MediaTypesSwitch.js +51 -1
- package/lib/components/MediaTypeSwitch/index.js +2 -1
- package/lib/components/OperationItem/Description.d.ts +1 -4
- package/lib/components/OperationItem/Description.js +9 -1
- package/lib/components/OperationItem/OperationItem.js +70 -5
- package/lib/components/OperationItem/_tests_/OperationItem.test.js +70 -1
- package/lib/components/OperationItem/_tests_/__mocks__/mock-intersection-observer.js +40 -1
- package/lib/components/OperationItem/index.js +2 -1
- package/lib/components/OperationItem/types.js +2 -0
- package/lib/components/Overlay.js +48 -3
- package/lib/components/Overview/Overview.js +20 -1
- package/lib/components/Overview/index.js +2 -1
- package/lib/components/PageFooter/PageFooter.js +19 -1
- package/lib/components/PageFooter/index.js +2 -1
- package/lib/components/Panel/ResponsePanel.js +12 -6
- package/lib/components/Panel/Trigger.js +4 -2
- package/lib/components/Panel/index.js +3 -1
- package/lib/components/PanelItem/PanelItem.js +6 -1
- package/lib/components/PanelItem/index.js +3 -1
- package/lib/components/PanelItem/styled.js +20 -10
- package/lib/components/PayloadSamples/Example.js +6 -1
- package/lib/components/PayloadSamples/ExampleValue.js +30 -1
- package/lib/components/PayloadSamples/MediaTypeSamples.js +36 -2
- package/lib/components/PayloadSamples/PayloadSamples.js +26 -1
- package/lib/components/PayloadSamples/index.js +7 -1
- package/lib/components/PayloadSamples/styled.js +9 -4
- package/lib/components/PayloadSamples/types.js +2 -0
- package/lib/components/PropertyDetails/DescriptionEnums.js +19 -3
- package/lib/components/PropertyDetails/EnumValues.js +37 -1
- package/lib/components/PropertyDetails/Examples.js +26 -1
- package/lib/components/PropertyDetails/Extensions.js +17 -2
- package/lib/components/PropertyDetails/FieldDetail.js +15 -2
- package/lib/components/PropertyDetails/FieldDetails.js +51 -6
- package/lib/components/PropertyDetails/Pattern.js +21 -1
- package/lib/components/PropertyDetails/PlusCircleIcon.js +10 -4
- package/lib/components/PropertyDetails/PropertyDetails.js +22 -5
- package/lib/components/PropertyDetails/SchemaTypeInfo.js +10 -2
- package/lib/components/PropertyDetails/SimpleEnums.js +13 -2
- package/lib/components/PropertyDetails/cycleColorsByLevel.js +18 -1
- package/lib/components/PropertyDetails/index.js +4 -1
- package/lib/components/PropertyDetails/styled.js +15 -7
- package/lib/components/PropertyDetails/types.js +2 -0
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +114 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +57 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +86 -1
- package/lib/components/RedoclyOpenAPIDocs/index.js +5 -1
- package/lib/components/RedoclyOpenAPIDocs/styled.js +4 -2
- package/lib/components/RedoclyOpenAPIDocs/types.js +2 -0
- package/lib/components/RedoclyOpenAPIDocs/utils.js +33 -1
- package/lib/components/RenderHook/RenderHook.js +17 -1
- package/lib/components/RenderHook/index.js +2 -1
- package/lib/components/Replay/EmbeddedReplay.js +41 -3
- package/lib/components/Replay/Replay.js +99 -1
- package/lib/components/Replay/index.js +3 -1
- package/lib/components/Replay/utils.js +208 -1
- package/lib/components/Request/RequestDetails.js +33 -2
- package/lib/components/Request/types.js +2 -0
- package/lib/components/RequestParameters/Body.js +8 -1
- package/lib/components/RequestParameters/ParametersGroup.js +19 -4
- package/lib/components/RequestParameters/RequestParameters.js +40 -1
- package/lib/components/RequestParameters/index.js +4 -1
- package/lib/components/RequestSamples/CodeSample.js +55 -2
- package/lib/components/RequestSamples/Example.js +37 -1
- package/lib/components/RequestSamples/RequestSamples.js +89 -5
- package/lib/components/RequestSamples/index.js +3 -1
- package/lib/components/RequestSamples/useCodeSamples.js +92 -1
- package/lib/components/ResponseSamples/ResponseSamples.js +47 -1
- package/lib/components/ResponseSamples/Summary.js +9 -1
- package/lib/components/ResponseSamples/index.js +2 -1
- package/lib/components/Responses/OperationResponseList.js +42 -2
- package/lib/components/Responses/ResponseDetails.js +18 -1
- package/lib/components/Responses/ResponseHeaders.js +15 -1
- package/lib/components/Responses/index.js +6 -1
- package/lib/components/Responses/styled.js +14 -6
- package/lib/components/Responses/types.js +2 -0
- package/lib/components/RightPanel/RightPanel.js +21 -1
- package/lib/components/RightPanel/index.js +2 -1
- package/lib/components/Samples/ExampleSwitch.js +33 -1
- package/lib/components/Samples/index.js +3 -1
- package/lib/components/Samples/use-example-key.js +12 -1
- package/lib/components/Schema/ArraySchema.js +45 -1
- package/lib/components/Schema/ObjectSchema.js +29 -1
- package/lib/components/Schema/OneOfSchema.js +47 -3
- package/lib/components/Schema/RecursiveSchema.js +10 -1
- package/lib/components/Schema/Schema.js +63 -2
- package/lib/components/Schema/SubSchema.js +20 -1
- package/lib/components/Schema/helpers.js +16 -1
- package/lib/components/Schema/index.js +5 -1
- package/lib/components/Schema/types.js +2 -0
- package/lib/components/Schema/useOneOfLocationIdx.js +11 -1
- package/lib/components/SchemaDefinition/SchemaDefinition.js +65 -2
- package/lib/components/SchemaDefinition/index.js +2 -1
- package/lib/components/SectionContent/SectionContent.js +49 -6
- package/lib/components/SectionContent/index.js +2 -1
- package/lib/components/SectionItem/SectionItem.js +14 -1
- package/lib/components/SectionItem/index.js +2 -1
- package/lib/components/Security/Divider.js +9 -2
- package/lib/components/Security/OAuthFlow.js +11 -1
- package/lib/components/Security/OAuthScopes.js +59 -9
- package/lib/components/Security/Security.js +15 -1
- package/lib/components/Security/SecurityButton.js +31 -7
- package/lib/components/Security/SecurityFlow.js +28 -4
- package/lib/components/Security/SecurityModal.js +34 -5
- package/lib/components/Security/SecuritySchemeItem.js +15 -4
- package/lib/components/Security/helper.js +16 -1
- package/lib/components/Security/index.js +11 -1
- package/lib/components/Security/styled.js +6 -3
- package/lib/components/SelectOrLabel/SelectOrLabel.js +12 -2
- package/lib/components/SelectOrLabel/index.js +2 -1
- package/lib/components/ServerList/ServerList.js +36 -10
- package/lib/components/ServerList/index.js +2 -1
- package/lib/components/ServerList/types.js +2 -0
- package/lib/components/ServerListDropdown/ServerListDropdown.js +54 -1
- package/lib/components/ServerListDropdown/index.js +2 -1
- package/lib/components/ServerListDropdown/styled.js +15 -6
- package/lib/components/SideMenu/SideMenu.js +13 -2
- package/lib/components/SideMenu/hooks/useMenuItems.js +110 -1
- package/lib/components/SideMenu/index.js +2 -1
- package/lib/components/SideMenu/types.js +2 -0
- package/lib/components/StickySidebar/SidebarActions.js +14 -2
- package/lib/components/StickySidebar/StickyResponsiveSidebar.js +37 -7
- package/lib/components/StickySidebar/index.js +2 -1
- package/lib/components/Tabs/Tabs.js +16 -5
- package/lib/components/Tabs/index.js +3 -1
- package/lib/components/Tabs/useTabsState.js +22 -1
- package/lib/components/TagItem/OperationNavigationItems.js +18 -4
- package/lib/components/TagItem/OperationsNavigation.js +46 -2
- package/lib/components/TagItem/TagItem.js +41 -8
- package/lib/components/TagItem/index.js +2 -1
- package/lib/components/TagItem/styled.js +5 -2
- package/lib/components/TagItem/types.js +2 -0
- package/lib/components/ViewNested/ViewNested.js +42 -9
- package/lib/components/ViewNested/index.js +2 -1
- package/lib/components/common/Badges.js +21 -5
- package/lib/components/common/BodyContent/BodyContent.js +31 -4
- package/lib/components/common/BodyContent/index.js +2 -1
- package/lib/components/common/ClearButton/ClearButton.js +5 -1
- package/lib/components/common/ClearButton/index.js +3 -1
- package/lib/components/common/ClearButton/styled.js +5 -2
- package/lib/components/common/ClearButton/types.js +2 -0
- package/lib/components/common/CodeBlockPanel.js +7 -3
- package/lib/components/common/ConstraintsView.js +14 -2
- package/lib/components/common/Dropdown/Dropdown.js +22 -4
- package/lib/components/common/Dropdown/index.js +2 -1
- package/lib/components/common/ExpandableExample/ExpandableExample.js +24 -3
- package/lib/components/common/ExpandableExample/index.js +2 -1
- package/lib/components/common/Extensions.js +17 -2
- package/lib/components/common/Fields/fields-layout.js +76 -51
- package/lib/components/common/Fields/fields.js +39 -17
- package/lib/components/common/Fields/index.js +3 -1
- package/lib/components/common/LinkToField.js +33 -6
- package/lib/components/common/OperationItemTitle.d.ts +1 -0
- package/lib/components/common/OperationItemTitle.js +16 -5
- package/lib/components/common/SchemaSelection/SchemaSelection.js +51 -1
- package/lib/components/common/SchemaSelection/index.js +2 -1
- package/lib/components/common/Select/Select.js +21 -1
- package/lib/components/common/Select/index.js +3 -1
- package/lib/components/common/Select/styled.js +17 -9
- package/lib/components/common/Select/types.js +2 -0
- package/lib/components/common/Skeleton/LanguageListSkeleton.js +16 -6
- package/lib/components/common/Skeleton/Skeleton.js +15 -5
- package/lib/components/common/Skeleton/index.js +3 -1
- package/lib/components/common/headers.js +4 -2
- package/lib/components/common/index.js +14 -1
- package/lib/components/common/linkify.js +28 -4
- package/lib/components/common/mixins.js +4 -2
- package/lib/components/common/panels.js +58 -33
- package/lib/components/common/schema.js +16 -8
- package/lib/components/common/styled.js +15 -7
- package/lib/components/index.js +25 -1
- package/lib/components/pluggable/RedocExample.js +20 -1
- package/lib/components/pluggable/RedocSchema.js +22 -1
- package/lib/components/pluggable/index.js +3 -1
- package/lib/components/pluggable/styled.components.js +9 -4
- package/lib/constants.js +30 -1
- package/lib/empty.js +7 -1
- package/lib/events/codeSampleCopy.js +19 -1
- package/lib/events/creator.js +5 -1
- package/lib/events/index.js +8 -1
- package/lib/events/languageSwitch.js +18 -1
- package/lib/events/panelToggle.js +16 -1
- package/lib/events/serverSwitch.js +13 -1
- package/lib/events/tryItOpen.js +12 -1
- package/lib/events/tryItSent.js +12 -1
- package/lib/events/types.js +11 -1
- package/lib/hoc/types.js +2 -0
- package/lib/hoc/utils.js +4 -1
- package/lib/hoc/withRouter.js +17 -1
- package/lib/hoc/withStore.js +28 -1
- package/lib/hooks/index.js +9 -1
- package/lib/hooks/useActivateExample.js +35 -1
- package/lib/hooks/useActiveWithFallback.js +12 -1
- package/lib/hooks/useContentItems.js +10 -1
- package/lib/hooks/useLicense.js +17 -1
- package/lib/hooks/usePerformanceMetrics.js +26 -1
- package/lib/hooks/useRouter.js +17 -1
- package/lib/hooks/useTelemetry.js +5 -1
- package/lib/hooks/useTranslate.js +6 -1
- package/lib/hooks/useUppercase2LowercaseRedirect.js +12 -1
- package/lib/icons/CSharpIcon/CSharpIcon.js +7 -1
- package/lib/icons/CSharpIcon/index.js +2 -1
- package/lib/icons/CurlIcon/CurlIcon.js +8 -2
- package/lib/icons/CurlIcon/index.js +2 -1
- package/lib/icons/GOIcon/GOIcon.js +7 -1
- package/lib/icons/GOIcon/index.js +2 -1
- package/lib/icons/JavaIcon/JavaIcon.js +7 -1
- package/lib/icons/JavaIcon/index.js +2 -1
- package/lib/icons/JavaScriptIcon/JavaScriptIcon.js +7 -1
- package/lib/icons/JavaScriptIcon/index.js +2 -1
- package/lib/icons/NodeJSIcon/NodeJSIcon.js +7 -1
- package/lib/icons/NodeJSIcon/index.js +2 -1
- package/lib/icons/PHPIcon/PHPIcon.js +7 -1
- package/lib/icons/PHPIcon/index.js +2 -1
- package/lib/icons/PayloadIcon/PayloadIcon.js +7 -1
- package/lib/icons/PayloadIcon/index.js +2 -1
- package/lib/icons/PythonIcon/PythonIcon.js +7 -1
- package/lib/icons/PythonIcon/index.js +2 -1
- package/lib/icons/RIcon/RIcon.js +7 -1
- package/lib/icons/RIcon/index.js +2 -1
- package/lib/icons/RubyIcon/RubyIcon.js +7 -1
- package/lib/icons/RubyIcon/index.js +2 -1
- package/lib/index.js +49 -1
- package/lib/jotai/app.js +113 -1
- package/lib/jotai/operation.js +28 -1
- package/lib/jotai/replay.js +5 -1
- package/lib/jotai/store.js +8 -1
- package/lib/jotai/use-write-atom.js +9 -1
- package/lib/models/callback.js +28 -1
- package/lib/models/code-sample-options.js +2 -0
- package/lib/models/example.js +17 -1
- package/lib/models/field.js +109 -1
- package/lib/models/group.js +38 -1
- package/lib/models/index.js +14 -1
- package/lib/models/mediaContent.js +26 -1
- package/lib/models/mediaType.js +153 -1
- package/lib/models/operation.js +166 -1
- package/lib/models/request.js +25 -1
- package/lib/models/response.js +46 -1
- package/lib/models/schema.js +474 -2
- package/lib/models/security.js +84 -1
- package/lib/models/tab.js +2 -0
- package/lib/models/types.js +2 -0
- package/lib/services/OpenAPIParser.js +321 -1
- package/lib/services/check.js +104 -1
- package/lib/services/code-samples/constants.js +16 -1
- package/lib/services/code-samples/generator.js +540 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-builder.d.ts +5 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-builder.js +252 -3
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.js +90 -2
- package/lib/services/code-samples/httpsnippet/helpers/constants.js +28 -1
- package/lib/services/code-samples/httpsnippet/helpers/lodash-int.js +173 -1
- package/lib/services/code-samples/httpsnippet/helpers/mocks/code-helpers-mock.js +76 -37
- package/lib/services/code-samples/httpsnippet/helpers/reducer.js +16 -1
- package/lib/services/code-samples/httpsnippet/helpers/shell.js +20 -1
- package/lib/services/code-samples/httpsnippet/helpers/string-utility.js +19 -1
- package/lib/services/code-samples/httpsnippet/index.js +166 -1
- package/lib/services/code-samples/httpsnippet/targets/__mocks__/mock.js +2340 -146
- package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +227 -2
- package/lib/services/code-samples/httpsnippet/targets/csharp/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/httpclient.js +185 -2
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/go/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/go/native.js +222 -3
- package/lib/services/code-samples/httpsnippet/targets/index.js +28 -1
- package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +184 -3
- package/lib/services/code-samples/httpsnippet/targets/java/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +223 -2
- package/lib/services/code-samples/httpsnippet/targets/java8/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +147 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +199 -1
- package/lib/services/code-samples/httpsnippet/targets/node/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/php/curl.js +203 -5
- package/lib/services/code-samples/httpsnippet/targets/php/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/php/types.js +2 -0
- package/lib/services/code-samples/httpsnippet/targets/php/utils.js +106 -5
- package/lib/services/code-samples/httpsnippet/targets/python/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/python/requests.js +185 -6
- package/lib/services/code-samples/httpsnippet/targets/r/httr.js +111 -1
- package/lib/services/code-samples/httpsnippet/targets/r/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/r/utils.js +18 -6
- package/lib/services/code-samples/httpsnippet/targets/ruby/index.js +11 -1
- package/lib/services/code-samples/httpsnippet/targets/ruby/native.js +169 -1
- package/lib/services/code-samples/httpsnippet/targets/shell/curl.js +94 -6
- package/lib/services/code-samples/httpsnippet/targets/shell/index.js +11 -1
- package/lib/services/code-samples/index.js +3 -1
- package/lib/services/code-samples/types.js +2 -0
- package/lib/services/config-options/helpers.js +49 -1
- package/lib/services/config-options/index.js +3 -1
- package/lib/services/config-options/normalizeOptions.js +83 -1
- package/lib/services/config-options/types.js +2 -0
- package/lib/services/history/helpers.js +63 -1
- package/lib/services/history/index.js +2 -1
- package/lib/services/index.js +9 -1
- package/lib/services/menu/builder.js +47 -1
- package/lib/services/menu/index.js +2 -1
- package/lib/services/menu/markdown.js +93 -1
- package/lib/services/menu/operation.js +50 -1
- package/lib/services/menu/tags.js +166 -1
- package/lib/services/types.d.ts +0 -3
- package/lib/services/types.js +2 -0
- package/lib/services/utils.js +83 -1
- package/lib/standalone.js +68 -1
- package/lib/styled-components.js +6 -1
- package/lib/types/app.js +2 -0
- package/lib/types/index.js +4 -1
- package/lib/types/open-api.d.ts +1 -0
- package/lib/types/open-api.js +2 -0
- package/lib/types/security.js +2 -0
- package/lib/utils/JsonPointer.js +84 -1
- package/lib/utils/areArraysEqual.js +4 -1
- package/lib/utils/argValuesHelpers.js +35 -1
- package/lib/utils/compose.js +2 -1
- package/lib/utils/configure-helpers.js +223 -1
- package/lib/utils/convertSwagger2OpenAPI.js +14 -1
- package/lib/utils/cookies.js +73 -1
- package/lib/utils/debounce.js +22 -1
- package/lib/utils/debug.js +11 -1
- package/lib/utils/dom.js +65 -1
- package/lib/utils/environments.js +13 -1
- package/lib/utils/helpers.js +222 -12
- package/lib/utils/index.js +25 -1
- package/lib/utils/isMobile.js +13 -1
- package/lib/utils/loadAndBundleSpec.js +32 -1
- package/lib/utils/local-storage.js +12 -1
- package/lib/utils/object.js +31 -1
- package/lib/utils/openapi.js +592 -1
- package/lib/utils/parameters.js +13 -1
- package/lib/utils/path.js +22 -1
- package/lib/utils/queryString.js +60 -1
- package/lib/utils/replaceVariables.js +14 -1
- package/lib/utils/saveTextBeforeHeading.js +35 -1
- package/lib/utils/security-details.js +49 -1
- package/lib/utils/session-storage.js +12 -1
- package/lib/utils/simplifyAstStructure.js +22 -1
- package/lib/utils/sort.js +21 -1
- package/lib/utils/string.js +65 -1
- package/lib/utils/telemetry.js +7 -1
- package/lib/utils/test-utils.js +26 -1
- package/lib/utils/theme-helpers.js +24 -3
- package/lib/utils/url.js +38 -1
- package/package.json +5 -5
package/lib/utils/queryString.js
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
|
-
import{tryDecodeURIComponent
|
|
1
|
+
import { tryDecodeURIComponent } from './string.js';
|
|
2
|
+
class QueryString {
|
|
3
|
+
parse(query) {
|
|
4
|
+
const params = {};
|
|
5
|
+
if (!query) {
|
|
6
|
+
return params;
|
|
7
|
+
}
|
|
8
|
+
const pairs = query.startsWith('?') ? query.substring(1).split('&') : query.split('&');
|
|
9
|
+
for (const pair of pairs) {
|
|
10
|
+
const [key, value] = pair.split('=');
|
|
11
|
+
if (key && value) {
|
|
12
|
+
const decodedKey = tryDecodeURIComponent(key);
|
|
13
|
+
const decodedValue = tryDecodeURIComponent(value);
|
|
14
|
+
if (decodedKey in params) {
|
|
15
|
+
if (Array.isArray(params[decodedKey])) {
|
|
16
|
+
params[decodedKey].push(decodedValue);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
params[decodedKey] = [params[decodedKey], decodedValue];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const separators = [',', '|'];
|
|
24
|
+
const separator = separators.find((sep) => decodedValue.includes(sep));
|
|
25
|
+
params[decodedKey] = separator ? decodedValue.split(separator) : decodedValue;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return params;
|
|
30
|
+
}
|
|
31
|
+
stringify(params, options = { encode: true, sort: true }) {
|
|
32
|
+
const pairs = [];
|
|
33
|
+
for (const [key, value] of Object.entries(params)) {
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
35
|
+
const encodedKey = options.encode ? encodeURIComponent(key) : key;
|
|
36
|
+
if (Array.isArray(value)) {
|
|
37
|
+
for (const element of value) {
|
|
38
|
+
if (element) {
|
|
39
|
+
const encodedValue = options.encode ? encodeURIComponent(element) : element;
|
|
40
|
+
pairs.push(`${encodedKey}=${encodedValue}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
if (value) {
|
|
46
|
+
const encodedValue = options.encode ? encodeURIComponent(value) : value;
|
|
47
|
+
pairs.push(`${encodedKey}=${encodedValue}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (options.sort) {
|
|
53
|
+
pairs.sort();
|
|
54
|
+
}
|
|
55
|
+
return pairs.join('&');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const queryString = new QueryString();
|
|
59
|
+
export { queryString };
|
|
60
|
+
//# sourceMappingURL=queryString.js.map
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
function
|
|
1
|
+
export function replaceVariables(server) {
|
|
2
|
+
let { url, variables } = server;
|
|
3
|
+
if (variables) {
|
|
4
|
+
for (const key in variables) {
|
|
5
|
+
const variable = variables[key];
|
|
6
|
+
if (variable.default) {
|
|
7
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
8
|
+
url = url.replace(regex, variable.default);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return url;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=replaceVariables.js.map
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import markdoc from '@markdoc/markdoc';
|
|
2
|
+
import { isString } from '@redocly/theme/core/openapi';
|
|
3
|
+
export function saveTextBeforeHeading(description) {
|
|
4
|
+
if (!description) {
|
|
5
|
+
return '';
|
|
6
|
+
}
|
|
7
|
+
if (!isString(description)) {
|
|
8
|
+
if (!description?.result) {
|
|
9
|
+
return description;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
result: modifyNodeByHeading(markdoc.Ast.fromJSON(JSON.stringify(description.result))) || '',
|
|
13
|
+
raw: saveTextBeforeHeading(description.raw),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const headingRegex = new RegExp(`^#{1,6}?\\s+`, 'm');
|
|
17
|
+
const firstHeadingLinePos = description.search(headingRegex);
|
|
18
|
+
return firstHeadingLinePos > -1 ? description.substring(0, firstHeadingLinePos) : description;
|
|
19
|
+
}
|
|
20
|
+
function modifyNodeByHeading(ast) {
|
|
21
|
+
if (Array.isArray(ast)) {
|
|
22
|
+
const headingIndex = ast.findIndex((node) => node.type === 'heading');
|
|
23
|
+
return headingIndex === -1 ? ast : ast.slice(0, headingIndex);
|
|
24
|
+
}
|
|
25
|
+
if (!ast.children || !Array.isArray(ast.children)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const headingIndex = ast.children.findIndex((node) => node.type === 'heading');
|
|
29
|
+
if (headingIndex === -1) {
|
|
30
|
+
return ast;
|
|
31
|
+
}
|
|
32
|
+
ast.children = ast.children.slice(0, headingIndex);
|
|
33
|
+
return ast;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=saveTextBeforeHeading.js.map
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
import{SecurityVariablesEnvSuffix
|
|
1
|
+
import { SecurityVariablesEnvSuffix } from '@redocly/theme/core/openapi';
|
|
2
|
+
import { escapeFormId } from './string.js';
|
|
3
|
+
import { fromSessionStorage, toSessionStorage } from './session-storage.js';
|
|
4
|
+
export function setSecurityDetailsVariants(name, variants) {
|
|
5
|
+
name = escapeFormId(name);
|
|
6
|
+
toSessionStorage(`auth.${name}.variants`, JSON.stringify(variants));
|
|
7
|
+
// if (typeof details === 'string') {
|
|
8
|
+
// toStorage('auth.' + name, details);
|
|
9
|
+
// // Write to storage all data for first time or for selected security only
|
|
10
|
+
// } else if (details) {
|
|
11
|
+
// toStorage(`auth.${name}.password`, details.password || '');
|
|
12
|
+
// toStorage(`auth.${name}.username`, details.username || '');
|
|
13
|
+
// toStorage(`auth.${name}.token`, (details.token && JSON.stringify(details.token)) || '');
|
|
14
|
+
// toStorage(`auth.${name}.client_id`, details.client_id || '');
|
|
15
|
+
// toStorage(`auth.${name}.client_secret`, details.client_secret || '');
|
|
16
|
+
// toStorage(`auth.${name}.scopes`, (details.scopes && JSON.stringify(details.scopes)) || '');
|
|
17
|
+
// }
|
|
18
|
+
}
|
|
19
|
+
export function getSecurityDetails(name, environment = {}) {
|
|
20
|
+
return {
|
|
21
|
+
raw: environment[name + SecurityVariablesEnvSuffix.APIKey],
|
|
22
|
+
password: environment[name + SecurityVariablesEnvSuffix.Password],
|
|
23
|
+
username: environment[name + SecurityVariablesEnvSuffix.Username],
|
|
24
|
+
token: environment[name + SecurityVariablesEnvSuffix.Token]
|
|
25
|
+
? {
|
|
26
|
+
access_token: environment[name + SecurityVariablesEnvSuffix.Token],
|
|
27
|
+
}
|
|
28
|
+
: undefined,
|
|
29
|
+
client_id: environment[name + SecurityVariablesEnvSuffix.ClientId],
|
|
30
|
+
client_secret: environment[name + SecurityVariablesEnvSuffix.ClientSecret],
|
|
31
|
+
scopes: fromSessionStorage(`auth.${name}.scopes`), // TODO
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function setSecurityDetails(name, details) {
|
|
35
|
+
name = escapeFormId(name);
|
|
36
|
+
if (typeof details === 'string') {
|
|
37
|
+
toSessionStorage('auth.' + name, details);
|
|
38
|
+
// Write to storage all data for first time or for selected security only
|
|
39
|
+
}
|
|
40
|
+
else if (details) {
|
|
41
|
+
toSessionStorage(`auth.${name}.password`, details.password || '');
|
|
42
|
+
toSessionStorage(`auth.${name}.username`, details.username || '');
|
|
43
|
+
toSessionStorage(`auth.${name}.token`, (details.token && JSON.stringify(details.token)) || '');
|
|
44
|
+
toSessionStorage(`auth.${name}.client_id`, details.client_id || '');
|
|
45
|
+
toSessionStorage(`auth.${name}.client_secret`, details.client_secret || '');
|
|
46
|
+
toSessionStorage(`auth.${name}.scopes`, (details.scopes && JSON.stringify(details.scopes)) || '');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=security-details.js.map
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
import{IS_BROWSER
|
|
1
|
+
import { IS_BROWSER } from '@redocly/theme/core/openapi';
|
|
2
|
+
export function toSessionStorage(key, value) {
|
|
3
|
+
if (IS_BROWSER) {
|
|
4
|
+
window.sessionStorage.setItem('redoc.' + key, value);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export function fromSessionStorage(key) {
|
|
8
|
+
if (!IS_BROWSER)
|
|
9
|
+
return '';
|
|
10
|
+
return (window.sessionStorage.getItem('redoc.' + key) || '');
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=session-storage.js.map
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
export const simplifyAstStructure = (ast) => {
|
|
2
|
+
clearRedundantProperties(ast);
|
|
3
|
+
for (const node of ast.walk()) {
|
|
4
|
+
clearRedundantProperties(node);
|
|
5
|
+
if (node?.children?.length) {
|
|
6
|
+
simplifyAstStructure(node);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function clearRedundantProperties(node) {
|
|
10
|
+
// location no needs in runtime we need it only for validation
|
|
11
|
+
if (node?.location) {
|
|
12
|
+
delete node.location;
|
|
13
|
+
}
|
|
14
|
+
// tag is optional in AST, no need to keep undefined values
|
|
15
|
+
if (node.tag === undefined) {
|
|
16
|
+
delete node.tag;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// we slice extra document level in ast
|
|
20
|
+
return ast.type === 'document' && ast?.children?.length ? ast?.children : ast;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=simplifyAstStructure.js.map
|
package/lib/utils/sort.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Function that returns a comparator for sorting objects by some specific key alphabetically.
|
|
3
|
+
*
|
|
4
|
+
* @param {String} property key of the object to sort, if starts from `-` - reverse
|
|
5
|
+
*/
|
|
6
|
+
export function alphabeticallyByProp(property) {
|
|
7
|
+
let sortOrder = 1;
|
|
8
|
+
if (property[0] === '-') {
|
|
9
|
+
sortOrder = -1;
|
|
10
|
+
property = property.substr(1);
|
|
11
|
+
}
|
|
12
|
+
return function (a, b) {
|
|
13
|
+
if (sortOrder == -1) {
|
|
14
|
+
return b[property].localeCompare(a[property]);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return a[property].localeCompare(b[property]);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=sort.js.map
|
package/lib/utils/string.js
CHANGED
|
@@ -1 +1,65 @@
|
|
|
1
|
-
import
|
|
1
|
+
import slugify from 'slugify';
|
|
2
|
+
export function strikethroughText(text) {
|
|
3
|
+
return text
|
|
4
|
+
.split('')
|
|
5
|
+
.map((char) => char + '\u0335')
|
|
6
|
+
.join('');
|
|
7
|
+
}
|
|
8
|
+
export function escapeFormId(id) {
|
|
9
|
+
return id.replace(/[.[\]]/g, (m) => {
|
|
10
|
+
return ({
|
|
11
|
+
'.': '%2e',
|
|
12
|
+
'[': '%5b',
|
|
13
|
+
']': '%5d',
|
|
14
|
+
}[m] || '');
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function unescapeFormId(id) {
|
|
18
|
+
return id.replace(/%2e|%5b|%5d/g, (m) => {
|
|
19
|
+
return ({
|
|
20
|
+
'%2e': '.',
|
|
21
|
+
'%5b': '[',
|
|
22
|
+
'%5d': ']',
|
|
23
|
+
}[m] || '');
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export function encodeBackSlashes(str) {
|
|
27
|
+
return str.replace(/\\/g, '%5C');
|
|
28
|
+
}
|
|
29
|
+
export function removePercentChart(str) {
|
|
30
|
+
return str.replace(/%/g, '');
|
|
31
|
+
}
|
|
32
|
+
export function tryDecodeURIComponent(str) {
|
|
33
|
+
try {
|
|
34
|
+
return decodeURIComponent(str);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
console.error(`Decoding failed: ${str}`, e);
|
|
38
|
+
return str;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* slugify() returns empty string when failed to slugify.
|
|
43
|
+
* so try to return minimum slugified-string with failed one which keeps original value
|
|
44
|
+
* the regex codes are referenced with https://gist.github.com/mathewbyrne/1280286
|
|
45
|
+
*/
|
|
46
|
+
export function safeSlugify(value) {
|
|
47
|
+
return (slugify(value) ||
|
|
48
|
+
value
|
|
49
|
+
.toString()
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.replace(/\s+/g, '-') // Replace spaces with -
|
|
52
|
+
.replace(/&/g, '-and-') // Replace & with 'and'
|
|
53
|
+
.replace(/--+/g, '-') // Replace multiple - with single -
|
|
54
|
+
.replace(/^-+/, '') // Trim - from start of text
|
|
55
|
+
.replace(/-+$/, '')); // Trim - from end of text
|
|
56
|
+
}
|
|
57
|
+
export function safeJsonParse(str, fallback = {}) {
|
|
58
|
+
try {
|
|
59
|
+
return JSON.parse(str);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return fallback;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=string.js.map
|
package/lib/utils/telemetry.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{withPathPrefix
|
|
1
|
+
import { withPathPrefix } from '@redocly/theme/core/openapi';
|
|
2
|
+
export function getDefaultCollectorUrl() {
|
|
3
|
+
return process.env.NODE_ENV === 'development'
|
|
4
|
+
? 'http://localhost:4318'
|
|
5
|
+
: window.location.origin + withPathPrefix('/_otel');
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=telemetry.js.map
|
package/lib/utils/test-utils.js
CHANGED
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/* tslint:disable:no-implicit-dependencies */
|
|
2
|
+
import { objectHas, objectSet } from './object.js';
|
|
3
|
+
function traverseComponent(root, fn) {
|
|
4
|
+
if (!root) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
fn(root);
|
|
8
|
+
if (root.children) {
|
|
9
|
+
for (const child of root.children) {
|
|
10
|
+
traverseComponent(child, fn);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function filterPropsDeep(component, paths) {
|
|
15
|
+
traverseComponent(component, (comp) => {
|
|
16
|
+
if (comp.props) {
|
|
17
|
+
for (const path of paths) {
|
|
18
|
+
if (objectHas(comp.props, path)) {
|
|
19
|
+
objectSet(comp.props, path, '<<<filtered>>>');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return component;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=test-utils.js.map
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
import{css
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
const typographyProperties = Object.entries({
|
|
3
|
+
fontSize: 'font-size',
|
|
4
|
+
fontWeight: 'font-weight',
|
|
5
|
+
fontFamily: 'font-family',
|
|
6
|
+
lineHeight: 'line-height',
|
|
7
|
+
color: 'text-color',
|
|
8
|
+
textTransform: 'text-transform',
|
|
9
|
+
});
|
|
10
|
+
export function getTypographyCssRulesByComponentName(componentName, fallbackName) {
|
|
11
|
+
const result = {};
|
|
12
|
+
for (const [styledPropertyName, cssPropertyName] of typographyProperties) {
|
|
13
|
+
const cssVariable = `--${componentName}-${cssPropertyName}`;
|
|
14
|
+
const fallbackVariable = fallbackName ? `,var(--${fallbackName}-${cssPropertyName})` : '';
|
|
15
|
+
result[styledPropertyName] = `var(${cssVariable}${fallbackVariable})`;
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
export function typography(componentName, fallbackName) {
|
|
20
|
+
return css `
|
|
21
|
+
${getTypographyCssRulesByComponentName(componentName, fallbackName)}
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=theme-helpers.js.map
|
package/lib/utils/url.js
CHANGED
|
@@ -1 +1,38 @@
|
|
|
1
|
-
function
|
|
1
|
+
export function urlParse(url, slashesDenoteHost = false) {
|
|
2
|
+
// Handle slashesDenoteHost parameter
|
|
3
|
+
let processedUrl = url;
|
|
4
|
+
if (slashesDenoteHost && processedUrl.startsWith('//')) {
|
|
5
|
+
// When slashesDenoteHost is true, //example.com should be treated as having a host
|
|
6
|
+
// Add a dummy protocol to make it a valid URL
|
|
7
|
+
processedUrl = 'http:' + url;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
return URL?.parse ? URL?.parse(processedUrl) : new URL(processedUrl);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
console.error(`Invalid URL: ${processedUrl}`, error);
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function getUrlDirname(urlLikeString) {
|
|
18
|
+
try {
|
|
19
|
+
const url = new URL(urlLikeString);
|
|
20
|
+
let pathname = url.pathname;
|
|
21
|
+
if (pathname.endsWith('/')) {
|
|
22
|
+
return url.origin + pathname;
|
|
23
|
+
}
|
|
24
|
+
const lastSlashIndex = pathname.lastIndexOf('/');
|
|
25
|
+
if (lastSlashIndex !== -1) {
|
|
26
|
+
pathname = pathname.substring(0, lastSlashIndex + 1);
|
|
27
|
+
return url.origin + pathname;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return url.origin + '/';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.error(`Invalid URL: ${urlLikeString}`, error);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=url.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.1",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "
|
|
24
|
+
"@redocly/openapi-core": "2.0.2",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.6",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"url-template": "^2.0.8",
|
|
37
37
|
"util": "~0.12.5",
|
|
38
38
|
"web-vitals": "3.3.1",
|
|
39
|
-
"@redocly/
|
|
40
|
-
"@redocly/
|
|
39
|
+
"@redocly/replay": "0.15.1",
|
|
40
|
+
"@redocly/config": "0.28.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typescript": "5.6.2",
|
|
75
75
|
"url": "~0.11.0",
|
|
76
76
|
"vite": "^6.3.5",
|
|
77
|
-
"@redocly/theme": "0.56.
|
|
77
|
+
"@redocly/theme": "0.56.1"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"start": "npm run copy-highlight-hook && vite",
|