@redocly/openapi-docs 3.4.0-rc.5 → 3.4.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 +1565 -1366
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/Metadata.d.ts +3 -1
- package/lib/components/ApiInfo/Metadata.js +1 -1
- package/lib/components/CallbackSamples/CallbackSamples.d.ts +2 -1
- package/lib/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib/components/Callbacks/CallbackDetails.d.ts +2 -1
- package/lib/components/Callbacks/CallbackDetails.js +1 -1
- package/lib/components/Callbacks/CallbackOperation.js +1 -1
- package/lib/components/Callbacks/CallbackSummary.d.ts +3 -2
- package/lib/components/Callbacks/CallbackSummary.js +1 -1
- package/lib/components/Callbacks/CallbacksList.d.ts +0 -1
- package/lib/components/Callbacks/styled.d.ts +1 -1
- package/lib/components/Content/Content.d.ts +0 -1
- package/lib/components/Content/useAutoScroll.js +1 -1
- package/lib/components/ContentItem/ContentItem.d.ts +0 -1
- package/lib/components/ContentItem/useIsExpanded.js +1 -1
- package/lib/components/ContentItems/ContentItems.d.ts +0 -1
- package/lib/components/ContentItems/helpers.js +1 -1
- package/lib/components/Discriminator/Discriminator.d.ts +2 -1
- package/lib/components/Discriminator/Discriminator.js +1 -1
- package/lib/components/ExpandAllButton/ExpandAllButton.js +1 -1
- package/lib/components/ExpandAllButton/getAllNestedSchema.d.ts +4 -4
- package/lib/components/ExpandAllButton/useUpdateExpandedFields.js +1 -1
- package/lib/components/ExternalDocumentation/ExternalDocumentation.d.ts +0 -1
- package/lib/components/Language/LanguageList.d.ts +0 -1
- package/lib/components/Language/styled.d.ts +12 -13
- package/lib/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib/components/OperationItem/Description.js +1 -1
- package/lib/components/OperationItem/OperationItem.d.ts +0 -1
- package/lib/components/OperationItem/OperationItem.js +2 -2
- package/lib/components/Overview/Overview.d.ts +8 -3
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/PageFooter/PageFooter.d.ts +0 -1
- package/lib/components/PageFooter/PageFooter.js +1 -1
- package/lib/components/PanelItem/styled.d.ts +5 -6
- package/lib/components/PayloadSamples/Example.js +1 -1
- package/lib/components/PayloadSamples/ExampleValue.d.ts +0 -1
- package/lib/components/PayloadSamples/ExampleValue.js +1 -1
- package/lib/components/PayloadSamples/ExternalExample.js +1 -1
- package/lib/components/PayloadSamples/MediaTypeSamples.d.ts +0 -1
- package/lib/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib/components/PayloadSamples/PayloadSamples.d.ts +0 -1
- package/lib/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib/components/PayloadSamples/useExternalExample.js +1 -1
- package/lib/components/PropertyDetails/DescriptionEnums.d.ts +1 -1
- package/lib/components/PropertyDetails/DescriptionEnums.js +2 -2
- package/lib/components/PropertyDetails/EnumValues.d.ts +0 -1
- package/lib/components/PropertyDetails/EnumValues.js +1 -1
- package/lib/components/PropertyDetails/Examples.js +1 -1
- package/lib/components/PropertyDetails/Extensions.d.ts +0 -1
- package/lib/components/PropertyDetails/FieldDetail.d.ts +1 -1
- package/lib/components/PropertyDetails/FieldDetail.js +1 -1
- package/lib/components/PropertyDetails/FieldDetails.d.ts +0 -1
- package/lib/components/PropertyDetails/FieldDetails.js +4 -3
- package/lib/components/PropertyDetails/Pattern.js +1 -1
- package/lib/components/PropertyDetails/PlusCircleIcon.js +1 -1
- package/lib/components/PropertyDetails/PropertyDetails.d.ts +0 -1
- package/lib/components/PropertyDetails/SchemaTypeInfo.js +1 -1
- package/lib/components/PropertyDetails/SimpleEnums.d.ts +1 -1
- package/lib/components/PropertyDetails/SimpleEnums.js +1 -1
- package/lib/components/PropertyDetails/styled.d.ts +1 -10
- package/lib/components/PropertyDetails/types.d.ts +3 -0
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/styled.d.ts +0 -4
- package/lib/components/RedoclyOpenAPIDocs/styled.js +1 -30
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +0 -3
- package/lib/components/RedoclyOpenAPIDocs/utils.js +1 -1
- package/lib/components/RenderHook/RenderHook.js +1 -1
- package/lib/components/Replay/EmbeddedReplay.d.ts +0 -1
- package/lib/components/Replay/EmbeddedReplay.js +1 -1
- package/lib/components/Replay/Replay.d.ts +0 -1
- package/lib/components/Replay/Replay.js +2 -9
- package/lib/components/Replay/utils.js +1 -1
- package/lib/components/Request/RequestDetails.d.ts +0 -1
- package/lib/components/Request/RequestDetails.js +1 -1
- package/lib/components/Request/types.d.ts +2 -0
- package/lib/components/RequestParameters/Body.d.ts +0 -1
- package/lib/components/RequestParameters/ParametersGroup.d.ts +0 -1
- package/lib/components/RequestParameters/RequestParameters.js +1 -1
- package/lib/components/RequestSamples/CodeSample.d.ts +0 -1
- package/lib/components/RequestSamples/RequestSamples.d.ts +0 -1
- package/lib/components/RequestSamples/useCodeSamples.js +1 -1
- package/lib/components/ResponseSamples/Summary.js +1 -1
- package/lib/components/Responses/OperationResponseList.js +1 -1
- package/lib/components/Responses/ResponseDetails.d.ts +0 -1
- package/lib/components/Responses/ResponseHeaders.d.ts +0 -1
- package/lib/components/Responses/ResponseHeaders.js +1 -1
- package/lib/components/Responses/styled.d.ts +1 -2
- package/lib/components/RightPanel/RightPanel.js +1 -1
- package/lib/components/Samples/use-example-key.js +1 -1
- package/lib/components/Schema/ArraySchema.d.ts +0 -1
- package/lib/components/Schema/ObjectSchema.d.ts +0 -1
- package/lib/components/Schema/ObjectSchema.js +1 -1
- package/lib/components/Schema/OneOfSchema.d.ts +0 -1
- package/lib/components/Schema/OneOfSchema.js +1 -1
- package/lib/components/Schema/RecursiveSchema.d.ts +0 -1
- package/lib/components/Schema/RecursiveSchema.js +1 -1
- package/lib/components/Schema/Schema.d.ts +0 -1
- package/lib/components/Schema/SubSchema.js +1 -1
- package/lib/components/Schema/helpers.d.ts +1 -1
- package/lib/components/Schema/helpers.js +1 -1
- package/lib/components/Schema/useOneOfLocationIdx.js +1 -1
- package/lib/components/SchemaDefinition/SchemaDefinition.d.ts +0 -1
- package/lib/components/SectionContent/SectionContent.js +1 -1
- package/lib/components/SectionItem/SectionItem.d.ts +0 -1
- package/lib/components/Security/Divider.js +1 -1
- package/lib/components/Security/OAuthFlow.js +1 -1
- package/lib/components/Security/Security.js +1 -1
- package/lib/components/Security/SecurityButton.js +1 -1
- package/lib/components/Security/SecurityFlow.js +1 -1
- package/lib/components/Security/SecurityModal.js +1 -1
- package/lib/components/Security/SecuritySchemeItem.js +1 -1
- package/lib/components/Security/helper.js +1 -1
- package/lib/components/SelectOrLabel/SelectOrLabel.js +2 -2
- package/lib/components/ServerList/ServerList.d.ts +1 -1
- package/lib/components/ServerList/ServerList.js +1 -1
- package/lib/components/ServerList/types.d.ts +4 -1
- package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/components/ServerListDropdown/styled.d.ts +0 -1
- package/lib/components/SideMenu/SideMenu.d.ts +0 -1
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/Tabs/useTabsState.js +1 -1
- package/lib/components/TagItem/OperationNavigationItems.d.ts +9 -0
- package/lib/components/TagItem/OperationNavigationItems.js +37 -0
- package/lib/components/TagItem/OperationsNavigation.d.ts +1 -7
- package/lib/components/TagItem/OperationsNavigation.js +1 -40
- package/lib/components/TagItem/TagItem.js +1 -1
- package/lib/components/TagItem/styled.d.ts +1 -0
- package/lib/components/TagItem/styled.js +6 -0
- package/lib/components/TagItem/types.d.ts +5 -0
- package/lib/components/TagItem/types.js +2 -0
- package/lib/components/common/Badges.d.ts +2 -2
- package/lib/components/common/BodyContent/BodyContent.d.ts +0 -1
- package/lib/components/common/BodyContent/BodyContent.js +1 -1
- package/lib/components/common/ClearButton/ClearButton.d.ts +0 -1
- package/lib/components/common/ClearButton/styled.d.ts +0 -1
- package/lib/components/common/ConstraintsView.d.ts +0 -1
- package/lib/components/common/ExpandableExample/ExpandableExample.js +1 -1
- package/lib/components/common/Extensions.d.ts +0 -1
- package/lib/components/common/Fields/fields-layout.d.ts +3 -3
- package/lib/components/common/Fields/fields.d.ts +1 -2
- package/lib/components/common/LinkToField.js +1 -1
- package/lib/components/common/Select/Select.d.ts +0 -1
- package/lib/components/common/Select/styled.d.ts +11 -12
- package/lib/components/common/Skeleton/Skeleton.d.ts +1 -1
- package/lib/components/common/Skeleton/Skeleton.js +2 -2
- package/lib/components/common/linkify.js +2 -2
- package/lib/components/common/panels.d.ts +7 -7
- package/lib/components/common/panels.js +2 -2
- package/lib/components/pluggable/styled.components.d.ts +3 -3
- package/lib/events/creator.js +1 -1
- package/lib/hoc/utils.js +1 -1
- package/lib/hoc/withRouter.js +1 -1
- package/lib/hoc/withStore.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useActivateExample.js +1 -1
- package/lib/hooks/useActiveWithFallback.js +1 -1
- package/lib/hooks/useDimensions.js +1 -1
- package/lib/hooks/useLicense.js +1 -1
- package/lib/hooks/usePrevious.js +1 -1
- package/lib/hooks/useRouter.d.ts +1 -1
- package/lib/hooks/useTranslate.d.ts +2 -0
- package/lib/hooks/useTranslate.js +2 -0
- package/lib/hooks/useUppercase2LowercaseRedirect.js +1 -1
- package/lib/index.js +1 -1
- package/lib/jotai/app.d.ts +2 -4
- package/lib/jotai/app.js +1 -1
- package/lib/jotai/operation.js +1 -1
- package/lib/models/callback.js +1 -1
- package/lib/models/example.js +1 -1
- package/lib/models/field.js +1 -1
- package/lib/models/group.js +1 -1
- package/lib/models/mediaContent.js +1 -1
- package/lib/models/mediaType.js +1 -1
- package/lib/models/operation.js +1 -1
- package/lib/models/request.js +1 -1
- package/lib/models/response.js +1 -1
- package/lib/models/schema.js +1 -1
- package/lib/models/security.js +1 -1
- package/lib/models/tab.d.ts +1 -1
- package/lib/services/OpenAPIParser.js +1 -1
- package/lib/services/check.js +1 -1
- package/lib/services/code-samples/generator.d.ts +3 -1
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/__mocks__/mock.d.ts +46 -0
- package/lib/services/code-samples/httpsnippet/targets/__mocks__/mock.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/index.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/index.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/php/utils.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/r/utils.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/shell/index.d.ts +1 -1
- package/lib/services/config-options/helpers.js +1 -1
- package/lib/services/config-options/normalizeOptions.js +1 -1
- package/lib/services/history/helpers.js +1 -1
- package/lib/services/menu/builder.js +1 -1
- package/lib/services/menu/markdown.js +1 -1
- package/lib/services/menu/operation.js +1 -1
- package/lib/services/menu/tags.js +1 -1
- package/lib/services/utils.js +1 -1
- package/lib/standalone.js +1 -1
- package/lib/utils/areArraysEqual.js +1 -1
- package/lib/utils/argValuesHelpers.js +1 -1
- package/lib/utils/compose.d.ts +1 -1
- package/lib/utils/convertExamplesFormat.d.ts +2 -0
- package/lib/utils/convertExamplesFormat.js +2 -0
- package/lib/utils/cookies.js +1 -1
- package/lib/utils/createParsedDocument.js +1 -1
- package/lib/utils/debounce.js +1 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/dom.js +1 -1
- package/lib/utils/environments.js +1 -1
- package/lib/utils/helpers.d.ts +2 -2
- package/lib/utils/helpers.js +1 -1
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/isMobile.js +1 -1
- package/lib/utils/loadAndBundleSpec.js +1 -1
- package/lib/utils/local-storage.js +1 -1
- package/lib/utils/object.js +1 -1
- package/lib/utils/openapi.d.ts +2 -1
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/parameters.js +1 -1
- package/lib/utils/path.js +1 -1
- package/lib/utils/replaceVariables.js +1 -1
- package/lib/utils/saveTextBeforeHeading.js +1 -1
- package/lib/utils/security-details.js +1 -1
- package/lib/utils/session-storage.js +1 -1
- package/lib/utils/sort.js +1 -1
- package/lib/utils/string.js +1 -1
- package/lib/utils/test-utils.js +1 -1
- package/lib/utils/theme-helpers.js +2 -2
- package/lib-esm/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/components/ApiInfo/Metadata.d.ts +3 -1
- package/lib-esm/components/ApiInfo/Metadata.js +1 -1
- package/lib-esm/components/CallbackSamples/CallbackSamples.d.ts +2 -1
- package/lib-esm/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib-esm/components/Callbacks/CallbackDetails.d.ts +2 -1
- package/lib-esm/components/Callbacks/CallbackDetails.js +1 -1
- package/lib-esm/components/Callbacks/CallbackOperation.js +1 -1
- package/lib-esm/components/Callbacks/CallbackSummary.d.ts +3 -2
- package/lib-esm/components/Callbacks/CallbackSummary.js +1 -1
- package/lib-esm/components/Callbacks/CallbacksList.d.ts +0 -1
- package/lib-esm/components/Callbacks/styled.d.ts +1 -1
- package/lib-esm/components/Content/Content.d.ts +0 -1
- package/lib-esm/components/ContentItem/ContentItem.d.ts +0 -1
- package/lib-esm/components/ContentItems/ContentItems.d.ts +0 -1
- package/lib-esm/components/Discriminator/Discriminator.d.ts +2 -1
- package/lib-esm/components/Discriminator/Discriminator.js +1 -1
- package/lib-esm/components/ExpandAllButton/ExpandAllButton.js +1 -1
- package/lib-esm/components/ExpandAllButton/getAllNestedSchema.d.ts +4 -4
- package/lib-esm/components/ExternalDocumentation/ExternalDocumentation.d.ts +0 -1
- package/lib-esm/components/Language/LanguageList.d.ts +0 -1
- package/lib-esm/components/Language/styled.d.ts +12 -13
- package/lib-esm/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib-esm/components/OperationItem/OperationItem.d.ts +0 -1
- package/lib-esm/components/OperationItem/OperationItem.js +2 -2
- package/lib-esm/components/Overview/Overview.d.ts +8 -3
- package/lib-esm/components/Overview/Overview.js +1 -1
- package/lib-esm/components/PageFooter/PageFooter.d.ts +0 -1
- package/lib-esm/components/PanelItem/styled.d.ts +5 -6
- package/lib-esm/components/PayloadSamples/Example.js +1 -1
- package/lib-esm/components/PayloadSamples/ExampleValue.d.ts +0 -1
- package/lib-esm/components/PayloadSamples/MediaTypeSamples.d.ts +0 -1
- package/lib-esm/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib-esm/components/PayloadSamples/PayloadSamples.d.ts +0 -1
- package/lib-esm/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib-esm/components/PropertyDetails/DescriptionEnums.d.ts +1 -1
- package/lib-esm/components/PropertyDetails/DescriptionEnums.js +1 -1
- package/lib-esm/components/PropertyDetails/EnumValues.d.ts +0 -1
- package/lib-esm/components/PropertyDetails/EnumValues.js +1 -1
- package/lib-esm/components/PropertyDetails/Examples.js +1 -1
- package/lib-esm/components/PropertyDetails/Extensions.d.ts +0 -1
- package/lib-esm/components/PropertyDetails/FieldDetail.d.ts +1 -1
- package/lib-esm/components/PropertyDetails/FieldDetail.js +1 -1
- package/lib-esm/components/PropertyDetails/FieldDetails.d.ts +0 -1
- package/lib-esm/components/PropertyDetails/FieldDetails.js +4 -3
- package/lib-esm/components/PropertyDetails/Pattern.js +1 -1
- package/lib-esm/components/PropertyDetails/PropertyDetails.d.ts +0 -1
- package/lib-esm/components/PropertyDetails/SimpleEnums.d.ts +1 -1
- package/lib-esm/components/PropertyDetails/SimpleEnums.js +1 -1
- package/lib-esm/components/PropertyDetails/styled.d.ts +1 -10
- package/lib-esm/components/PropertyDetails/types.d.ts +3 -0
- package/lib-esm/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.d.ts +0 -4
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.js +1 -30
- package/lib-esm/components/RedoclyOpenAPIDocs/types.d.ts +0 -3
- package/lib-esm/components/Replay/EmbeddedReplay.d.ts +0 -1
- package/lib-esm/components/Replay/EmbeddedReplay.js +1 -1
- package/lib-esm/components/Replay/Replay.d.ts +0 -1
- package/lib-esm/components/Replay/Replay.js +2 -9
- package/lib-esm/components/Request/RequestDetails.d.ts +0 -1
- package/lib-esm/components/Request/RequestDetails.js +1 -1
- package/lib-esm/components/Request/types.d.ts +2 -0
- package/lib-esm/components/RequestParameters/Body.d.ts +0 -1
- package/lib-esm/components/RequestParameters/ParametersGroup.d.ts +0 -1
- package/lib-esm/components/RequestParameters/RequestParameters.js +1 -1
- package/lib-esm/components/RequestSamples/CodeSample.d.ts +0 -1
- package/lib-esm/components/RequestSamples/RequestSamples.d.ts +0 -1
- package/lib-esm/components/RequestSamples/useCodeSamples.js +1 -1
- package/lib-esm/components/ResponseSamples/Summary.js +1 -1
- package/lib-esm/components/Responses/OperationResponseList.js +1 -1
- package/lib-esm/components/Responses/ResponseDetails.d.ts +0 -1
- package/lib-esm/components/Responses/ResponseHeaders.d.ts +0 -1
- package/lib-esm/components/Responses/ResponseHeaders.js +1 -1
- package/lib-esm/components/Responses/styled.d.ts +1 -2
- package/lib-esm/components/RightPanel/RightPanel.js +1 -1
- package/lib-esm/components/Schema/ArraySchema.d.ts +0 -1
- package/lib-esm/components/Schema/ObjectSchema.d.ts +0 -1
- package/lib-esm/components/Schema/ObjectSchema.js +1 -1
- package/lib-esm/components/Schema/OneOfSchema.d.ts +0 -1
- package/lib-esm/components/Schema/OneOfSchema.js +1 -1
- package/lib-esm/components/Schema/RecursiveSchema.d.ts +0 -1
- package/lib-esm/components/Schema/RecursiveSchema.js +1 -1
- package/lib-esm/components/Schema/Schema.d.ts +0 -1
- package/lib-esm/components/Schema/SubSchema.js +1 -1
- package/lib-esm/components/Schema/helpers.d.ts +1 -1
- package/lib-esm/components/Schema/helpers.js +1 -1
- package/lib-esm/components/SchemaDefinition/SchemaDefinition.d.ts +0 -1
- package/lib-esm/components/SectionItem/SectionItem.d.ts +0 -1
- package/lib-esm/components/Security/OAuthFlow.js +1 -1
- package/lib-esm/components/Security/SecurityFlow.js +1 -1
- package/lib-esm/components/Security/SecurityModal.js +1 -1
- package/lib-esm/components/ServerList/ServerList.d.ts +1 -1
- package/lib-esm/components/ServerList/ServerList.js +1 -1
- package/lib-esm/components/ServerList/types.d.ts +4 -1
- package/lib-esm/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib-esm/components/ServerListDropdown/styled.d.ts +0 -1
- package/lib-esm/components/SideMenu/SideMenu.d.ts +0 -1
- package/lib-esm/components/TagItem/OperationNavigationItems.d.ts +9 -0
- package/lib-esm/components/TagItem/OperationNavigationItems.js +37 -0
- package/lib-esm/components/TagItem/OperationsNavigation.d.ts +1 -7
- package/lib-esm/components/TagItem/OperationsNavigation.js +1 -40
- package/lib-esm/components/TagItem/TagItem.js +2 -2
- package/lib-esm/components/TagItem/styled.d.ts +1 -0
- package/lib-esm/components/TagItem/styled.js +6 -0
- package/lib-esm/components/TagItem/types.d.ts +5 -0
- package/lib-esm/components/TagItem/types.js +2 -0
- package/lib-esm/components/common/Badges.d.ts +2 -2
- package/lib-esm/components/common/BodyContent/BodyContent.d.ts +0 -1
- package/lib-esm/components/common/BodyContent/BodyContent.js +1 -1
- package/lib-esm/components/common/ClearButton/ClearButton.d.ts +0 -1
- package/lib-esm/components/common/ClearButton/styled.d.ts +0 -1
- package/lib-esm/components/common/ConstraintsView.d.ts +0 -1
- package/lib-esm/components/common/ExpandableExample/ExpandableExample.js +1 -1
- package/lib-esm/components/common/Extensions.d.ts +0 -1
- package/lib-esm/components/common/Fields/fields-layout.d.ts +3 -3
- package/lib-esm/components/common/Fields/fields.d.ts +1 -2
- package/lib-esm/components/common/Select/Select.d.ts +0 -1
- package/lib-esm/components/common/Select/styled.d.ts +11 -12
- package/lib-esm/components/common/Skeleton/Skeleton.d.ts +1 -1
- package/lib-esm/components/common/panels.d.ts +7 -7
- package/lib-esm/components/common/panels.js +2 -2
- package/lib-esm/components/pluggable/styled.components.d.ts +3 -3
- package/lib-esm/hooks/index.d.ts +1 -0
- package/lib-esm/hooks/index.js +1 -1
- package/lib-esm/hooks/useRouter.d.ts +1 -1
- package/lib-esm/hooks/useTranslate.d.ts +2 -0
- package/lib-esm/hooks/useTranslate.js +2 -0
- package/lib-esm/jotai/app.d.ts +2 -4
- package/lib-esm/jotai/app.js +1 -1
- package/lib-esm/models/mediaType.js +1 -1
- package/lib-esm/models/tab.d.ts +1 -1
- package/lib-esm/services/code-samples/generator.d.ts +3 -1
- package/lib-esm/services/code-samples/generator.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/__mocks__/mock.d.ts +46 -0
- package/lib-esm/services/code-samples/httpsnippet/targets/__mocks__/mock.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/index.d.ts +2 -2
- package/lib-esm/services/code-samples/httpsnippet/targets/java/httpclient.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/javascript/index.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/shell/index.d.ts +1 -1
- package/lib-esm/utils/compose.d.ts +1 -1
- package/lib-esm/utils/convertExamplesFormat.d.ts +2 -0
- package/lib-esm/utils/convertExamplesFormat.js +2 -0
- package/lib-esm/utils/helpers.d.ts +2 -2
- package/lib-esm/utils/openapi.d.ts +2 -1
- package/lib-esm/utils/openapi.js +1 -1
- package/package.json +15 -14
- package/lib/components/UnsupportedFeatureScreen/UnsupportedFeatureScreen.d.ts +0 -1
- package/lib/components/UnsupportedFeatureScreen/UnsupportedFeatureScreen.js +0 -18
- package/lib/components/UnsupportedFeatureScreen/index.d.ts +0 -1
- package/lib/components/UnsupportedFeatureScreen/index.js +0 -2
- package/lib/setupTests.d.ts +0 -2
- package/lib/setupTests.js +0 -2
- package/lib/testProviders.d.ts +0 -3
- package/lib/testProviders.js +0 -2
- package/lib-esm/components/UnsupportedFeatureScreen/UnsupportedFeatureScreen.d.ts +0 -1
- package/lib-esm/components/UnsupportedFeatureScreen/UnsupportedFeatureScreen.js +0 -18
- package/lib-esm/components/UnsupportedFeatureScreen/index.d.ts +0 -1
- package/lib-esm/components/UnsupportedFeatureScreen/index.js +0 -2
- package/lib-esm/setupTests.d.ts +0 -2
- package/lib-esm/setupTests.js +0 -2
- package/lib-esm/testProviders.d.ts +0 -3
- package/lib-esm/testProviders.js +0 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{joinWithSeparator}from"../../services";import{encodeBackSlashes}from"../../utils";import{HttpVerb,NavigationBadge}from"../common";import{StyledButton}from"./styled";function OperationNavigationItemsComponent({title:e,items:t,onClick:a,routingBasePath:r,translate:o}){return _jsxs(_Fragment,{children:[_jsx(Heading,{children:e}),t.map((({id:e,href:t,httpVerb:i,path:n,deprecated:s,badges:l})=>_jsx(Item,{variant:"outlined",size:"large",onClick:()=>a(joinWithSeparator(r,encodeBackSlashes(t))),children:_jsxs("span",{children:[_jsx(HttpVerb,{color:s?"http-deprecated":i,children:i}),_jsx(Path,{children:n}),s&&_jsx(NavigationBadge,{deprecated:!0,children:o("openapi.badges.deprecated","Deprecated")}),null==l?void 0:l.map((({name:e,color:t})=>_jsx(NavigationBadge,{color:t,children:e},e)))]})},e)))]})}export const OperationNavigationItems=memo(OperationNavigationItemsComponent);const Heading=styled.span`
|
|
2
|
+
font-size: var(--font-size-base);
|
|
3
|
+
line-height: var(--line-height-base);
|
|
4
|
+
font-weight: var(--font-weight-bold);
|
|
5
|
+
color: var(--text-color-primary);
|
|
6
|
+
margin: var(--spacing-sm) 0 var(--spacing-xxs) 0;
|
|
7
|
+
`,Item=styled(StyledButton)`
|
|
8
|
+
border-radius: var(--border-radius);
|
|
9
|
+
background: var(--bg-color);
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
|
|
12
|
+
& > span {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: baseline;
|
|
15
|
+
gap: var(--spacing-unit);
|
|
16
|
+
overflow-x: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
background: var(--bg-color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:hover::after {
|
|
24
|
+
content: '→';
|
|
25
|
+
line-height: var(--line-height-base);
|
|
26
|
+
}
|
|
27
|
+
`,Path=styled.span`
|
|
28
|
+
font-family: var(--font-family-base);
|
|
29
|
+
font-size: var(--font-size-base);
|
|
30
|
+
line-height: var(--line-height-base);
|
|
31
|
+
color: var(--text-color-primary);
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
overflow-x: hidden;
|
|
36
|
+
`;
|
|
37
|
+
//# sourceMappingURL=OperationNavigationItems.js.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import type { OperationMenuItem } from '../../models';
|
|
3
|
-
type OperationsNavigationProps = {
|
|
4
|
-
items: OperationMenuItem[];
|
|
5
|
-
routingBasePath: string;
|
|
6
|
-
};
|
|
1
|
+
import type { OperationsNavigationProps } from './types';
|
|
7
2
|
export declare function OperationsNavigationComponent({ items, routingBasePath, }: OperationsNavigationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
3
|
export declare const OperationsNavigation: import("react").NamedExoticComponent<OperationsNavigationProps>;
|
|
9
|
-
export {};
|
|
@@ -1,46 +1,7 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo,memo,useState,useCallback}from"react";import{useNavigate}from"react-router-dom";import{LayoutVariant}from"@redocly/theme";import styled from"styled-components";import{useAtomValue}from"jotai/index";import{SamplesPanel}from"../common";import{layoutAtom}from"../../jotai/app";import{OperationNavigationItems}from"./OperationNavigationItems";import{StyledButton}from"./styled";import{useTranslate}from"../../hooks";const MAX_OPERATIONS=8;export function OperationsNavigationComponent({items:o,routingBasePath:t}){const e=useTranslate(),[a,s]=useState(!1),i=useNavigate(),n=useAtomValue(layoutAtom)===LayoutVariant.STACKED,{operations:r,webhooks:p,count:m}=useMemo((()=>{const t=o.filter((o=>"operation"===o.type)),e=a?t:t.slice(0,MAX_OPERATIONS),{operations:s,webhooks:i}=e.reduce(((o,t)=>t.isWebhook?Object.assign(Object.assign({},o),{webhooks:[...o.webhooks,t]}):Object.assign(Object.assign({},o),{operations:[...o.operations,t]})),{operations:[],webhooks:[]});return{operations:s,webhooks:i,count:!a&&t.length>MAX_OPERATIONS?t.length-MAX_OPERATIONS:0}}),[a,o]),l=useCallback((o=>i(o)),[i]);return r.length||p.length?_jsxs(Wrapper,{isStacked:n,"data-testid":"operation-navigation-list",children:[r.length>0&&_jsx(OperationNavigationItems,{items:r,onClick:l,routingBasePath:t,translate:e,title:e("openapi.operations","Operations")}),p.length>0&&_jsx(OperationNavigationItems,{items:p,onClick:l,routingBasePath:t,translate:e,title:e("openapi.webhooks","Webhooks")}),!a&&Boolean(m)&&_jsxs(StyledButton,{variant:"link",size:"large","data-testid":"show-more-operations",fullWidth:!0,onClick:()=>s(!0),children:[e("openapi.actions.show","Show")," ",m," ",e("openapi.actions.more","more"),"..."]})]}):null}export const OperationsNavigation=memo(OperationsNavigationComponent);const Wrapper=styled(SamplesPanel)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: var(--spacing-xxs);
|
|
5
5
|
padding-top: var(--spacing-xxl);
|
|
6
|
-
`,Heading=styled.span`
|
|
7
|
-
font-size: var(--font-size-base);
|
|
8
|
-
line-height: var(--line-height-base);
|
|
9
|
-
font-weight: var(--font-weight-bold);
|
|
10
|
-
color: var(--text-color-primary);
|
|
11
|
-
margin: var(--spacing-sm) 0 var(--spacing-xxs) 0;
|
|
12
|
-
`,StyledButton=styled(Button)`
|
|
13
|
-
& + & {
|
|
14
|
-
margin-left: 0;
|
|
15
|
-
}
|
|
16
|
-
`,Item=styled(StyledButton)`
|
|
17
|
-
border-radius: var(--border-radius);
|
|
18
|
-
background: var(--bg-color);
|
|
19
|
-
justify-content: space-between;
|
|
20
|
-
|
|
21
|
-
& > span {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: baseline;
|
|
24
|
-
gap: var(--spacing-unit);
|
|
25
|
-
overflow-x: hidden;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:hover {
|
|
29
|
-
background: var(--bg-color);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:hover::after {
|
|
33
|
-
content: '→';
|
|
34
|
-
line-height: var(--line-height-base);
|
|
35
|
-
}
|
|
36
|
-
`,Path=styled.span`
|
|
37
|
-
font-family: var(--font-family-base);
|
|
38
|
-
font-size: var(--font-size-base);
|
|
39
|
-
line-height: var(--line-height-base);
|
|
40
|
-
color: var(--text-color-primary);
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
white-space: nowrap;
|
|
43
|
-
text-overflow: ellipsis;
|
|
44
|
-
overflow-x: hidden;
|
|
45
6
|
`;
|
|
46
7
|
//# sourceMappingURL=OperationsNavigation.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo,useCallback}from"react";import{breakpoints,Button,H2,LayoutVariant,LinkIcon}from"@redocly/theme";import{useNavigate}from"react-router-dom";import styled from"styled-components";import{useAtomValue}from"jotai";import{Row,SamplesMiddlePanel,ShareLink}from"../common";import{Markdown}from"../Markdown";import{OperationsNavigation}from"./OperationsNavigation";import{layoutAtom}from"../../jotai/app";export function TagItemComponent({item:
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo,useCallback}from"react";import{breakpoints,Button,H2,LayoutVariant,LinkIcon}from"@redocly/theme";import{useNavigate}from"react-router-dom";import styled from"styled-components";import{useAtomValue}from"jotai";import{Row,SamplesMiddlePanel,ShareLink}from"../common";import{Markdown}from"../Markdown";import{OperationsNavigation}from"./OperationsNavigation";import{layoutAtom}from"../../jotai/app";import{useTranslate}from"../../hooks";export function TagItemComponent({item:a,routingBasePath:t="",isExpanded:o}){const e=useTranslate(),{description:i,name:n,href:r}=a,s=useNavigate(),m=useAtomValue(layoutAtom),d=useCallback((()=>{s(t+a.href)}),[a.href,s,t]),l=Boolean(a.items.length),p=m===LayoutVariant.STACKED;return _jsxs(Wrapper,{expanded:o,children:[_jsxs(Row,{layout:m,children:[_jsxs(SamplesMiddlePanel,{fullWidth:!l,isStacked:p,children:[_jsxs(Heading,{children:[_jsx(ShareLink,{to:r,"aria-label":`link to ${n}`}),n]}),_jsx(Markdown,{source:i})]}),l&&_jsx(OperationsNavigation,{items:a.items,routingBasePath:t})]}),l&&!o&&_jsxs(ShowButton,{type:"button",variant:"text",size:"medium",onClick:d,children:["+ ",e("openapi.actions.show","Show")]})]})}export const TagItem=memo(TagItemComponent);const Wrapper=styled.div`
|
|
2
2
|
padding-top: var(--spacing-lg);
|
|
3
|
-
padding-bottom: ${({expanded:
|
|
3
|
+
padding-bottom: ${({expanded:a})=>a?"var(--spacing-xxl)":""};
|
|
4
4
|
`,ShowButton=styled(Button)`
|
|
5
5
|
margin: var(--spacing-md) var(--spacing-xl) var(--spacing-xxs);
|
|
6
6
|
width: calc(100% - var(--spacing-xl) * 2);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledButton: import("styled-components").StyledComponent<import("react").FC<import("@redocly/theme").ButtonProps>, any, import("@redocly/theme").ButtonProps, never>;
|
|
@@ -7,7 +7,7 @@ interface CustomBadgesProps {
|
|
|
7
7
|
export declare const CustomBadges: import("react").NamedExoticComponent<PropsWithChildren<CustomBadgesProps>>;
|
|
8
8
|
export declare const StyledBadge: import("styled-components").StyledComponent<typeof Badge, any, {}, never>;
|
|
9
9
|
export declare const NavigationBadge: import("styled-components").StyledComponent<typeof Badge, any, {
|
|
10
|
-
deprecated?: boolean
|
|
11
|
-
color?: string
|
|
10
|
+
deprecated?: boolean;
|
|
11
|
+
color?: string;
|
|
12
12
|
}, never>;
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{useAtom}from"jotai";import{LinkIcon}from"@redocly/theme";import{Dropdown}from"../Dropdown";import{RequiredLabel}from"../Fields";import{ConstraintsView}from"../ConstraintsView";import{Schema}from"../../Schema";import{getActiveMediaType}from"../../../models";import{Markdown}from"../../Markdown";import{activeMimeNameAtom}from"../../../jotai/app";import{LinkToField}from"../LinkToField";function BodyContentComponent({required:e,skipReadOnly:o,skipWriteOnly:i,description:t,content:n,deepLink:r}){const
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{useAtom}from"jotai";import{LinkIcon}from"@redocly/theme";import{Dropdown}from"../Dropdown";import{RequiredLabel}from"../Fields";import{ConstraintsView}from"../ConstraintsView";import{Schema}from"../../Schema";import{getActiveMediaType}from"../../../models";import{Markdown}from"../../Markdown";import{activeMimeNameAtom}from"../../../jotai/app";import{LinkToField}from"../LinkToField";import{useTranslate}from"../../../hooks";function BodyContentComponent({required:e,skipReadOnly:o,skipWriteOnly:i,description:t,content:n,deepLink:r}){const a=useTranslate(),[s,m]=useAtom(activeMimeNameAtom);if(!n)return null;const{schema:l,examples:p,operation:d,name:c}=getActiveMediaType(n,s),g=n.mediaTypes.map((({name:e})=>({label:e,value:e})));return _jsxs(_Fragment,{children:[_jsxs(Title,{children:[r&&_jsx(LinkToField,{to:r}),a("openapi.body","Body"),_jsx(Dropdown,{options:g,value:c,triggerVariant:"ghost",triggerSize:"large",onChange:({value:e})=>m(e)})]}),e&&_jsx(RequiredLabel,{children:a("openapi.badges.required","required")}),_jsx(StyledMarkdown,{source:t}),"object"===(null==l?void 0:l.type)&&(null==l?void 0:l.constraints)&&_jsx(ConstraintsView,{constraints:(null==l?void 0:l.constraints)||[]}),_jsx(Schema,{skipReadOnly:o,skipWriteOnly:i,schema:l,examples:p,operation:d,level:1,disableDeepLinks:!r},"schema")]})}export const BodyContent=memo(BodyContentComponent);const StyledMarkdown=styled(Markdown)`
|
|
2
2
|
margin: var(--spacing-xxs) 0 0;
|
|
3
3
|
`,Title=styled.span`
|
|
4
4
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import styled from"styled-components";import{Button}from"@redocly/theme";import{useMemo,useState}from"react";import{Markdown}from"../../Markdown";import{ExampleValue}from"../Fields";const MAX_EXAMPLE_LENGTH=150;export function ExpandableExample({value:e}){const[
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import styled from"styled-components";import{Button}from"@redocly/theme";import{useMemo,useState}from"react";import{Markdown}from"../../Markdown";import{ExampleValue}from"../Fields";import{useTranslate}from"../../../hooks";const MAX_EXAMPLE_LENGTH=150;export function ExpandableExample({value:e}){const s=useTranslate(),[o,a]=useState(!1),t=useMemo((()=>e.slice(0,MAX_EXAMPLE_LENGTH)),[e]);return _jsxs(Container,{children:[_jsx(Markdown,{source:o?e:t}),(e!==t||o)&&_jsx(ButtonWrap,{children:_jsx(Button,{variant:"link",size:"small",onClick:()=>{a(!o)},children:o?s("openapi.hideExample","Hide example"):s("openapi.showExample","Show example")})})]})}const Container=styled(ExampleValue)`
|
|
2
2
|
display: inline;
|
|
3
3
|
|
|
4
4
|
& * {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const getCssVariable: (variable: string) => string;
|
|
2
2
|
export declare const PropertiesTableCaption: import("styled-components").StyledComponent<"caption", any, {}, never>;
|
|
3
3
|
export declare const PropertyCell: import("styled-components").StyledComponent<"td", any, {
|
|
4
|
-
kind?: string
|
|
4
|
+
kind?: string;
|
|
5
5
|
}, never>;
|
|
6
6
|
export declare const PropertyCellWithInner: import("styled-components").StyledComponent<"td", any, {
|
|
7
|
-
kind?: string
|
|
7
|
+
kind?: string;
|
|
8
8
|
}, never>;
|
|
9
9
|
export declare const PropertyNameCell: import("styled-components").StyledComponent<"td", any, {
|
|
10
|
-
kind?: string
|
|
10
|
+
kind?: string;
|
|
11
11
|
}, never>;
|
|
12
12
|
export declare const PropertyDetailsCell: import("styled-components").StyledComponent<"td", any, {}, never>;
|
|
13
13
|
export declare const PropertyBullet: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const FieldLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
2
|
export declare const TypePrefix: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
3
|
export declare const TypeName: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -36,4 +35,4 @@ export declare const ConstraintItem: import("styled-components").StyledComponent
|
|
|
36
35
|
export declare const ToggleButton: import("styled-components").StyledComponent<import("react").FC<import("@redocly/theme").ButtonProps>, any, import("@redocly/theme").ButtonProps & {
|
|
37
36
|
variant: "link";
|
|
38
37
|
size: "small";
|
|
39
|
-
}, "
|
|
38
|
+
}, "size" | "variant">;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { SelectProps } from './types';
|
|
3
2
|
export declare const Select: import("styled-components").StyledComponent<import("react").NamedExoticComponent<SelectProps>, any, SelectProps & {
|
|
4
|
-
fullWidth?: boolean
|
|
5
|
-
variant?: "dark" | "light"
|
|
3
|
+
fullWidth?: boolean;
|
|
4
|
+
variant?: "dark" | "light";
|
|
6
5
|
}, never>;
|
|
7
6
|
export declare const SimpleSelect: import("styled-components").StyledComponent<import("react").NamedExoticComponent<SelectProps>, any, SelectProps & {
|
|
8
|
-
fullWidth?: boolean
|
|
9
|
-
variant?: "dark" | "light"
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
variant?: "dark" | "light";
|
|
10
9
|
}, never>;
|
|
11
10
|
export declare const CollapsingSelect: import("styled-components").StyledComponent<import("react").NamedExoticComponent<SelectProps>, any, SelectProps & {
|
|
12
|
-
fullWidth?: boolean
|
|
13
|
-
variant?: "dark" | "light"
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
variant?: "dark" | "light";
|
|
14
13
|
} & {
|
|
15
|
-
active?: boolean
|
|
14
|
+
active?: boolean;
|
|
16
15
|
}, never>;
|
|
17
|
-
export declare const Arrow: import("styled-components").StyledComponent<(props: import("@redocly/theme/lib/icons/types").IconProps) =>
|
|
16
|
+
export declare const Arrow: import("styled-components").StyledComponent<(props: import("@redocly/theme/lib/icons/types").IconProps) => React.JSX.Element, any, {
|
|
18
17
|
'data-component-name': string;
|
|
19
18
|
} & {
|
|
20
|
-
color?: string
|
|
21
|
-
size?: string
|
|
22
|
-
className?: string
|
|
19
|
+
color?: string;
|
|
20
|
+
size?: string;
|
|
21
|
+
className?: string;
|
|
23
22
|
} & import("react").SVGProps<SVGSVGElement>, "data-component-name">;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { LayoutVariant } from '@redocly/theme';
|
|
2
2
|
export declare const SamplesMiddlePanel: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
-
compact?: boolean
|
|
4
|
-
isStacked?: boolean
|
|
5
|
-
fullWidth?: boolean
|
|
3
|
+
compact?: boolean;
|
|
4
|
+
isStacked?: boolean;
|
|
5
|
+
fullWidth?: boolean;
|
|
6
6
|
}, never>;
|
|
7
7
|
export declare const Section: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
-
underlined?: boolean
|
|
9
|
-
sectionId?: string
|
|
10
|
-
expanded?: boolean
|
|
8
|
+
underlined?: boolean;
|
|
9
|
+
sectionId?: string;
|
|
10
|
+
expanded?: boolean;
|
|
11
11
|
}, never>;
|
|
12
12
|
export declare const SamplesPanel: import("styled-components").StyledComponent<"div", any, {
|
|
13
13
|
isStacked: boolean;
|
|
14
14
|
}, never>;
|
|
15
15
|
export declare const Row: import("styled-components").StyledComponent<"div", any, {
|
|
16
|
-
layout?: LayoutVariant
|
|
16
|
+
layout?: LayoutVariant;
|
|
17
17
|
}, never>;
|
|
@@ -10,7 +10,7 @@ import{H2,LayoutVariant,breakpoints,Markdown}from"@redocly/theme";import styled,
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
@media screen and (min-width: ${breakpoints.large}) {
|
|
13
|
-
width: ${t?"100%":"calc(100% - var(--panel-samples-width))"};
|
|
13
|
+
width: ${t||i?"100%":"calc(100% - var(--panel-samples-width))"};
|
|
14
14
|
padding-left: ${i?"var(--panel-gap-horizontal)":"calc(var(--panel-gap-horizontal) * 2)"};
|
|
15
15
|
padding-right: ${i?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
|
|
16
16
|
padding-top: 0;
|
|
@@ -93,7 +93,7 @@ import{H2,LayoutVariant,breakpoints,Markdown}from"@redocly/theme";import styled,
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
@media screen and (min-width: ${breakpoints.large}) {
|
|
96
|
-
width: var(--panel-samples-width);
|
|
96
|
+
width: ${({isStacked:a})=>a?"100%":"var(--panel-samples-width)"};
|
|
97
97
|
padding-top: 0;
|
|
98
98
|
padding-bottom: 0;
|
|
99
99
|
padding-left: ${({isStacked:a})=>a?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const SamplesWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export declare const ExamplesWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export declare const FullWidthPanel: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
-
compact?: boolean
|
|
5
|
-
isStacked?: boolean
|
|
6
|
-
fullWidth?: boolean
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
isStacked?: boolean;
|
|
6
|
+
fullWidth?: boolean;
|
|
7
7
|
}, never>;
|
package/lib-esm/hooks/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export { useRouter } from './useRouter';
|
|
|
5
5
|
export { useContentItems } from './useContentItems';
|
|
6
6
|
export { useActiveWithFallback } from './useActiveWithFallback';
|
|
7
7
|
export { useUppercase2LowercaseRedirect } from './useUppercase2LowercaseRedirect';
|
|
8
|
+
export { useTranslate } from './useTranslate';
|
package/lib-esm/hooks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{useDimensions}from"./useDimensions";export{usePrevious}from"./usePrevious";export{useActivateExample}from"./useActivateExample";export{useRouter}from"./useRouter";export{useContentItems}from"./useContentItems";export{useActiveWithFallback}from"./useActiveWithFallback";export{useUppercase2LowercaseRedirect}from"./useUppercase2LowercaseRedirect";
|
|
1
|
+
export{useDimensions}from"./useDimensions";export{usePrevious}from"./usePrevious";export{useActivateExample}from"./useActivateExample";export{useRouter}from"./useRouter";export{useContentItems}from"./useContentItems";export{useActiveWithFallback}from"./useActiveWithFallback";export{useUppercase2LowercaseRedirect}from"./useUppercase2LowercaseRedirect";export{useTranslate}from"./useTranslate";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@ interface RouterProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const useRouter: (router: RouterType, basePath: string) => {
|
|
8
8
|
Router: ComponentType<{
|
|
9
|
-
children?: import("react").ReactNode;
|
|
9
|
+
children?: import("react").ReactNode | undefined;
|
|
10
10
|
}>;
|
|
11
11
|
routerProps: RouterProps;
|
|
12
12
|
};
|
package/lib-esm/jotai/app.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { LayoutVariant } from '@redocly/theme';
|
|
3
2
|
import type { AsyncLocalStorage } from 'node:async_hooks';
|
|
4
3
|
import type { TabType } from '../models/tab';
|
|
@@ -30,8 +29,8 @@ export declare const appStoreOverrideAtom: import("jotai").PrimitiveAtom<Partial
|
|
|
30
29
|
};
|
|
31
30
|
export declare const environmentsAtom: import("jotai").Atom<import("../utils/environments").EnvironmentData>;
|
|
32
31
|
export declare const environmentAtom: import("jotai").WritableAtom<[Record<string, string>, string], [{
|
|
33
|
-
environment?: string
|
|
34
|
-
environments?: Record<string, Record<string, string
|
|
32
|
+
environment?: string;
|
|
33
|
+
environments?: Record<string, Record<string, string>>;
|
|
35
34
|
}], void>;
|
|
36
35
|
export declare const isSidebarOpenedAtom: import("jotai").WritableAtom<boolean, boolean[], void>;
|
|
37
36
|
export declare const activeMimeNameAtom: import("jotai").WritableAtom<string, [string], void>;
|
|
@@ -46,5 +45,4 @@ export declare function getLangKey({ lang, label }: {
|
|
|
46
45
|
label?: string;
|
|
47
46
|
}): string;
|
|
48
47
|
export declare const languageAtom: import("jotai").WritableAtom<LanguageAtom, [string], void>;
|
|
49
|
-
export declare const unsupportedFeatureScreenAtom: import("jotai").WritableAtom<boolean, boolean[], void>;
|
|
50
48
|
export {};
|
package/lib-esm/jotai/app.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __rest=this&&this.__rest||function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};import{atom}from"jotai";import{atomWithStorage,createJSONStorage}from"jotai/utils";import{LayoutVariant
|
|
1
|
+
var __rest=this&&this.__rest||function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};import{atom}from"jotai";import{atomWithStorage,createJSONStorage}from"jotai/utils";import{IS_BROWSER,LayoutVariant}from"@redocly/theme";import{getCookie,removeCookie,setCookie}from"../utils/cookies";import{globalOptionsAtom}from"./store";import{mergeEnvData}from"../utils/environments";import{fromSessionStorage,safeJsonParse,toSessionStorage}from"../utils";const defaultAppStoreValue={isSidebarOpened:!0,activeMimeName:"",layout:LayoutVariant.THREE_PANEL,language:"",environment:"",environments:{}},customStorage={getItem:e=>{var t,o;const n=safeJsonParse(getCookie(e,null===(o=null===(t=globalThis.redoclyCookieStorage)||void 0===t?void 0:t.getStore)||void 0===o?void 0:o.call(t))),r=safeJsonParse(fromSessionStorage(e));return Object.assign(Object.assign(Object.assign({},defaultAppStoreValue),r),n)},setItem:(e,t)=>{const{environments:o}=t,n=__rest(t,["environments"]),r={environments:o};setCookie(e,JSON.stringify(n)),toSessionStorage(e,JSON.stringify(r))},removeItem:e=>{removeCookie(e),sessionStorage.removeItem(e)}};export const appStore=atomWithStorage("redoc.appStore",defaultAppStoreValue,customStorage);export const appStoreOverrideAtom=atom({});export const environmentsAtom=atom((e=>{const t=e(appStore),o=e(appStoreOverrideAtom);return mergeEnvData(t.environments,(null==o?void 0:o.environments)||{})}));export const environmentAtom=atom((e=>{const t=e(appStore),o=e(appStoreOverrideAtom),n=mergeEnvData(t.environments,(null==o?void 0:o.environments)||{}),r=(null==o?void 0:o.environment)||t.environment,a=n[r]?r:Object.keys(n)[0];return[n[a]||{},a||""]}),((e,t,{environment:o,environments:n})=>{const r=e(appStore);t(appStore,Object.assign(Object.assign({},r),{environment:o||r.environment,environments:mergeEnvData(r.environments||{},n)}))}));export const isSidebarOpenedAtom=atom((e=>e(appStore).isSidebarOpened),((e,t,o)=>{const n=e(appStore);t(appStore,Object.assign(Object.assign({},n),{isSidebarOpened:o}))}));export const activeMimeNameAtom=atom((e=>e(appStore).activeMimeName),((e,t,o)=>{const n=e(appStore);t(appStore,Object.assign(Object.assign({},n),{activeMimeName:o}))}));export const layoutAtom=atom((e=>e(appStore).layout),((e,t,o=LayoutVariant.STACKED)=>{const n=e(appStore);t(appStore,Object.assign(Object.assign({},n),{layout:o}))}));export const appSessionStore=atomWithStorage("redoc.appSessionStore",{collapsedSidebar:!1,unsupportedFeatureScreen:!1},IS_BROWSER?createJSONStorage((()=>sessionStorage)):void 0);export const collapsedSidebarAtom=atom((e=>e(appSessionStore).collapsedSidebar),((e,t,o)=>{const n=e(appSessionStore);t(appSessionStore,Object.assign(Object.assign({},n),{collapsedSidebar:o}))}));export function getLangKey({lang:e,label:t}){return(t||e).toLowerCase()}export const languageAtom=atom((e=>{var t;const{codeSamples:o}=e(globalOptionsAtom),n=o.languages.map((({lang:e,label:t},o)=>({key:getLangKey({lang:e,label:t}),lang:e,title:t||e,order:o}))),r=e(appStore).language||n[0].key;return{languages:n,activeLanguage:(null===(t=n.find((({key:e})=>e===r)))||void 0===t?void 0:t.key)||n[0].key}}),((e,t,o)=>{const n=e(appStore);t(appStore,Object.assign(Object.assign({},n),{language:o}))}));
|
|
2
2
|
//# sourceMappingURL=app.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as Sampler from"openapi-sampler";import{getSchema}from"./schema";import{isFormUrlEncoded,isJsonLike,isMultipartFormData,JsonPointer,mapValues}from"../utils";import{getExamples}from"./example";function generateExamples({parser:e,info:{encoding:a,schema:
|
|
1
|
+
import*as Sampler from"openapi-sampler";import{getSchema}from"./schema";import{isFormUrlEncoded,isJsonLike,isXmlLike,isMultipartFormData,JsonPointer,mapValues}from"../utils";import{getExamples}from"./example";function generateExamples({parser:e,info:{encoding:a,schema:i},schema:s,mime:r,isRequestType:n,onlyRequiredInSamples:o,generatedSamplesMaxDepth:m}){const t={skipReadOnly:n,skipWriteOnly:!n,skipNonRequired:n&&o,maxSampleDepth:m,quiet:!0};let p={};if(s&&s.oneOf)for(const i of s.oneOf){const n=Sampler.sample(i.rawSchema,t,e.definition);s.discriminatorProp&&"object"==typeof n&&n&&n[s.discriminatorProp]&&(n[s.discriminatorProp]=i.title),p[i.title]=getExamples({parser:e,infoOrRef:{value:n},mime:r,encoding:a})}else p=s?{default:getExamples({parser:e,infoOrRef:{value:Sampler.sample(i,t,e.definition)},mime:r,encoding:a})}:{default:{value:null,rawValue:"null"}};return p}export function getMediaType(e,a,i,s,r,{operation:n,type:o,response:m,absolutePointer:t=""}){let p,l;const d=s.schema&&getSchema({parser:e,schemaOrRef:s.schema,pointer:"",absolutePointer:JsonPointer.join(t,["content",a,"schema"]),options:r,deps:{operation:n,type:o,response:m}}),{onlyRequiredInSamples:u,generatedSamplesMaxDepth:c}=r,{encoding:f,examples:g,example:x}=s;return r.unstable_skipSamples||(void 0!==g?p=mapValues(g,(i=>getExamples({parser:e,infoOrRef:i,mime:a,encoding:f}))):void 0!==x?p={default:getExamples({parser:e,infoOrRef:{value:e.deref(x).resolved},mime:a,encoding:f})}:isJsonLike(a)||isXmlLike(a)?p=generateExamples({parser:e,info:s,schema:d,mime:a,isRequestType:i,onlyRequiredInSamples:u,generatedSamplesMaxDepth:c}):(isFormUrlEncoded(a)||isMultipartFormData(a))&&(l=generateExamples({parser:e,info:s,schema:d,mime:a,isRequestType:i,onlyRequiredInSamples:u,generatedSamplesMaxDepth:c}))),{examples:p,schema:d,name:a,isRequestType:i,formExamples:l,onlyRequiredInSamples:u,operation:n}}
|
|
2
2
|
//# sourceMappingURL=mediaType.js.map
|
package/lib-esm/models/tab.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OperationModel } from '../../models';
|
|
2
2
|
import type * as HAR from './har';
|
|
3
3
|
import type { Languages } from './types';
|
|
4
|
+
import type { TFunction } from '@redocly/theme';
|
|
4
5
|
export type CustomHAR = HAR.Request & {
|
|
5
6
|
securityOAuth2ExtraCalls?: HAR.Request[];
|
|
6
7
|
basicAuth?: {
|
|
@@ -13,7 +14,7 @@ export type CustomHAR = HAR.Request & {
|
|
|
13
14
|
serverVariables?: Record<string, string>;
|
|
14
15
|
allResponseCodes?: string[];
|
|
15
16
|
};
|
|
16
|
-
export declare function getCodeSample({ lang, operation, exampleName, pathParams, properties, options, environment, }: {
|
|
17
|
+
export declare function getCodeSample({ lang, operation, exampleName, pathParams, properties, options, environment, translate, }: {
|
|
17
18
|
lang: Languages;
|
|
18
19
|
operation: OperationModel;
|
|
19
20
|
exampleName?: string;
|
|
@@ -21,6 +22,7 @@ export declare function getCodeSample({ lang, operation, exampleName, pathParams
|
|
|
21
22
|
properties?: GenericObject;
|
|
22
23
|
options?: GenericObject;
|
|
23
24
|
environment: Record<string, string>;
|
|
25
|
+
translate: TFunction;
|
|
24
26
|
}): string;
|
|
25
27
|
export declare function isDefined<T>(arg?: T): arg is T;
|
|
26
28
|
export declare function capitalizeFirst(str: string): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as Sampler from"openapi-sampler";import merge from"deepmerge";import{areArraysEqual,serializeParameterValue,getSecurityDetails,getParameterValue,queryString,isArrayOfObjects,deleteEmptyArrayItem}from"../../utils";import{normalizeMimeType,arrayMergeStrategy}from"../utils";import{MediaTypes}from"../../constants";import{HTTPSnippet}from"./httpsnippet";import{getActiveMediaType}from"../../models/mediaContent";import StringUtility from"./httpsnippet/helpers/string-utility";function getSelectedSecurityScheme(e,t){return e.find((e=>{const a=e.schemes.map((e=>e.id));return areArraysEqual(a,t||[])}))}function mapOperationToHAR(e,{exampleName:t="",skipOptionalParameters:a=!1,withOAuth2Call:r=!1,spec:s,generatedPayloadSamplesMaxDepth:i=8,pathParams:n={},properties:o={}},{environment:l,requestValues:u,activeSecuritySchemeIds:p}){var c,d,m;const h=l.server,y=e.servers.find((e=>e.url===h))||e.servers[0],f=getSelectedSecurityScheme(e.security,p),{securityHeaders:g,securityCookies:v,securityQueries:O,securityOAuth2ExtraCalls:S,basicAuth:T}=getSecurityData(f||(null===(c=e.security)||void 0===c?void 0:c[0]),r,l),C=(null===(d=null==e?void 0:e.requestBody)||void 0===d?void 0:d.content)&&getActiveMediaType(e.requestBody.content),b={skipNonRequired:a,skipReadOnly:!0,maxSampleDepth:i,quiet:!0},E=u;let _=!1;const A=e.parameters.filter((e=>"header"===e.in)).filter((e=>!(a&&!e.required))).map((e=>{var t;return{name:e.name,value:(null===(t=E.header)||void 0===t?void 0:t[e.name])||getParameterValue("header",e.name)||serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,b,s))}})).map((e=>((null==C?void 0:C.name)&&"content-type"===e.name.toLowerCase()&&(_=!0,e.value=C.name),e))).concat(g);!_&&(null==C?void 0:C.name)&&A.unshift({name:"Content-Type",value:null==C?void 0:C.name});const k=e.parameters.filter((e=>"cookie"===e.in)).filter((e=>!(a&&!e.required))).map((e=>queryString.parse(serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,b,s))))).reduce(((e,t)=>{var a;for(const[r,s]of Object.entries(t))e.push({name:r,value:String((null===(a=E.cookie)||void 0===a?void 0:a[r])||s)});return e}),[]).concat(v),
|
|
1
|
+
import*as Sampler from"openapi-sampler";import merge from"deepmerge";import{toXML}from"jstoxml";import{areArraysEqual,serializeParameterValue,getSecurityDetails,getParameterValue,queryString,isArrayOfObjects,deleteEmptyArrayItem}from"../../utils";import{normalizeMimeType,arrayMergeStrategy}from"../utils";import{MediaTypes}from"../../constants";import{HTTPSnippet}from"./httpsnippet";import{getActiveMediaType}from"../../models/mediaContent";import StringUtility from"./httpsnippet/helpers/string-utility";function getSelectedSecurityScheme(e,t){return e.find((e=>{const a=e.schemes.map((e=>e.id));return areArraysEqual(a,t||[])}))}function mapOperationToHAR(e,{exampleName:t="",skipOptionalParameters:a=!1,withOAuth2Call:r=!1,spec:s,generatedPayloadSamplesMaxDepth:i=8,pathParams:n={},properties:o={}},{environment:l,requestValues:u,activeSecuritySchemeIds:p}){var c,d,m;const h=l.server,y=e.servers.find((e=>e.url===h))||e.servers[0],f=getSelectedSecurityScheme(e.security,p),{securityHeaders:g,securityCookies:v,securityQueries:O,securityOAuth2ExtraCalls:S,basicAuth:T}=getSecurityData(f||(null===(c=e.security)||void 0===c?void 0:c[0]),r,l),C=(null===(d=null==e?void 0:e.requestBody)||void 0===d?void 0:d.content)&&getActiveMediaType(e.requestBody.content),b={skipNonRequired:a,skipReadOnly:!0,maxSampleDepth:i,quiet:!0},E=u;let _=!1;const A=e.parameters.filter((e=>"header"===e.in)).filter((e=>!(a&&!e.required))).map((e=>{var t;return{name:e.name,value:(null===(t=E.header)||void 0===t?void 0:t[e.name])||getParameterValue("header",e.name)||serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,b,s))}})).map((e=>((null==C?void 0:C.name)&&"content-type"===e.name.toLowerCase()&&(_=!0,e.value=C.name),e))).concat(g);!_&&(null==C?void 0:C.name)&&A.unshift({name:"Content-Type",value:null==C?void 0:C.name});const k=e.parameters.filter((e=>"cookie"===e.in)).filter((e=>!(a&&!e.required))).map((e=>queryString.parse(serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,b,s))))).reduce(((e,t)=>{var a;for(const[r,s]of Object.entries(t))e.push({name:r,value:String((null===(a=E.cookie)||void 0===a?void 0:a[r])||s)});return e}),[]).concat(v),j=e.parameters.filter((e=>"query"===e.in)).filter((e=>!(a&&!e.required))).map((e=>queryString.parse(serializeParameterValue(e,Sampler.sample(e.schema.rawSchema,b,s))))).reduce(((e,t)=>{var a,r,s;for(const[i,n]of Object.entries(t))e.push({name:i,value:isArrayOfObjects(null===(a=E.query)||void 0===a?void 0:a[i])&&JSON.stringify(deleteEmptyArrayItem(null===(r=E.query)||void 0===r?void 0:r[i]))||String((null===(s=E.query)||void 0===s?void 0:s[i])||n)});return e}),[]).concat(O),P=`${null==y?void 0:y.url.replace(/\/$/,"")}/${e.path.replace(/^\//,"")}`,w=e.parameters.filter((e=>"path"===e.in)).reduce(((e,t)=>{var a;const{in:r,name:s}=t;return e[s]=(null===(a=E.path)||void 0===a?void 0:a[s])||n[s]||getParameterValue(r,s),e}),{}),R=null===(m=null==C?void 0:C.examples)||void 0===m?void 0:m[t],D=(null==C?void 0:C.examples)||{},[q]=Object.values(D),M=(null==E?void 0:E.body)||(null==R?void 0:R.value)||(null==q?void 0:q.value)||(null==C?void 0:C.schema)&&Sampler.sample(null==C?void 0:C.schema.rawSchema,b,s),H=null==C?void 0:C.name.toLowerCase();let N="",x=[];switch(normalizeMimeType(H)){case MediaTypes.JSON:N=JSON.stringify(getDataRequest(M,o));break;case MediaTypes.XML:N="object"==typeof M?toXML(getDataRequest(M,o),{indent:" "}):M;break;case MediaTypes.URL_ENCODED:case MediaTypes.MULTIPART:N=queryString.stringify(getDataRequest(M,o)),x=objectToHarParams(getDataRequest(M,o));break;default:N=String(M||"")}const U=N?{mimeType:(null==C?void 0:C.name)||MediaTypes.OCTET_STREAM,text:N,params:x}:void 0,z=e.responses.map((e=>e.code));return{method:e.httpVerb,url:P,httpVersion:"HTTP/1.1",cookies:k,headers:A,queryString:j,postData:U,headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:S,basicAuth:T,pathParameters:w,serverVariables:l,allResponseCodes:z}}const defaultOptions={withImports:!0,withComments:!1},langToSnippetConfig={curl:{code:"shell",defaultTarget:"curl",defaultOptions:Object.assign(Object.assign({},defaultOptions),{short:!0})},JavaScript:{code:"javascript",defaultTarget:"fetch",defaultOptions:Object.assign(Object.assign({},defaultOptions),{withImports:!1})},"Node.js":{code:"node",defaultTarget:"fetch",defaultOptions:Object.assign({},defaultOptions)},Python:{code:"python",defaultTarget:"requests",defaultOptions:Object.assign({},defaultOptions)},"Java8+Apache":{code:"java8",defaultTarget:"apachehttp",defaultOptions:Object.assign({},defaultOptions)},Java:{code:"java",defaultTarget:"httpclient",defaultOptions:Object.assign({},defaultOptions)},"C#":{code:"csharp",defaultTarget:"httpclient",defaultOptions:Object.assign({},defaultOptions)},"C#+Newtonsoft":{code:"csharpNewtonsoft",defaultTarget:"httpclient",defaultOptions:Object.assign({},defaultOptions)},Go:{code:"go",defaultTarget:"http.DefaultClient",defaultOptions:Object.assign({},defaultOptions)},PHP:{code:"php",defaultTarget:"curl",defaultOptions:Object.assign({},defaultOptions)},Ruby:{code:"ruby",defaultTarget:"net::http",defaultOptions:Object.assign({},defaultOptions)},R:{code:"r",defaultTarget:"httr",defaultOptions:Object.assign({},defaultOptions)}};export function getCodeSample({lang:e,operation:t,exampleName:a,pathParams:r,properties:s,options:i={},environment:n,translate:o}){try{const{skipOptionalParameters:l,withOAuth2Call:u,spec:p,generatedPayloadSamplesMaxDepth:c,store:d}=i,m=mapOperationToHAR(t,{exampleName:a,pathParams:r,properties:s,skipOptionalParameters:l,withOAuth2Call:u,spec:p,generatedPayloadSamplesMaxDepth:c},{environment:n,requestValues:d.requestValues,activeSecuritySchemeIds:d.activeSecuritySchemeIds}),h=new HTTPSnippet(m);return langToSnippetConfig[e]?h.convert(langToSnippetConfig[e].code,langToSnippetConfig[e].defaultTarget,Object.assign(Object.assign({},langToSnippetConfig[e].defaultOptions),i)):o("openapi.unsupportedLanguage","Language is not supported.")}catch(e){return console.error(e),o("openapi.failedToGenerateCodeSample","Failed to generate code sample.")}}function getSecurityData(e,t,a){var r,s,i,n,o;const l={securityHeaders:[],securityCookies:[],securityQueries:[],securityOAuth2ExtraCalls:[],basicAuth:void 0};for(const u of(null==e?void 0:e.schemes)||[]){const e=getSecurityDetails(u.id,a);switch(u.type){case"openIdConnect":null===(r=l.securityHeaders)||void 0===r||r.push({name:"Authorization",value:e.token?`${e.token.token_type||"Bearer"} ${e.token.access_token}`:"Bearer <YOUR_TOKEN_HERE>"});break;case"oauth2":{const a=e.token?`${e.token.token_type||"Bearer"} ${e.token.access_token}`:"Bearer <YOUR_TOKEN_HERE>";u.flows.clientCredentials&&t?l.securityOAuth2ExtraCalls.push(getOAuth2ClientCredsCallHar(u.flows.clientCredentials,u.scopes,e)):u.flows.password&&t&&l.securityOAuth2ExtraCalls.push(getOAuth2PasswordCallHar(u.flows.password,u.scopes,e)),null===(s=l.securityHeaders)||void 0===s||s.push({name:"Authorization",value:a});break}case"apiKey":{const t=e.raw||"YOUR_API_KEY_HERE";"header"===u.in&&(null===(i=l.securityHeaders)||void 0===i||i.push({name:u.name,value:t})),"cookie"===u.in&&l.securityCookies.push({name:u.name,value:t}),"query"===u.in&&l.securityQueries.push({name:u.name,value:t});break}case"http":if("basic"===u.scheme)l.basicAuth={username:e.username||`<${StringUtility.toSnakeCase("Username")}>`,password:e.password||`<${StringUtility.toSnakeCase("Password")}>`};else{const t=(null===(n=e.token)||void 0===n?void 0:n.access_token)||`<YOUR_${u.bearerFormat||"TOKEN"}_HERE>`;null===(o=l.securityHeaders)||void 0===o||o.push({name:"Authorization",value:`${capitalizeFirst(u.scheme||"bearer")} ${t}`})}}}return l}function getOAuth2PasswordCallHar(e,t,a){return{method:"POST",url:e.tokenUrl,httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:MediaTypes.URL_ENCODED},{name:"Accept",value:MediaTypes.JSON}],queryString:[],postData:{mimeType:MediaTypes.URL_ENCODED,text:"",params:[{name:"grant_type",value:"password"},{name:"client_id",value:a.client_id||"YOUR_CLIENT_ID"},{name:"client_secret",value:a.client_secret||"YOUR_CLIENT_SECRET"},{name:"username",value:a.username||"<username>"},{name:"password",value:a.password||"<password>"},t.length?{name:"scope",value:t.join(" ")}:void 0].filter(isDefined)},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}}function getOAuth2ClientCredsCallHar(e,t,a){return{method:"POST",url:e.tokenUrl,httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:MediaTypes.URL_ENCODED},{name:"Accept",value:MediaTypes.JSON}],queryString:[],postData:{mimeType:MediaTypes.URL_ENCODED,text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:a.client_id||"YOUR_CLIENT_ID"},{name:"client_secret",value:a.client_secret||"YOUR_CLIENT_SECRET"},t.length?{name:"scope",value:t.join(" ")}:void 0].filter(isDefined)},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}}function getDataRequest(e,t){if(e){if("object"==typeof e)return merge(e,t,{arrayMerge:arrayMergeStrategy});try{return merge(JSON.parse(e),t,{arrayMerge:arrayMergeStrategy})}catch(e){return!1}}return!1}function objectToHarParams(e,t=""){const a=[];for(const[r,s]of Object.entries(e)){const e=t?`${t}[${r}]`:r;"object"==typeof s&&null!==s?a.push(...objectToHarParams(s,e)):a.push({name:e,value:String(s)})}return a}export function isDefined(e){return void 0!==e}export function capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}
|
|
2
2
|
//# sourceMappingURL=generator.js.map
|
|
@@ -2004,6 +2004,52 @@ export declare const source: {
|
|
|
2004
2004
|
};
|
|
2005
2005
|
fullUrl: string;
|
|
2006
2006
|
};
|
|
2007
|
+
"POST http://petstore.swagger.io/v2/uploadImage": {
|
|
2008
|
+
httpVersion: string;
|
|
2009
|
+
queryString: never[];
|
|
2010
|
+
basicAuth: {
|
|
2011
|
+
username: string;
|
|
2012
|
+
password: string;
|
|
2013
|
+
};
|
|
2014
|
+
headersSize: number;
|
|
2015
|
+
bodySize: number;
|
|
2016
|
+
securityOAuth2ExtraCalls: never[];
|
|
2017
|
+
pathParameters: {};
|
|
2018
|
+
queryObj: {};
|
|
2019
|
+
headersObj: {};
|
|
2020
|
+
cookiesObj: {};
|
|
2021
|
+
allHeaders: {};
|
|
2022
|
+
serverVariables: {};
|
|
2023
|
+
cookies: {
|
|
2024
|
+
name: string;
|
|
2025
|
+
value: string;
|
|
2026
|
+
}[];
|
|
2027
|
+
uriObj: {
|
|
2028
|
+
protocol: string;
|
|
2029
|
+
slashes: boolean;
|
|
2030
|
+
auth: null;
|
|
2031
|
+
host: string;
|
|
2032
|
+
port: null;
|
|
2033
|
+
hostname: string;
|
|
2034
|
+
hash: null;
|
|
2035
|
+
search: string;
|
|
2036
|
+
query: {};
|
|
2037
|
+
pathname: string;
|
|
2038
|
+
path: string;
|
|
2039
|
+
href: string;
|
|
2040
|
+
};
|
|
2041
|
+
fullUrl: string;
|
|
2042
|
+
method: string;
|
|
2043
|
+
url: string;
|
|
2044
|
+
headers: never[];
|
|
2045
|
+
postData: {
|
|
2046
|
+
mimeType: string;
|
|
2047
|
+
params: {
|
|
2048
|
+
name: string;
|
|
2049
|
+
value: string;
|
|
2050
|
+
}[];
|
|
2051
|
+
};
|
|
2052
|
+
};
|
|
2007
2053
|
};
|
|
2008
2054
|
export declare const serverVariablesOptions: {
|
|
2009
2055
|
withImports: boolean;
|