@redocly/openapi-docs 3.24.1 → 3.25.0-next.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.
Files changed (283) hide show
  1. package/dist/{redocly-openapi-docs.min.AiChatProvider-j-VDfFJ9.js → redocly-openapi-docs.min.AiChatProvider-CDMc3dS6.js} +1 -1
  2. package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-BBRBmffc.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-BopXqcPv.js} +1 -1
  3. package/dist/{redocly-openapi-docs.min.AiPanel-DTzHqAiI.js → redocly-openapi-docs.min.AiPanel-DkXOeLs5.js} +1 -1
  4. package/dist/redocly-openapi-docs.min.FileWatcher-DMjNW66W.js +1 -0
  5. package/dist/{redocly-openapi-docs.min.SemanticSearchService-DNFOPBZK.js → redocly-openapi-docs.min.SemanticSearchService-DbpnWseN.js} +1 -1
  6. package/dist/{redocly-openapi-docs.min.SqliteDBStorage-Dy40Vq04.js → redocly-openapi-docs.min.SqliteDBStorage-ak3Zqgtw.js} +1 -1
  7. package/dist/{redocly-openapi-docs.min.TauriFileSystemAdapter-CpViFqJQ.js → redocly-openapi-docs.min.TauriFileSystemAdapter-Dl2fY3am.js} +1 -1
  8. package/dist/{redocly-openapi-docs.min.TauriRootStorage-TCUrp2uB.js → redocly-openapi-docs.min.TauriRootStorage-m4plsfqx.js} +1 -1
  9. package/dist/{redocly-openapi-docs.min.ai-chat-mappers-CmX-8902.js → redocly-openapi-docs.min.ai-chat-mappers-Dg8U8w8r.js} +1 -1
  10. package/dist/{redocly-openapi-docs.min.external-resolver-BkceRyB4.js → redocly-openapi-docs.min.external-resolver-Db7hewsm.js} +1 -1
  11. package/dist/{redocly-openapi-docs.min.index-BCcol5vU.js → redocly-openapi-docs.min.index-B5-R6EGY.js} +1 -1
  12. package/dist/{redocly-openapi-docs.min.index-CmXZfuiZ.js → redocly-openapi-docs.min.index-D9U4Tk7n.js} +1320 -1213
  13. package/dist/{redocly-openapi-docs.min.index-DVWw0ICA.js → redocly-openapi-docs.min.index-DeHk4n2z.js} +1 -1
  14. package/dist/{redocly-openapi-docs.min.index-C6uU_v-b.js → redocly-openapi-docs.min.index-EVRmC_IQ.js} +1 -1
  15. package/dist/redocly-openapi-docs.min.js +1 -1
  16. package/dist/{redocly-openapi-docs.min.lint-2YpbCz3r.js → redocly-openapi-docs.min.lint-PvmGrAK3.js} +2 -2
  17. package/dist/{redocly-openapi-docs.min.lint-graphql-Bgfcu2tP.js → redocly-openapi-docs.min.lint-graphql-CMMhYVr_.js} +1 -1
  18. package/dist/{redocly-openapi-docs.min.respect-run-Ct8taisL.js → redocly-openapi-docs.min.respect-run-DgsYdmxw.js} +1 -1
  19. package/dist/{redocly-openapi-docs.min.standalone-BPCdJgtH.js → redocly-openapi-docs.min.standalone-D9becCWS.js} +708 -673
  20. package/dist/redocly-openapi-docs.min.tauri-path-Bv9A5DVf.js +1 -0
  21. package/dist/{redocly-openapi-docs.min.useAiChatQueries-t8oy8jik.js → redocly-openapi-docs.min.useAiChatQueries-Cb-1pa0w.js} +2 -2
  22. package/lib/telemetry/RedocTelemetry.js +1 -31
  23. package/package.json +5 -5
  24. package/dist/redocly-openapi-docs.min.FileWatcher-DDoyaS7A.js +0 -1
  25. package/dist/redocly-openapi-docs.min.tauri-path-CmqBCxGb.js +0 -1
  26. package/lib/components/ApiInfo/__tests__/ApiInfo.test.d.ts +0 -1
  27. package/lib/components/ApiInfo/__tests__/ApiInfo.test.js +0 -46
  28. package/lib/components/Callbacks/__tests__/Callbacks.test.d.ts +0 -1
  29. package/lib/components/Callbacks/__tests__/Callbacks.test.js +0 -46
  30. package/lib/components/Content/__tests__/useAutoScroll.test.d.ts +0 -1
  31. package/lib/components/Content/__tests__/useAutoScroll.test.js +0 -88
  32. package/lib/components/ContentItem/__tests__/useIsExpanded.test.d.ts +0 -1
  33. package/lib/components/ContentItem/__tests__/useIsExpanded.test.js +0 -123
  34. package/lib/components/ContentItems/__tests__/Items.test.d.ts +0 -1
  35. package/lib/components/ContentItems/__tests__/Items.test.js +0 -66
  36. package/lib/components/ContentItems/__tests__/VirtualList.test.d.ts +0 -1
  37. package/lib/components/ContentItems/__tests__/VirtualList.test.js +0 -135
  38. package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.d.ts +0 -1
  39. package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.js +0 -63
  40. package/lib/components/Download/__tests__/DownloadSpecification.test.d.ts +0 -1
  41. package/lib/components/Download/__tests__/DownloadSpecification.test.js +0 -52
  42. package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.d.ts +0 -1
  43. package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.js +0 -60
  44. package/lib/components/ExpandAllButton/__tests__/helpers.test.d.ts +0 -1
  45. package/lib/components/ExpandAllButton/__tests__/helpers.test.js +0 -133
  46. package/lib/components/Language/__tests__/LanguageDropdown.test.d.ts +0 -1
  47. package/lib/components/Language/__tests__/LanguageDropdown.test.js +0 -23
  48. package/lib/components/Markdown/__tests__/Markdown.test.d.ts +0 -1
  49. package/lib/components/Markdown/__tests__/Markdown.test.js +0 -34
  50. package/lib/components/McpOverview/__tests__/McpOverview.test.d.ts +0 -1
  51. package/lib/components/McpOverview/__tests__/McpOverview.test.js +0 -66
  52. package/lib/components/McpTool/__tests__/McpPrompt.test.d.ts +0 -1
  53. package/lib/components/McpTool/__tests__/McpPrompt.test.js +0 -57
  54. package/lib/components/McpTool/__tests__/McpResource.test.d.ts +0 -1
  55. package/lib/components/McpTool/__tests__/McpResource.test.js +0 -81
  56. package/lib/components/McpTool/__tests__/McpTool.test.d.ts +0 -1
  57. package/lib/components/McpTool/__tests__/McpTool.test.js +0 -82
  58. package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.d.ts +0 -1
  59. package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.js +0 -79
  60. package/lib/components/OperationItem/__tests__/OperationItem.test.d.ts +0 -1
  61. package/lib/components/OperationItem/__tests__/OperationItem.test.js +0 -70
  62. package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.d.ts +0 -16
  63. package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.js +0 -42
  64. package/lib/components/Overview/__tests__/Overview.test.d.ts +0 -1
  65. package/lib/components/Overview/__tests__/Overview.test.js +0 -59
  66. package/lib/components/PayloadSamples/__tests__/Example.test.d.ts +0 -1
  67. package/lib/components/PayloadSamples/__tests__/Example.test.js +0 -36
  68. package/lib/components/PayloadSamples/__tests__/ExampleValue.test.d.ts +0 -1
  69. package/lib/components/PayloadSamples/__tests__/ExampleValue.test.js +0 -197
  70. package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.d.ts +0 -1
  71. package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.js +0 -38
  72. package/lib/components/PropertyDetails/__tests__/Extensions.test.d.ts +0 -1
  73. package/lib/components/PropertyDetails/__tests__/Extensions.test.js +0 -21
  74. package/lib/components/PropertyDetails/__tests__/FieldDetail.test.d.ts +0 -1
  75. package/lib/components/PropertyDetails/__tests__/FieldDetail.test.js +0 -52
  76. package/lib/components/PropertyDetails/__tests__/FieldDetails.test.d.ts +0 -1
  77. package/lib/components/PropertyDetails/__tests__/FieldDetails.test.js +0 -191
  78. package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.d.ts +0 -1
  79. package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.js +0 -365
  80. package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.d.ts +0 -1
  81. package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.js +0 -23
  82. package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.d.ts +0 -1
  83. package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.js +0 -16
  84. package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.d.ts +0 -1
  85. package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.js +0 -104
  86. package/lib/components/RenderHook/__tests__/RenderHook.test.d.ts +0 -1
  87. package/lib/components/RenderHook/__tests__/RenderHook.test.js +0 -15
  88. package/lib/components/Replay/__tests__/utils.test.d.ts +0 -1
  89. package/lib/components/Replay/__tests__/utils.test.js +0 -526
  90. package/lib/components/Request/__tests__/RequestDetails.test.d.ts +0 -1
  91. package/lib/components/Request/__tests__/RequestDetails.test.js +0 -98
  92. package/lib/components/RequestSamples/__tests__/Example.test.d.ts +0 -1
  93. package/lib/components/RequestSamples/__tests__/Example.test.js +0 -384
  94. package/lib/components/RequestSamples/__tests__/RequestSamples.test.d.ts +0 -1
  95. package/lib/components/RequestSamples/__tests__/RequestSamples.test.js +0 -226
  96. package/lib/components/RequestSamples/__tests__/useCodeSamples.test.d.ts +0 -1
  97. package/lib/components/RequestSamples/__tests__/useCodeSamples.test.js +0 -64
  98. package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.d.ts +0 -1
  99. package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.js +0 -29
  100. package/lib/components/Responses/__tests__/OperationResponseList.test.d.ts +0 -1
  101. package/lib/components/Responses/__tests__/OperationResponseList.test.js +0 -89
  102. package/lib/components/Responses/__tests__/ResponseDetails.test.d.ts +0 -1
  103. package/lib/components/Responses/__tests__/ResponseDetails.test.js +0 -111
  104. package/lib/components/Responses/__tests__/ResponsesHeaders.test.d.ts +0 -1
  105. package/lib/components/Responses/__tests__/ResponsesHeaders.test.js +0 -26
  106. package/lib/components/Schema/__tests__/ArraySchema.test.d.ts +0 -1
  107. package/lib/components/Schema/__tests__/ArraySchema.test.js +0 -93
  108. package/lib/components/Schema/__tests__/ObjectSchema.test.d.ts +0 -1
  109. package/lib/components/Schema/__tests__/ObjectSchema.test.js +0 -115
  110. package/lib/components/Schema/__tests__/OneOfSchema.test.d.ts +0 -1
  111. package/lib/components/Schema/__tests__/OneOfSchema.test.js +0 -33
  112. package/lib/components/Schema/__tests__/Schema.test.d.ts +0 -1
  113. package/lib/components/Schema/__tests__/Schema.test.js +0 -67
  114. package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.d.ts +0 -1
  115. package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.js +0 -22
  116. package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.d.ts +0 -1
  117. package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.js +0 -95
  118. package/lib/components/Security/__tests__/Security.test.d.ts +0 -1
  119. package/lib/components/Security/__tests__/Security.test.js +0 -38
  120. package/lib/components/Security/__tests__/SecurityButton.test.d.ts +0 -1
  121. package/lib/components/Security/__tests__/SecurityButton.test.js +0 -92
  122. package/lib/components/Security/__tests__/SecurityModal.test.d.ts +0 -1
  123. package/lib/components/Security/__tests__/SecurityModal.test.js +0 -172
  124. package/lib/components/ServerList/__tests__/ServerList.test.d.ts +0 -1
  125. package/lib/components/ServerList/__tests__/ServerList.test.js +0 -83
  126. package/lib/components/Tabs/__tests__/Tabs.test.d.ts +0 -1
  127. package/lib/components/Tabs/__tests__/Tabs.test.js +0 -27
  128. package/lib/components/ViewNested/__tests__/ViewNested.test.d.ts +0 -1
  129. package/lib/components/ViewNested/__tests__/ViewNested.test.js +0 -42
  130. package/lib/components/__tests__/Samples/ExampleSwitch.test.d.ts +0 -1
  131. package/lib/components/__tests__/Samples/ExampleSwitch.test.js +0 -45
  132. package/lib/components/__tests__/Samples/use-example-key.test.d.ts +0 -1
  133. package/lib/components/__tests__/Samples/use-example-key.test.js +0 -28
  134. package/lib/components/__tests__/common/ClearButton.test.d.ts +0 -1
  135. package/lib/components/__tests__/common/ClearButton.test.js +0 -18
  136. package/lib/components/__tests__/common/Dropdown.test.d.ts +0 -1
  137. package/lib/components/__tests__/common/Dropdown.test.js +0 -52
  138. package/lib/components/__tests__/mocks/examples.d.ts +0 -4
  139. package/lib/components/__tests__/mocks/examples.js +0 -115
  140. package/lib/components/common/__tests__/Dropdown.test.d.ts +0 -1
  141. package/lib/components/common/__tests__/Dropdown.test.js +0 -129
  142. package/lib/components/common/__tests__/LinkToField.test.d.ts +0 -1
  143. package/lib/components/common/__tests__/LinkToField.test.js +0 -39
  144. package/lib/jotai/__tests__/app.test.d.ts +0 -1
  145. package/lib/jotai/__tests__/app.test.js +0 -53
  146. package/lib/models/__tests__/Callback.test.d.ts +0 -1
  147. package/lib/models/__tests__/Callback.test.js +0 -15
  148. package/lib/models/__tests__/FieldModel.test.d.ts +0 -1
  149. package/lib/models/__tests__/FieldModel.test.js +0 -117
  150. package/lib/models/__tests__/MediaContent.test.d.ts +0 -1
  151. package/lib/models/__tests__/MediaContent.test.js +0 -105
  152. package/lib/models/__tests__/Operation.test.d.ts +0 -1
  153. package/lib/models/__tests__/Operation.test.js +0 -459
  154. package/lib/models/__tests__/Response.test.d.ts +0 -1
  155. package/lib/models/__tests__/Response.test.js +0 -221
  156. package/lib/models/__tests__/Schema.circular.test.d.ts +0 -1
  157. package/lib/models/__tests__/Schema.circular.test.js +0 -694
  158. package/lib/models/__tests__/Schema.test.d.ts +0 -1
  159. package/lib/models/__tests__/Schema.test.js +0 -1395
  160. package/lib/models/__tests__/example.test.d.ts +0 -1
  161. package/lib/models/__tests__/example.test.js +0 -90
  162. package/lib/models/__tests__/group.test.d.ts +0 -1
  163. package/lib/models/__tests__/group.test.js +0 -52
  164. package/lib/models/__tests__/helpers.d.ts +0 -5
  165. package/lib/models/__tests__/helpers.js +0 -62
  166. package/lib/models/__tests__/request.test.d.ts +0 -1
  167. package/lib/models/__tests__/request.test.js +0 -119
  168. package/lib/services/__tests__/OpenAPIParser.test.d.ts +0 -1
  169. package/lib/services/__tests__/OpenAPIParser.test.js +0 -80
  170. package/lib/services/__tests__/check.test.d.ts +0 -1
  171. package/lib/services/__tests__/check.test.js +0 -22
  172. package/lib/services/__tests__/utils.test.d.ts +0 -1
  173. package/lib/services/__tests__/utils.test.js +0 -42
  174. package/lib/services/code-samples/__tests__/apply-environments.test.d.ts +0 -1
  175. package/lib/services/code-samples/__tests__/apply-environments.test.js +0 -64
  176. package/lib/services/code-samples/__tests__/build-code-samples.test.d.ts +0 -1
  177. package/lib/services/code-samples/__tests__/build-code-samples.test.js +0 -70
  178. package/lib/services/code-samples/__tests__/convertSampleToString.test.d.ts +0 -1
  179. package/lib/services/code-samples/__tests__/convertSampleToString.test.js +0 -116
  180. package/lib/services/code-samples/__tests__/generator-data-value.test.d.ts +0 -1
  181. package/lib/services/code-samples/__tests__/generator-data-value.test.js +0 -277
  182. package/lib/services/code-samples/__tests__/generator-serialized-value.test.d.ts +0 -1
  183. package/lib/services/code-samples/__tests__/generator-serialized-value.test.js +0 -258
  184. package/lib/services/code-samples/__tests__/generator-value.test.d.ts +0 -1
  185. package/lib/services/code-samples/__tests__/generator-value.test.js +0 -273
  186. package/lib/services/code-samples/__tests__/generator.test.d.ts +0 -249
  187. package/lib/services/code-samples/__tests__/generator.test.js +0 -1201
  188. package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.d.ts +0 -1
  189. package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.js +0 -31
  190. package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.d.ts +0 -1
  191. package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.js +0 -222
  192. package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.d.ts +0 -1
  193. package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.js +0 -129
  194. package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.d.ts +0 -1
  195. package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.js +0 -49
  196. package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.d.ts +0 -1
  197. package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.js +0 -172
  198. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.d.ts +0 -1
  199. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.js +0 -172
  200. package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.d.ts +0 -1
  201. package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.js +0 -130
  202. package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.d.ts +0 -1
  203. package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.js +0 -191
  204. package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.d.ts +0 -1
  205. package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.js +0 -172
  206. package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.d.ts +0 -1
  207. package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.js +0 -85
  208. package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.d.ts +0 -1
  209. package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.js +0 -85
  210. package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.d.ts +0 -1
  211. package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.js +0 -126
  212. package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.d.ts +0 -1
  213. package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.js +0 -105
  214. package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.d.ts +0 -1
  215. package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.js +0 -126
  216. package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.d.ts +0 -1
  217. package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.js +0 -129
  218. package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.d.ts +0 -1
  219. package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.js +0 -129
  220. package/lib/services/config-options/__tests__/helpers.test.d.ts +0 -1
  221. package/lib/services/config-options/__tests__/helpers.test.js +0 -234
  222. package/lib/services/history/__tests__/helpers.test.d.ts +0 -1
  223. package/lib/services/history/__tests__/helpers.test.js +0 -19
  224. package/lib/services/menu/__tests__/buildNestedTagsItems.test.d.ts +0 -1
  225. package/lib/services/menu/__tests__/buildNestedTagsItems.test.js +0 -109
  226. package/lib/services/menu/__tests__/builder.test.d.ts +0 -1
  227. package/lib/services/menu/__tests__/builder.test.js +0 -307
  228. package/lib/services/menu/__tests__/operation.test.d.ts +0 -1
  229. package/lib/services/menu/__tests__/operation.test.js +0 -240
  230. package/lib/services/menu/__tests__/tags.test.d.ts +0 -1
  231. package/lib/services/menu/__tests__/tags.test.js +0 -71
  232. package/lib/telemetry/__tests__/RedocTelemetry.test.d.ts +0 -1
  233. package/lib/telemetry/__tests__/RedocTelemetry.test.js +0 -107
  234. package/lib/testProviders.d.ts +0 -6
  235. package/lib/testProviders.js +0 -14
  236. package/lib/utils/__tests__/areArraysEqual.test.d.ts +0 -1
  237. package/lib/utils/__tests__/areArraysEqual.test.js +0 -33
  238. package/lib/utils/__tests__/argValuesHelpers.d.ts +0 -1
  239. package/lib/utils/__tests__/argValuesHelpers.js +0 -56
  240. package/lib/utils/__tests__/calculateMaxLength.test.d.ts +0 -1
  241. package/lib/utils/__tests__/calculateMaxLength.test.js +0 -119
  242. package/lib/utils/__tests__/configure-helpers.test.d.ts +0 -1
  243. package/lib/utils/__tests__/configure-helpers.test.js +0 -356
  244. package/lib/utils/__tests__/convertSwagger2OpenAPI.test.d.ts +0 -1
  245. package/lib/utils/__tests__/convertSwagger2OpenAPI.test.js +0 -392
  246. package/lib/utils/__tests__/debounce.test.d.ts +0 -1
  247. package/lib/utils/__tests__/debounce.test.js +0 -54
  248. package/lib/utils/__tests__/debug.test.d.ts +0 -1
  249. package/lib/utils/__tests__/debug.test.js +0 -23
  250. package/lib/utils/__tests__/dom.test.d.ts +0 -1
  251. package/lib/utils/__tests__/dom.test.js +0 -108
  252. package/lib/utils/__tests__/getBreadcrumbs.test.d.ts +0 -1
  253. package/lib/utils/__tests__/getBreadcrumbs.test.js +0 -98
  254. package/lib/utils/__tests__/hasNestedFields.test.d.ts +0 -1
  255. package/lib/utils/__tests__/hasNestedFields.test.js +0 -147
  256. package/lib/utils/__tests__/helpers.test.d.ts +0 -1
  257. package/lib/utils/__tests__/helpers.test.js +0 -174
  258. package/lib/utils/__tests__/isMobile.test.d.ts +0 -1
  259. package/lib/utils/__tests__/isMobile.test.js +0 -28
  260. package/lib/utils/__tests__/loadAndBundleSpec.test.d.ts +0 -1
  261. package/lib/utils/__tests__/loadAndBundleSpec.test.js +0 -22
  262. package/lib/utils/__tests__/local-storage.test.d.ts +0 -1
  263. package/lib/utils/__tests__/local-storage.test.js +0 -48
  264. package/lib/utils/__tests__/object.test.d.ts +0 -1
  265. package/lib/utils/__tests__/object.test.js +0 -45
  266. package/lib/utils/__tests__/openapi.test.d.ts +0 -1
  267. package/lib/utils/__tests__/openapi.test.js +0 -1378
  268. package/lib/utils/__tests__/path.test.d.ts +0 -1
  269. package/lib/utils/__tests__/path.test.js +0 -16
  270. package/lib/utils/__tests__/queryString.test.d.ts +0 -1
  271. package/lib/utils/__tests__/queryString.test.js +0 -60
  272. package/lib/utils/__tests__/replaceVariables.test.d.ts +0 -1
  273. package/lib/utils/__tests__/replaceVariables.test.js +0 -46
  274. package/lib/utils/__tests__/simplifyAstStructure.test.d.ts +0 -1
  275. package/lib/utils/__tests__/simplifyAstStructure.test.js +0 -26
  276. package/lib/utils/__tests__/sort.test.d.ts +0 -1
  277. package/lib/utils/__tests__/sort.test.js +0 -16
  278. package/lib/utils/__tests__/string.test.d.ts +0 -1
  279. package/lib/utils/__tests__/string.test.js +0 -16
  280. package/lib/utils/__tests__/theme-helpers.test.d.ts +0 -1
  281. package/lib/utils/__tests__/theme-helpers.test.js +0 -24
  282. package/lib/utils/__tests__/url.test.d.ts +0 -1
  283. package/lib/utils/__tests__/url.test.js +0 -134
