@scalar/api-reference 0.5.0 → 0.5.2

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 (470) hide show
  1. package/dist/components/Content/Introduction/BaseUrl.vue.d.ts.map +1 -1
  2. package/dist/components/Content/MarkdownRenderer.vue.d.ts.map +1 -1
  3. package/dist/components/Content/ReferenceEndpoint/Copy.vue.d.ts.map +1 -1
  4. package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts.map +1 -1
  5. package/dist/components/Content/ReferenceEndpoint/{ExampleResponses.vue.d.ts → ExampleResponses/ExampleResponses.vue.d.ts} +1 -1
  6. package/dist/components/Content/ReferenceEndpoint/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -0
  7. package/dist/components/Content/ReferenceEndpoint/ExampleResponses/Headers.vue.d.ts +14 -0
  8. package/dist/components/Content/ReferenceEndpoint/ExampleResponses/Headers.vue.d.ts.map +1 -0
  9. package/dist/components/Content/ReferenceEndpoint/ExampleResponses/SelectExample.vue.d.ts +13 -0
  10. package/dist/components/Content/ReferenceEndpoint/ExampleResponses/SelectExample.vue.d.ts.map +1 -0
  11. package/dist/components/Content/ReferenceEndpoint/ExampleResponses/index.d.ts +2 -0
  12. package/dist/components/Content/ReferenceEndpoint/ExampleResponses/index.d.ts.map +1 -0
  13. package/dist/components/Sidebar.vue.d.ts.map +1 -1
  14. package/dist/helpers/index.d.ts +1 -0
  15. package/dist/helpers/index.d.ts.map +1 -1
  16. package/dist/helpers/mapFromObject.d.ts +8 -0
  17. package/dist/helpers/mapFromObject.d.ts.map +1 -0
  18. package/dist/index.js +8898 -11685
  19. package/dist/types.d.ts +9 -7
  20. package/dist/types.d.ts.map +1 -1
  21. package/package.json +10 -10
  22. package/dist/components/Content/ReferenceEndpoint/ExampleResponses.vue.d.ts.map +0 -1
  23. package/src/components/ApiClientModal.vue +0 -205
  24. package/src/components/ApiReference.vue +0 -750
  25. package/src/components/Card/Card.vue +0 -12
  26. package/src/components/Card/CardContent.vue +0 -45
  27. package/src/components/Card/CardFooter.vue +0 -13
  28. package/src/components/Card/CardHeader.vue +0 -37
  29. package/src/components/Card/CardTab.vue +0 -32
  30. package/src/components/Card/CardTabHeader.vue +0 -32
  31. package/src/components/Card/index.ts +0 -6
  32. package/src/components/Content/Content.vue +0 -145
  33. package/src/components/Content/Introduction/BaseUrl.vue +0 -32
  34. package/src/components/Content/Introduction/Introduction.vue +0 -141
  35. package/src/components/Content/Introduction/LanguageSelector.vue +0 -361
  36. package/src/components/Content/Introduction/index.ts +0 -1
  37. package/src/components/Content/MarkdownRenderer.vue +0 -174
  38. package/src/components/Content/ReferenceEndpoint/Copy.vue +0 -100
  39. package/src/components/Content/ReferenceEndpoint/ExampleRequest.vue +0 -318
  40. package/src/components/Content/ReferenceEndpoint/ExampleResponseTab.vue +0 -22
  41. package/src/components/Content/ReferenceEndpoint/ExampleResponses.vue +0 -169
  42. package/src/components/Content/ReferenceEndpoint/ParameterItem.vue +0 -26
  43. package/src/components/Content/ReferenceEndpoint/Parameters.vue +0 -23
  44. package/src/components/Content/ReferenceEndpoint/ReferenceEndpoint.vue +0 -29
  45. package/src/components/Content/ReferenceEndpoint/RequestBody.vue +0 -125
  46. package/src/components/Content/ReferenceEndpoint/RequestBodyProperties.vue +0 -54
  47. package/src/components/Content/ReferenceEndpoint/RequestBodyPropertiesChild.vue +0 -39
  48. package/src/components/Content/ReferenceEndpoint/index.ts +0 -1
  49. package/src/components/Content/ReferenceTag.vue +0 -99
  50. package/src/components/Content/Spinner.vue +0 -51
  51. package/src/components/Content/index.ts +0 -1
  52. package/src/components/FindAnythingButton.vue +0 -76
  53. package/src/components/FlowButton.vue +0 -184
  54. package/src/components/FlowIconButton.vue +0 -25
  55. package/src/components/FlowLoader.vue +0 -207
  56. package/src/components/FlowModal.vue +0 -133
  57. package/src/components/HelpfulLink.vue +0 -19
  58. package/src/components/Icon/FlowIcon.vue +0 -19
  59. package/src/components/Icon/Icon.vue +0 -23
  60. package/src/components/Icon/SvgRenderer.ts +0 -66
  61. package/src/components/Icon/brand/brand-adobe.svg +0 -1
  62. package/src/components/Icon/brand/brand-amazon.svg +0 -1
  63. package/src/components/Icon/brand/brand-browser-firefox.svg +0 -5
  64. package/src/components/Icon/brand/brand-browser-googlechrome.svg +0 -5
  65. package/src/components/Icon/brand/brand-creative-commons.svg +0 -1
  66. package/src/components/Icon/brand/brand-ecommerce-etsy.svg +0 -1
  67. package/src/components/Icon/brand/brand-ecommerce-patreon.svg +0 -1
  68. package/src/components/Icon/brand/brand-ecommerce-shopify.svg +0 -5
  69. package/src/components/Icon/brand/brand-ecommerce-wordpress.svg +0 -1
  70. package/src/components/Icon/brand/brand-gaming-nintendo-switch.svg +0 -5
  71. package/src/components/Icon/brand/brand-gaming-playstation.svg +0 -1
  72. package/src/components/Icon/brand/brand-gaming-xbox-live.svg +0 -5
  73. package/src/components/Icon/brand/brand-google-drive.svg +0 -5
  74. package/src/components/Icon/brand/brand-google-gmail.svg +0 -5
  75. package/src/components/Icon/brand/brand-google.svg +0 -1
  76. package/src/components/Icon/brand/brand-music-itunes.svg +0 -1
  77. package/src/components/Icon/brand/brand-music-soundcloud.svg +0 -1
  78. package/src/components/Icon/brand/brand-music-spotify.svg +0 -1
  79. package/src/components/Icon/brand/brand-office-dropbox.svg +0 -5
  80. package/src/components/Icon/brand/brand-office-slack.svg +0 -5
  81. package/src/components/Icon/brand/brand-office-zoom.svg +0 -1
  82. package/src/components/Icon/brand/brand-payments-alipay.svg +0 -1
  83. package/src/components/Icon/brand/brand-payments-paypal.svg +0 -1
  84. package/src/components/Icon/brand/brand-payments-stripe.svg +0 -1
  85. package/src/components/Icon/brand/brand-platform-android.svg +0 -1
  86. package/src/components/Icon/brand/brand-platform-apple.svg +0 -5
  87. package/src/components/Icon/brand/brand-platform-linux.svg +0 -5
  88. package/src/components/Icon/brand/brand-platform-microsoft-windows.svg +0 -4
  89. package/src/components/Icon/brand/brand-social-chat-discord.svg +0 -5
  90. package/src/components/Icon/brand/brand-social-chat-kuaishou.svg +0 -5
  91. package/src/components/Icon/brand/brand-social-chat-line.svg +0 -5
  92. package/src/components/Icon/brand/brand-social-chat-messenger.svg +0 -5
  93. package/src/components/Icon/brand/brand-social-chat-signal.svg +0 -5
  94. package/src/components/Icon/brand/brand-social-chat-snapchat.svg +0 -5
  95. package/src/components/Icon/brand/brand-social-chat-telegram.svg +0 -5
  96. package/src/components/Icon/brand/brand-social-chat-wechat.svg +0 -5
  97. package/src/components/Icon/brand/brand-social-chat-whatsapp.svg +0 -5
  98. package/src/components/Icon/brand/brand-social-media-deviantart.svg +0 -5
  99. package/src/components/Icon/brand/brand-social-media-dribbble.svg +0 -1
  100. package/src/components/Icon/brand/brand-social-media-facebook.svg +0 -1
  101. package/src/components/Icon/brand/brand-social-media-instagram.svg +0 -5
  102. package/src/components/Icon/brand/brand-social-media-linkedin.svg +0 -5
  103. package/src/components/Icon/brand/brand-social-media-pinterest.svg +0 -5
  104. package/src/components/Icon/brand/brand-social-media-reddit.svg +0 -1
  105. package/src/components/Icon/brand/brand-social-media-sina-weibo.svg +0 -5
  106. package/src/components/Icon/brand/brand-social-media-threads.svg +0 -1
  107. package/src/components/Icon/brand/brand-social-media-tiktok.svg +0 -5
  108. package/src/components/Icon/brand/brand-social-media-tinder.svg +0 -1
  109. package/src/components/Icon/brand/brand-social-media-tumblr.svg +0 -5
  110. package/src/components/Icon/brand/brand-social-media-twitter.svg +0 -5
  111. package/src/components/Icon/brand/brand-software-design-figma.svg +0 -1
  112. package/src/components/Icon/brand/brand-software-development-authy.svg +0 -1
  113. package/src/components/Icon/brand/brand-software-development-digital-ocean.svg +0 -1
  114. package/src/components/Icon/brand/brand-software-development-docker.svg +0 -5
  115. package/src/components/Icon/brand/brand-software-development-github.svg +0 -5
  116. package/src/components/Icon/brand/brand-software-development-jira.svg +0 -1
  117. package/src/components/Icon/brand/brand-software-development-openai.svg +0 -1
  118. package/src/components/Icon/brand/brand-software-development-stackexchange.svg +0 -5
  119. package/src/components/Icon/brand/brand-software-development-stackoverflow.svg +0 -1
  120. package/src/components/Icon/brand/brand-video-netflix.svg +0 -5
  121. package/src/components/Icon/brand/brand-video-twitch.svg +0 -1
  122. package/src/components/Icon/brand/brand-video-vimeo.svg +0 -5
  123. package/src/components/Icon/brand/brand-video-youtube.svg +0 -5
  124. package/src/components/Icon/brand/programming-framework-angular.svg +0 -5
  125. package/src/components/Icon/brand/programming-framework-astro.svg +0 -5
  126. package/src/components/Icon/brand/programming-framework-laravel.svg +0 -1
  127. package/src/components/Icon/brand/programming-framework-nextdotjs.svg +0 -5
  128. package/src/components/Icon/brand/programming-framework-react.svg +0 -5
  129. package/src/components/Icon/brand/programming-framework-vuedotjs.svg +0 -1
  130. package/src/components/Icon/brand/programming-language-c.svg +0 -5
  131. package/src/components/Icon/brand/programming-language-clojure.svg +0 -5
  132. package/src/components/Icon/brand/programming-language-csharp.svg +0 -4
  133. package/src/components/Icon/brand/programming-language-css3.svg +0 -4
  134. package/src/components/Icon/brand/programming-language-go.svg +0 -4
  135. package/src/components/Icon/brand/programming-language-html5.svg +0 -4
  136. package/src/components/Icon/brand/programming-language-java.svg +0 -21
  137. package/src/components/Icon/brand/programming-language-javascript-js.svg +0 -4
  138. package/src/components/Icon/brand/programming-language-json.svg +0 -8
  139. package/src/components/Icon/brand/programming-language-kotlin.svg +0 -3
  140. package/src/components/Icon/brand/programming-language-node.svg +0 -10
  141. package/src/components/Icon/brand/programming-language-objc.svg +0 -6
  142. package/src/components/Icon/brand/programming-language-ocaml.svg +0 -4
  143. package/src/components/Icon/brand/programming-language-php.svg +0 -4
  144. package/src/components/Icon/brand/programming-language-powershell.svg +0 -10
  145. package/src/components/Icon/brand/programming-language-python.svg +0 -4
  146. package/src/components/Icon/brand/programming-language-r.svg +0 -7
  147. package/src/components/Icon/brand/programming-language-ruby.svg +0 -5
  148. package/src/components/Icon/brand/programming-language-scala.svg +0 -5
  149. package/src/components/Icon/brand/programming-language-shell.svg +0 -5
  150. package/src/components/Icon/brand/programming-language-swift.svg +0 -4
  151. package/src/components/Icon/brand/programming-language-typescript.svg +0 -5
  152. package/src/components/Icon/brand/programming-tool-git.svg +0 -1
  153. package/src/components/Icon/brand/programming-tool-tailwindcss.svg +0 -5
  154. package/src/components/Icon/icons/Add.svg +0 -4
  155. package/src/components/Icon/icons/ArrowDown.svg +0 -3
  156. package/src/components/Icon/icons/ArrowLeft.svg +0 -3
  157. package/src/components/Icon/icons/ArrowRight.svg +0 -3
  158. package/src/components/Icon/icons/ArrowUp.svg +0 -3
  159. package/src/components/Icon/icons/Background.svg +0 -8
  160. package/src/components/Icon/icons/CallToAction.svg +0 -5
  161. package/src/components/Icon/icons/CheckMark.svg +0 -3
  162. package/src/components/Icon/icons/ChevronDown.svg +0 -3
  163. package/src/components/Icon/icons/ChevronLeft.svg +0 -3
  164. package/src/components/Icon/icons/ChevronRight.svg +0 -3
  165. package/src/components/Icon/icons/ChevronUp.svg +0 -3
  166. package/src/components/Icon/icons/Close.svg +0 -3
  167. package/src/components/Icon/icons/DarkMode.svg +0 -4
  168. package/src/components/Icon/icons/Delete.svg +0 -5
  169. package/src/components/Icon/icons/Discord.svg +0 -5
  170. package/src/components/Icon/icons/Duplicate.svg +0 -6
  171. package/src/components/Icon/icons/Edit.svg +0 -4
  172. package/src/components/Icon/icons/EditorBold.svg +0 -4
  173. package/src/components/Icon/icons/EditorCode.svg +0 -6
  174. package/src/components/Icon/icons/EditorHighlight.svg +0 -12
  175. package/src/components/Icon/icons/EditorItalic.svg +0 -4
  176. package/src/components/Icon/icons/EditorLink.svg +0 -8
  177. package/src/components/Icon/icons/EditorStrike.svg +0 -4
  178. package/src/components/Icon/icons/EditorUnderline.svg +0 -6
  179. package/src/components/Icon/icons/Ellipses.svg +0 -4
  180. package/src/components/Icon/icons/Error.svg +0 -4
  181. package/src/components/Icon/icons/ExternalLink.svg +0 -7
  182. package/src/components/Icon/icons/Folder.svg +0 -4
  183. package/src/components/Icon/icons/GitHub.svg +0 -4
  184. package/src/components/Icon/icons/Google.svg +0 -4
  185. package/src/components/Icon/icons/Hide.svg +0 -5
  186. package/src/components/Icon/icons/Key.svg +0 -5
  187. package/src/components/Icon/icons/Leave.svg +0 -5
  188. package/src/components/Icon/icons/LightMode.svg +0 -6
  189. package/src/components/Icon/icons/Link.svg +0 -5
  190. package/src/components/Icon/icons/Lock.svg +0 -4
  191. package/src/components/Icon/icons/Logo.svg +0 -4
  192. package/src/components/Icon/icons/LogoAPI.svg +0 -4
  193. package/src/components/Icon/icons/LogoClient.svg +0 -4
  194. package/src/components/Icon/icons/LogoMarket.svg +0 -4
  195. package/src/components/Icon/icons/LogoSwagger.svg +0 -4
  196. package/src/components/Icon/icons/Magic.svg +0 -5
  197. package/src/components/Icon/icons/Menu.svg +0 -3
  198. package/src/components/Icon/icons/Page.svg +0 -8
  199. package/src/components/Icon/icons/Payment.svg +0 -5
  200. package/src/components/Icon/icons/Refresh.svg +0 -4
  201. package/src/components/Icon/icons/Search.svg +0 -4
  202. package/src/components/Icon/icons/Show.svg +0 -5
  203. package/src/components/Icon/icons/Sigma.svg +0 -4
  204. package/src/components/Icon/icons/Trash.svg +0 -5
  205. package/src/components/Icon/icons/index.ts +0 -65
  206. package/src/components/Icon/index.ts +0 -2
  207. package/src/components/Icon/line/arrow-chevron-down.svg +0 -1
  208. package/src/components/Icon/line/arrow-chevron-left.svg +0 -1
  209. package/src/components/Icon/line/arrow-chevron-right.svg +0 -1
  210. package/src/components/Icon/line/arrow-chevron-up.svg +0 -1
  211. package/src/components/Icon/line/arrow-down.svg +0 -1
  212. package/src/components/Icon/line/arrow-left.svg +0 -1
  213. package/src/components/Icon/line/arrow-right.svg +0 -1
  214. package/src/components/Icon/line/arrow-up.svg +0 -1
  215. package/src/components/Icon/line/basic-shape-diamond.svg +0 -1
  216. package/src/components/Icon/line/basic-shape-hexagon.svg +0 -1
  217. package/src/components/Icon/line/basic-shape-primary-circle-ellipse-round.svg +0 -1
  218. package/src/components/Icon/line/basic-shape-primary-square-rectangle.svg +0 -1
  219. package/src/components/Icon/line/basic-shape-shield.svg +0 -1
  220. package/src/components/Icon/line/computer-device-desktop-monitor.svg +0 -1
  221. package/src/components/Icon/line/computer-device-desktop.svg +0 -1
  222. package/src/components/Icon/line/computer-device-laptop.svg +0 -1
  223. package/src/components/Icon/line/computer-device-mobile-phone-android-samsung-back.svg +0 -1
  224. package/src/components/Icon/line/computer-device-mobile-phone-android-samsung.svg +0 -1
  225. package/src/components/Icon/line/computer-device-mobile-phone-iphone-x-back.svg +0 -1
  226. package/src/components/Icon/line/computer-device-mobile-phone-iphone-x.svg +0 -1
  227. package/src/components/Icon/line/computer-device-mobile-tablet-touch.svg +0 -1
  228. package/src/components/Icon/line/computer-device-mobile-tablet.svg +0 -1
  229. package/src/components/Icon/line/computer-device-network-ethernet-cat6.svg +0 -1
  230. package/src/components/Icon/line/computer-device-network-lan-www.svg +0 -1
  231. package/src/components/Icon/line/computer-device-network-wifi-connection.svg +0 -1
  232. package/src/components/Icon/line/computer-device-network-wifi-router.svg +0 -1
  233. package/src/components/Icon/line/computer-keyboard-alt.svg +0 -1
  234. package/src/components/Icon/line/computer-keyboard-command-cmd-control-ctrl.svg +0 -1
  235. package/src/components/Icon/line/computer-keyboard-option.svg +0 -1
  236. package/src/components/Icon/line/computer-keyboard-shift.svg +0 -1
  237. package/src/components/Icon/line/ecology-science-erlenmeyer-flask.svg +0 -1
  238. package/src/components/Icon/line/entertainment-control-button-circle-left-arrow-rewind.svg +0 -1
  239. package/src/components/Icon/line/entertainment-control-button-circle-pause.svg +0 -1
  240. package/src/components/Icon/line/entertainment-control-button-circle-right-arrow-fast-forward.svg +0 -1
  241. package/src/components/Icon/line/entertainment-control-button-circle-stop-square.svg +0 -1
  242. package/src/components/Icon/line/entertainment-control-button-play-circle.svg +0 -1
  243. package/src/components/Icon/line/entertainment-party-popper-confetti.svg +0 -1
  244. package/src/components/Icon/line/image-flash-lightning.svg +0 -1
  245. package/src/components/Icon/line/image-photo-frame.svg +0 -1
  246. package/src/components/Icon/line/image-picture-flower.svg +0 -1
  247. package/src/components/Icon/line/interface-add.svg +0 -1
  248. package/src/components/Icon/line/interface-alert-error-exclamation-block-square.svg +0 -1
  249. package/src/components/Icon/line/interface-alert-error-x-block-square.svg +0 -1
  250. package/src/components/Icon/line/interface-alert-exclamation-diamond.svg +0 -1
  251. package/src/components/Icon/line/interface-alert-exclamation-triangle-warning.svg +0 -1
  252. package/src/components/Icon/line/interface-alert-information-circle.svg +0 -1
  253. package/src/components/Icon/line/interface-award-crown.svg +0 -1
  254. package/src/components/Icon/line/interface-bookmark-tag.svg +0 -1
  255. package/src/components/Icon/line/interface-bookmark.svg +0 -1
  256. package/src/components/Icon/line/interface-calendar-date-one.svg +0 -1
  257. package/src/components/Icon/line/interface-close.svg +0 -1
  258. package/src/components/Icon/line/interface-content-book-open-pages.svg +0 -1
  259. package/src/components/Icon/line/interface-content-book-page.svg +0 -1
  260. package/src/components/Icon/line/interface-content-file.svg +0 -8
  261. package/src/components/Icon/line/interface-content-folder.svg +0 -1
  262. package/src/components/Icon/line/interface-copy-clipboard.svg +0 -1
  263. package/src/components/Icon/line/interface-delete-bin-trash.svg +0 -1
  264. package/src/components/Icon/line/interface-dots-horizontal.svg +0 -1
  265. package/src/components/Icon/line/interface-dots-vertical.svg +0 -1
  266. package/src/components/Icon/line/interface-edit-attachment.svg +0 -1
  267. package/src/components/Icon/line/interface-edit-binocular.svg +0 -1
  268. package/src/components/Icon/line/interface-edit-magic-wand.svg +0 -1
  269. package/src/components/Icon/line/interface-edit-tool-eraser.svg +0 -1
  270. package/src/components/Icon/line/interface-edit-tool-paint-brush.svg +0 -1
  271. package/src/components/Icon/line/interface-edit-tool-paint-roller.svg +0 -1
  272. package/src/components/Icon/line/interface-edit-tool-pen.svg +0 -1
  273. package/src/components/Icon/line/interface-edit-tool-pencil.svg +0 -1
  274. package/src/components/Icon/line/interface-edit-view-eye.svg +0 -1
  275. package/src/components/Icon/line/interface-favorite-award.svg +0 -1
  276. package/src/components/Icon/line/interface-favorite-flag.svg +0 -1
  277. package/src/components/Icon/line/interface-favorite-heart.svg +0 -1
  278. package/src/components/Icon/line/interface-favorite-star.svg +0 -1
  279. package/src/components/Icon/line/interface-favorite-stars-shining.svg +0 -1
  280. package/src/components/Icon/line/interface-favorite-stars-sparkles.svg +0 -1
  281. package/src/components/Icon/line/interface-hierarchy-flowchart.svg +0 -1
  282. package/src/components/Icon/line/interface-home-house.svg +0 -1
  283. package/src/components/Icon/line/interface-hyperlink.svg +0 -1
  284. package/src/components/Icon/line/interface-lighting-brightness.svg +0 -1
  285. package/src/components/Icon/line/interface-lock-closed.svg +0 -1
  286. package/src/components/Icon/line/interface-lock-open-unlock.svg +0 -1
  287. package/src/components/Icon/line/interface-login-key.svg +0 -1
  288. package/src/components/Icon/line/interface-search.svg +0 -1
  289. package/src/components/Icon/line/interface-setting-cog.svg +0 -1
  290. package/src/components/Icon/line/interface-share-megaphone-bullhorn.svg +0 -1
  291. package/src/components/Icon/line/interface-share-rocket.svg +0 -1
  292. package/src/components/Icon/line/interface-share-satellite.svg +0 -1
  293. package/src/components/Icon/line/interface-share-space-ship.svg +0 -1
  294. package/src/components/Icon/line/interface-share.svg +0 -1
  295. package/src/components/Icon/line/interface-signal-square.svg +0 -1
  296. package/src/components/Icon/line/interface-text-formatting-left-open-quote.svg +0 -1
  297. package/src/components/Icon/line/interface-text-formatting-right-close-quote.svg +0 -1
  298. package/src/components/Icon/line/interface-time-clock-circle.svg +0 -1
  299. package/src/components/Icon/line/interface-time-hour-glass.svg +0 -1
  300. package/src/components/Icon/line/interface-users-multiple.svg +0 -1
  301. package/src/components/Icon/line/interface-validation-checkbox-square.svg +0 -1
  302. package/src/components/Icon/line/interface-weather-moon.svg +0 -1
  303. package/src/components/Icon/line/legal-justice-hammer-gavel.svg +0 -1
  304. package/src/components/Icon/line/mail-chat-bubble-square.svg +0 -1
  305. package/src/components/Icon/line/mail-send-email-paper-airplane.svg +0 -1
  306. package/src/components/Icon/line/mail-send-envelope.svg +0 -1
  307. package/src/components/Icon/line/mail-sign-hashtag.svg +0 -1
  308. package/src/components/Icon/line/money-cashier-receipt.svg +0 -1
  309. package/src/components/Icon/line/money-currency-dollar-pay.svg +0 -1
  310. package/src/components/Icon/line/money-graph-arrow-increase.svg +0 -1
  311. package/src/components/Icon/line/money-graph-bar-chart-increase.svg +0 -1
  312. package/src/components/Icon/line/nature-ecology-leaf.svg +0 -1
  313. package/src/components/Icon/line/phone-telephone.svg +0 -1
  314. package/src/components/Icon/line/programming-bug.svg +0 -1
  315. package/src/components/Icon/line/programming-cloud.svg +0 -1
  316. package/src/components/Icon/line/programming-computer-database-server.svg +0 -1
  317. package/src/components/Icon/line/programming-computer-database.svg +0 -1
  318. package/src/components/Icon/line/programming-module-four-layout.svg +0 -1
  319. package/src/components/Icon/line/programming-module-three.svg +0 -1
  320. package/src/components/Icon/line/programming-module.svg +0 -1
  321. package/src/components/Icon/line/programming-script-code.svg +0 -1
  322. package/src/components/Icon/line/shopping-cart.svg +0 -8
  323. package/src/components/Icon/line/shopping-gift-present.svg +0 -1
  324. package/src/components/Icon/line/shopping-shipping-box-parcel-package.svg +0 -1
  325. package/src/components/Icon/line/tag-new-circle.svg +0 -1
  326. package/src/components/Icon/line/travel-map-earth-globe.svg +0 -1
  327. package/src/components/Icon/localIcons.ts +0 -68
  328. package/src/components/Icon/solid/arrow-chevron-down.svg +0 -1
  329. package/src/components/Icon/solid/arrow-chevron-left.svg +0 -1
  330. package/src/components/Icon/solid/arrow-chevron-right.svg +0 -1
  331. package/src/components/Icon/solid/arrow-chevron-up.svg +0 -1
  332. package/src/components/Icon/solid/arrow-down.svg +0 -1
  333. package/src/components/Icon/solid/arrow-left.svg +0 -1
  334. package/src/components/Icon/solid/arrow-right.svg +0 -1
  335. package/src/components/Icon/solid/arrow-up.svg +0 -1
  336. package/src/components/Icon/solid/basic-shape-diamond.svg +0 -1
  337. package/src/components/Icon/solid/basic-shape-hexagon.svg +0 -1
  338. package/src/components/Icon/solid/basic-shape-primary-circle-ellipse-round.svg +0 -1
  339. package/src/components/Icon/solid/basic-shape-primary-square-rectangle.svg +0 -1
  340. package/src/components/Icon/solid/basic-shape-shield.svg +0 -1
  341. package/src/components/Icon/solid/computer-device-desktop-monitor.svg +0 -1
  342. package/src/components/Icon/solid/computer-device-desktop.svg +0 -1
  343. package/src/components/Icon/solid/computer-device-laptop.svg +0 -1
  344. package/src/components/Icon/solid/computer-device-mobile-phone-android-samsung-back.svg +0 -1
  345. package/src/components/Icon/solid/computer-device-mobile-phone-android-samsung.svg +0 -1
  346. package/src/components/Icon/solid/computer-device-mobile-phone-iphone-x-back.svg +0 -1
  347. package/src/components/Icon/solid/computer-device-mobile-phone-iphone-x.svg +0 -1
  348. package/src/components/Icon/solid/computer-device-mobile-tablet-touch.svg +0 -1
  349. package/src/components/Icon/solid/computer-device-mobile-tablet.svg +0 -1
  350. package/src/components/Icon/solid/computer-device-network-ethernet-cat6.svg +0 -1
  351. package/src/components/Icon/solid/computer-device-network-lan-www.svg +0 -1
  352. package/src/components/Icon/solid/computer-device-network-wifi-connection.svg +0 -5
  353. package/src/components/Icon/solid/computer-device-network-wifi-router.svg +0 -1
  354. package/src/components/Icon/solid/computer-keyboard-alt.svg +0 -1
  355. package/src/components/Icon/solid/computer-keyboard-command-cmd-control-ctrl.svg +0 -1
  356. package/src/components/Icon/solid/computer-keyboard-option.svg +0 -1
  357. package/src/components/Icon/solid/computer-keyboard-shift.svg +0 -1
  358. package/src/components/Icon/solid/ecology-science-erlenmeyer-flask.svg +0 -1
  359. package/src/components/Icon/solid/entertainment-control-button-circle-left-arrow-rewind.svg +0 -1
  360. package/src/components/Icon/solid/entertainment-control-button-circle-pause.svg +0 -1
  361. package/src/components/Icon/solid/entertainment-control-button-circle-play.svg +0 -5
  362. package/src/components/Icon/solid/entertainment-control-button-circle-right-arrow-fast-forward.svg +0 -1
  363. package/src/components/Icon/solid/entertainment-control-button-circle-stop-square.svg +0 -1
  364. package/src/components/Icon/solid/entertainment-party-popper-confetti.svg +0 -1
  365. package/src/components/Icon/solid/image-flash-lightning.svg +0 -5
  366. package/src/components/Icon/solid/image-photo-frame.svg +0 -11
  367. package/src/components/Icon/solid/image-picture-flower.svg +0 -5
  368. package/src/components/Icon/solid/interface-add-square.svg +0 -5
  369. package/src/components/Icon/solid/interface-alert-error-exclamation-block-square.svg +0 -1
  370. package/src/components/Icon/solid/interface-alert-error-x-block-square.svg +0 -1
  371. package/src/components/Icon/solid/interface-alert-exclamation-diamond.svg +0 -1
  372. package/src/components/Icon/solid/interface-alert-exclamation-triangle-warning.svg +0 -1
  373. package/src/components/Icon/solid/interface-alert-information-circle.svg +0 -5
  374. package/src/components/Icon/solid/interface-award-crown.svg +0 -5
  375. package/src/components/Icon/solid/interface-bookmark-tag.svg +0 -1
  376. package/src/components/Icon/solid/interface-bookmark.svg +0 -5
  377. package/src/components/Icon/solid/interface-calendar-date-one.svg +0 -5
  378. package/src/components/Icon/solid/interface-close.svg +0 -8
  379. package/src/components/Icon/solid/interface-content-book-open-pages.svg +0 -13
  380. package/src/components/Icon/solid/interface-content-book-page.svg +0 -5
  381. package/src/components/Icon/solid/interface-content-file.svg +0 -5
  382. package/src/components/Icon/solid/interface-content-folder.svg +0 -1
  383. package/src/components/Icon/solid/interface-copy-clipboard.svg +0 -5
  384. package/src/components/Icon/solid/interface-delete-bin-trash.svg +0 -1
  385. package/src/components/Icon/solid/interface-dots-horizontal.svg +0 -1
  386. package/src/components/Icon/solid/interface-dots-vertical.svg +0 -1
  387. package/src/components/Icon/solid/interface-edit-attachment.svg +0 -5
  388. package/src/components/Icon/solid/interface-edit-binocular.svg +0 -5
  389. package/src/components/Icon/solid/interface-edit-magic-wand.svg +0 -7
  390. package/src/components/Icon/solid/interface-edit-tool-eraser.svg +0 -1
  391. package/src/components/Icon/solid/interface-edit-tool-paint-brush.svg +0 -1
  392. package/src/components/Icon/solid/interface-edit-tool-paint-roller.svg +0 -5
  393. package/src/components/Icon/solid/interface-edit-tool-pen.svg +0 -5
  394. package/src/components/Icon/solid/interface-edit-tool-pencil.svg +0 -1
  395. package/src/components/Icon/solid/interface-edit-view-eye.svg +0 -7
  396. package/src/components/Icon/solid/interface-favorite-award.svg +0 -5
  397. package/src/components/Icon/solid/interface-favorite-flag.svg +0 -1
  398. package/src/components/Icon/solid/interface-favorite-heart.svg +0 -5
  399. package/src/components/Icon/solid/interface-favorite-star.svg +0 -5
  400. package/src/components/Icon/solid/interface-favorite-stars-shining.svg +0 -1
  401. package/src/components/Icon/solid/interface-favorite-stars-sparkles.svg +0 -1
  402. package/src/components/Icon/solid/interface-hierarchy-flowchart.svg +0 -5
  403. package/src/components/Icon/solid/interface-home-house.svg +0 -5
  404. package/src/components/Icon/solid/interface-hyperlink.svg +0 -5
  405. package/src/components/Icon/solid/interface-lighting-brightness.svg +0 -22
  406. package/src/components/Icon/solid/interface-lock-closed.svg +0 -5
  407. package/src/components/Icon/solid/interface-lock-open-unlock.svg +0 -1
  408. package/src/components/Icon/solid/interface-login-key.svg +0 -5
  409. package/src/components/Icon/solid/interface-search.svg +0 -5
  410. package/src/components/Icon/solid/interface-setting-cog.svg +0 -5
  411. package/src/components/Icon/solid/interface-share-megaphone-bullhorn.svg +0 -5
  412. package/src/components/Icon/solid/interface-share-rocket.svg +0 -1
  413. package/src/components/Icon/solid/interface-share-satellite.svg +0 -8
  414. package/src/components/Icon/solid/interface-share-space-ship.svg +0 -1
  415. package/src/components/Icon/solid/interface-share.svg +0 -5
  416. package/src/components/Icon/solid/interface-signal-square.svg +0 -5
  417. package/src/components/Icon/solid/interface-text-formatting-left-open-quote.svg +0 -1
  418. package/src/components/Icon/solid/interface-text-formatting-right-close-quote.svg +0 -1
  419. package/src/components/Icon/solid/interface-time-clock-circle.svg +0 -5
  420. package/src/components/Icon/solid/interface-time-hour-glass.svg +0 -1
  421. package/src/components/Icon/solid/interface-users-multiple.svg +0 -11
  422. package/src/components/Icon/solid/interface-validation-checkbox-square.svg +0 -5
  423. package/src/components/Icon/solid/interface-weather-moon.svg +0 -5
  424. package/src/components/Icon/solid/legal-justice-hammer-gavel.svg +0 -1
  425. package/src/components/Icon/solid/mail-chat-bubble-square.svg +0 -5
  426. package/src/components/Icon/solid/mail-send-email-paper-airplane.svg +0 -5
  427. package/src/components/Icon/solid/mail-send-envelope.svg +0 -1
  428. package/src/components/Icon/solid/mail-sign-hashtag.svg +0 -5
  429. package/src/components/Icon/solid/money-cashier-receipt.svg +0 -1
  430. package/src/components/Icon/solid/money-currency-dollar-pay.svg +0 -5
  431. package/src/components/Icon/solid/money-graph-arrow-increase.svg +0 -5
  432. package/src/components/Icon/solid/money-graph-bar-chart-increase.svg +0 -1
  433. package/src/components/Icon/solid/nature-ecology-leaf.svg +0 -5
  434. package/src/components/Icon/solid/phone-telephone.svg +0 -5
  435. package/src/components/Icon/solid/programming-bug.svg +0 -5
  436. package/src/components/Icon/solid/programming-cloud.svg +0 -4
  437. package/src/components/Icon/solid/programming-computer-database-server.svg +0 -5
  438. package/src/components/Icon/solid/programming-computer-database.svg +0 -5
  439. package/src/components/Icon/solid/programming-module-four-layout.svg +0 -1
  440. package/src/components/Icon/solid/programming-module-three.svg +0 -1
  441. package/src/components/Icon/solid/programming-module.svg +0 -1
  442. package/src/components/Icon/solid/programming-script-code.svg +0 -5
  443. package/src/components/Icon/solid/shopping-cart.svg +0 -1
  444. package/src/components/Icon/solid/shopping-gift-present.svg +0 -16
  445. package/src/components/Icon/solid/shopping-shipping-box-parcel-package.svg +0 -11
  446. package/src/components/Icon/solid/tag-new-circle.svg +0 -7
  447. package/src/components/Icon/solid/travel-map-earth-globe.svg +0 -5
  448. package/src/components/SearchModal.vue +0 -305
  449. package/src/components/Sidebar.vue +0 -289
  450. package/src/components/SidebarElement.vue +0 -133
  451. package/src/components/SidebarGroup.vue +0 -12
  452. package/src/components/SimpleTable/SimpleCell.vue +0 -46
  453. package/src/components/SimpleTable/SimpleHeader.vue +0 -17
  454. package/src/components/SimpleTable/SimpleRow.vue +0 -5
  455. package/src/components/SimpleTable/SimpleTable.vue +0 -13
  456. package/src/components/SimpleTable/index.ts +0 -4
  457. package/src/declarations/typographic-base.d.ts +0 -1
  458. package/src/helpers/generateAxiosCodeFromRequest.ts +0 -42
  459. package/src/helpers/generateLaravelCodeFromRequest.ts +0 -20
  460. package/src/helpers/index.ts +0 -4
  461. package/src/helpers/objectMerge.ts +0 -19
  462. package/src/helpers/specHelpers.ts +0 -62
  463. package/src/helpers/transformToJson.test.ts +0 -7
  464. package/src/helpers/transformToJson.ts +0 -22
  465. package/src/hooks/useRefOnMount.ts +0 -12
  466. package/src/index.ts +0 -9
  467. package/src/standalone.ts +0 -27
  468. package/src/stores/template.ts +0 -66
  469. package/src/stores/utility.ts +0 -23
  470. package/src/types.ts +0 -150
