@scalar/api-client 2.15.0 → 2.17.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 (271) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/dist/hooks/useResponseBody.js +6 -6
  3. package/dist/libs/errors.d.ts +1 -0
  4. package/dist/libs/errors.d.ts.map +1 -1
  5. package/dist/libs/errors.js +1 -0
  6. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  7. package/dist/libs/send-request/create-request-operation.js +41 -35
  8. package/dist/style.css +1 -1
  9. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +28 -38
  10. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +84 -45
  12. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -11
  13. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  15. package/dist/v2/blocks/operation-block/components/Header.vue2.js +28 -35
  16. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +10 -0
  17. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -0
  18. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +22 -0
  19. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +31 -0
  20. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -0
  21. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +31 -0
  22. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +3 -9
  23. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +56 -0
  25. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +10 -3
  26. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +46 -0
  28. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +45 -0
  29. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -0
  30. package/dist/v2/blocks/operation-block/helpers/build-request.js +66 -0
  31. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +9 -0
  32. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts +16 -0
  33. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts.map +1 -0
  34. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +4 -0
  35. package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +17 -0
  36. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +9 -3
  37. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-block/helpers/get-example.js +21 -0
  39. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +53 -0
  40. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -0
  41. package/dist/v2/blocks/operation-block/helpers/send-request.js +120 -0
  42. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +1 -1
  43. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  45. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  46. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +89 -110
  47. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +2 -2
  48. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +8 -13
  50. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
  51. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +22 -28
  52. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +19 -8
  53. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  54. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -24
  55. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +12 -0
  56. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -0
  57. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +20 -0
  58. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +10 -0
  59. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -0
  60. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +4 -0
  61. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +14 -12
  62. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  63. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +191 -169
  64. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  65. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +10 -10
  66. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +2 -1
  67. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  68. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +15 -19
  69. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +2 -2
  70. package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
  71. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  72. package/dist/v2/blocks/operation-code-sample/types.d.ts +16 -0
  73. package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +15 -10
  75. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  76. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  77. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +158 -125
  78. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  80. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +59 -50
  81. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
  82. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
  83. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
  84. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
  85. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  86. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
  87. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +1 -0
  88. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +148 -149
  90. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
  91. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  92. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
  93. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
  94. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
  95. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
  96. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
  97. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
  98. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  99. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
  100. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
  101. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  102. package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
  103. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
  104. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
  105. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
  106. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
  107. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
  108. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +0 -2
  109. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  111. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -87
  112. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
  113. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
  114. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
  116. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +59 -56
  118. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  122. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
  124. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
  126. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
  127. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
  128. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
  129. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
  130. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  131. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
  132. package/dist/v2/components/code-input/CodeInput.vue.d.ts +7 -6
  133. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  134. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  135. package/dist/v2/components/code-input/CodeInput.vue2.js +61 -59
  136. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
  137. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  138. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
  139. package/dist/v2/components/resize/index.d.ts +0 -1
  140. package/dist/v2/components/resize/index.d.ts.map +1 -1
  141. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -5
  142. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  143. package/dist/v2/components/sidebar/Sidebar.vue.js +49 -47
  144. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
  145. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  146. package/dist/v2/features/app/App.vue.d.ts +3 -0
  147. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  148. package/dist/v2/features/app/App.vue.js +128 -139
  149. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
  150. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  151. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  152. package/dist/v2/features/app/components/AppSidebar.vue2.js +137 -105
  153. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
  154. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  155. package/dist/v2/features/app/components/{ItemDecorator.vue.d.ts → SidebarItemMenu.vue.d.ts} +1 -1
  156. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -0
  157. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +129 -0
  158. package/dist/v2/features/app/components/SidebarItemMenu.vue2.js +4 -0
  159. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
  160. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  161. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  162. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  163. package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
  164. package/dist/v2/features/app/helpers/routes.d.ts +32 -6
  165. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  166. package/dist/v2/features/app/helpers/routes.js +25 -16
  167. package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
  168. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
  169. package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
  170. package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
  171. package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
  172. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
  173. package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
  174. package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
  175. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
  176. package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
  177. package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
  178. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
  179. package/dist/v2/{hooks/use-workspace-client-events.js → features/app/hooks/use-workspace-client-app-events.js} +48 -45
  180. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
  181. package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
  182. package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
  183. package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
  184. package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
  185. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
  186. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  187. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  188. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
  189. package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
  190. package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
  191. package/dist/v2/features/collection/components/Environment.vue.js +32 -1
  192. package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
  193. package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
  194. package/dist/v2/features/collection/components/Servers.vue.js +142 -2
  195. package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
  196. package/dist/v2/features/collection/components/Settings.vue.js +58 -2
  197. package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
  198. package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
  199. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  200. package/dist/v2/features/modal/Modal.vue.js +1 -1
  201. package/dist/v2/features/modal/Modal.vue2.js +118 -31
  202. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
  203. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  204. package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
  205. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
  206. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
  207. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
  208. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
  209. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
  210. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
  211. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
  212. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
  213. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
  214. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  215. package/dist/v2/features/operation/Operation.vue.js +59 -28
  216. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
  217. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
  218. package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
  219. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  220. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  221. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
  222. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
  223. package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
  224. package/dist/v2/features/operation/index.d.ts +0 -1
  225. package/dist/v2/features/operation/index.d.ts.map +1 -1
  226. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
  227. package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
  228. package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
  229. package/dist/v2/helpers/generate-location-id.d.ts +19 -0
  230. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
  231. package/dist/v2/helpers/generate-location-id.js +10 -0
  232. package/dist/v2/helpers/get-active-environment.d.ts +5 -0
  233. package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
  234. package/dist/v2/helpers/get-active-environment.js +22 -0
  235. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  236. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  237. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  238. package/dist/v2/helpers/plugins.d.ts +59 -0
  239. package/dist/v2/helpers/plugins.d.ts.map +1 -0
  240. package/dist/v2/helpers/plugins.js +11 -0
  241. package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
  242. package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
  243. package/dist/v2/hooks/use-scroll-lock.js +21 -0
  244. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
  245. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  246. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
  247. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
  248. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  249. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  250. package/package.json +20 -20
  251. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
  252. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
  253. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
  254. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
  255. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
  256. package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
  257. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +0 -1
  258. package/dist/v2/features/app/components/ItemDecorator.vue.js +0 -138
  259. package/dist/v2/features/app/components/ItemDecorator.vue2.js +0 -4
  260. package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
  261. package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
  262. package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
  263. package/dist/v2/hooks/use-sync-path.js +0 -51
  264. package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
  265. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
  266. package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
  267. package/dist/v2/plugins.d.ts +0 -44
  268. package/dist/v2/plugins.d.ts.map +0 -1
  269. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
  270. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
  271. /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AA+ahG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,YAAY,EACpB,UAAU;IACR,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,qDAAqD;IACrD,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,EACD,OAAO,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACtB,CAAC,KACD,OAyJF,CAAA"}