@@ -1,105 +0,0 @@
1
- import { getMediaContent } from '../mediaContent.js';
2
- import { normalizeOptions, OpenAPIParser } from '../../services/index.js';
3
- import { MediaTypes } from '../../constants.js';
4
- const options = normalizeOptions({});
5
- const data = { operation: { pointer: 'testMediaContent' } };
6
- describe('Models', () => {
7
- describe('mediaContent', () => {
8
- let parser;
9
- const info = {
10
- [MediaTypes.JSON]: {
11
- schema: {
12
- additionalProperties: {
13
- format: 'int32',
14
- },
15
- },
16
- },
17
- };
18
- beforeEach(() => {
19
- parser = new OpenAPIParser({ openapi: '3.0.0' }, undefined, options);
20
- });
21
- test('should work with default arguments', () => {
22
- const consoleError = vi.spyOn(global.console, 'error');
23
- const mediaContentModel = getMediaContent({
24
- parser,
25
- info: {},
26
- isRequestType: true,
27
- options,
28
- data,
29
- });
30
- expect(consoleError).not.toHaveBeenCalled();
31
- expect(mediaContentModel).toEqual({
32
- hasSample: false,
33
- isRequestType: true,
34
- mediaTypes: [],
35
- ...data,
36
- });
37
- });
38
- test('should handle isRequestType argument', () => {
39
- const mediaContentModelWithRequestTypeTrue = getMediaContent({
40
- parser,
41
- info: {},
42
- isRequestType: true,
43
- options,
44
- data,
45
- });
46
- const mediaContentModelWithRequestTypeFalse = getMediaContent({
47
- parser,
48
- info: {},
49
- isRequestType: false,
50
- options,
51
- data,
52
- });
53
- expect(mediaContentModelWithRequestTypeTrue.isRequestType).toEqual(true);
54
- expect(mediaContentModelWithRequestTypeFalse.isRequestType).toEqual(false);
55
- });
56
- test('should return mediaType', () => {
57
- const mediaContentModel = getMediaContent({
58
- parser,
59
- info,
60
- isRequestType: true,
61
- options,
62
- data,
63
- });
64
- const firstMediaType = mediaContentModel.mediaTypes[0];
65
- expect(mediaContentModel.mediaTypes.length).toEqual(1);
66
- expect(firstMediaType.name).toEqual(MediaTypes.JSON);
67
- });
68
- test('should preserve summary for each example when media type uses examples object', () => {
69
- const infoWithExamples = {
70
- [MediaTypes.JSON]: {
71
- schema: {
72
- type: 'object',
73
- properties: { publisherId: { type: 'string' } },
74
- },
75
- examples: {
76
- 'example-0': {
77
- summary: 'First Example',
78
- value: { publisherId: '1' },
79
- },
80
- 'example-1': {
81
- summary: 'Second Example',
82
- value: { publisherId: '2' },
83
- },
84
- },
85
- },
86
- };
87
- const mediaContentModel = getMediaContent({
88
- parser,
89
- info: infoWithExamples,
90
- isRequestType: true,
91
- options,
92
- data,
93
- });
94
- const examples = mediaContentModel.mediaTypes[0]?.examples;
95
- expect(examples).toBeDefined();
96
- expect(examples?.['example-0']).toBeDefined();
97
- expect(examples?.['example-0']?.summary).toBe('First Example');
98
- expect(examples?.['example-0']?.value).toEqual({ publisherId: '1' });
99
- expect(examples?.['example-1']).toBeDefined();
100
- expect(examples?.['example-1']?.summary).toBe('Second Example');
101
- expect(examples?.['example-1']?.value).toEqual({ publisherId: '2' });
102
- });
103
- });
104
- });
105
- //# sourceMappingURL=MediaContent.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,459 +0,0 @@
1
- import { normalizeOptions, OpenAPIParser } from '../../services/index.js';
2
- import { getOperation } from '../operation.js';
3
- import { getRequestBody } from '../request.js';
4
- import specFixture from './fixtures/operation/petstore.json';
5
- import definitionFixture from './fixtures/operation/operationDefinition.json';
6
- import noRequestDefinitionFixture from './fixtures/operation/noRequestOperationDefinition.json';
7
- import { replaceCircularJson } from './helpers.js';
8
- const options = normalizeOptions({});
9
- import { configure as originalConfigure } from '@redocly/theme/ext/configure';
10
- vi.mock('@redocly/theme/ext/configure', async (importOriginal) => {
11
- const actual = await importOriginal();
12
- return {
13
- ...actual,
14
- configure: vi.fn(() => ({
15
- requestValues: {},
16
- })),
17
- };
18
- });
19
- const mockConfigure = vi.mocked(originalConfigure);
20
- const spec = specFixture;
21
- const definition = definitionFixture;
22
- const noRequestDefinition = noRequestDefinitionFixture;
23
- describe('Models', () => {
24
- describe('Operation', () => {
25
- const parser = new OpenAPIParser(spec, undefined, options);
26
- let operation;
27
- let requestBody;
28
- let payload;
29
- describe('Operation with request body', () => {
30
- beforeEach(() => {
31
- operation = getOperation(parser, definition, undefined, options, 'test');
32
- requestBody = getRequestBody({
33
- parser,
34
- infoOrRef: definition?.requestBody,
35
- options,
36
- operation,
37
- isEvent: false,
38
- });
39
- payload = {
40
- lang: 'payload',
41
- label: 'Payload',
42
- source: '',
43
- requestBodyContent: requestBody.content,
44
- };
45
- });
46
- test('should create Operation Model', () => {
47
- expect(operation).toBeDefined();
48
- expect(operation.operationId).toBe(definition.operationId);
49
- });
50
- test('should return request body', () => {
51
- expect(operation.requestBody?.description).toEqual(requestBody.description);
52
- expect(operation.requestBody?.required).toEqual(requestBody.required);
53
- expect(JSON.stringify(operation.requestBody?.content, replaceCircularJson)).toEqual(JSON.stringify(requestBody.content, replaceCircularJson));
54
- });
55
- test('should return payload', () => {
56
- expect(JSON.stringify(operation.payload, replaceCircularJson)).toEqual(JSON.stringify(payload, replaceCircularJson));
57
- });
58
- test('should return hasSamples: true', () => {
59
- expect(operation.hasSamples).toBe(true);
60
- });
61
- test('should return definitionSamples', () => {
62
- expect(operation.definitionSamples).toEqual(definition['x-codeSamples']);
63
- });
64
- });
65
- describe('Operation without request body', () => {
66
- beforeEach(() => {
67
- operation = getOperation(parser, noRequestDefinition, undefined, options, '');
68
- });
69
- test('should return requestBody undefined', () => {
70
- expect(operation.requestBody).toBe(undefined);
71
- });
72
- test('should return payload undefined', () => {
73
- expect(operation.payload).toEqual({
74
- lang: 'Payload',
75
- source: '',
76
- requestBodyContent: undefined,
77
- });
78
- });
79
- test('should return hasSamples: false', () => {
80
- expect(operation.hasSamples).toBe(false);
81
- });
82
- });
83
- describe('Operation with mock server options', () => {
84
- const specWithServers = {
85
- ...spec,
86
- servers: [
87
- {
88
- url: 'https://default-server-url.com',
89
- description: 'default server',
90
- },
91
- ],
92
- };
93
- const parser = new OpenAPIParser(specWithServers, undefined, options);
94
- test('Should handle mock server position "first"', () => {
95
- const options = {
96
- ...normalizeOptions({}),
97
- mockServer: { url: 'http://mock-server-url.com', position: 'first' },
98
- };
99
- const operation = getOperation(parser, definition, undefined, options, '');
100
- expect(operation.servers).toEqual([
101
- {
102
- description: '',
103
- url: 'http://mock-server-url.com',
104
- },
105
- ...specWithServers.servers,
106
- ]);
107
- });
108
- test('Should handle mock server position "last"', () => {
109
- const options = {
110
- ...normalizeOptions({}),
111
- mockServer: { url: 'http://mock-server-url.com', position: 'last' },
112
- };
113
- const operation = getOperation(parser, definition, undefined, options, '');
114
- expect(operation.servers).toEqual([
115
- ...specWithServers.servers,
116
- {
117
- description: '',
118
- url: 'http://mock-server-url.com',
119
- },
120
- ]);
121
- });
122
- test('Should handle mock server position "replace"', () => {
123
- const options = {
124
- ...normalizeOptions({}),
125
- mockServer: { url: 'http://mock-server-url.com', position: 'replace' },
126
- };
127
- const operation = getOperation(parser, definition, undefined, options, '');
128
- expect(operation.servers).toEqual([
129
- {
130
- description: '',
131
- url: 'http://mock-server-url.com',
132
- },
133
- ]);
134
- });
135
- });
136
- describe('Operation with configured request values', () => {
137
- beforeEach(() => {
138
- // Reset the mock before each test
139
- mockConfigure.mockReturnValue({ requestValues: {} });
140
- });
141
- test('should update request body with configured values', () => {
142
- mockConfigure.mockReturnValue({
143
- requestValues: {
144
- body: {
145
- name: 'test-pet',
146
- status: 'available-test',
147
- },
148
- },
149
- });
150
- operation = getOperation(parser, definition, undefined, options, 'test');
151
- const content = operation.requestBody?.content?.mediaTypes[0];
152
- expect(content?.examples?.cat?.value).toEqual(expect.objectContaining({
153
- name: 'test-pet',
154
- status: 'available-test',
155
- }));
156
- });
157
- test('should update security with configured values', () => {
158
- mockConfigure.mockReturnValue({
159
- requestValues: {
160
- security: {
161
- default: {
162
- token: {
163
- access_token: 'test-token',
164
- token_type: 'test token type',
165
- },
166
- },
167
- },
168
- },
169
- });
170
- operation = getOperation(parser, definition, undefined, options, 'test');
171
- operation.security.forEach((security) => {
172
- security.schemes.forEach((scheme) => {
173
- expect(scheme['x-defaultAccessToken']).toBe('test-token');
174
- expect(scheme['x-defaultTokenType']).toBe('test token type');
175
- });
176
- });
177
- });
178
- });
179
- describe('Operation with server-specific request values', () => {
180
- const servers = [
181
- {
182
- url: 'https://prod-server-url.com',
183
- description: 'prod server',
184
- },
185
- {
186
- url: 'https://dev-server-url.com',
187
- description: 'dev server',
188
- },
189
- ];
190
- const specWithServers = {
191
- ...spec,
192
- servers: servers,
193
- };
194
- const definitionWithServers = {
195
- ...definition,
196
- servers: specWithServers.servers,
197
- };
198
- const parser = new OpenAPIParser(specWithServers, undefined, options);
199
- beforeEach(() => {
200
- // Reset the mock before each test
201
- mockConfigure.mockReturnValue({ requestValues: {} });
202
- });
203
- test('should apply server-specific body values from configure function', () => {
204
- mockConfigure.mockReturnValue({
205
- requestValues: {
206
- 'https://prod-server-url.com': {
207
- body: {
208
- name: 'prod-pet',
209
- status: 'available-prod',
210
- },
211
- },
212
- 'https://dev-server-url.com': {
213
- body: {
214
- name: 'dev-pet',
215
- status: 'available-dev',
216
- },
217
- },
218
- },
219
- });
220
- operation = getOperation(parser, definitionWithServers, undefined, options, 'test');
221
- const content = operation.requestBody?.content?.mediaTypes[0];
222
- expect(content?.examples?.cat?.serverValues?.['https://prod-server-url.com']?.value).toEqual(expect.objectContaining({
223
- name: 'prod-pet',
224
- status: 'available-prod',
225
- }));
226
- expect(content?.examples?.cat?.serverValues?.['https://dev-server-url.com']?.value).toEqual(expect.objectContaining({
227
- name: 'dev-pet',
228
- status: 'available-dev',
229
- }));
230
- });
231
- test('should handle security settings in server-specific request values', () => {
232
- mockConfigure.mockReturnValue({
233
- requestValues: {
234
- 'https://prod-server-url.com': {
235
- security: {
236
- default: {
237
- token: {
238
- access_token: 'prod-token',
239
- token_type: 'prod token type',
240
- },
241
- },
242
- },
243
- },
244
- 'https://dev-server-url.com': {
245
- security: {
246
- default: {
247
- token: {
248
- access_token: 'dev-token',
249
- token_type: 'dev token type',
250
- },
251
- },
252
- },
253
- },
254
- },
255
- });
256
- operation = getOperation(parser, definitionWithServers, undefined, options, 'test');
257
- operation.security.forEach((security) => {
258
- security.schemes.forEach((scheme) => {
259
- // Check server-specific credentials
260
- expect(scheme.serverValues?.['https://prod-server-url.com']?.['x-defaultAccessToken']).toEqual('prod-token');
261
- expect(scheme.serverValues?.['https://dev-server-url.com']?.['x-defaultAccessToken']).toEqual('dev-token');
262
- });
263
- });
264
- });
265
- test('should handle empty serverValues object', () => {
266
- mockConfigure.mockReturnValue({
267
- requestValues: {},
268
- });
269
- operation = getOperation(parser, definitionWithServers, undefined, options, 'test');
270
- const content = operation.requestBody?.content?.mediaTypes[0];
271
- // Verify default example values remain unchanged
272
- expect(content?.examples?.cat?.serverValues).toBeUndefined();
273
- });
274
- test('should handle request values with only some servers defined', () => {
275
- mockConfigure.mockReturnValue({
276
- requestValues: {
277
- 'https://prod-server-url.com': {
278
- body: {
279
- name: 'prod-only-pet',
280
- },
281
- },
282
- // dev server not defined
283
- },
284
- });
285
- operation = getOperation(parser, definitionWithServers, undefined, options, 'test');
286
- const content = operation.requestBody?.content?.mediaTypes[0];
287
- // Prod server should have values
288
- expect(content?.examples?.cat?.serverValues?.['https://prod-server-url.com']?.value).toEqual(expect.objectContaining({
289
- name: 'prod-only-pet',
290
- }));
291
- // Dev server should not have values
292
- expect(content?.examples?.cat?.serverValues?.['https://dev-server-url.com']).toBeUndefined();
293
- });
294
- });
295
- describe('Operation with dynamic request values', () => {
296
- beforeEach(() => {
297
- mockConfigure.mockReturnValue({ requestValues: {} });
298
- });
299
- test('should prioritize dynamicRequestValues over configured values', () => {
300
- mockConfigure.mockReturnValue({
301
- requestValues: {
302
- body: {
303
- name: 'configured-pet',
304
- status: 'configured-status',
305
- },
306
- security: {
307
- default: {
308
- token: {
309
- access_token: 'configured-token',
310
- token_type: 'configured token type',
311
- },
312
- },
313
- },
314
- },
315
- });
316
- const dynamicRequestValues = {
317
- body: {
318
- name: 'dynamic-pet',
319
- status: 'dynamic-status',
320
- },
321
- security: {
322
- default: {
323
- token: {
324
- access_token: 'dynamic-token',
325
- token_type: 'dynamic token type',
326
- },
327
- },
328
- },
329
- };
330
- operation = getOperation(parser, definition, undefined, options, 'test', undefined, undefined, dynamicRequestValues);
331
- const content = operation.requestBody?.content?.mediaTypes[0];
332
- expect(content?.examples?.cat?.value).toEqual(expect.objectContaining({
333
- name: 'dynamic-pet',
334
- status: 'dynamic-status',
335
- }));
336
- operation.security.forEach((security) => {
337
- security.schemes.forEach((scheme) => {
338
- expect(scheme['x-defaultAccessToken']).toBe('dynamic-token');
339
- expect(scheme['x-defaultTokenType']).toBe('dynamic token type');
340
- });
341
- });
342
- });
343
- });
344
- describe('Operation badges', () => {
345
- beforeEach(() => {
346
- mockConfigure.mockReturnValue({ requestValues: {} });
347
- });
348
- test('should include badges from x-badges extension with default values', () => {
349
- const operationDefinitionWithBadges = {
350
- ...definition,
351
- 'x-badges': [
352
- {
353
- name: 'Beta',
354
- color: 'blue',
355
- position: 'before',
356
- },
357
- {
358
- name: 'New',
359
- },
360
- ],
361
- };
362
- operation = getOperation(parser, operationDefinitionWithBadges, undefined, options, 'test');
363
- expect(operation.badges).toEqual([
364
- {
365
- name: 'Beta',
366
- color: 'blue',
367
- position: 'before',
368
- },
369
- {
370
- name: 'New',
371
- color: 'blue',
372
- position: 'after',
373
- },
374
- ]);
375
- });
376
- test('should add badges from tags matching badge or audience kind tags in spec', () => {
377
- const specWithBadgeTags = {
378
- ...spec,
379
- tags: [
380
- {
381
- name: 'beta',
382
- kind: 'badge',
383
- summary: 'Beta Feature',
384
- },
385
- {
386
- name: 'developers',
387
- kind: 'audience',
388
- },
389
- {
390
- name: 'pet',
391
- description: 'Pet operations',
392
- },
393
- ],
394
- };
395
- const operationDefinitionWithTag = {
396
- ...definition,
397
- tags: ['beta', 'developers', 'pet'],
398
- };
399
- const parserWithBadgeTags = new OpenAPIParser(specWithBadgeTags, undefined, options);
400
- operation = getOperation(parserWithBadgeTags, operationDefinitionWithTag, undefined, options, 'test');
401
- expect(operation.badges).toEqual([
402
- {
403
- name: 'Beta Feature',
404
- color: 'blue',
405
- position: 'after',
406
- icon: undefined,
407
- description: undefined,
408
- },
409
- {
410
- name: 'developers',
411
- color: 'grey',
412
- position: 'after',
413
- icon: 'user-group',
414
- description: undefined,
415
- },
416
- ]);
417
- });
418
- test('should combine x-badges and tag-based badges', () => {
419
- const specWithBadgeTags = {
420
- ...spec,
421
- tags: [
422
- {
423
- name: 'beta',
424
- kind: 'badge',
425
- summary: 'Beta Feature',
426
- },
427
- ],
428
- };
429
- const operationDefinitionWithBoth = {
430
- ...definition,
431
- tags: ['beta'],
432
- 'x-badges': [
433
- {
434
- name: 'New',
435
- color: 'green',
436
- },
437
- ],
438
- };
439
- const parserWithBadgeTags = new OpenAPIParser(specWithBadgeTags, undefined, options);
440
- operation = getOperation(parserWithBadgeTags, operationDefinitionWithBoth, undefined, options, 'test');
441
- expect(operation.badges).toEqual([
442
- {
443
- name: 'New',
444
- color: 'green',
445
- position: 'after',
446
- },
447
- {
448
- name: 'Beta Feature',
449
- color: 'blue',
450
- position: 'after',
451
- icon: undefined,
452
- description: undefined,
453
- },
454
- ]);
455
- });
456
- });
457
- });
458
- });
459
- //# sourceMappingURL=Operation.test.js.map
@@ -1 +0,0 @@
1
- export {};