@redocly/openapi-docs 3.24.0-next.9 → 3.24.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.AiChatProvider-DcsGB2gP.js → redocly-openapi-docs.min.AiChatProvider-j-VDfFJ9.js} +3 -3
- package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-wCZA4usG.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-BBRBmffc.js} +1 -1
- package/dist/{redocly-openapi-docs.min.AiPanel-jo7fqtSt.js → redocly-openapi-docs.min.AiPanel-DTzHqAiI.js} +116 -116
- package/dist/redocly-openapi-docs.min.FileWatcher-DDoyaS7A.js +1 -0
- package/dist/redocly-openapi-docs.min.Observable-D6wKbFwB.js +1 -0
- package/dist/redocly-openapi-docs.min.SemanticSearchService-DNFOPBZK.js +1 -0
- package/dist/{redocly-openapi-docs.min.SqliteDBStorage-B_f6WR8o.js → redocly-openapi-docs.min.SqliteDBStorage-Dy40Vq04.js} +1 -1
- package/dist/redocly-openapi-docs.min.TauriFileSystemAdapter-CpViFqJQ.js +1 -0
- package/dist/redocly-openapi-docs.min.TauriRootStorage-TCUrp2uB.js +1 -0
- package/dist/redocly-openapi-docs.min.ai-chat-mappers-CmX-8902.js +1 -0
- package/dist/redocly-openapi-docs.min.core-BYyFOtMX.js +1 -0
- package/dist/redocly-openapi-docs.min.external-resolver-BkceRyB4.js +2 -0
- package/dist/redocly-openapi-docs.min.index-BCcol5vU.js +1 -0
- package/dist/redocly-openapi-docs.min.index-C6uU_v-b.js +1 -0
- package/dist/redocly-openapi-docs.min.index-CmXZfuiZ.js +7730 -0
- package/dist/redocly-openapi-docs.min.index-DVWw0ICA.js +1 -0
- package/dist/redocly-openapi-docs.min.index-YnvLQkG_.js +1 -0
- package/dist/redocly-openapi-docs.min.index-xl_tBaHD.js +1 -0
- package/dist/redocly-openapi-docs.min.js +1 -1
- package/dist/{redocly-openapi-docs.min.lint-C-zlwxhp.js → redocly-openapi-docs.min.lint-2YpbCz3r.js} +69 -69
- package/dist/{redocly-openapi-docs.min.lint-graphql-qEh9cZHx.js → redocly-openapi-docs.min.lint-graphql-Bgfcu2tP.js} +1 -1
- package/dist/redocly-openapi-docs.min.periodic-revalidation-Dsp-n7ui.js +1 -0
- package/dist/redocly-openapi-docs.min.promise-map-limit-Db_42GvV.js +1 -0
- package/dist/{redocly-openapi-docs.min.respect-run-hfNPYQ9x.js → redocly-openapi-docs.min.respect-run-Ct8taisL.js} +1 -1
- package/dist/redocly-openapi-docs.min.standalone-BPCdJgtH.js +11995 -0
- package/dist/redocly-openapi-docs.min.tauri-path-CmqBCxGb.js +1 -0
- package/dist/{redocly-openapi-docs.min.useAiChatQueries-DgSsCKMW.js → redocly-openapi-docs.min.useAiChatQueries-t8oy8jik.js} +80 -80
- package/lib/components/ApiInfo/__tests__/ApiInfo.test.d.ts +1 -0
- package/lib/components/ApiInfo/__tests__/ApiInfo.test.js +46 -0
- package/lib/components/Callbacks/CallbackOperation.js +1 -1
- package/lib/components/Callbacks/__tests__/Callbacks.test.d.ts +1 -0
- package/lib/components/Callbacks/__tests__/Callbacks.test.js +46 -0
- package/lib/components/Content/__tests__/useAutoScroll.test.d.ts +1 -0
- package/lib/components/Content/__tests__/useAutoScroll.test.js +88 -0
- package/lib/components/Content/useAutoScroll.js +1 -1
- package/lib/components/ContentItem/__tests__/useIsExpanded.test.d.ts +1 -0
- package/lib/components/ContentItem/__tests__/useIsExpanded.test.js +123 -0
- package/lib/components/ContentItem/useIsExpanded.js +1 -1
- package/lib/components/ContentItems/ContentItems.js +1 -1
- package/lib/components/ContentItems/VirtualList.js +1 -1
- package/lib/components/ContentItems/__tests__/Items.test.d.ts +1 -0
- package/lib/components/ContentItems/__tests__/Items.test.js +66 -0
- package/lib/components/ContentItems/__tests__/VirtualList.test.d.ts +1 -0
- package/lib/components/ContentItems/__tests__/VirtualList.test.js +135 -0
- package/lib/components/ContentItems/useScrollOnRender.js +1 -1
- package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.d.ts +1 -0
- package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.js +63 -0
- package/lib/components/Download/__tests__/DownloadSpecification.test.d.ts +1 -0
- package/lib/components/Download/__tests__/DownloadSpecification.test.js +52 -0
- package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.d.ts +1 -0
- package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.js +60 -0
- package/lib/components/ExpandAllButton/__tests__/helpers.test.d.ts +1 -0
- package/lib/components/ExpandAllButton/__tests__/helpers.test.js +133 -0
- package/lib/components/Language/__tests__/LanguageDropdown.test.d.ts +1 -0
- package/lib/components/Language/__tests__/LanguageDropdown.test.js +23 -0
- package/lib/components/Markdown/__tests__/Markdown.test.d.ts +1 -0
- package/lib/components/Markdown/__tests__/Markdown.test.js +34 -0
- package/lib/components/McpOverview/__tests__/McpOverview.test.d.ts +1 -0
- package/lib/components/McpOverview/__tests__/McpOverview.test.js +66 -0
- package/lib/components/McpTool/__tests__/McpPrompt.test.d.ts +1 -0
- package/lib/components/McpTool/__tests__/McpPrompt.test.js +57 -0
- package/lib/components/McpTool/__tests__/McpResource.test.d.ts +1 -0
- package/lib/components/McpTool/__tests__/McpResource.test.js +81 -0
- package/lib/components/McpTool/__tests__/McpTool.test.d.ts +1 -0
- package/lib/components/McpTool/__tests__/McpTool.test.js +82 -0
- package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.d.ts +1 -0
- package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.js +79 -0
- package/lib/components/OperationItem/__tests__/OperationItem.test.d.ts +1 -0
- package/lib/components/OperationItem/__tests__/OperationItem.test.js +70 -0
- package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.d.ts +16 -0
- package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.js +42 -0
- package/lib/components/Overview/__tests__/Overview.test.d.ts +1 -0
- package/lib/components/Overview/__tests__/Overview.test.js +59 -0
- package/lib/components/PayloadSamples/__tests__/Example.test.d.ts +1 -0
- package/lib/components/PayloadSamples/__tests__/Example.test.js +36 -0
- package/lib/components/PayloadSamples/__tests__/ExampleValue.test.d.ts +1 -0
- package/lib/components/PayloadSamples/__tests__/ExampleValue.test.js +197 -0
- package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.d.ts +1 -0
- package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.js +38 -0
- package/lib/components/PropertyDetails/__tests__/Extensions.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/Extensions.test.js +21 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetail.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetail.test.js +52 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetails.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetails.test.js +191 -0
- package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.js +365 -0
- package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.js +23 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.d.ts +1 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.js +16 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.d.ts +1 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.js +104 -0
- package/lib/components/RenderHook/__tests__/RenderHook.test.d.ts +1 -0
- package/lib/components/RenderHook/__tests__/RenderHook.test.js +15 -0
- package/lib/components/Replay/__tests__/utils.test.d.ts +1 -0
- package/lib/components/Replay/__tests__/utils.test.js +526 -0
- package/lib/components/Request/__tests__/RequestDetails.test.d.ts +1 -0
- package/lib/components/Request/__tests__/RequestDetails.test.js +98 -0
- package/lib/components/RequestSamples/__tests__/Example.test.d.ts +1 -0
- package/lib/components/RequestSamples/__tests__/Example.test.js +384 -0
- package/lib/components/RequestSamples/__tests__/RequestSamples.test.d.ts +1 -0
- package/lib/components/RequestSamples/__tests__/RequestSamples.test.js +226 -0
- package/lib/components/RequestSamples/__tests__/useCodeSamples.test.d.ts +1 -0
- package/lib/components/RequestSamples/__tests__/useCodeSamples.test.js +64 -0
- package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.d.ts +1 -0
- package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.js +29 -0
- package/lib/components/Responses/OperationResponseList.js +1 -1
- package/lib/components/Responses/__tests__/OperationResponseList.test.d.ts +1 -0
- package/lib/components/Responses/__tests__/OperationResponseList.test.js +89 -0
- package/lib/components/Responses/__tests__/ResponseDetails.test.d.ts +1 -0
- package/lib/components/Responses/__tests__/ResponseDetails.test.js +111 -0
- package/lib/components/Responses/__tests__/ResponsesHeaders.test.d.ts +1 -0
- package/lib/components/Responses/__tests__/ResponsesHeaders.test.js +26 -0
- package/lib/components/Schema/Schema.js +1 -1
- package/lib/components/Schema/SubSchema.js +1 -1
- package/lib/components/Schema/__tests__/ArraySchema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/ArraySchema.test.js +93 -0
- package/lib/components/Schema/__tests__/ObjectSchema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/ObjectSchema.test.js +115 -0
- package/lib/components/Schema/__tests__/OneOfSchema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/OneOfSchema.test.js +33 -0
- package/lib/components/Schema/__tests__/Schema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/Schema.test.js +67 -0
- package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.js +22 -0
- package/lib/components/Schema/useOneOfLocationIdx.js +1 -1
- package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.d.ts +1 -0
- package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.js +95 -0
- package/lib/components/Security/__tests__/Security.test.d.ts +1 -0
- package/lib/components/Security/__tests__/Security.test.js +38 -0
- package/lib/components/Security/__tests__/SecurityButton.test.d.ts +1 -0
- package/lib/components/Security/__tests__/SecurityButton.test.js +92 -0
- package/lib/components/Security/__tests__/SecurityModal.test.d.ts +1 -0
- package/lib/components/Security/__tests__/SecurityModal.test.js +172 -0
- package/lib/components/ServerList/__tests__/ServerList.test.d.ts +1 -0
- package/lib/components/ServerList/__tests__/ServerList.test.js +83 -0
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/StickySidebar/StickyResponsiveSidebar.js +1 -1
- package/lib/components/Tabs/__tests__/Tabs.test.d.ts +1 -0
- package/lib/components/Tabs/__tests__/Tabs.test.js +27 -0
- package/lib/components/TagItem/OperationsNavigation.js +1 -1
- package/lib/components/TagItem/TagItem.js +1 -1
- package/lib/components/ViewNested/__tests__/ViewNested.test.d.ts +1 -0
- package/lib/components/ViewNested/__tests__/ViewNested.test.js +42 -0
- package/lib/components/__tests__/Samples/ExampleSwitch.test.d.ts +1 -0
- package/lib/components/__tests__/Samples/ExampleSwitch.test.js +45 -0
- package/lib/components/__tests__/Samples/use-example-key.test.d.ts +1 -0
- package/lib/components/__tests__/Samples/use-example-key.test.js +28 -0
- package/lib/components/__tests__/common/ClearButton.test.d.ts +1 -0
- package/lib/components/__tests__/common/ClearButton.test.js +18 -0
- package/lib/components/__tests__/common/Dropdown.test.d.ts +1 -0
- package/lib/components/__tests__/common/Dropdown.test.js +52 -0
- package/lib/components/__tests__/mocks/examples.d.ts +4 -0
- package/lib/components/__tests__/mocks/examples.js +115 -0
- package/lib/components/common/LinkToField.js +1 -1
- package/lib/components/common/__tests__/Dropdown.test.d.ts +1 -0
- package/lib/components/common/__tests__/Dropdown.test.js +129 -0
- package/lib/components/common/__tests__/LinkToField.test.d.ts +1 -0
- package/lib/components/common/__tests__/LinkToField.test.js +39 -0
- package/lib/components/common/linkify.js +1 -1
- package/lib/hooks/useRouter.js +1 -1
- package/lib/hooks/useUppercase2LowercaseRedirect.js +1 -1
- package/lib/jotai/__tests__/app.test.d.ts +1 -0
- package/lib/jotai/__tests__/app.test.js +53 -0
- package/lib/models/__tests__/Callback.test.d.ts +1 -0
- package/lib/models/__tests__/Callback.test.js +15 -0
- package/lib/models/__tests__/FieldModel.test.d.ts +1 -0
- package/lib/models/__tests__/FieldModel.test.js +117 -0
- package/lib/models/__tests__/MediaContent.test.d.ts +1 -0
- package/lib/models/__tests__/MediaContent.test.js +105 -0
- package/lib/models/__tests__/Operation.test.d.ts +1 -0
- package/lib/models/__tests__/Operation.test.js +459 -0
- package/lib/models/__tests__/Response.test.d.ts +1 -0
- package/lib/models/__tests__/Response.test.js +221 -0
- package/lib/models/__tests__/Schema.circular.test.d.ts +1 -0
- package/lib/models/__tests__/Schema.circular.test.js +694 -0
- package/lib/models/__tests__/Schema.test.d.ts +1 -0
- package/lib/models/__tests__/Schema.test.js +1395 -0
- package/lib/models/__tests__/example.test.d.ts +1 -0
- package/lib/models/__tests__/example.test.js +90 -0
- package/lib/models/__tests__/group.test.d.ts +1 -0
- package/lib/models/__tests__/group.test.js +52 -0
- package/lib/models/__tests__/helpers.d.ts +5 -0
- package/lib/models/__tests__/helpers.js +62 -0
- package/lib/models/__tests__/request.test.d.ts +1 -0
- package/lib/models/__tests__/request.test.js +119 -0
- package/lib/services/__tests__/OpenAPIParser.test.d.ts +1 -0
- package/lib/services/__tests__/OpenAPIParser.test.js +80 -0
- package/lib/services/__tests__/check.test.d.ts +1 -0
- package/lib/services/__tests__/check.test.js +22 -0
- package/lib/services/__tests__/utils.test.d.ts +1 -0
- package/lib/services/__tests__/utils.test.js +42 -0
- package/lib/services/code-samples/__tests__/apply-environments.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/apply-environments.test.js +64 -0
- package/lib/services/code-samples/__tests__/build-code-samples.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/build-code-samples.test.js +70 -0
- package/lib/services/code-samples/__tests__/convertSampleToString.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/convertSampleToString.test.js +116 -0
- package/lib/services/code-samples/__tests__/generator-data-value.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/generator-data-value.test.js +277 -0
- package/lib/services/code-samples/__tests__/generator-serialized-value.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/generator-serialized-value.test.js +258 -0
- package/lib/services/code-samples/__tests__/generator-value.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/generator-value.test.js +273 -0
- package/lib/services/code-samples/__tests__/generator.test.d.ts +249 -0
- package/lib/services/code-samples/__tests__/generator.test.js +1201 -0
- package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.js +31 -0
- package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.js +222 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.js +129 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.js +49 -0
- package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.js +172 -0
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.js +172 -0
- package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.js +130 -0
- package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.js +191 -0
- package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.js +172 -0
- package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.js +85 -0
- package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.js +85 -0
- package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.js +126 -0
- package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.js +105 -0
- package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.js +126 -0
- package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.js +129 -0
- package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.js +129 -0
- package/lib/services/config-options/__tests__/helpers.test.d.ts +1 -0
- package/lib/services/config-options/__tests__/helpers.test.js +234 -0
- package/lib/services/history/__tests__/helpers.test.d.ts +1 -0
- package/lib/services/history/__tests__/helpers.test.js +19 -0
- package/lib/services/menu/__tests__/buildNestedTagsItems.test.d.ts +1 -0
- package/lib/services/menu/__tests__/buildNestedTagsItems.test.js +109 -0
- package/lib/services/menu/__tests__/builder.test.d.ts +1 -0
- package/lib/services/menu/__tests__/builder.test.js +307 -0
- package/lib/services/menu/__tests__/operation.test.d.ts +1 -0
- package/lib/services/menu/__tests__/operation.test.js +240 -0
- package/lib/services/menu/__tests__/tags.test.d.ts +1 -0
- package/lib/services/menu/__tests__/tags.test.js +71 -0
- package/lib/telemetry/RedocTelemetry.js +31 -1
- package/lib/telemetry/__tests__/RedocTelemetry.test.d.ts +1 -0
- package/lib/telemetry/__tests__/RedocTelemetry.test.js +107 -0
- package/lib/testProviders.d.ts +6 -0
- package/lib/testProviders.js +14 -0
- package/lib/utils/__tests__/areArraysEqual.test.d.ts +1 -0
- package/lib/utils/__tests__/areArraysEqual.test.js +33 -0
- package/lib/utils/__tests__/argValuesHelpers.d.ts +1 -0
- package/lib/utils/__tests__/argValuesHelpers.js +56 -0
- package/lib/utils/__tests__/calculateMaxLength.test.d.ts +1 -0
- package/lib/utils/__tests__/calculateMaxLength.test.js +119 -0
- package/lib/utils/__tests__/configure-helpers.test.d.ts +1 -0
- package/lib/utils/__tests__/configure-helpers.test.js +356 -0
- package/lib/utils/__tests__/convertSwagger2OpenAPI.test.d.ts +1 -0
- package/lib/utils/__tests__/convertSwagger2OpenAPI.test.js +392 -0
- package/lib/utils/__tests__/debounce.test.d.ts +1 -0
- package/lib/utils/__tests__/debounce.test.js +54 -0
- package/lib/utils/__tests__/debug.test.d.ts +1 -0
- package/lib/utils/__tests__/debug.test.js +23 -0
- package/lib/utils/__tests__/dom.test.d.ts +1 -0
- package/lib/utils/__tests__/dom.test.js +108 -0
- package/lib/utils/__tests__/getBreadcrumbs.test.d.ts +1 -0
- package/lib/utils/__tests__/getBreadcrumbs.test.js +98 -0
- package/lib/utils/__tests__/hasNestedFields.test.d.ts +1 -0
- package/lib/utils/__tests__/hasNestedFields.test.js +147 -0
- package/lib/utils/__tests__/helpers.test.d.ts +1 -0
- package/lib/utils/__tests__/helpers.test.js +174 -0
- package/lib/utils/__tests__/isMobile.test.d.ts +1 -0
- package/lib/utils/__tests__/isMobile.test.js +28 -0
- package/lib/utils/__tests__/loadAndBundleSpec.test.d.ts +1 -0
- package/lib/utils/__tests__/loadAndBundleSpec.test.js +22 -0
- package/lib/utils/__tests__/local-storage.test.d.ts +1 -0
- package/lib/utils/__tests__/local-storage.test.js +48 -0
- package/lib/utils/__tests__/object.test.d.ts +1 -0
- package/lib/utils/__tests__/object.test.js +45 -0
- package/lib/utils/__tests__/openapi.test.d.ts +1 -0
- package/lib/utils/__tests__/openapi.test.js +1378 -0
- package/lib/utils/__tests__/path.test.d.ts +1 -0
- package/lib/utils/__tests__/path.test.js +16 -0
- package/lib/utils/__tests__/queryString.test.d.ts +1 -0
- package/lib/utils/__tests__/queryString.test.js +60 -0
- package/lib/utils/__tests__/replaceVariables.test.d.ts +1 -0
- package/lib/utils/__tests__/replaceVariables.test.js +46 -0
- package/lib/utils/__tests__/simplifyAstStructure.test.d.ts +1 -0
- package/lib/utils/__tests__/simplifyAstStructure.test.js +26 -0
- package/lib/utils/__tests__/sort.test.d.ts +1 -0
- package/lib/utils/__tests__/sort.test.js +16 -0
- package/lib/utils/__tests__/string.test.d.ts +1 -0
- package/lib/utils/__tests__/string.test.js +16 -0
- package/lib/utils/__tests__/theme-helpers.test.d.ts +1 -0
- package/lib/utils/__tests__/theme-helpers.test.js +24 -0
- package/lib/utils/__tests__/url.test.d.ts +1 -0
- package/lib/utils/__tests__/url.test.js +134 -0
- package/lib/utils/path.d.ts +1 -1
- package/package.json +12 -12
- package/dist/redocly-openapi-docs.min.ai-chat-mappers-MY79QAeW.js +0 -1
- package/dist/redocly-openapi-docs.min.external-resolver-3KMJv7SC.js +0 -2
- package/dist/redocly-openapi-docs.min.index-BYVMr_la.js +0 -1
- package/dist/redocly-openapi-docs.min.index-CsqzTi3Z.js +0 -7586
- package/dist/redocly-openapi-docs.min.index-D8F7x0S6.js +0 -1
- package/dist/redocly-openapi-docs.min.index-qqKTpI_q.js +0 -1
- package/dist/redocly-openapi-docs.min.standalone-Ci6886Cr.js +0 -12114
- package/dist/redocly-openapi-docs.min.tauri-path-Bs1-AQjc.js +0 -1
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { updateObjectProperties, createSecurityUpdates, updateServerVariablesWithUserValues, } from '../index.js';
|
|
2
|
+
import { isDirectConfigureRequestValues } from '@redocly/theme/ext/configure';
|
|
3
|
+
describe('Utils', () => {
|
|
4
|
+
describe('configure-helpers updateObjectProperties', () => {
|
|
5
|
+
it('Should update object with new values for existing properties', () => {
|
|
6
|
+
const originalObject = {
|
|
7
|
+
name: 'Museum Hours',
|
|
8
|
+
items: [
|
|
9
|
+
{
|
|
10
|
+
date: '2023-10-29',
|
|
11
|
+
timeOpen: '09:00',
|
|
12
|
+
timeClose: '18:00',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
};
|
|
16
|
+
const newValues = {
|
|
17
|
+
location: 'Grand Exhibition Hall',
|
|
18
|
+
name: 'John Doe Prod',
|
|
19
|
+
items: [
|
|
20
|
+
{
|
|
21
|
+
date: '2024-01-13',
|
|
22
|
+
timeOpen: '08:00',
|
|
23
|
+
timeClose: '15:00',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
artifacts: [
|
|
27
|
+
{
|
|
28
|
+
artifactId: 'prod-artifact-777',
|
|
29
|
+
artifactNumber: 777,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
visitors: [
|
|
33
|
+
{
|
|
34
|
+
visitorId: 'prod-visitor-345-678',
|
|
35
|
+
visitorNumber: 678,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
const expectedObject = {
|
|
40
|
+
name: 'John Doe Prod',
|
|
41
|
+
items: [
|
|
42
|
+
{
|
|
43
|
+
date: '2024-01-13',
|
|
44
|
+
timeOpen: '08:00',
|
|
45
|
+
timeClose: '15:00',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
expect(updateObjectProperties(originalObject, newValues)).toStrictEqual(expectedObject);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('configure-helpers createSecurityUpdates', () => {
|
|
53
|
+
it('Should create security updates', () => {
|
|
54
|
+
const scheme = {
|
|
55
|
+
type: 'http',
|
|
56
|
+
scheme: 'basic',
|
|
57
|
+
id: 'MuseumPlaceholderAuth',
|
|
58
|
+
sectionId: 'MuseumPlaceholderAuth',
|
|
59
|
+
scopes: [],
|
|
60
|
+
serverValues: {
|
|
61
|
+
'https://api.fake-museum-example.com/{version}': {
|
|
62
|
+
scopes: [],
|
|
63
|
+
'x-defaultUsername': 'prod_api_user',
|
|
64
|
+
'x-defaultPassword': 'Pr0d@P!S3cur3',
|
|
65
|
+
},
|
|
66
|
+
'https://dev.api.fake-museum-example.com/v1.1': {
|
|
67
|
+
scopes: [],
|
|
68
|
+
'x-defaultUsername': 'dev_api_user',
|
|
69
|
+
'x-defaultPassword': 'Dev@P!T3st',
|
|
70
|
+
},
|
|
71
|
+
'https://stage.api.fake-museum-example.com/v1.1': {
|
|
72
|
+
scopes: [],
|
|
73
|
+
'x-defaultUsername': 'api_user',
|
|
74
|
+
'x-defaultPassword': 'secureP@ssword123',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
const securityValues = {
|
|
79
|
+
MuseumPlaceholderAuth: {
|
|
80
|
+
username: 'prod_api_user',
|
|
81
|
+
password: 'Pr0d@P!S3cur3',
|
|
82
|
+
token: {
|
|
83
|
+
access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
const expectedObject = {
|
|
88
|
+
scopes: [],
|
|
89
|
+
'x-defaultClientId': undefined,
|
|
90
|
+
'x-defaultClientSecret': undefined,
|
|
91
|
+
'x-defaultUsername': 'prod_api_user',
|
|
92
|
+
'x-defaultPassword': 'Pr0d@P!S3cur3',
|
|
93
|
+
};
|
|
94
|
+
expect(createSecurityUpdates(scheme, securityValues)).toStrictEqual(expectedObject);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
describe('configure-helpers isDirectConfigureRequestValues', () => {
|
|
98
|
+
it('Should return true if the value is a direct request values', () => {
|
|
99
|
+
const directRequestValues = {
|
|
100
|
+
body: {
|
|
101
|
+
location: 'Grand Exhibition Hall',
|
|
102
|
+
name: 'John Doe Prod',
|
|
103
|
+
},
|
|
104
|
+
security: {
|
|
105
|
+
default: {
|
|
106
|
+
username: 'prod_api_user',
|
|
107
|
+
password: 'Pr0d@P!S3cur3',
|
|
108
|
+
token: {
|
|
109
|
+
access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
expect(isDirectConfigureRequestValues(directRequestValues)).toBe(true);
|
|
115
|
+
});
|
|
116
|
+
it('Should return false if the value is not a direct request values', () => {
|
|
117
|
+
const serverRequestValues = {
|
|
118
|
+
'https://api.fake-museum-example.com/{version}': {
|
|
119
|
+
body: {
|
|
120
|
+
location: 'Grand Exhibition Hall',
|
|
121
|
+
name: 'John Doe Prod',
|
|
122
|
+
},
|
|
123
|
+
security: {
|
|
124
|
+
default: {
|
|
125
|
+
username: 'prod_api_user',
|
|
126
|
+
password: 'Pr0d@P!S3cur3',
|
|
127
|
+
token: {
|
|
128
|
+
access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
'https://dev.api.fake-museum-example.com/v1.1': {
|
|
134
|
+
body: {
|
|
135
|
+
location: 'Development Testing Hall',
|
|
136
|
+
eventDescription: 'Testing event configurations in development',
|
|
137
|
+
name: 'John Doe Dev',
|
|
138
|
+
},
|
|
139
|
+
security: {
|
|
140
|
+
default: {
|
|
141
|
+
username: 'dev_api_user',
|
|
142
|
+
password: 'Dev@P!T3st',
|
|
143
|
+
token: {
|
|
144
|
+
access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
expect(isDirectConfigureRequestValues(serverRequestValues)).toBe(false);
|
|
151
|
+
});
|
|
152
|
+
it('Should return true if the value contains serverVariables', () => {
|
|
153
|
+
const directRequestValuesWithServerVariables = {
|
|
154
|
+
serverVariables: {
|
|
155
|
+
version: 'v2',
|
|
156
|
+
environment: 'staging',
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
expect(isDirectConfigureRequestValues(directRequestValuesWithServerVariables)).toBe(true);
|
|
160
|
+
});
|
|
161
|
+
it('Should return true if the value contains inputHints only', () => {
|
|
162
|
+
const directRequestValuesWithInputHints = {
|
|
163
|
+
inputHints: {
|
|
164
|
+
bearerAuth_token: {
|
|
165
|
+
title: 'Sign in to auto-fill',
|
|
166
|
+
text: 'Sign in first.',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
expect(isDirectConfigureRequestValues(directRequestValuesWithInputHints)).toBe(true);
|
|
171
|
+
});
|
|
172
|
+
it('Should return false when server-keyed values include a top-level inputHints sibling', () => {
|
|
173
|
+
const serverRequestValuesWithTopLevelInputHints = {
|
|
174
|
+
'https://{host}/v1.1': {
|
|
175
|
+
security: {
|
|
176
|
+
default: {
|
|
177
|
+
username: 'user',
|
|
178
|
+
password: 'password',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
inputHints: {
|
|
183
|
+
bearerAuth_token: {
|
|
184
|
+
title: 'Sign in to auto-fill',
|
|
185
|
+
text: 'Sign in first.',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
expect(isDirectConfigureRequestValues(serverRequestValuesWithTopLevelInputHints)).toBe(false);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
describe('configure-helpers updateServerVariablesWithUserValues', () => {
|
|
193
|
+
let mockOperation;
|
|
194
|
+
beforeEach(() => {
|
|
195
|
+
mockOperation = {
|
|
196
|
+
servers: [
|
|
197
|
+
{
|
|
198
|
+
url: 'https://api.example.com/{version}/{environment}',
|
|
199
|
+
variables: {
|
|
200
|
+
version: { default: 'v1' },
|
|
201
|
+
environment: { default: 'prod' },
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
url: 'https://dev.api.example.com/{version}',
|
|
206
|
+
variables: {
|
|
207
|
+
version: { default: 'v1' },
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
it('should update server variables for all servers when no serverUrl is provided', () => {
|
|
214
|
+
const serverVariables = {
|
|
215
|
+
version: 'v2',
|
|
216
|
+
environment: 'staging',
|
|
217
|
+
};
|
|
218
|
+
updateServerVariablesWithUserValues(mockOperation, serverVariables);
|
|
219
|
+
expect(mockOperation.servers[0].variables.version.default).toBe('v2');
|
|
220
|
+
expect(mockOperation.servers[0].variables.environment.default).toBe('staging');
|
|
221
|
+
expect(mockOperation.servers[1].variables.version.default).toBe('v2');
|
|
222
|
+
expect(mockOperation.servers[1].variables.environment).toBeUndefined();
|
|
223
|
+
});
|
|
224
|
+
it('should update server variables for specific server when serverUrl is provided', () => {
|
|
225
|
+
const serverVariables = {
|
|
226
|
+
version: 'v3',
|
|
227
|
+
environment: 'development',
|
|
228
|
+
};
|
|
229
|
+
const targetServerUrl = 'https://api.example.com/{version}/{environment}';
|
|
230
|
+
updateServerVariablesWithUserValues(mockOperation, serverVariables, targetServerUrl);
|
|
231
|
+
expect(mockOperation.servers[0].variables.version.default).toBe('v3');
|
|
232
|
+
expect(mockOperation.servers[0].variables.environment.default).toBe('development');
|
|
233
|
+
expect(mockOperation.servers[1].variables.version.default).toBe('v1');
|
|
234
|
+
});
|
|
235
|
+
it('should not update non-existent server variables', () => {
|
|
236
|
+
const serverVariables = {
|
|
237
|
+
nonExistentVar: 'should-not-be-added',
|
|
238
|
+
version: 'v2',
|
|
239
|
+
};
|
|
240
|
+
updateServerVariablesWithUserValues(mockOperation, serverVariables);
|
|
241
|
+
expect(mockOperation.servers[0].variables.version.default).toBe('v2');
|
|
242
|
+
expect(mockOperation.servers[0].variables.nonExistentVar).toBeUndefined();
|
|
243
|
+
});
|
|
244
|
+
it('should handle empty serverVariables object', () => {
|
|
245
|
+
const originalVersion = mockOperation.servers[0].variables.version.default;
|
|
246
|
+
const originalEnvironment = mockOperation.servers[0].variables.environment.default;
|
|
247
|
+
updateServerVariablesWithUserValues(mockOperation, {});
|
|
248
|
+
expect(mockOperation.servers[0].variables.version.default).toBe(originalVersion);
|
|
249
|
+
expect(mockOperation.servers[0].variables.environment.default).toBe(originalEnvironment);
|
|
250
|
+
});
|
|
251
|
+
it('should handle undefined serverVariables', () => {
|
|
252
|
+
const originalVersion = mockOperation.servers[0].variables.version.default;
|
|
253
|
+
const originalEnvironment = mockOperation.servers[0].variables.environment.default;
|
|
254
|
+
updateServerVariablesWithUserValues(mockOperation, undefined);
|
|
255
|
+
expect(mockOperation.servers[0].variables.version.default).toBe(originalVersion);
|
|
256
|
+
expect(mockOperation.servers[0].variables.environment.default).toBe(originalEnvironment);
|
|
257
|
+
});
|
|
258
|
+
it('should preserve other variable properties when updating default values', () => {
|
|
259
|
+
const operationWithExtendedVariables = {
|
|
260
|
+
servers: [
|
|
261
|
+
{
|
|
262
|
+
url: 'https://api.example.com/{version}',
|
|
263
|
+
variables: {
|
|
264
|
+
version: {
|
|
265
|
+
default: 'v1',
|
|
266
|
+
enum: ['v1', 'v2', 'v3'],
|
|
267
|
+
description: 'API version',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
};
|
|
273
|
+
const serverVariables = {
|
|
274
|
+
version: 'v2',
|
|
275
|
+
};
|
|
276
|
+
updateServerVariablesWithUserValues(operationWithExtendedVariables, serverVariables);
|
|
277
|
+
expect(operationWithExtendedVariables.servers?.[0].variables?.version.default).toBe('v2');
|
|
278
|
+
expect(operationWithExtendedVariables.servers?.[0].variables?.version.enum).toEqual([
|
|
279
|
+
'v1',
|
|
280
|
+
'v2',
|
|
281
|
+
'v3',
|
|
282
|
+
]);
|
|
283
|
+
expect(operationWithExtendedVariables.servers?.[0].variables?.version.description).toBe('API version');
|
|
284
|
+
});
|
|
285
|
+
it('should handle partial serverVariables updates', () => {
|
|
286
|
+
const serverVariables = {
|
|
287
|
+
version: 'v2',
|
|
288
|
+
};
|
|
289
|
+
updateServerVariablesWithUserValues(mockOperation, serverVariables);
|
|
290
|
+
expect(mockOperation.servers[0].variables.version.default).toBe('v2');
|
|
291
|
+
expect(mockOperation.servers[0].variables.environment.default).toBe('prod');
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
describe('createSecurityUpdates - security resolution logic', () => {
|
|
295
|
+
it('should use scheme-specific values when scheme.id matches a key in securityValues', () => {
|
|
296
|
+
const scheme = {
|
|
297
|
+
id: 'MyApiKey',
|
|
298
|
+
type: 'apiKey',
|
|
299
|
+
in: 'header',
|
|
300
|
+
name: 'X-API-Key',
|
|
301
|
+
};
|
|
302
|
+
const securityValues = {
|
|
303
|
+
MyApiKey: {
|
|
304
|
+
token: {
|
|
305
|
+
access_token: 'scheme-specific-token',
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
default: {
|
|
309
|
+
token: {
|
|
310
|
+
access_token: 'default-token',
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
const result = createSecurityUpdates(scheme, securityValues);
|
|
315
|
+
expect(result['x-defaultAccessToken']).toBe('scheme-specific-token');
|
|
316
|
+
});
|
|
317
|
+
it('should fallback to default values when scheme.id does not match any key', () => {
|
|
318
|
+
const scheme = {
|
|
319
|
+
id: 'UnknownScheme',
|
|
320
|
+
type: 'http',
|
|
321
|
+
scheme: 'bearer',
|
|
322
|
+
};
|
|
323
|
+
const securityValues = {
|
|
324
|
+
SomeOtherScheme: {
|
|
325
|
+
token: {
|
|
326
|
+
access_token: 'other-token',
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
default: {
|
|
330
|
+
token: {
|
|
331
|
+
access_token: 'fallback-token',
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
const result = createSecurityUpdates(scheme, securityValues);
|
|
336
|
+
expect(result['x-defaultAccessToken']).toBe('fallback-token');
|
|
337
|
+
});
|
|
338
|
+
it('should return empty object values when neither scheme.id nor default key exist', () => {
|
|
339
|
+
const scheme = {
|
|
340
|
+
id: 'MissingScheme',
|
|
341
|
+
type: 'http',
|
|
342
|
+
scheme: 'bearer',
|
|
343
|
+
};
|
|
344
|
+
const securityValues = {
|
|
345
|
+
CompletelyDifferentScheme: {
|
|
346
|
+
token: {
|
|
347
|
+
access_token: 'unrelated-token',
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
const result = createSecurityUpdates(scheme, securityValues);
|
|
352
|
+
expect(result['x-defaultAccessToken']).toBeUndefined();
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
//# sourceMappingURL=configure-helpers.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|