@@ -1,318 +0,0 @@
1
- <script setup lang="ts">
2
- import {
3
- generateRequest,
4
- useApiClientRequestStore,
5
- useApiClientStore,
6
- useOperation,
7
- } from '@scalar/api-client'
8
- import { useClipboard } from '@scalar/use-clipboard'
9
- import { CodeMirror } from '@scalar/use-codemirror'
10
- import {
11
- HTTPSnippet,
12
- type HarRequest,
13
- type TargetId,
14
- availableTargets,
15
- } from 'httpsnippet-lite'
16
- import { computed, onMounted, ref, watch } from 'vue'
17
-
18
- import {
19
- generateAxiosCodeFromRequest,
20
- generateLaravelCodeFromRequest,
21
- } from '../../../helpers'
22
- import { useTemplateStore } from '../../../stores/template'
23
- import type { Operation, Server } from '../../../types'
24
- import { Card, CardContent, CardFooter, CardHeader } from '../../Card'
25
- import { Icon } from '../../Icon'
26
-
27
- const props = defineProps<{ operation: Operation; server: Server }>()
28
-
29
- const CodeMirrorValue = ref<string>('')
30
-
31
- const { copyToClipboard } = useClipboard()
32
-
33
- const { setActiveRequest } = useApiClientRequestStore()
34
-
35
- const { toggleApiClient } = useApiClientStore()
36
-
37
- const {
38
- state: templateState,
39
- getLanguageTitleByKey,
40
- setItem,
41
- } = useTemplateStore()
42
-
43
- const CodeMirrorLanguages = computed(() => {
44
- return [templateState.preferredLanguage]
45
- })
46
-
47
- const { parameterMap } = useOperation(props)
48
-
49
- async function generateSnippet() {
50
- let path = props.operation.path
51
-
52
- // Replace all variables of the format {something} with the uppercase variable name without the brackets
53
- const pathVariables = path.match(/{(.*?)}/g)
54
-
55
- if (pathVariables) {
56
- pathVariables.forEach((variable) => {
57
- const variableName = variable.replace(/{|}/g, '')
58
- path = path.replace(variable, variableName.toUpperCase())
59
- })
60
- }
61
-
62
- if (templateState.preferredLanguage === 'axios') {
63
- return generateAxiosCodeFromRequest({
64
- method: props.operation.httpVerb.toUpperCase(),
65
- url: `${props.server.url}${path}`,
66
- })
67
- } else if (templateState.preferredLanguage === 'laravel') {
68
- return generateLaravelCodeFromRequest({
69
- method: props.operation.httpVerb.toUpperCase(),
70
- url: `${props.server.url}${path}`,
71
- })
72
- }
73
-
74
- try {
75
- const snippet = new HTTPSnippet({
76
- method: props.operation.httpVerb.toUpperCase(),
77
- url: `${props.server.url}${path}`,
78
- } as HarRequest)
79
- const output = (await snippet.convert(
80
- templateState.preferredLanguage as TargetId,
81
- )) as string
82
- return output
83
- } catch {
84
- const snippet = new HTTPSnippet({
85
- method: props.operation.httpVerb.toUpperCase(),
86
- url: `${window.location.origin}${path}`,
87
- } as HarRequest)
88
- const output = (await snippet.convert(
89
- templateState.preferredLanguage as TargetId,
90
- )) as string
91
-
92
- return output
93
- }
94
- }
95
-
96
- onMounted(async () => {
97
- const initialSnippet = await generateSnippet()
98
- CodeMirrorValue.value = initialSnippet
99
- watch(
100
- () => templateState.preferredLanguage,
101
- async () => {
102
- const output = await generateSnippet()
103
- CodeMirrorValue.value = output
104
- },
105
- )
106
- })
107
-
108
- const copyExampleRequest = async () => {
109
- copyToClipboard(CodeMirrorValue.value)
110
- }
111
-
112
- function showItemInClient() {
113
- const item = generateRequest(
114
- props.operation,
115
- parameterMap.value,
116
- props.server,
117
- )
118
- setActiveRequest(item)
119
- toggleApiClient()
120
- }
121
-
122
- // Store selected languages in LocalStorage
123
- const localStorageKey = 'preferredLanguage'
124
- const selectLanguage = (language: TargetId) => {
125
- setItem('preferredLanguage', language)
126
- localStorage.setItem(localStorageKey, language)
127
- }
128
-
129
- const availableLanguages = computed(() => {
130
- return [
131
- ...availableTargets().filter((target) => target.key !== 'http'),
132
- { key: 'axios', title: 'JavaScript (Axios)' },
133
- { key: 'laravel', title: 'PHP (Laravel)' },
134
- ].sort((a, b) => a.title.localeCompare(b.title))
135
- })
136
- </script>
137
- <template>
138
- <Card class="dark-mode">
139
- <CardHeader muted>
140
- <span :class="`request-method request-method--${operation.httpVerb}`">
141
- {{ operation.httpVerb }}
142
- </span>
143
- <span class="request-path">{{ operation.path }}</span>
144
-
145
- <template #actions>
146
- <div class="language-select">
147
- <span>{{
148
- getLanguageTitleByKey(templateState.preferredLanguage)
149
- }}</span>
150
- <select
151
- class="language-select"
152
- :value="templateState.preferredLanguage"
153
- @input="event => selectLanguage((event.target as HTMLSelectElement).value as TargetId)">
154
- <option
155
- v-for="lang in availableLanguages"
156
- :key="lang.key"
157
- :value="lang.key">
158
- {{ lang.title }}
159
- </option>
160
- </select>
161
- </div>
162
-
163
- <button
164
- class="copy-button"
165
- type="button"
166
- @click="copyExampleRequest">
167
- <Icon
168
- src="solid/interface-copy-clipboard"
169
- width="10px" />
170
- </button>
171
- </template>
172
- </CardHeader>
173
- <CardContent
174
- borderless
175
- frameless>
176
- <!-- @vue-ignore -->
177
- <CodeMirror
178
- :content="CodeMirrorValue"
179
- :forceDarkMode="true"
180
- :languages="CodeMirrorLanguages"
181
- lineNumbers
182
- readOnly />
183
- </CardContent>
184
- <CardFooter muted>
185
- <button
186
- class="show-api-client-button"
187
- type="button"
188
- @click="showItemInClient">
189
- <Icon src="solid/mail-send-email-paper-airplane" />
190
- Test {{ operation.httpVerb }} Request in Client
191
- </button>
192
- </CardFooter>
193
- </Card>
194
- </template>
195
- <style scoped>
196
- .request-method--post {
197
- color: var(--theme-post-color);
198
- }
199
- .request-method--patch {
200
- color: var(--theme-patch-color);
201
- }
202
- .request-method--get {
203
- color: var(--theme-get-color);
204
- }
205
- .request-method--delete {
206
- color: var(--theme-delete-color);
207
- }
208
- .request-method--put {
209
- color: var(--theme-put-color);
210
- }
211
- .request-path {
212
- margin-left: 6px;
213
- color: var(--theme-color-2);
214
- white-space: nowrap;
215
- overflow: hidden;
216
- cursor: default;
217
- text-overflow: ellipsis;
218
- text-transform: none !important;
219
- }
220
-
221
- .language-select {
222
- position: relative;
223
- padding-right: 9px;
224
- border-right: 1px solid var(--theme-border-color);
225
- }
226
- .language-select select {
227
- border: none;
228
- outline: none;
229
- cursor: pointer;
230
- background: var(--theme-background-3);
231
- box-shadow: -2px 0 0 0 var(--theme-background-3);
232
- z-index: 2;
233
- position: absolute;
234
- top: 0;
235
- left: 0;
236
- width: 100%;
237
- height: 100%;
238
- opacity: 0;
239
- appearance: none;
240
- }
241
- .language-select span {
242
- font-size: 12px;
243
- color: var(--theme-color-3);
244
- font-weight: var(--theme-semibold);
245
- display: flex;
246
- align-items: center;
247
- justify-content: center;
248
- }
249
- .language-select span:after {
250
- content: '';
251
- width: 7px;
252
- height: 7px;
253
- transform: rotate(45deg) translate3d(-2px, -2px, 0);
254
- display: block;
255
- margin-left: 6px;
256
- box-shadow: 1px 1px 0 currentColor;
257
- }
258
- .language-select span:hover {
259
- background: var(--theme-background-2);
260
- }
261
-
262
- .copy-button {
263
- appearance: none;
264
- -webkit-appearance: none;
265
- outline: none;
266
- background: transparent;
267
- display: flex;
268
- cursor: pointer;
269
- color: var(--theme-color-3);
270
- margin-left: 6px;
271
- border: none;
272
- border-radius: 3px;
273
- }
274
-
275
- .copy-button:hover {
276
- color: var(--theme-color-1);
277
- }
278
-
279
- .copy-button svg {
280
- width: 13px;
281
- height: 13px;
282
- }
283
-
284
- .show-api-client-button {
285
- width: 100%;
286
- display: block;
287
- appearance: none;
288
- outline: none;
289
- border: none;
290
- border-radius: var(--theme-radius-lg);
291
- height: 35px;
292
- display: flex;
293
- justify-content: center;
294
- cursor: pointer;
295
- align-items: center;
296
- font-weight: var(--theme-bold);
297
- font-size: var(--theme-micro);
298
- text-transform: uppercase;
299
- border: 1px solid currentColor;
300
- background: var(--theme-button-1);
301
- color: var(--theme-button-1-color);
302
- }
303
- .show-api-client-button:hover {
304
- background: var(--theme-button-1-hover);
305
- }
306
- .show-api-client-button svg {
307
- height: 12px;
308
- width: auto;
309
- margin-right: 6px;
310
- }
311
-
312
- .request-method {
313
- font-family: var(--theme-font-code);
314
- }
315
- .request-path {
316
- font-family: var(--theme-font-code);
317
- }
318
- </style>
@@ -1,22 +0,0 @@
1
- <script lang="ts" setup>
2
- import { httpStatusCodes } from '@scalar/api-client'
3
- import { useTooltip } from '@scalar/use-tooltip'
4
- import { computed } from 'vue'
5
-
6
- const props = defineProps<{ title: string }>()
7
-
8
- const statusText = computed(() => {
9
- return httpStatusCodes[props.title]?.name ?? null
10
- })
11
-
12
- const tooltipRef = useTooltip({
13
- content: statusText.value,
14
- })
15
- </script>
16
- <template>
17
- <span
18
- ref="tooltipRef"
19
- class="codemenu-item-key">
20
- {{ title }}
21
- </span>
22
- </template>
@@ -1,169 +0,0 @@
1
- <script lang="ts" setup>
2
- import { type HttpHeader, httpHeaders } from '@scalar/api-client'
3
- import { useClipboard } from '@scalar/use-clipboard'
4
- import { CodeMirror } from '@scalar/use-codemirror'
5
- import { computed, ref } from 'vue'
6
-
7
- import type { TransformedOperation } from '../../../types'
8
- import {
9
- Card,
10
- CardContent,
11
- CardFooter,
12
- CardTab,
13
- CardTabHeader,
14
- } from '../../Card'
15
- import { Icon } from '../../Icon'
16
- import {
17
- SimpleCell,
18
- SimpleHeader,
19
- SimpleRow,
20
- SimpleTable,
21
- } from '../../SimpleTable'
22
-
23
- const props = defineProps<{ operation: TransformedOperation }>()
24
-
25
- const { copyToClipboard } = useClipboard()
26
-
27
- // Bring the status codes in the right order.
28
- const orderedStatusCodes = computed(() => {
29
- return Object.keys(props?.operation?.responses ?? {}).sort((x) => {
30
- if (x === 'default') {
31
- return -1
32
- }
33
-
34
- return 0
35
- })
36
- })
37
-
38
- // Keep track of the current selected tab
39
- const selectedResponseIndex = ref<number>(0)
40
-
41
- // Return the whole response object
42
- const currentResponse = computed(() => {
43
- const currentStatusCode =
44
- orderedStatusCodes.value[selectedResponseIndex.value]
45
-
46
- return props.operation.responses?.[currentStatusCode]
47
- })
48
-
49
- const currentResponseJsonBody = computed(() => {
50
- return currentResponse.value?.content?.['application/json']?.body
51
- })
52
-
53
- const changeTab = (index: number) => {
54
- selectedResponseIndex.value = index
55
- }
56
-
57
- const getDocumentationUrlForHttpHeader = (headerName: string) => {
58
- return httpHeaders.find((header: HttpHeader) => {
59
- return header.name.toLowerCase() === headerName.toLowerCase()
60
- })?.url
61
- }
62
-
63
- // Make the first letter and all letters after a - uppercase
64
- const formatHeaderName = (headerName: string) => {
65
- return headerName
66
- .split('-')
67
- .map((word) => {
68
- return word.charAt(0).toUpperCase() + word.slice(1)
69
- })
70
- .join('-')
71
- }
72
- </script>
73
- <template>
74
- <Card v-if="orderedStatusCodes.length">
75
- <CardTabHeader
76
- muted
77
- @change="changeTab">
78
- <CardTab
79
- v-for="statusCode in orderedStatusCodes"
80
- :key="statusCode">
81
- {{ statusCode }}
82
- </CardTab>
83
-
84
- <template #actions>
85
- <button
86
- v-if="currentResponseJsonBody"
87
- class="code-copy"
88
- type="button"
89
- @click="() => copyToClipboard(currentResponseJsonBody)">
90
- <Icon
91
- src="solid/interface-copy-clipboard"
92
- width="10px" />
93
- </button>
94
- </template>
95
- </CardTabHeader>
96
- <CardContent
97
- v-if="currentResponse.headers"
98
- muted>
99
- <SimpleTable>
100
- <SimpleRow>
101
- <SimpleHeader>Header</SimpleHeader>
102
- <SimpleHeader>Description</SimpleHeader>
103
- </SimpleRow>
104
- <SimpleRow
105
- v-for="(data, header) in currentResponse.headers"
106
- :key="header">
107
- <SimpleCell
108
- :href="getDocumentationUrlForHttpHeader(header)"
109
- :strong="true"
110
- :wrap="false">
111
- {{ formatHeaderName(header) }}
112
- </SimpleCell>
113
- <SimpleCell>{{ data.description }}</SimpleCell>
114
- </SimpleRow>
115
- </SimpleTable>
116
- </CardContent>
117
- <CardContent muted>
118
- <CodeMirror
119
- v-show="currentResponseJsonBody"
120
- :content="currentResponseJsonBody"
121
- :languages="['json']"
122
- readOnly />
123
- <div
124
- v-if="!currentResponseJsonBody"
125
- class="scalar-api-reference__empty-state">
126
- No Body
127
- </div>
128
- </CardContent>
129
- <CardFooter
130
- v-if="currentResponse?.description"
131
- muted>
132
- <div class="description">
133
- {{ currentResponse.description }}
134
- </div>
135
- </CardFooter>
136
- </Card>
137
- </template>
138
-
139
- <style scoped>
140
- .code-copy {
141
- display: flex;
142
- appearance: none;
143
- -webkit-appearance: none;
144
- outline: none;
145
- background: transparent;
146
- cursor: pointer;
147
- color: var(--theme-color-3);
148
- border: none;
149
- }
150
- .code-copy:hover {
151
- color: var(--theme-color-1);
152
- }
153
- .code-copy svg {
154
- width: 13px;
155
- height: 13px;
156
- }
157
- .description {
158
- font-weight: var(--theme-semibold);
159
- font-size: var(--theme-micro);
160
- }
161
- .scalar-api-reference__empty-state {
162
- border: 1px dashed var(--theme-border-color);
163
- width: 100%;
164
- text-align: center;
165
- font-size: var(--theme-micro);
166
- padding: 20px;
167
- color: var(--theme-color-2);
168
- }
169
- </style>
@@ -1,26 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Parameters } from '../../../types'
3
- import MarkdownRenderer from '../MarkdownRenderer.vue'
4
-
5
- defineProps<{ parameter: Parameters }>()
6
- </script>
7
- <template>
8
- <li>
9
- <span class="parameter-name">{{ parameter.name }}</span>
10
- <span
11
- v-if="parameter.required !== undefined"
12
- class="parameter-required"
13
- :class="parameter.required ? 'marc_required' : ''">
14
- {{ parameter.required ? 'required' : 'optional' }}
15
- </span>
16
- <span
17
- v-if="parameter.schema?.type"
18
- class="parameter-type">
19
- {{ parameter.schema?.type }}
20
- </span>
21
- <MarkdownRenderer
22
- v-if="parameter.description"
23
- class="parameter-description"
24
- :value="parameter.description" />
25
- </li>
26
- </template>
@@ -1,23 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Parameters } from '../../../types'
3
- import ParameterItem from './ParameterItem.vue'
4
-
5
- defineProps<{ parameters?: Parameters[]; title: string }>()
6
- </script>
7
- <template>
8
- <div
9
- v-if="parameters?.length"
10
- class="parameters-container">
11
- <div class="endpoint-title">
12
- <h5 class="title">
13
- {{ title }}
14
- </h5>
15
- </div>
16
- <ul class="parameter">
17
- <ParameterItem
18
- v-for="item in parameters"
19
- :key="item.name"
20
- :parameter="item" />
21
- </ul>
22
- </div>
23
- </template>
@@ -1,29 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Server, Tag, TransformedOperation } from '../../../types'
3
- import Copy from './Copy.vue'
4
- import ExampleRequest from './ExampleRequest.vue'
5
- import ExampleResponses from './ExampleResponses.vue'
6
-
7
- defineProps<{
8
- operation: TransformedOperation
9
- server: Server
10
- parentTag: Tag
11
- }>()
12
- </script>
13
- <template>
14
- <div
15
- :id="`endpoint/${operation.operationId}`"
16
- class="reference-container">
17
- <Copy
18
- :operation="operation"
19
- :parentTag="parentTag" />
20
- <div class="example">
21
- <ExampleRequest
22
- :operation="operation"
23
- :server="server" />
24
- <ExampleResponses
25
- :operation="operation"
26
- style="margin-top: 12px" />
27
- </div>
28
- </div>
29
- </template>
@@ -1,125 +0,0 @@
1
- <script setup lang="ts">
2
- import type { RequestBody } from '../../../types'
3
- import RequestBodyProperties from './RequestBodyProperties.vue'
4
-
5
- defineProps<{ requestBody?: RequestBody }>()
6
- </script>
7
- <template>
8
- <div
9
- v-if="requestBody && requestBody.content['application/json']"
10
- class="body-container">
11
- <div class="endpoint-title">
12
- <h5 class="title">Body</h5>
13
- </div>
14
- <ul
15
- v-if="requestBody.content['application/json']"
16
- class="parameter">
17
- <RequestBodyProperties
18
- :contentProperties="
19
- requestBody.content['application/json'].schema.properties || {}
20
- "
21
- :required="
22
- requestBody.content['application/json'].schema.required || []
23
- " />
24
- </ul>
25
- </div>
26
- </template>
27
-
28
- <style>
29
- .parameter p {
30
- margin-top: 6px;
31
- }
32
- .parameter .parameter-child {
33
- border: 1px solid var(--theme-border-color);
34
- border-radius: 20px;
35
- margin-top: 12px;
36
- width: fit-content;
37
- }
38
- .parameter .parameter {
39
- border: none !important;
40
- }
41
- .parameter-child-trigger {
42
- padding: 6px 12px;
43
- cursor: pointer;
44
- font-weight: 500;
45
- color: var(--theme-color-3);
46
- font-size: var(--theme-micro);
47
- display: flex;
48
- align-items: center;
49
- user-select: none;
50
- }
51
- .parameter-child-trigger:has(+ .parameter li:first-of-type:last-of-type) {
52
- display: none;
53
- }
54
- .parameter-child-trigger:hover {
55
- color: var(--theme-color-1);
56
- }
57
- .parameter-child-trigger > span:before {
58
- content: 'Show ';
59
- }
60
- .parameter-child__open > .parameter-child-trigger span:before {
61
- content: 'Hide ';
62
- }
63
- .parameter-child-trigger svg {
64
- height: 10px;
65
- width: 10px;
66
- margin-right: 6px;
67
- }
68
- .parameter-child__open .parameter-child-trigger svg {
69
- transform: rotate(45deg);
70
- }
71
- .parameter .parameter li:first-of-type {
72
- border-top: none;
73
- }
74
- .parameter .parameter li {
75
- padding: 12px;
76
- }
77
- .parameter-child__open > .parameter {
78
- display: block;
79
- }
80
- .parameter .parameter-child__open {
81
- width: 100%;
82
- border-radius: 6px;
83
- }
84
- .parameter .parameter-child__open > svg {
85
- transform: rotate(45deg);
86
- }
87
- .parameter-child__open > .parameter-child-trigger {
88
- border-bottom: 1px solid var(--theme-border-color);
89
- }
90
-
91
- .parameter {
92
- list-style: none;
93
- font-size: var(--theme-small);
94
- }
95
- .parameter li {
96
- border-top: 1px solid var(--theme-border-color);
97
- padding: 12px 0;
98
- }
99
- .parameter-name {
100
- font-weight: 500;
101
- margin-right: 6px;
102
- font-family: var(--theme-font-code);
103
- font-size: 13px;
104
- color: var(--theme-color-1);
105
- }
106
- .parameter-type,
107
- .parameter-required {
108
- color: var(--theme-color-3);
109
- font-weight: var(--theme-semibold);
110
- margin-right: 6px;
111
- position: relative;
112
- }
113
- .marc_required {
114
- text-transform: uppercase;
115
- font-size: 11px;
116
- font-weight: var(--theme-bold);
117
- color: #ffb040;
118
- }
119
- .parameter-options {
120
- position: relative;
121
- }
122
- .copy .parameter-description:empty {
123
- display: none;
124
- }
125
- </style>