1
+ {"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAichG,KAAK,2BAA2B,GAAG;IACjC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,qDAAqD;IACrD,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,CAAA;AAYD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,YAAY,EACpB,UAAU,2BAA2B,EACrC,uCAKG,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACtB,CAAM,KACN,OAuJF,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { isDefined as v } from "@scalar/helpers/array/is-defined";
2
- import { getRaw as S } from "@scalar/json-magic/magic-proxy";
2
+ import { getRaw as E } from "@scalar/json-magic/magic-proxy";
3
3
  import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
4
  import { unpackOverridesProxy as N } from "@scalar/workspace-store/helpers/overrides-proxy";
5
- const T = 10, j = 10, D = "propertyName*", A = (/* @__PURE__ */ new Date()).toISOString(), q = A.split("T")[0], k = A.split("T")[1].split(".")[0], I = {
6
- "date-time": A,
5
+ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toISOString(), q = j.split("T")[0], k = j.split("T")[1].split(".")[0], C = {
6
+ "date-time": j,
7
7
  date: q,
8
8
  email: "hello@example.com",
9
9
  hostname: "example.com",
@@ -29,248 +29,270 @@ const T = 10, j = 10, D = "propertyName*", A = (/* @__PURE__ */ new Date()).toIS
29
29
  uri: "https://example.com",
30
30
  uuid: "123e4567-e89b-12d3-a456-426614174000",
31
31
  "object-id": "6592008029c8c3e4dc76256c"
32
- }, E = (e, r = !1, l = "") => "type" in e && e.type === "string" && "format" in e && e.format === "binary" ? new File([""], "filename") : r && "format" in e && e.format ? I[e.format] ?? l : l, O = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), M = (e) => {
33
- if (!e)
32
+ }, w = (t, i = !1, o = "") => "type" in t && t.type === "string" && "format" in t && t.format === "binary" ? new File([""], "filename") : i && "format" in t && t.format ? C[t.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), I = (t) => {
33
+ if (!t)
34
34
  return;
35
- const r = P.get(e);
36
- if (r)
37
- return r;
38
- if ("required" in e) {
39
- const l = e.required;
40
- if (Array.isArray(l) && l.length > 0) {
41
- const a = new Set(l);
42
- return P.set(e, a), a;
35
+ const i = S.get(t);
36
+ if (i)
37
+ return i;
38
+ if ("required" in t) {
39
+ const o = t.required;
40
+ if (Array.isArray(o) && o.length > 0) {
41
+ const l = new Set(o);
42
+ return S.set(t, l), l;
43
43
  }
44
44
  }
45
- }, d = (e, r) => (typeof r != "object" || r === null || O.set(S(N(e)), r), r), _ = (e) => !!(e.allOf || e.oneOf || e.anyOf), C = (e, r, l, a) => {
46
- if (a?.omitEmptyAndOptionalProperties !== !0 || "type" in e && (e.type === "object" || e.type === "array") || _(e) || "examples" in e && Array.isArray(e.examples) && e.examples.length > 0 || "example" in e && e.example !== void 0 || "default" in e && e.default !== void 0 || "const" in e && e.const !== void 0 || "enum" in e && Array.isArray(e.enum) && e.enum.length > 0)
45
+ }, a = (t, i, o) => {
46
+ if (typeof i != "object" || i === null)
47
+ return i;
48
+ const l = E(N(t)), d = A.get(l) ?? /* @__PURE__ */ new Map();
49
+ return d && d.set(o, i), A.set(l, d), i;
50
+ }, _ = (t) => !!(t.allOf || t.oneOf || t.anyOf), F = (t, i, o, l) => {
51
+ if (t.deprecated || l?.mode === "write" && t.readOnly || l?.mode === "read" && t.writeOnly)
52
+ return !0;
53
+ if (l?.omitEmptyAndOptionalProperties !== !0 || "type" in t && (t.type === "object" || t.type === "array") || _(t) || "examples" in t && Array.isArray(t.examples) && t.examples.length > 0 || "example" in t && t.example !== void 0 || "default" in t && t.default !== void 0 || "const" in t && t.const !== void 0 || "enum" in t && Array.isArray(t.enum) && t.enum.length > 0)
47
54
  return !1;
48
- const o = l ?? e.title ?? "", i = M(r);
49
- return !(i ? i.has(o) : !1);
50
- }, R = (e, r) => Array.isArray(e) && Array.isArray(r) ? [...e, ...r] : e && typeof e == "object" && r && typeof r == "object" ? { ...e, ...r } : r, F = (e, r, l, a) => {
51
- const n = {};
52
- if ("properties" in e && e.properties) {
53
- const o = Object.keys(e.properties), i = l > 3 ? Math.min(j, o.length) : o.length;
54
- for (let t = 0; t < i; t++) {
55
- const p = o[t], u = m(e.properties[p]);
55
+ const r = o ?? t.title ?? "", e = I(i);
56
+ return !(e ? e.has(r) : !1);
57
+ }, R = (t, i) => Array.isArray(t) && Array.isArray(i) ? [...t, ...i] : t && typeof t == "object" && i && typeof i == "object" ? { ...t, ...i } : i, L = (t, i, o, l, d) => {
58
+ const r = {};
59
+ if ("properties" in t && t.properties) {
60
+ const e = Object.keys(t.properties), n = o > 3 ? Math.min(P, e.length) : e.length;
61
+ for (let p = 0; p < n; p++) {
62
+ const x = e[p], u = m(t.properties[x]);
56
63
  if (!u)
57
64
  continue;
58
- const c = r?.xml && "xml" in u ? u.xml?.name : void 0, y = s(u, r, {
59
- level: l + 1,
60
- parentSchema: e,
61
- name: p,
62
- seen: a
65
+ const s = i?.xml && "xml" in u ? u.xml?.name : void 0, y = c(u, i, {
66
+ level: o + 1,
67
+ parentSchema: t,
68
+ name: x,
69
+ seen: l
63
70
  });
64
- typeof y < "u" && (n[c ?? p] = y);
71
+ typeof y < "u" && (r[s ?? x] = y);
65
72
  }
66
- l > 3 && o.length > j && (n["..."] = "[Additional Properties Truncated]");
73
+ o > 3 && e.length > P && (r["..."] = "[Additional Properties Truncated]");
67
74
  }
68
- if ("patternProperties" in e && e.patternProperties)
69
- for (const o of Object.keys(e.patternProperties)) {
70
- const i = m(e.patternProperties[o]);
71
- i && (n[o] = s(i, r, {
72
- level: l + 1,
73
- parentSchema: e,
74
- name: o,
75
- seen: a
75
+ if ("patternProperties" in t && t.patternProperties)
76
+ for (const e of Object.keys(t.patternProperties)) {
77
+ const n = m(t.patternProperties[e]);
78
+ n && (r[e] = c(n, i, {
79
+ level: o + 1,
80
+ parentSchema: t,
81
+ name: e,
82
+ seen: l
76
83
  }));
77
84
  }
78
- if ("additionalProperties" in e && e.additionalProperties) {
79
- const o = m(e.additionalProperties), i = e.additionalProperties === !0 || typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0, t = typeof o == "object" && "x-additionalPropertiesName" in o && typeof o["x-additionalPropertiesName"] == "string" && o["x-additionalPropertiesName"].trim().length > 0 ? `${o["x-additionalPropertiesName"].trim()}*` : D;
80
- n[t] = i ? "anything" : typeof o == "object" ? s(o, r, {
81
- level: l + 1,
82
- seen: a
85
+ if ("additionalProperties" in t && t.additionalProperties) {
86
+ const e = m(t.additionalProperties), n = t.additionalProperties === !0 || typeof t.additionalProperties == "object" && Object.keys(t.additionalProperties).length === 0, p = typeof e == "object" && "x-additionalPropertiesName" in e && typeof e["x-additionalPropertiesName"] == "string" && e["x-additionalPropertiesName"].trim().length > 0 ? `${e["x-additionalPropertiesName"].trim()}*` : M;
87
+ r[p] = n ? "anything" : typeof e == "object" ? c(e, i, {
88
+ level: o + 1,
89
+ seen: l
83
90
  }) : "anything";
84
91
  }
85
- if (e.oneOf?.[0])
92
+ if (t.oneOf?.[0])
86
93
  Object.assign(
87
- n,
88
- s(m(e.oneOf[0]), r, {
89
- level: l + 1,
90
- seen: a
94
+ r,
95
+ c(m(t.oneOf[0]), i, {
96
+ level: o + 1,
97
+ seen: l
91
98
  })
92
99
  );
93
- else if (e.anyOf?.[0])
100
+ else if (t.anyOf?.[0])
94
101
  Object.assign(
95
- n,
96
- s(m(e.anyOf[0]), r, {
97
- level: l + 1,
98
- seen: a
102
+ r,
103
+ c(m(t.anyOf[0]), i, {
104
+ level: o + 1,
105
+ seen: l
99
106
  })
100
107
  );
101
- else if (Array.isArray(e.allOf) && e.allOf.length > 0) {
102
- let o = n;
103
- for (const i of e.allOf) {
104
- const t = s(m(i), r, {
105
- level: l + 1,
106
- parentSchema: e,
107
- seen: a
108
+ else if (Array.isArray(t.allOf) && t.allOf.length > 0) {
109
+ let e = r;
110
+ for (const n of t.allOf) {
111
+ const p = c(m(n), i, {
112
+ level: o + 1,
113
+ parentSchema: t,
114
+ seen: l
108
115
  });
109
- o = R(o, t);
116
+ e = R(e, p);
110
117
  }
111
- o && typeof o == "object" && Object.assign(n, o);
118
+ e && typeof e == "object" && Object.assign(r, e);
112
119
  }
113
- if (r?.xml && "xml" in e && e.xml?.name && l === 0) {
114
- const o = {};
115
- return o[e.xml.name] = n, d(e, o);
120
+ if (i?.xml && "xml" in t && t.xml?.name && o === 0) {
121
+ const e = {};
122
+ return e[t.xml.name] = r, a(t, e, d);
116
123
  }
117
- return d(e, n);
118
- }, L = (e, r, l, a) => {
119
- const n = "items" in e ? m(e.items) : void 0, o = n && typeof n == "object" && "xml" in n ? n.xml?.name : void 0, i = !!(r?.xml && "xml" in e && e.xml?.wrapped && o);
120
- if (e.example !== void 0)
121
- return d(e, i ? { [o]: e.example } : e.example);
122
- if (n && typeof n == "object") {
123
- if (Array.isArray(n.allOf) && n.allOf.length > 0) {
124
- const c = n.allOf.filter(v), y = m(c[0]);
124
+ return a(t, r, d);
125
+ }, X = (t, i, o, l, d) => {
126
+ const r = "items" in t ? m(t.items) : void 0, e = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in t && t.xml?.wrapped && e);
127
+ if (t.example !== void 0)
128
+ return a(t, n ? { [e]: t.example } : t.example, d);
129
+ if (r && typeof r == "object") {
130
+ if (Array.isArray(r.allOf) && r.allOf.length > 0) {
131
+ const s = r.allOf.filter(v), y = m(s[0]);
125
132
  if (y && typeof y == "object" && "type" in y && y.type === "object") {
126
- const x = s({ type: "object", allOf: c }, r, {
127
- level: l + 1,
128
- parentSchema: e,
129
- seen: a
133
+ const g = c({ type: "object", allOf: s }, i, {
134
+ level: o + 1,
135
+ parentSchema: t,
136
+ seen: l
130
137
  });
131
- return d(e, i ? [{ [o]: x }] : [x]);
138
+ return a(t, n ? [{ [e]: g }] : [g], d);
132
139
  }
133
- const g = c.map(
134
- (f) => s(m(f), r, {
135
- level: l + 1,
136
- parentSchema: e,
137
- seen: a
140
+ const O = s.map(
141
+ (f) => c(m(f), i, {
142
+ level: o + 1,
143
+ parentSchema: t,
144
+ seen: l
138
145
  })
139
146
  ).filter(v);
140
- return d(
141
- e,
142
- i ? g.map((f) => ({ [o]: f })) : g
147
+ return a(
148
+ t,
149
+ n ? O.map((f) => ({ [e]: f })) : O,
150
+ d
143
151
  );
144
152
  }
145
- const u = n.anyOf || n.oneOf;
153
+ const u = r.anyOf || r.oneOf;
146
154
  if (u && u.length > 0) {
147
- const c = u[0], y = s(m(c), r, {
148
- level: l + 1,
149
- parentSchema: e,
150
- seen: a
155
+ const s = u[0], y = c(m(s), i, {
156
+ level: o + 1,
157
+ parentSchema: t,
158
+ seen: l
151
159
  });
152
- return d(e, i ? [{ [o]: y }] : [y]);
160
+ return a(t, n ? [{ [e]: y }] : [y], d);
153
161
  }
154
162
  }
155
- const t = n && typeof n == "object" && ("type" in n && n.type === "object" || "properties" in n), p = n && typeof n == "object" && ("type" in n && n.type === "array" || "items" in n);
156
- if (n && typeof n == "object" && ("type" in n && n.type || t || p)) {
157
- const u = s(n, r, {
158
- level: l + 1,
159
- seen: a
163
+ const p = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), x = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
164
+ if (r && typeof r == "object" && ("type" in r && r.type || p || x)) {
165
+ const u = c(r, i, {
166
+ level: o + 1,
167
+ seen: l
160
168
  });
161
- return d(e, i ? [{ [o]: u }] : [u]);
169
+ return a(t, n ? [{ [e]: u }] : [u], d);
162
170
  }
163
- return d(e, []);
164
- }, X = (e, r, l) => {
165
- if ("type" in e && e.type && !Array.isArray(e.type))
166
- switch (e.type) {
171
+ return a(t, [], d);
172
+ }, U = (t, i, o) => {
173
+ if ("type" in t && t.type && !Array.isArray(t.type))
174
+ switch (t.type) {
167
175
  case "string":
168
- return E(e, r, l ?? "");
176
+ return w(t, i, o ?? "");
169
177
  case "boolean":
170
178
  return !0;
171
179
  case "integer":
172
- return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
180
+ return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
173
181
  case "number":
174
- return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
182
+ return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
175
183
  case "array":
176
184
  return [];
177
185
  default:
178
186
  return;
179
187
  }
180
- }, U = (e, r, l) => {
181
- if ("type" in e && Array.isArray(e.type)) {
182
- if (e.type.includes("null"))
188
+ }, W = (t, i, o) => {
189
+ if ("type" in t && Array.isArray(t.type)) {
190
+ if (t.type.includes("null"))
183
191
  return null;
184
- const a = e.type[0];
185
- if (a)
186
- switch (a) {
192
+ const l = t.type[0];
193
+ if (l)
194
+ switch (l) {
187
195
  case "string":
188
- return E(e, r, l ?? "");
196
+ return w(t, i, o ?? "");
189
197
  case "boolean":
190
198
  return !0;
191
199
  case "integer":
192
- return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
200
+ return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
193
201
  case "number":
194
- return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
202
+ return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
195
203
  case "null":
196
204
  return null;
197
205
  default:
198
206
  return;
199
207
  }
200
208
  }
201
- }, s = (e, r, l) => {
202
- const { level: a = 0, parentSchema: n, name: o, seen: i = /* @__PURE__ */ new WeakSet() } = l ?? {}, t = m(e);
203
- if (!v(t))
209
+ }, z = (t) => JSON.stringify({
210
+ emptyString: t?.emptyString,
211
+ xml: t?.xml,
212
+ mode: t?.mode,
213
+ variables: t?.variables,
214
+ omitEmptyAndOptionalProperties: t?.omitEmptyAndOptionalProperties
215
+ }), c = (t, i, {
216
+ level: o = 0,
217
+ parentSchema: l,
218
+ name: d,
219
+ seen: r = /* @__PURE__ */ new WeakSet()
220
+ } = {}) => {
221
+ const e = m(t);
222
+ if (!v(e))
204
223
  return;
205
- const p = S(N(t));
206
- if (i.has(p))
224
+ const n = E(N(e));
225
+ if (r.has(n))
207
226
  return "[Circular Reference]";
208
- if (i.add(p), O.has(p))
209
- return i.delete(p), O.get(p);
210
- if (a > T)
211
- return i.delete(p), "[Max Depth Exceeded]";
212
- const u = !!r?.emptyString;
213
- if (t.deprecated || r?.mode === "write" && t.readOnly || r?.mode === "read" && t.writeOnly || C(t, n, o, r)) {
214
- i.delete(p);
227
+ r.add(n);
228
+ const p = z(i), x = A.get(n)?.get(p);
229
+ if (typeof x < "u")
230
+ return r.delete(n), x;
231
+ if (o > D)
232
+ return r.delete(n), "[Max Depth Exceeded]";
233
+ const u = !!i?.emptyString;
234
+ if (F(e, l, d, i)) {
235
+ r.delete(n);
215
236
  return;
216
237
  }
217
- if ("x-variable" in t && t["x-variable"]) {
218
- const f = r?.variables?.[t["x-variable"]];
238
+ if ("x-variable" in e && e["x-variable"]) {
239
+ const f = i?.variables?.[e["x-variable"]];
219
240
  if (f !== void 0)
220
- return "type" in t && (t.type === "number" || t.type === "integer") ? (i.delete(p), d(t, Number(f))) : (i.delete(p), d(t, f));
241
+ return "type" in e && (e.type === "number" || e.type === "integer") ? (r.delete(n), a(e, Number(f), p)) : (r.delete(n), a(e, f, p));
221
242
  }
222
- if (Array.isArray(t.examples) && t.examples.length > 0)
223
- return i.delete(p), d(t, t.examples[0]);
224
- if (t.example !== void 0)
225
- return i.delete(p), d(t, t.example);
226
- if (t.default !== void 0)
227
- return i.delete(p), d(t, t.default);
228
- if (t.const !== void 0)
229
- return i.delete(p), d(t, t.const);
230
- if (Array.isArray(t.enum) && t.enum.length > 0)
231
- return i.delete(p), d(t, t.enum[0]);
232
- if ("properties" in t || "type" in t && t.type === "object") {
233
- const f = F(t, r, a, i);
234
- return i.delete(p), f;
243
+ if (Array.isArray(e.examples) && e.examples.length > 0)
244
+ return r.delete(n), a(e, e.examples[0], p);
245
+ if (e.example !== void 0)
246
+ return r.delete(n), a(e, e.example, p);
247
+ if (e.default !== void 0)
248
+ return r.delete(n), a(e, e.default, p);
249
+ if (e.const !== void 0)
250
+ return r.delete(n), a(e, e.const, p);
251
+ if (Array.isArray(e.enum) && e.enum.length > 0)
252
+ return r.delete(n), a(e, e.enum[0], p);
253
+ if ("properties" in e || "type" in e && e.type === "object") {
254
+ const f = L(e, i, o, r, p);
255
+ return r.delete(n), f;
235
256
  }
236
- if ("type" in t && t.type === "array" || "items" in t) {
237
- const f = L(t, r, a, i);
238
- return i.delete(p), f;
257
+ if ("type" in e && e.type === "array" || "items" in e) {
258
+ const f = X(e, i, o, r, p);
259
+ return r.delete(n), f;
239
260
  }
240
- const c = X(t, u, r?.emptyString);
241
- if (c !== void 0)
242
- return i.delete(p), d(t, c);
243
- const y = t.oneOf || t.anyOf;
261
+ const s = U(e, u, i?.emptyString);
262
+ if (s !== void 0)
263
+ return r.delete(n), a(e, s, p);
264
+ const y = e.oneOf || e.anyOf;
244
265
  if (Array.isArray(y) && y.length > 0) {
245
266
  for (const f of y) {
246
- const x = m(f);
247
- if (x && (!("type" in x) || x.type !== "null"))
248
- return i.delete(p), d(
249
- t,
250
- s(x, r, {
251
- level: a + 1,
252
- seen: i
253
- })
267
+ const g = m(f);
268
+ if (g && (!("type" in g) || g.type !== "null"))
269
+ return r.delete(n), a(
270
+ e,
271
+ c(g, i, {
272
+ level: o + 1,
273
+ seen: r
274
+ }),
275
+ p
254
276
  );
255
277
  }
256
- return i.delete(p), d(t, null);
278
+ return r.delete(n), a(e, null, p);
257
279
  }
258
- if (Array.isArray(t.allOf) && t.allOf.length > 0) {
280
+ if (Array.isArray(e.allOf) && e.allOf.length > 0) {
259
281
  let f;
260
- const x = t.allOf;
261
- for (const w of x) {
262
- const b = s(w, r, {
263
- level: a + 1,
264
- parentSchema: t,
265
- seen: i
282
+ const g = e.allOf;
283
+ for (const T of g) {
284
+ const b = c(T, i, {
285
+ level: o + 1,
286
+ parentSchema: e,
287
+ seen: r
266
288
  });
267
289
  f === void 0 ? f = b : f && typeof f == "object" && b && typeof b == "object" ? f = R(f, b) : b !== void 0 && (f = b);
268
290
  }
269
- return i.delete(p), d(t, f ?? null);
291
+ return r.delete(n), a(e, f ?? null, p);
270
292
  }
271
- const g = U(t, u, r?.emptyString);
272
- return g !== void 0 ? (i.delete(p), d(t, g)) : (i.delete(p), d(t, null));
293
+ const O = W(e, u, i?.emptyString);
294
+ return O !== void 0 ? (r.delete(n), a(e, O, p)) : (r.delete(n), a(e, null, p));
273
295
  };
274
296
  export {
275
- s as getExampleFromSchema
297
+ c as getExampleFromSchema
276
298
  };
@@ -1 +1 @@
1
- {"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAOvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;CACzC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,6EAQ5B,mBAAmB,KAAG,UA6ExB,CAAA"}
1
+ {"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAOvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;CACzC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,6EAQ5B,mBAAmB,KAAG,UAgFxB,CAAA"}
@@ -1,20 +1,20 @@
1
- import { getResolvedRef as y } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
- import { processBody as f } from "./process-body.js";
1
+ import { getResolvedRef as f } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
+ import { processBody as y } from "./process-body.js";
3
3
  import { processParameters as l } from "./process-parameters.js";
4
4
  import { processSecuritySchemes as S } from "./process-security-schemes.js";
5
5
  import { processServerUrl as g } from "./process-server-url.js";
6
6
  const b = ({
7
7
  operation: t,
8
- contentType: a,
8
+ contentType: i,
9
9
  method: h,
10
- path: i,
10
+ path: a,
11
11
  server: n,
12
12
  example: p,
13
13
  securitySchemes: m
14
14
  }) => {
15
15
  const e = {
16
16
  method: h,
17
- url: i,
17
+ url: a,
18
18
  headers: [],
19
19
  queryString: [],
20
20
  postData: void 0,
@@ -23,19 +23,19 @@ const b = ({
23
23
  headersSize: -1,
24
24
  bodySize: -1
25
25
  };
26
- if (n?.url && (e.url = g(n, i)), t.parameters) {
26
+ if (n?.url && (e.url = g(n, a)), t.parameters) {
27
27
  const { url: r, headers: o, queryString: s, cookies: c } = l({
28
28
  harRequest: e,
29
29
  parameters: t.parameters,
30
30
  example: p,
31
- contentType: a
31
+ contentType: i
32
32
  });
33
33
  e.url = r, e.headers = o, e.queryString = s, e.cookies = c;
34
34
  }
35
- const u = y(t.requestBody);
35
+ const u = f(t.requestBody);
36
36
  if (u?.content) {
37
- const r = f({ requestBody: u, contentType: a, example: p });
38
- if (e.postData = r, e.bodySize = r.text?.length ?? -1, r.mimeType) {
37
+ const r = y({ requestBody: u, contentType: i, example: p });
38
+ if (r && (e.postData = r, e.bodySize = r.text?.length ?? -1, r.mimeType)) {
39
39
  const o = e.headers.find(
40
40
  (s) => s.name.toLowerCase() === "content-type"
41
41
  );
@@ -6,7 +6,8 @@ type ProcessBodyProps = Pick<OperationToHarProps, 'contentType' | 'example'> & {
6
6
  };
7
7
  /**
8
8
  * Processes the request body and returns the processed data
9
+ * Returns undefined if no example is found
9
10
  */
10
- export declare const processBody: ({ requestBody, contentType, example }: ProcessBodyProps) => PostData;
11
+ export declare const processBody: ({ requestBody, contentType, example }: ProcessBodyProps) => PostData | undefined;
11
12
  export {};
12
13
  //# sourceMappingURL=process-body.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IAC7E,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoCD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,uCAAuC,gBAAgB,KAAG,QAoErF,CAAA"}
1
+ {"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IAC7E,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoCD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,uCAAuC,gBAAgB,KAAG,QAAQ,GAAG,SAiEhG,CAAA"}
@@ -1,45 +1,45 @@
1
1
  import { json2xml as s } from "@scalar/helpers/file/json2xml";
2
2
  import { getResolvedRef as c } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { getExampleFromSchema as l } from "../get-example-from-schema.js";
4
- import { getExampleValue as u } from "./get-example-value.js";
4
+ import { getExample as u } from "../../../operation-block/helpers/get-example.js";
5
5
  const p = (i) => {
6
6
  const n = [];
7
7
  for (const [a, e] of Object.entries(i))
8
8
  if (e != null)
9
9
  if (Array.isArray(e))
10
- for (const m of e)
11
- n.push({ name: a, value: String(m) });
10
+ for (const r of e)
11
+ n.push({ name: a, value: String(r) });
12
12
  else if (typeof e == "object") {
13
- const m = p(e);
14
- for (const r of m)
15
- n.push({ name: `${a}.${r.name}`, value: r.value });
13
+ const r = p(e);
14
+ for (const m of r)
15
+ n.push({ name: `${a}.${m.name}`, value: m.value });
16
16
  } else
17
17
  n.push({ name: a, value: String(e) });
18
18
  return n;
19
- }, b = ({ requestBody: i, contentType: n, example: a }) => {
20
- const e = n || Object.keys(i.content)[0] || "", m = e === "multipart/form-data" || e === "application/x-www-form-urlencoded", r = e === "application/xml", t = u(i, a, n);
19
+ }, j = ({ requestBody: i, contentType: n, example: a }) => {
20
+ const e = n || Object.keys(i.content)[0] || "", r = e === "multipart/form-data" || e === "application/x-www-form-urlencoded", m = e === "application/xml", t = u(i, a, n)?.value;
21
21
  if (typeof t < "u")
22
- return m && typeof t == "object" && t !== null ? {
22
+ return r && typeof t == "object" && t !== null ? {
23
23
  mimeType: e,
24
24
  params: p(t)
25
- } : r && typeof t == "object" && t !== null ? {
25
+ } : m && typeof t == "object" && t !== null ? {
26
26
  mimeType: e,
27
27
  text: s(t)
28
28
  } : {
29
29
  mimeType: e,
30
- text: JSON.stringify(t)
30
+ text: typeof t == "string" ? t : JSON.stringify(t)
31
31
  };
32
32
  const f = c(i.content[e]?.schema);
33
33
  if (typeof f < "u") {
34
34
  const o = l(f, {
35
35
  mode: "write",
36
- xml: r
36
+ xml: m
37
37
  });
38
38
  if (o !== void 0)
39
- return m && typeof o == "object" && o !== null ? {
39
+ return r && typeof o == "object" && o !== null ? {
40
40
  mimeType: e,
41
41
  params: p(o)
42
- } : r && typeof o == "object" && o !== null ? {
42
+ } : m && typeof o == "object" && o !== null ? {
43
43
  mimeType: e,
44
44
  text: s(o)
45
45
  } : {
@@ -47,11 +47,7 @@ const p = (i) => {
47
47
  text: JSON.stringify(o)
48
48
  };
49
49
  }
50
- return {
51
- mimeType: e,
52
- text: "null"
53
- };
54
50
  };
55
51
  export {
56
- b as processBody
52
+ j as processBody
57
53
  };
@@ -1,6 +1,6 @@
1
1
  import { getResolvedRef as d } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
2
  import { getExampleFromSchema as p } from "../get-example-from-schema.js";
3
- import { getExampleValue as h } from "./get-example-value.js";
3
+ import { getExample as h } from "../../../operation-block/helpers/get-example.js";
4
4
  const A = (e) => (e ?? []).map((o) => d(o)), g = (e) => {
5
5
  if (e.in === "header")
6
6
  return { style: "simple", explode: "explode" in e && e.explode !== void 0 ? e.explode : !1 };
@@ -14,7 +14,7 @@ const A = (e) => (e ?? []).map((o) => d(o)), g = (e) => {
14
14
  }[e.in], t = "style" in e && e.style ? e.style : o, $ = "explode" in e && e.explode !== void 0 ? e.explode : t === "form";
15
15
  return { style: t, explode: $ };
16
16
  }, S = (e, o, t) => {
17
- const $ = h(e, o, t);
17
+ const $ = h(e, o, t)?.value;
18
18
  if ($ !== void 0)
19
19
  return $;
20
20
  if ("schema" in e && e.schema) {