@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,31 +0,0 @@
1
- import { getExampleValueByMimeType } from '../get-example-value-by-mime-type.js';
2
- describe('getExampleValueByMimeType', () => {
3
- it('returns an empty string for undefined values', () => {
4
- expect(getExampleValueByMimeType(undefined, 'application/json')).toBe('');
5
- });
6
- it('pretty-prints objects for json-like media types', () => {
7
- expect(getExampleValueByMimeType({ a: 1, b: 'two' }, 'application/json')).toBe('{\n "a": 1,\n "b": "two"\n}');
8
- });
9
- it('parses and pretty-prints JSON provided as a string', () => {
10
- expect(getExampleValueByMimeType('{"a":1}', 'application/json')).toBe('{\n "a": 1\n}');
11
- });
12
- it('falls back to the raw string when a json-like string is not valid JSON', () => {
13
- expect(getExampleValueByMimeType('not json', 'application/json')).toBe('not json');
14
- });
15
- it('url-encodes objects for application/x-www-form-urlencoded', () => {
16
- const result = getExampleValueByMimeType({ a: 'x', b: 'y' }, 'application/x-www-form-urlencoded');
17
- expect(result).toContain('a=x');
18
- expect(result).toContain('b=y');
19
- });
20
- it('builds XML for xml-like media types', () => {
21
- expect(getExampleValueByMimeType({ name: 'John' }, 'application/xml')).toContain('<name>John</name>');
22
- });
23
- it('stringifies objects as JSON for non-json, non-xml, non-form media types', () => {
24
- expect(getExampleValueByMimeType({ a: 1 }, 'text/plain')).toBe('{\n "a": 1\n}');
25
- });
26
- it('stringifies primitive values', () => {
27
- expect(getExampleValueByMimeType('hello', 'text/plain')).toBe('hello');
28
- expect(getExampleValueByMimeType(42, 'text/plain')).toBe('42');
29
- });
30
- });
31
- //# sourceMappingURL=get-example-value-by-mime-type.test.js.map
@@ -1,222 +0,0 @@
1
- import { HTTPSnippet } from '../index.js';
2
- describe('Device Authorization Flow', () => {
3
- // Base HAR request for device authorization
4
- const baseDeviceAuthHAR = {
5
- method: 'POST',
6
- url: 'https://petstore.swagger.io/v2/pet',
7
- httpVersion: 'HTTP/1.1',
8
- headers: [
9
- { name: 'Content-Type', value: 'application/json' },
10
- { name: 'Authorization', value: 'Bearer <YOUR_TOKEN_HERE>' },
11
- ],
12
- queryString: [],
13
- postData: {
14
- mimeType: 'application/json',
15
- text: JSON.stringify({ name: 'Fluffy', status: 'available' }),
16
- params: [],
17
- },
18
- cookies: [],
19
- headersSize: -1,
20
- bodySize: -1,
21
- securityOAuth2ExtraCalls: [
22
- {
23
- method: 'POST',
24
- url: 'http://petstore.swagger.io/api/oauth/device',
25
- httpVersion: 'HTTP/1.1',
26
- headers: [
27
- { name: 'Content-Type', value: 'application/x-www-form-urlencoded' },
28
- { name: 'Accept', value: 'application/json' },
29
- ],
30
- queryString: [],
31
- postData: {
32
- mimeType: 'application/x-www-form-urlencoded',
33
- text: '',
34
- params: [
35
- { name: 'client_id', value: 'test-client-id' },
36
- { name: 'scope', value: 'write:pets read:pets' },
37
- ],
38
- },
39
- cookies: [],
40
- headersSize: -1,
41
- bodySize: -1,
42
- flowType: 'deviceAuthorization',
43
- tokenUrl: 'http://petstore.swagger.io/api/oauth/token',
44
- clientId: 'test-client-id',
45
- securityOAuth2ExtraCalls: [],
46
- },
47
- ],
48
- };
49
- describe('Node.js', () => {
50
- it('should generate device authorization flow code', () => {
51
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
52
- const code = snippet.convert('node', 'fetch', {});
53
- expect(code).toContain('device_code');
54
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
55
- expect(code).toContain('http://petstore.swagger.io/api/oauth/token');
56
- expect(code).toContain('while (Date.now() < deadline)');
57
- expect(code).toContain('urn:ietf:params:oauth:grant-type:device_code');
58
- expect(code).toContain('accessToken');
59
- expect(code).toMatchSnapshot();
60
- });
61
- });
62
- describe('JavaScript', () => {
63
- it('should generate device authorization flow code', () => {
64
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
65
- const code = snippet.convert('javascript', 'fetch', {});
66
- expect(code).toContain('device_code');
67
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
68
- expect(code).toContain('while (Date.now() < deadline)');
69
- expect(code).toContain('accessToken');
70
- expect(code).toMatchSnapshot();
71
- });
72
- });
73
- describe('Python', () => {
74
- it('should generate device authorization flow code', () => {
75
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
76
- const code = snippet.convert('python', 'requests', {});
77
- expect(code).toContain('time.time()');
78
- expect(code).toContain('device_code');
79
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
80
- expect(code).toContain('while time.time() < deadline:');
81
- expect(code).toContain('access_token');
82
- expect(code).toMatchSnapshot();
83
- });
84
- });
85
- describe('PHP', () => {
86
- it('should generate device authorization flow code', () => {
87
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
88
- const code = snippet.convert('php', 'curl', {});
89
- expect(code).toContain('device_code');
90
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
91
- expect(code).toContain('while (time() < $deadline)');
92
- expect(code).toContain('usleep');
93
- expect(code).toContain('$accessToken');
94
- expect(code).toMatchSnapshot();
95
- });
96
- });
97
- describe('Go', () => {
98
- it('should generate device authorization flow code', () => {
99
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
100
- const code = snippet.convert('go', 'native', {});
101
- expect(code).toContain('"time"');
102
- expect(code).toContain('Device_code');
103
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
104
- expect(code).toContain('for time.Now().Unix() < deadline');
105
- expect(code).toContain('time.Sleep');
106
- expect(code).toContain('accessToken');
107
- expect(code).toMatchSnapshot();
108
- });
109
- });
110
- describe('C#', () => {
111
- it('should generate device authorization flow code', () => {
112
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
113
- const code = snippet.convert('csharp', 'httpclient', {});
114
- expect(code).toContain('using System.Text.Json');
115
- expect(code).toContain('deviceCode');
116
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
117
- expect(code).toContain('while (DateTime.UtcNow < deadline)');
118
- expect(code).toContain('await Task.Delay');
119
- expect(code).toContain('accessToken');
120
- expect(code).toMatchSnapshot();
121
- });
122
- });
123
- describe('C# + Newtonsoft', () => {
124
- it('should generate device authorization flow code', () => {
125
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
126
- const code = snippet.convert('csharpNewtonsoft', 'httpclient', {});
127
- expect(code).toContain('using Newtonsoft.Json.Linq');
128
- expect(code).toContain('deviceCode');
129
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
130
- expect(code).toContain('while (DateTime.UtcNow < deadline)');
131
- expect(code).toContain('JObject');
132
- expect(code).toContain('accessToken');
133
- expect(code).toMatchSnapshot();
134
- });
135
- });
136
- describe('Java', () => {
137
- it('should generate device authorization flow code', () => {
138
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
139
- const code = snippet.convert('java', 'httpclient', {});
140
- expect(code).toContain('JSONObject');
141
- expect(code).toContain('deviceCode');
142
- expect(code).toContain('/api/oauth/device');
143
- expect(code).toContain('/api/oauth/token');
144
- expect(code).toContain('while (System.currentTimeMillis() < deadline)');
145
- expect(code).toContain('Thread.sleep');
146
- expect(code).toContain('accessToken');
147
- expect(code).toMatchSnapshot();
148
- });
149
- });
150
- describe('Java8+Apache', () => {
151
- it('should generate device authorization flow code', () => {
152
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
153
- const code = snippet.convert('java8', 'apachehttp', {});
154
- expect(code).toContain('JSONObject');
155
- expect(code).toContain('deviceCode');
156
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
157
- expect(code).toContain('while (System.currentTimeMillis() < deadline)');
158
- expect(code).toContain('Thread.sleep');
159
- expect(code).toContain('accessToken');
160
- expect(code).toMatchSnapshot();
161
- });
162
- });
163
- describe('R', () => {
164
- it('should generate device authorization flow code', () => {
165
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
166
- const code = snippet.convert('r', 'httr', {});
167
- expect(code).toContain('library(httr)');
168
- expect(code).toContain('device_code');
169
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
170
- expect(code).toContain('while (as.numeric(Sys.time()) < deadline)');
171
- expect(code).toContain('Sys.sleep');
172
- expect(code).toContain('access_token');
173
- expect(code).toMatchSnapshot();
174
- });
175
- });
176
- describe('Ruby', () => {
177
- it('should generate device authorization flow code', () => {
178
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
179
- const code = snippet.convert('ruby', 'native', {});
180
- expect(code).toContain("require 'json'");
181
- expect(code).toContain('device_code');
182
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
183
- expect(code).toContain('while Time.now.to_i < deadline');
184
- expect(code).toContain('sleep');
185
- expect(code).toContain('access_token');
186
- expect(code).toMatchSnapshot();
187
- });
188
- });
189
- describe('curl', () => {
190
- it('should generate device authorization flow script', () => {
191
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
192
- const code = snippet.convert('shell', 'curl', {});
193
- expect(code).toContain('DEVICE_CODE=');
194
- expect(code).toContain('http://petstore.swagger.io/api/oauth/device');
195
- expect(code).toContain('while [ $(date +%s) -lt $DEADLINE ]');
196
- expect(code).toContain('jq -r');
197
- expect(code).toContain('ACCESS_TOKEN');
198
- expect(code).toMatchSnapshot();
199
- });
200
- });
201
- describe('Error handling', () => {
202
- it('should handle slow_down error', () => {
203
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
204
- const code = snippet.convert('node', 'fetch', {});
205
- expect(code).toContain('slow_down');
206
- expect(code).toContain('intervalMs');
207
- });
208
- it('should handle access_denied and expired_token errors', () => {
209
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
210
- const pythonCode = snippet.convert('python', 'requests', {});
211
- expect(pythonCode).toContain('access_denied');
212
- expect(pythonCode).toContain('expired_token');
213
- expect(pythonCode).toContain('Device flow failed');
214
- });
215
- it('should handle timeout', () => {
216
- const snippet = new HTTPSnippet(baseDeviceAuthHAR);
217
- const goCode = snippet.convert('go', 'native', {});
218
- expect(goCode).toContain('Timed out waiting for authorization');
219
- });
220
- });
221
- });
222
- //# sourceMappingURL=device-authorization.test.js.map
@@ -1,129 +0,0 @@
1
- import { buildUrlExpression, parseUrlIntoOperands, printUrlVariablesDeclarations, } from '../code-helpers.js';
2
- import { Lang } from '../constants.js';
3
- import { CodeBuilder } from '../code-builder.js';
4
- import { buildUrlExpressionData, commonVariablesInput, printUrlVariablesDeclarationsOutput, } from '../mocks/code-helpers-mock.js';
5
- describe('parseUrlIntoOperands', () => {
6
- it('should correctly parse string without path parameters', () => {
7
- expect(parseUrlIntoOperands('/v1/test', {})).toEqual([{ type: 'string', value: '/v1/test' }]);
8
- });
9
- it('should correctly parse string with single known parameter in the end', () => {
10
- expect(parseUrlIntoOperands('/v1/{test}', { test: '1' })).toEqual([
11
- { type: 'string', value: '/v1/' },
12
- { type: 'variable', name: 'test' },
13
- ]);
14
- });
15
- it('should correctly parse string with single known parameter in the middle', () => {
16
- expect(parseUrlIntoOperands('/v1/{test}/test', { test: '1' })).toEqual([
17
- { type: 'string', value: '/v1/' },
18
- { type: 'variable', name: 'test' },
19
- { type: 'string', value: '/test' },
20
- ]);
21
- });
22
- it('should correctly parse string with single known parameter and trailing slash', () => {
23
- expect(parseUrlIntoOperands('/v1/{test}/', { test: '1' })).toEqual([
24
- { type: 'string', value: '/v1/' },
25
- { type: 'variable', name: 'test' },
26
- { type: 'string', value: '/' },
27
- ]);
28
- });
29
- it('should correctly parse string with multiple known parameters', () => {
30
- expect(parseUrlIntoOperands('/v1/{test2}/{test}', { test: '1', test2: '1' })).toEqual([
31
- { type: 'string', value: '/v1/' },
32
- { type: 'variable', name: 'test2' },
33
- { type: 'string', value: '/' },
34
- { type: 'variable', name: 'test' },
35
- ]);
36
- });
37
- });
38
- describe('printUrlVariablesDeclarations', () => {
39
- it('should print empty string on empty pathParameters/serverVariables', () => {
40
- const variablesPrefix = 'variablesPrefix';
41
- const snippetRequest = { pathParameters: {}, serverVariables: {} };
42
- for (const key in Lang) {
43
- const code = new CodeBuilder({
44
- indentation: '',
45
- variablesPrefix,
46
- lang: Lang[key],
47
- lineJoin: '\n',
48
- });
49
- printUrlVariablesDeclarations(snippetRequest, code);
50
- expect(code.join()).toEqual('');
51
- }
52
- });
53
- it('should declare variable presented in pathParameters/serverVariables for given lang', () => {
54
- const variablesPrefix = 'variablesPrefix';
55
- for (const key in Lang) {
56
- const lang = Lang[key];
57
- const output = printUrlVariablesDeclarationsOutput[lang];
58
- const code = new CodeBuilder({
59
- indentation: '',
60
- variablesPrefix,
61
- lang,
62
- lineJoin: '\n',
63
- });
64
- printUrlVariablesDeclarations(commonVariablesInput, code);
65
- try {
66
- expect(code.join()).toEqual(output);
67
- }
68
- catch (e) {
69
- throw new Error(`${lang} is broken ${e}`);
70
- }
71
- }
72
- });
73
- });
74
- describe('buildUrlExpression', () => {
75
- it('should not change url if variables are empty', () => {
76
- const variablesPrefix = 'variablesPrefix';
77
- const url = 'http://acme.com';
78
- const input = {
79
- pathParameters: {},
80
- serverVariables: {},
81
- url,
82
- fullUrl: url,
83
- pathname: url,
84
- };
85
- for (const key in Lang) {
86
- const lang = Lang[key];
87
- const code = new CodeBuilder({
88
- indentation: '',
89
- variablesPrefix,
90
- lang,
91
- lineJoin: '\n',
92
- });
93
- const res = buildUrlExpression(input, code).replace(/["']/g, '');
94
- try {
95
- expect(res).toEqual('http://acme.com');
96
- }
97
- catch (e) {
98
- throw new Error(`${lang} is broken ${e}`);
99
- }
100
- }
101
- });
102
- it('should work with given input', () => {
103
- const variablesPrefix = 'variablesPrefix';
104
- const url = 'http://acme.com/{pathParam1}/{pathParam2}/{pathParam3}/{pathParam4}/{serverVariable1}/{serverVariable2}';
105
- const input = {
106
- ...commonVariablesInput,
107
- url,
108
- fullUrl: url,
109
- pathname: url,
110
- };
111
- for (const key in Lang) {
112
- const lang = Lang[key];
113
- const code = new CodeBuilder({
114
- indentation: '',
115
- variablesPrefix,
116
- lang,
117
- lineJoin: '\n',
118
- });
119
- const res = buildUrlExpression(input, code);
120
- try {
121
- expect(res).toEqual(buildUrlExpressionData[lang]);
122
- }
123
- catch (e) {
124
- throw new Error(`${lang} is broken ${e}`);
125
- }
126
- }
127
- });
128
- });
129
- //# sourceMappingURL=code-helpers.test.js.map
@@ -1,49 +0,0 @@
1
- import StringUtility from '../string-utility.js';
2
- describe('StringUtility', () => {
3
- const testStrings = [
4
- 'lives-Down_by-the.River',
5
- 'Lives`Down,by~the RIVER',
6
- 'LivesDownBY the RIVER',
7
- ];
8
- describe('toCamelCase', () => {
9
- it('returns camelCase string', () => {
10
- const expectedResult = 'livesDownByTheRiver';
11
- testStrings.forEach((str) => {
12
- expect(StringUtility.toCamelCase(str)).toEqual(expectedResult);
13
- });
14
- });
15
- });
16
- describe('toTitleCase', () => {
17
- it('returns Title Case string', () => {
18
- const expectedResult = 'Lives Down By The River';
19
- testStrings.forEach((str) => {
20
- expect(StringUtility.toTitleCase(str)).toEqual(expectedResult);
21
- });
22
- });
23
- });
24
- describe('toPascalCase', () => {
25
- it('returns PascalCase string', () => {
26
- const expectedResult = 'LivesDownByTheRiver';
27
- testStrings.forEach((str) => {
28
- expect(StringUtility.toPascalCase(str)).toEqual(expectedResult);
29
- });
30
- });
31
- });
32
- describe('toLowerCase', () => {
33
- it('returns lowercase string', () => {
34
- const expectedResult = 'livesdownbytheriver';
35
- testStrings.forEach((str) => {
36
- expect(StringUtility.toLowerCase(str)).toEqual(expectedResult);
37
- });
38
- });
39
- });
40
- describe('toSnakeCase', () => {
41
- it('returns snake_case string', () => {
42
- const expectedResult = 'lives_down_by_the_river';
43
- testStrings.forEach((str) => {
44
- expect(StringUtility.toSnakeCase(str)).toEqual(expectedResult);
45
- });
46
- });
47
- });
48
- });
49
- //# sourceMappingURL=string-utility.test.js.map
@@ -1 +0,0 @@
1
- export { HTTPSnippet } from '../../../index.js';
@@ -1,172 +0,0 @@
1
- export { HTTPSnippet } from '../../../index.js'; // we need to reexport it before to prevent circular ref issue
2
- import httpclient from '../httpclient.js';
3
- import { originalOptions, serverVariablesOptions, source } from '../../__mocks__/mock.js';
4
- describe('#code-samples C#', () => {
5
- describe('handler', () => {
6
- it('returns code API PUT /pet', () => {
7
- const result = httpclient(source['PUT http://petstore.swagger.io/v2/pet'], originalOptions, {
8
- target: 'csharp',
9
- client: 'httpclient',
10
- });
11
- expect(result).toMatchSnapshot();
12
- });
13
- it('returns code with path parameters reserved (data) and not (petId) /pet/{petId}/uploadImage/{data}', () => {
14
- const result = httpclient(source['POST http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}'], originalOptions, { target: 'csharp', client: 'httpclient' });
15
- expect(result).toMatchSnapshot();
16
- });
17
- it('returns code with one path parameter inside url /pet/{petId}/uploadImage', () => {
18
- const result = httpclient(source['POST http://petstore.swagger.io/v2/pet/{petId}/uploadImage'], originalOptions, { target: 'csharp', client: 'httpclient' });
19
- expect(result).toMatchSnapshot();
20
- });
21
- it('returns code with path parameter and query /pet/findByStatus/{id}?status=...', () => {
22
- const result = httpclient(source['GET http://petstore.swagger.io/v2/pet/findByStatus/{id}'], originalOptions, { target: 'csharp', client: 'httpclient' });
23
- expect(result).toMatchSnapshot();
24
- });
25
- it('should generate code with server variables', () => {
26
- const result = httpclient(source['POST https://{customerId}.saas-app.com:{port}/v2'], serverVariablesOptions, {
27
- target: 'csharp',
28
- client: 'httpclient',
29
- });
30
- expect(result).toMatchSnapshot();
31
- });
32
- it('should generate code with basic auth', () => {
33
- const result = httpclient(source['POST http://petstore.swagger.io/login'], serverVariablesOptions, {
34
- target: 'csharp',
35
- client: 'httpclient',
36
- });
37
- expect(result).toMatchSnapshot();
38
- });
39
- it('should handle URL_ENCODED with text but no params (serializedValue case)', () => {
40
- const sourceWithUrlEncodedText = {
41
- method: 'post',
42
- url: 'http://petstore.swagger.io/v2/pet',
43
- httpVersion: 'HTTP/1.1',
44
- cookies: [],
45
- headers: [{ name: 'Content-Type', value: 'application/x-www-form-urlencoded' }],
46
- queryString: [],
47
- postData: {
48
- mimeType: 'application/x-www-form-urlencoded',
49
- text: 'name=Museum+Visitor&value=premium&count=5',
50
- params: [],
51
- },
52
- headersSize: 0,
53
- bodySize: 0,
54
- securityOAuth2ExtraCalls: [],
55
- pathParameters: {},
56
- serverVariables: {},
57
- queryObj: {},
58
- headersObj: { 'Content-Type': 'application/x-www-form-urlencoded' },
59
- cookiesObj: {},
60
- allHeaders: { 'Content-Type': 'application/x-www-form-urlencoded' },
61
- uriObj: {
62
- protocol: 'http:',
63
- slashes: true,
64
- auth: null,
65
- host: 'petstore.swagger.io',
66
- port: null,
67
- hostname: 'petstore.swagger.io',
68
- hash: null,
69
- search: '',
70
- query: {},
71
- pathname: '/v2/pet',
72
- path: '/v2/pet',
73
- href: 'http://petstore.swagger.io/v2/pet',
74
- },
75
- fullUrl: 'http://petstore.swagger.io/v2/pet',
76
- };
77
- const result = httpclient(sourceWithUrlEncodedText, originalOptions, {
78
- target: 'csharp',
79
- client: 'httpclient',
80
- });
81
- expect(result).toMatchSnapshot();
82
- });
83
- it('should handle MULTIPART with text but no params (serializedValue case)', () => {
84
- const sourceWithMultipartText = {
85
- method: 'post',
86
- url: 'http://petstore.swagger.io/v2/pet',
87
- httpVersion: 'HTTP/1.1',
88
- cookies: [],
89
- headers: [{ name: 'Content-Type', value: 'multipart/form-data' }],
90
- queryString: [],
91
- postData: {
92
- mimeType: 'multipart/form-data',
93
- text: '--boundary123\r\nContent-Disposition: form-data; name="field1"\r\n\r\nvalue1\r\n--boundary123\r\nContent-Disposition: form-data; name="field2"\r\n\r\nvalue2\r\n--boundary123--',
94
- params: [],
95
- },
96
- headersSize: 0,
97
- bodySize: 0,
98
- securityOAuth2ExtraCalls: [],
99
- pathParameters: {},
100
- serverVariables: {},
101
- queryObj: {},
102
- headersObj: { 'Content-Type': 'multipart/form-data' },
103
- cookiesObj: {},
104
- allHeaders: { 'Content-Type': 'multipart/form-data' },
105
- uriObj: {
106
- protocol: 'http:',
107
- slashes: true,
108
- auth: null,
109
- host: 'petstore.swagger.io',
110
- port: null,
111
- hostname: 'petstore.swagger.io',
112
- hash: null,
113
- search: '',
114
- query: {},
115
- pathname: '/v2/pet',
116
- path: '/v2/pet',
117
- href: 'http://petstore.swagger.io/v2/pet',
118
- },
119
- fullUrl: 'http://petstore.swagger.io/v2/pet',
120
- };
121
- const result = httpclient(sourceWithMultipartText, originalOptions, {
122
- target: 'csharp',
123
- client: 'httpclient',
124
- });
125
- expect(result).toMatchSnapshot();
126
- });
127
- it('should handle OCTET_STREAM with text (binary data case)', () => {
128
- const sourceWithOctetStream = {
129
- method: 'post',
130
- url: 'http://petstore.swagger.io/v2/upload',
131
- httpVersion: 'HTTP/1.1',
132
- cookies: [],
133
- headers: [{ name: 'Content-Type', value: 'application/octet-stream' }],
134
- queryString: [],
135
- postData: {
136
- mimeType: 'application/octet-stream',
137
- text: 'SGVsbG8gV29ybGQ=',
138
- },
139
- headersSize: 0,
140
- bodySize: 0,
141
- securityOAuth2ExtraCalls: [],
142
- pathParameters: {},
143
- serverVariables: {},
144
- queryObj: {},
145
- headersObj: { 'Content-Type': 'application/octet-stream' },
146
- cookiesObj: {},
147
- allHeaders: { 'Content-Type': 'application/octet-stream' },
148
- uriObj: {
149
- protocol: 'http:',
150
- slashes: true,
151
- auth: null,
152
- host: 'petstore.swagger.io',
153
- port: null,
154
- hostname: 'petstore.swagger.io',
155
- hash: null,
156
- search: '',
157
- query: {},
158
- pathname: '/v2/upload',
159
- path: '/v2/upload',
160
- href: 'http://petstore.swagger.io/v2/upload',
161
- },
162
- fullUrl: 'http://petstore.swagger.io/v2/upload',
163
- };
164
- const result = httpclient(sourceWithOctetStream, originalOptions, {
165
- target: 'csharp',
166
- client: 'httpclient',
167
- });
168
- expect(result).toMatchSnapshot();
169
- });
170
- });
171
- });
172
- //# sourceMappingURL=httpclient.test.js.map
@@ -1 +0,0 @@
1
- export { HTTPSnippet } from '../../../index.js';