@scalar/api-reference 1.48.8 → 1.49.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 (381) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/AgentScalarChatInterface-MUbtSqMw.js +41 -0
  3. package/dist/AgentScalarChatInterface-MUbtSqMw.js.map +1 -0
  4. package/dist/ExternalDocs-phu7GxpZ.js +272 -0
  5. package/dist/ExternalDocs-phu7GxpZ.js.map +1 -0
  6. package/dist/MobileHeader-B71jYJdT.js +1373 -0
  7. package/dist/MobileHeader-B71jYJdT.js.map +1 -0
  8. package/dist/Operation-CixLVfKd.js +3827 -0
  9. package/dist/Operation-CixLVfKd.js.map +1 -0
  10. package/dist/SearchButton-xzhIpMCZ.js +621 -0
  11. package/dist/SearchButton-xzhIpMCZ.js.map +1 -0
  12. package/dist/ServerSelector-5y29y2BJ.js +852 -0
  13. package/dist/ServerSelector-5y29y2BJ.js.map +1 -0
  14. package/dist/blocks/index.js +3 -10
  15. package/dist/blocks/scalar-client-selector-block/index.d.ts +1 -1
  16. package/dist/blocks/scalar-info-block/index.d.ts +2 -2
  17. package/dist/blocks/scalar-server-selector-block/index.d.ts +1 -1
  18. package/dist/browser/standalone.js +40748 -34662
  19. package/dist/browser/webpack-stats.json +1 -1
  20. package/dist/components/AgentScalar/index.d.ts +3 -3
  21. package/dist/components/Anchor/index.d.ts +2 -2
  22. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  23. package/dist/components/Badge/index.d.ts +1 -1
  24. package/dist/components/Content/Auth/index.d.ts +1 -1
  25. package/dist/components/Content/Content.vue.d.ts +2 -4
  26. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Models/ModelTag.vue.d.ts +3 -3
  28. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  29. package/dist/components/Content/Models/index.d.ts +2 -2
  30. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
  32. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
  33. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -1
  34. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
  35. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  36. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  37. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  38. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +1 -1
  39. package/dist/components/Content/Schema/index.d.ts +4 -4
  40. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts +2 -2
  41. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
  42. package/dist/components/Content/Tags/index.d.ts +1 -1
  43. package/dist/components/Content/index.d.ts +2 -2
  44. package/dist/components/HttpMethod/index.d.ts +1 -1
  45. package/dist/components/Lazy/Lazy.vue.d.ts +3 -0
  46. package/dist/components/Lazy/Lazy.vue.d.ts.map +1 -1
  47. package/dist/components/LinkList/index.d.ts +1 -1
  48. package/dist/components/OperationsList/index.d.ts +1 -1
  49. package/dist/components/RenderPlugins/index.d.ts +1 -1
  50. package/dist/components/Section/index.d.ts +10 -10
  51. package/dist/components/SectionFlare/index.d.ts +1 -1
  52. package/dist/components/index.d.ts +5 -5
  53. package/dist/components/index.js +102 -42
  54. package/dist/components/index.js.map +1 -0
  55. package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -1
  56. package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -1
  57. package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -1
  58. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -1
  59. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -1
  60. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +1 -1
  61. package/dist/features/Operation/index.d.ts +1 -1
  62. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
  63. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +1 -1
  64. package/dist/features/Search/components/SearchResult.vue.d.ts +1 -1
  65. package/dist/features/Search/helpers/create-fuse-instance.d.ts +1 -1
  66. package/dist/features/Search/helpers/create-search-index.d.ts +1 -1
  67. package/dist/features/Search/index.d.ts +2 -2
  68. package/dist/features/Search/types.d.ts +1 -1
  69. package/dist/features/ask-agent-button/AskAgentButton.vue.d.ts.map +1 -1
  70. package/dist/features/developer-tools/index.d.ts +1 -1
  71. package/dist/features/example-responses/index.d.ts +1 -1
  72. package/dist/features/external-docs/index.d.ts +1 -1
  73. package/dist/features/index.d.ts +2 -2
  74. package/dist/features/index.js +4 -10
  75. package/dist/features/info-object/index.d.ts +3 -3
  76. package/dist/features/specification-extension/index.d.ts +2 -2
  77. package/dist/features/test-request-button/index.d.ts +1 -1
  78. package/dist/features/x-badges/index.d.ts +1 -1
  79. package/dist/helpers/download.d.ts +1 -1
  80. package/dist/helpers/download.d.ts.map +1 -1
  81. package/dist/helpers/id-routing.d.ts +4 -0
  82. package/dist/helpers/id-routing.d.ts.map +1 -1
  83. package/dist/helpers/index.d.ts +8 -8
  84. package/dist/helpers/index.js +3 -24
  85. package/dist/helpers/lazy-bus.d.ts +19 -19
  86. package/dist/helpers/lazy-bus.d.ts.map +1 -1
  87. package/dist/hooks/index.d.ts +2 -2
  88. package/dist/hooks/index.js +3 -8
  89. package/dist/index.d.ts +5 -5
  90. package/dist/index.js +7 -14
  91. package/dist/lazy-bus-CV8Ox5hD.js +333 -0
  92. package/dist/lazy-bus-CV8Ox5hD.js.map +1 -0
  93. package/dist/normalize-configurations-DcVpOEjD.js +232 -0
  94. package/dist/normalize-configurations-DcVpOEjD.js.map +1 -0
  95. package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
  96. package/dist/plugins/index.d.ts +3 -3
  97. package/dist/plugins/index.js +2 -9
  98. package/dist/plugins-4EyiUD_A.js +80 -0
  99. package/dist/plugins-4EyiUD_A.js.map +1 -0
  100. package/dist/src-DqcYVBWI.js +1686 -0
  101. package/dist/src-DqcYVBWI.js.map +1 -0
  102. package/dist/ssr.d.ts +2 -2
  103. package/dist/ssr.js +7 -14
  104. package/dist/storage--3JuzjCI.js +42 -0
  105. package/dist/storage--3JuzjCI.js.map +1 -0
  106. package/dist/style.css +6840 -7397
  107. package/dist/urls-gPTXGgbj.js +17 -0
  108. package/dist/urls-gPTXGgbj.js.map +1 -0
  109. package/dist/use-agent-Bnm1de0n.js +60 -0
  110. package/dist/use-agent-Bnm1de0n.js.map +1 -0
  111. package/dist/use-intersection-8QqPi2O-.js +24 -0
  112. package/dist/use-intersection-8QqPi2O-.js.map +1 -0
  113. package/package.json +25 -27
  114. package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
  115. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +0 -7
  116. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +0 -123
  117. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +0 -7
  118. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +0 -142
  119. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js +0 -24
  120. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +0 -7
  121. package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +0 -63
  122. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +0 -59
  123. package/dist/blocks/scalar-info-block/components/InfoBlock.vue2.js +0 -4
  124. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +0 -7
  125. package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +0 -70
  126. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +0 -38
  127. package/dist/blocks/scalar-info-block/components/InfoLinks.vue2.js +0 -4
  128. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +0 -38
  129. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue2.js +0 -4
  130. package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js +0 -28
  131. package/dist/blocks/scalar-info-block/components/InfoVersion.vue2.js +0 -4
  132. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +0 -7
  133. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue2.js +0 -19
  134. package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +0 -14
  135. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +0 -7
  136. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +0 -112
  137. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +0 -21
  138. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue2.js +0 -4
  139. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +0 -76
  140. package/dist/blocks/scalar-server-selector-block/components/Selector.vue2.js +0 -4
  141. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +0 -72
  142. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue2.js +0 -4
  143. package/dist/components/AgentScalar/AgentScalarButton.vue.js +0 -22
  144. package/dist/components/AgentScalar/AgentScalarButton.vue2.js +0 -4
  145. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js +0 -4
  146. package/dist/components/AgentScalar/AgentScalarChatInterface.vue2.js +0 -29
  147. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +0 -7
  148. package/dist/components/AgentScalar/AgentScalarDrawer.vue2.js +0 -78
  149. package/dist/components/AgentScalar/OpenMCPButton.vue.js +0 -7
  150. package/dist/components/AgentScalar/OpenMCPButton.vue2.js +0 -191
  151. package/dist/components/Anchor/Anchor.vue.js +0 -51
  152. package/dist/components/Anchor/Anchor.vue2.js +0 -4
  153. package/dist/components/Anchor/WithBreadcrumb.vue.js +0 -41
  154. package/dist/components/Anchor/WithBreadcrumb.vue2.js +0 -4
  155. package/dist/components/ApiReference.vue.js +0 -10
  156. package/dist/components/ApiReference.vue2.js +0 -744
  157. package/dist/components/Badge/Badge.vue.js +0 -7
  158. package/dist/components/Badge/Badge.vue2.js +0 -26
  159. package/dist/components/ClassicHeader.vue.js +0 -21
  160. package/dist/components/Content/Auth/Auth.vue.js +0 -77
  161. package/dist/components/Content/Auth/Auth.vue2.js +0 -4
  162. package/dist/components/Content/Auth/helpers/get-default-security.js +0 -55
  163. package/dist/components/Content/Content.vue.js +0 -177
  164. package/dist/components/Content/Content.vue3.js +0 -5
  165. package/dist/components/Content/Models/Model.vue.js +0 -47
  166. package/dist/components/Content/Models/Model.vue2.js +0 -4
  167. package/dist/components/Content/Models/ModelTag.vue.js +0 -82
  168. package/dist/components/Content/Models/ModelTag.vue2.js +0 -4
  169. package/dist/components/Content/Models/components/ClassicLayout.vue.js +0 -7
  170. package/dist/components/Content/Models/components/ClassicLayout.vue2.js +0 -78
  171. package/dist/components/Content/Models/components/ModernLayout.vue.js +0 -61
  172. package/dist/components/Content/Models/components/ModernLayout.vue2.js +0 -4
  173. package/dist/components/Content/Operations/TraversedEntry.vue.js +0 -145
  174. package/dist/components/Content/Operations/TraversedEntry.vue2.js +0 -4
  175. package/dist/components/Content/Schema/RenderString.vue.js +0 -27
  176. package/dist/components/Content/Schema/RenderString.vue2.js +0 -4
  177. package/dist/components/Content/Schema/Schema.vue.js +0 -7
  178. package/dist/components/Content/Schema/Schema.vue2.js +0 -193
  179. package/dist/components/Content/Schema/SchemaComposition.vue.js +0 -120
  180. package/dist/components/Content/Schema/SchemaComposition.vue2.js +0 -4
  181. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +0 -7
  182. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +0 -36
  183. package/dist/components/Content/Schema/SchemaEnums.vue.js +0 -7
  184. package/dist/components/Content/Schema/SchemaEnums.vue2.js +0 -112
  185. package/dist/components/Content/Schema/SchemaHeading.vue.js +0 -7
  186. package/dist/components/Content/Schema/SchemaHeading.vue2.js +0 -61
  187. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js +0 -66
  188. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue2.js +0 -4
  189. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +0 -120
  190. package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +0 -4
  191. package/dist/components/Content/Schema/SchemaProperty.vue.js +0 -7
  192. package/dist/components/Content/Schema/SchemaProperty.vue2.js +0 -228
  193. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +0 -7
  194. package/dist/components/Content/Schema/SchemaPropertyDefault.vue2.js +0 -45
  195. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +0 -7
  196. package/dist/components/Content/Schema/SchemaPropertyDetail.vue2.js +0 -40
  197. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +0 -7
  198. package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +0 -80
  199. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +0 -7
  200. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +0 -318
  201. package/dist/components/Content/Schema/helpers/format-example.js +0 -41
  202. package/dist/components/Content/Schema/helpers/format-value.js +0 -35
  203. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +0 -31
  204. package/dist/components/Content/Schema/helpers/get-enum-values.js +0 -20
  205. package/dist/components/Content/Schema/helpers/get-property-description.js +0 -34
  206. package/dist/components/Content/Schema/helpers/get-ref-name.js +0 -14
  207. package/dist/components/Content/Schema/helpers/get-schema-type.js +0 -47
  208. package/dist/components/Content/Schema/helpers/has-complex-array-items.js +0 -48
  209. package/dist/components/Content/Schema/helpers/is-empty-schema-object.js +0 -13
  210. package/dist/components/Content/Schema/helpers/is-type-object.js +0 -27
  211. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +0 -215
  212. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +0 -64
  213. package/dist/components/Content/Schema/helpers/schema-composition.js +0 -4
  214. package/dist/components/Content/Schema/helpers/schema-name.js +0 -24
  215. package/dist/components/Content/Schema/helpers/should-display-description.js +0 -12
  216. package/dist/components/Content/Schema/helpers/should-display-heading.js +0 -12
  217. package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js +0 -15
  218. package/dist/components/Content/Schema/helpers/sort-property-names.js +0 -71
  219. package/dist/components/Content/Tags/Tag.vue.js +0 -46
  220. package/dist/components/Content/Tags/Tag.vue2.js +0 -4
  221. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +0 -7
  222. package/dist/components/Content/Tags/components/ClassicLayout.vue2.js +0 -57
  223. package/dist/components/Content/Tags/components/ModernLayout.vue.js +0 -7
  224. package/dist/components/Content/Tags/components/ModernLayout.vue2.js +0 -64
  225. package/dist/components/Content/Tags/components/TagSection.vue.js +0 -100
  226. package/dist/components/Content/Tags/components/TagSection.vue2.js +0 -4
  227. package/dist/components/GettingStarted.vue.js +0 -7
  228. package/dist/components/GettingStarted.vue2.js +0 -82
  229. package/dist/components/HttpMethod/HttpMethod.vue.js +0 -34
  230. package/dist/components/HttpMethod/HttpMethod.vue2.js +0 -4
  231. package/dist/components/IntersectionObserver.vue.js +0 -55
  232. package/dist/components/IntersectionObserver.vue2.js +0 -4
  233. package/dist/components/Lazy/Lazy.vue.js +0 -17
  234. package/dist/components/Lazy/Lazy.vue2.js +0 -4
  235. package/dist/components/LinkList/LinkList.vue.js +0 -7
  236. package/dist/components/LinkList/LinkList.vue2.js +0 -48
  237. package/dist/components/LoadingSkeleton.vue.js +0 -7
  238. package/dist/components/LoadingSkeleton.vue2.js +0 -20
  239. package/dist/components/MobileHeader.vue.js +0 -62
  240. package/dist/components/MobileHeader.vue2.js +0 -4
  241. package/dist/components/OperationPath.vue.js +0 -7
  242. package/dist/components/OperationPath.vue2.js +0 -30
  243. package/dist/components/OperationsList/OperationsList.vue.js +0 -7
  244. package/dist/components/OperationsList/OperationsList.vue2.js +0 -61
  245. package/dist/components/OperationsList/OperationsListItem.vue.js +0 -7
  246. package/dist/components/OperationsList/OperationsListItem.vue2.js +0 -68
  247. package/dist/components/RenderPlugins/RenderPlugins.vue.js +0 -43
  248. package/dist/components/RenderPlugins/RenderPlugins.vue2.js +0 -4
  249. package/dist/components/ScreenReader.vue.js +0 -7
  250. package/dist/components/ScreenReader.vue2.js +0 -21
  251. package/dist/components/Section/CompactSection.vue.js +0 -7
  252. package/dist/components/Section/CompactSection.vue2.js +0 -60
  253. package/dist/components/Section/Section.vue.js +0 -7
  254. package/dist/components/Section/Section.vue2.js +0 -23
  255. package/dist/components/Section/SectionAccordion.vue.js +0 -7
  256. package/dist/components/Section/SectionAccordion.vue2.js +0 -76
  257. package/dist/components/Section/SectionColumn.vue.js +0 -14
  258. package/dist/components/Section/SectionColumns.vue.js +0 -14
  259. package/dist/components/Section/SectionContainer.vue.js +0 -7
  260. package/dist/components/Section/SectionContainer.vue2.js +0 -21
  261. package/dist/components/Section/SectionContainerAccordion.vue.js +0 -7
  262. package/dist/components/Section/SectionContainerAccordion.vue2.js +0 -54
  263. package/dist/components/Section/SectionContent.vue.js +0 -7
  264. package/dist/components/Section/SectionContent.vue2.js +0 -22
  265. package/dist/components/Section/SectionHeader.vue.js +0 -7
  266. package/dist/components/Section/SectionHeader.vue2.js +0 -26
  267. package/dist/components/Section/SectionHeaderTag.vue.js +0 -7
  268. package/dist/components/Section/SectionHeaderTag.vue2.js +0 -20
  269. package/dist/components/SectionFlare/SectionFlare.vue.js +0 -14
  270. package/dist/components/ShowMoreButton.vue.js +0 -7
  271. package/dist/components/ShowMoreButton.vue2.js +0 -23
  272. package/dist/consts/urls.js +0 -16
  273. package/dist/features/Operation/Operation.vue.js +0 -100
  274. package/dist/features/Operation/Operation.vue2.js +0 -4
  275. package/dist/features/Operation/components/ContentTypeSelect.vue.js +0 -88
  276. package/dist/features/Operation/components/ContentTypeSelect.vue2.js +0 -4
  277. package/dist/features/Operation/components/Header.vue.js +0 -33
  278. package/dist/features/Operation/components/Header.vue2.js +0 -4
  279. package/dist/features/Operation/components/Headers.vue.js +0 -7
  280. package/dist/features/Operation/components/Headers.vue2.js +0 -71
  281. package/dist/features/Operation/components/OperationParameters.vue.js +0 -92
  282. package/dist/features/Operation/components/OperationParameters.vue2.js +0 -4
  283. package/dist/features/Operation/components/OperationResponses.vue.js +0 -44
  284. package/dist/features/Operation/components/OperationResponses.vue2.js +0 -4
  285. package/dist/features/Operation/components/ParameterList.vue.js +0 -50
  286. package/dist/features/Operation/components/ParameterList.vue2.js +0 -4
  287. package/dist/features/Operation/components/ParameterListItem.vue.js +0 -7
  288. package/dist/features/Operation/components/ParameterListItem.vue2.js +0 -163
  289. package/dist/features/Operation/components/RequestBody.vue.js +0 -7
  290. package/dist/features/Operation/components/RequestBody.vue2.js +0 -164
  291. package/dist/features/Operation/components/callbacks/Callback.vue.js +0 -7
  292. package/dist/features/Operation/components/callbacks/Callback.vue2.js +0 -60
  293. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +0 -63
  294. package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +0 -4
  295. package/dist/features/Operation/helpers/filter-selected-security.js +0 -28
  296. package/dist/features/Operation/helpers/get-first-server.js +0 -25
  297. package/dist/features/Operation/layouts/ClassicLayout.vue.js +0 -7
  298. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +0 -243
  299. package/dist/features/Operation/layouts/ModernLayout.vue.js +0 -7
  300. package/dist/features/Operation/layouts/ModernLayout.vue2.js +0 -256
  301. package/dist/features/Search/components/SearchButton.vue.js +0 -88
  302. package/dist/features/Search/components/SearchButton.vue2.js +0 -4
  303. package/dist/features/Search/components/SearchModal.vue.js +0 -7
  304. package/dist/features/Search/components/SearchModal.vue2.js +0 -120
  305. package/dist/features/Search/components/SearchResult.vue.js +0 -84
  306. package/dist/features/Search/components/SearchResult.vue2.js +0 -4
  307. package/dist/features/Search/helpers/create-fuse-instance.js +0 -43
  308. package/dist/features/Search/helpers/create-search-index.js +0 -119
  309. package/dist/features/Search/hooks/useSearchIndex.js +0 -33
  310. package/dist/features/ask-agent-button/AskAgentButton.vue.js +0 -7
  311. package/dist/features/ask-agent-button/AskAgentButton.vue2.js +0 -47
  312. package/dist/features/developer-tools/DeveloperTools.vue.js +0 -60
  313. package/dist/features/developer-tools/DeveloperTools.vue2.js +0 -4
  314. package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +0 -13
  315. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js +0 -33
  316. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue2.js +0 -4
  317. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js +0 -138
  318. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue2.js +0 -4
  319. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js +0 -66
  320. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue2.js +0 -4
  321. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js +0 -54
  322. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue2.js +0 -4
  323. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js +0 -71
  324. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue2.js +0 -4
  325. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js +0 -63
  326. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue2.js +0 -4
  327. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +0 -73
  328. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue2.js +0 -4
  329. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js +0 -57
  330. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue2.js +0 -4
  331. package/dist/features/developer-tools/components/DeployApiReference.vue.js +0 -35
  332. package/dist/features/developer-tools/components/DeployApiReference.vue2.js +0 -4
  333. package/dist/features/developer-tools/components/ModifyConfiguration.vue.js +0 -103
  334. package/dist/features/developer-tools/components/ModifyConfiguration.vue2.js +0 -4
  335. package/dist/features/developer-tools/components/ShareApiReference.vue.js +0 -35
  336. package/dist/features/developer-tools/components/ShareApiReference.vue2.js +0 -4
  337. package/dist/features/example-responses/ExampleResponse.vue.js +0 -7
  338. package/dist/features/example-responses/ExampleResponse.vue2.js +0 -61
  339. package/dist/features/example-responses/ExampleResponseTab.vue.js +0 -7
  340. package/dist/features/example-responses/ExampleResponseTab.vue2.js +0 -25
  341. package/dist/features/example-responses/ExampleResponseTabList.vue.js +0 -7
  342. package/dist/features/example-responses/ExampleResponseTabList.vue2.js +0 -37
  343. package/dist/features/example-responses/ExampleResponses.vue.js +0 -7
  344. package/dist/features/example-responses/ExampleResponses.vue2.js +0 -181
  345. package/dist/features/example-responses/ExampleSchema.vue.js +0 -42
  346. package/dist/features/example-responses/ExampleSchema.vue2.js +0 -4
  347. package/dist/features/example-responses/has-response-content.js +0 -28
  348. package/dist/features/external-docs/ExternalDocs.vue.js +0 -42
  349. package/dist/features/external-docs/ExternalDocs.vue2.js +0 -4
  350. package/dist/features/info-object/Contact.vue.js +0 -46
  351. package/dist/features/info-object/Contact.vue2.js +0 -4
  352. package/dist/features/info-object/License.vue.js +0 -40
  353. package/dist/features/info-object/License.vue2.js +0 -4
  354. package/dist/features/info-object/TermsOfService.vue.js +0 -34
  355. package/dist/features/info-object/TermsOfService.vue2.js +0 -4
  356. package/dist/features/multiple-documents/DocumentSelector.vue.js +0 -54
  357. package/dist/features/multiple-documents/DocumentSelector.vue2.js +0 -4
  358. package/dist/features/specification-extension/SpecificationExtension.vue.js +0 -4
  359. package/dist/features/specification-extension/SpecificationExtension.vue2.js +0 -52
  360. package/dist/features/specification-extension/helpers.js +0 -9
  361. package/dist/features/test-request-button/TestRequestButton.vue.js +0 -7
  362. package/dist/features/test-request-button/TestRequestButton.vue2.js +0 -46
  363. package/dist/features/x-badges/XBadges.vue.js +0 -35
  364. package/dist/features/x-badges/XBadges.vue2.js +0 -4
  365. package/dist/helpers/color-mode.js +0 -9
  366. package/dist/helpers/download.js +0 -45
  367. package/dist/helpers/id-routing.js +0 -63
  368. package/dist/helpers/lazy-bus.js +0 -160
  369. package/dist/helpers/load-from-perssistance.js +0 -17
  370. package/dist/helpers/map-config-plugins.js +0 -27
  371. package/dist/helpers/map-config-to-workspace-store.js +0 -45
  372. package/dist/helpers/normalize-configurations.js +0 -69
  373. package/dist/helpers/openapi.js +0 -135
  374. package/dist/helpers/storage.js +0 -47
  375. package/dist/helpers/upload-temp-document.js +0 -24
  376. package/dist/hooks/use-agent.js +0 -42
  377. package/dist/hooks/use-intersection.js +0 -32
  378. package/dist/plugins/hooks/usePluginManager.js +0 -14
  379. package/dist/plugins/persistance-plugin.js +0 -48
  380. package/dist/plugins/plugin-manager.js +0 -39
  381. package/dist/standalone/lib/html-api.js +0 -81
@@ -1,45 +0,0 @@
1
- import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
2
- import { useSeoMeta } from "@unhead/vue";
3
- import { useFavicon } from "@vueuse/core";
4
- import { watch, toValue, computed } from "vue";
5
- const mapConfigToWorkspaceStore = ({
6
- config,
7
- store,
8
- isDarkMode
9
- }) => {
10
- watch(
11
- () => toValue(config).defaultHttpClient,
12
- (newValue) => {
13
- if (newValue) {
14
- const { targetKey, clientKey } = newValue;
15
- const clientId = `${targetKey}/${clientKey}`;
16
- if (isClient(clientId)) {
17
- store.update("x-scalar-default-client", clientId);
18
- }
19
- }
20
- },
21
- { immediate: true }
22
- );
23
- watch(
24
- () => toValue(config).darkMode,
25
- (isDark) => store.update("x-scalar-color-mode", isDark ? "dark" : "light")
26
- );
27
- watch(
28
- () => isDarkMode.value,
29
- (newIsDark) => store.update("x-scalar-color-mode", newIsDark ? "dark" : "light"),
30
- { immediate: true }
31
- );
32
- if (toValue(config).metaData) {
33
- useSeoMeta(toValue(config).metaData);
34
- }
35
- watch(
36
- () => toValue(config).proxyUrl,
37
- (newProxyUrl) => store.update("x-scalar-active-proxy", newProxyUrl),
38
- { immediate: true }
39
- );
40
- const favicon = computed(() => toValue(config).favicon);
41
- useFavicon(favicon);
42
- };
43
- export {
44
- mapConfigToWorkspaceStore
45
- };
@@ -1,69 +0,0 @@
1
- import { parseJsonOrYaml } from "@scalar/oas-utils/helpers";
2
- import { isConfigurationWithSources, apiReferenceConfigurationWithSourceSchema } from "@scalar/types/api-reference";
3
- import GitHubSlugger from "github-slugger";
4
- const normalizeConfigurations = (configuration) => {
5
- const slugger = new GitHubSlugger();
6
- const normalized = {};
7
- if (!configuration) {
8
- return normalized;
9
- }
10
- const configList = Array.isArray(configuration) ? configuration : [configuration];
11
- configList.flatMap((c) => {
12
- if (isConfigurationWithSources(c)) {
13
- const { sources: configSources, ...rest } = c;
14
- return configSources?.map((source) => ({ ...rest, ...source })) ?? [];
15
- }
16
- return [c];
17
- }).map((source) => {
18
- const validated = apiReferenceConfigurationWithSourceSchema.safeParse(source);
19
- return validated.success ? validated.data : null;
20
- }).filter((c) => !!c && (!!c.url || !!c.content)).map((source, index) => addSlugAndTitle(source, index, slugger)).forEach((c) => {
21
- const { url, content, ...config } = c;
22
- normalized[c.slug] = {
23
- config,
24
- title: c.title,
25
- slug: c.slug,
26
- default: !!c?.default,
27
- agent: c.agent,
28
- source: content ? { content: normalizeContent(content) ?? {} } : { url }
29
- };
30
- });
31
- return normalized;
32
- };
33
- const normalizeContent = (content) => {
34
- if (!content) {
35
- return null;
36
- }
37
- if (typeof content === "function") {
38
- return normalizeContent(content());
39
- }
40
- if (typeof content === "string") {
41
- return parseJsonOrYaml(content);
42
- }
43
- return content;
44
- };
45
- const addSlugAndTitle = (source, index = 0, slugger) => {
46
- if (source.title) {
47
- return {
48
- ...source,
49
- slug: source.slug || slugger.slug(source.title),
50
- title: source.title
51
- };
52
- }
53
- if (source.slug) {
54
- return {
55
- ...source,
56
- slug: slugger.slug(source.slug),
57
- title: source.slug
58
- };
59
- }
60
- return {
61
- ...source,
62
- slug: `api-${index + 1}`,
63
- title: `API #${index + 1}`
64
- };
65
- };
66
- export {
67
- normalizeConfigurations,
68
- normalizeContent
69
- };
@@ -1,135 +0,0 @@
1
- import { isDereferenced } from "@scalar/openapi-types/helpers";
2
- import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { isObjectSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
4
- function resolveSchemaRef(ref) {
5
- return getResolvedRef(ref);
6
- }
7
- function formatProperty(key, obj) {
8
- let output = key;
9
- const isRequired = obj.required?.includes(key);
10
- output += isRequired ? " REQUIRED " : " optional ";
11
- const propRef = obj.properties[key];
12
- if (!propRef) return output;
13
- const property = resolveSchemaRef(propRef);
14
- if (property && typeof property === "object" && "type" in property) {
15
- output += property.type ?? "";
16
- if ("description" in property && typeof property.description === "string") {
17
- output += " " + property.description;
18
- }
19
- }
20
- return output;
21
- }
22
- function recursiveLogger(obj) {
23
- const results = ["Body"];
24
- const schema = getResolvedRef(obj?.schema);
25
- if (!schema || !isObjectSchema(schema) || !schema.properties) {
26
- return results;
27
- }
28
- const properties = schema.properties;
29
- const schemaWithProps = {
30
- properties,
31
- required: schema.required
32
- };
33
- Object.keys(properties).forEach((key) => {
34
- if (!obj.schema) {
35
- return;
36
- }
37
- results.push(formatProperty(key, schemaWithProps));
38
- const propRef = properties[key];
39
- if (!propRef) return;
40
- const property = resolveSchemaRef(propRef);
41
- if (property && isObjectSchema(property) && property.properties) {
42
- const nestedProperties = property.properties;
43
- Object.keys(nestedProperties).forEach((subKey) => {
44
- const ref = nestedProperties[subKey];
45
- if (!ref) return;
46
- const nested = resolveSchemaRef(ref);
47
- const typeStr = nested && typeof nested === "object" && "type" in nested ? nested.type ?? "" : "";
48
- results.push(`${subKey} ${typeStr}`);
49
- });
50
- }
51
- });
52
- return results;
53
- }
54
- function extractRequestBody(operation) {
55
- try {
56
- const media = getResolvedRef(operation?.requestBody)?.content?.["application/json"];
57
- if (!media) {
58
- throw new Error("Body not found");
59
- }
60
- return recursiveLogger(media);
61
- } catch (_error) {
62
- return false;
63
- }
64
- }
65
- function deepMerge(source, target) {
66
- for (const [key, val] of Object.entries(source)) {
67
- if (val !== null && typeof val === "object") {
68
- target[key] ??= new val.__proto__.constructor();
69
- deepMerge(val, target[key]);
70
- } else if (typeof val !== "undefined") {
71
- target[key] = val;
72
- }
73
- }
74
- return target;
75
- }
76
- function createEmptySpecification(partialSpecification) {
77
- return deepMerge(partialSpecification ?? {}, {
78
- info: {
79
- title: "",
80
- description: "",
81
- termsOfService: "",
82
- version: "",
83
- license: {
84
- name: "",
85
- url: ""
86
- },
87
- contact: {
88
- email: ""
89
- }
90
- },
91
- servers: [],
92
- tags: []
93
- });
94
- }
95
- function createParameterMap(operation) {
96
- const map = {
97
- path: [],
98
- query: [],
99
- header: [],
100
- cookie: [],
101
- body: [],
102
- formData: []
103
- };
104
- const parameters = operation.parameters ?? [];
105
- if (parameters) {
106
- parameters.forEach((parameter) => {
107
- if (!isDereferenced(parameter)) {
108
- return;
109
- }
110
- if (typeof parameter === "object" && parameter !== null && "$ref" in parameter) {
111
- return;
112
- }
113
- if (parameter.in === "path") {
114
- map.path.push(parameter);
115
- } else if (parameter.in === "query") {
116
- map.query.push(parameter);
117
- } else if (parameter.in === "header") {
118
- map.header.push(parameter);
119
- } else if (parameter.in === "cookie") {
120
- map.cookie.push(parameter);
121
- } else if (parameter.in === "body") {
122
- map.body.push(parameter);
123
- } else if (parameter.in === "formData") {
124
- map.formData.push(parameter);
125
- }
126
- });
127
- }
128
- return map;
129
- }
130
- export {
131
- createEmptySpecification,
132
- createParameterMap,
133
- deepMerge,
134
- extractRequestBody
135
- };
@@ -1,47 +0,0 @@
1
- import { REFERENCE_LS_KEYS, safeLocalStorage } from "@scalar/helpers/object/local-storage";
2
- import { AuthSchema } from "@scalar/workspace-store/entities/auth";
3
- import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
4
- const storage = safeLocalStorage();
5
- const clientStorage = () => {
6
- const key = REFERENCE_LS_KEYS.SELECTED_CLIENT;
7
- return {
8
- /**
9
- * Gets the stored selected client from local storage.
10
- */
11
- get: () => {
12
- return storage.getItem(key);
13
- },
14
- /**
15
- * Stores the selected client value in local storage.
16
- * @param value The value to store
17
- */
18
- set: (value) => {
19
- storage.setItem(key, value);
20
- }
21
- };
22
- };
23
- const authStorage = () => {
24
- const getKey = (slug) => {
25
- return `${REFERENCE_LS_KEYS.AUTH}-${slug}`;
26
- };
27
- return {
28
- /**
29
- * Retrieves and coerces the authentication schemes stored in local storage.
30
- */
31
- getAuth: (slug) => {
32
- const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? "{}");
33
- return coerceValue(AuthSchema, parsed);
34
- },
35
- /**
36
- * Stores the authentication schemes in local storage.
37
- * @param value The Auth object to stringify and store.
38
- */
39
- setAuth: (slug, value) => {
40
- storage.setItem(getKey(slug), JSON.stringify(value));
41
- }
42
- };
43
- };
44
- export {
45
- authStorage,
46
- clientStorage
47
- };
@@ -1,24 +0,0 @@
1
- import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
2
- import { PROXY_URL, UPLOAD_TEMP_API_URL } from "../consts/urls.js";
3
- function isResponseBody(data) {
4
- return !!data && typeof data === "object" && "url" in data && typeof data.url === "string";
5
- }
6
- async function uploadTempDocument(document) {
7
- const body = JSON.stringify({ document });
8
- const response = await fetch(redirectToProxy(PROXY_URL, UPLOAD_TEMP_API_URL), {
9
- method: "POST",
10
- headers: { "Content-Type": "application/json" },
11
- body
12
- });
13
- if (!response.ok) {
14
- throw new Error(` Failed to generate temporary link, server responded with ${response.status}`);
15
- }
16
- const data = await response.json();
17
- if (!isResponseBody(data)) {
18
- throw new Error("Failed to generate temporary link, invalid response from server");
19
- }
20
- return data.url;
21
- }
22
- export {
23
- uploadTempDocument
24
- };
@@ -1,42 +0,0 @@
1
- import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
2
- import { ref, computed, inject } from "vue";
3
- const AGENT_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol();
4
- const agentStateRef = ref(null);
5
- function useAgent(options) {
6
- const showAgent = ref(false);
7
- const prefilledMessage = ref("");
8
- const agentEnabled = options.agentEnabled ?? computed(() => isLocalUrl(window.location.href));
9
- const openAgent = (message) => {
10
- prefilledMessage.value = message ?? "";
11
- showAgent.value = true;
12
- };
13
- const closeAgent = () => {
14
- showAgent.value = false;
15
- prefilledMessage.value = "";
16
- };
17
- const toggleAgent = () => {
18
- showAgent.value = !showAgent.value;
19
- if (!showAgent.value) {
20
- prefilledMessage.value = "";
21
- }
22
- };
23
- const state = {
24
- showAgent,
25
- agentEnabled,
26
- prefilledMessage,
27
- openAgent,
28
- closeAgent,
29
- toggleAgent
30
- };
31
- agentStateRef.value = state;
32
- return state;
33
- }
34
- function useAgentContext() {
35
- const injected = inject(AGENT_CONTEXT_SYMBOL, void 0);
36
- return computed(() => injected ?? agentStateRef.value ?? void 0);
37
- }
38
- export {
39
- AGENT_CONTEXT_SYMBOL,
40
- useAgent,
41
- useAgentContext
42
- };
@@ -1,32 +0,0 @@
1
- import { useIntersectionObserver } from "@vueuse/core";
2
- import { onMounted } from "vue";
3
- const useIntersection = (el, onIntersect) => {
4
- const calculateRootMargin = (element) => {
5
- const height = element.offsetHeight;
6
- return `${height / 2}px 0px ${height / 2}px 0px`;
7
- };
8
- const calculateThreshold = (element) => {
9
- const height = element.offsetHeight;
10
- return height < window.innerHeight ? 0.8 : 0.5;
11
- };
12
- onMounted(() => {
13
- if (el.value) {
14
- const options = {
15
- rootMargin: calculateRootMargin(el.value),
16
- threshold: calculateThreshold(el.value)
17
- };
18
- useIntersectionObserver(
19
- el,
20
- ([entry]) => {
21
- if (entry?.isIntersecting) {
22
- onIntersect();
23
- }
24
- },
25
- options
26
- );
27
- }
28
- });
29
- };
30
- export {
31
- useIntersection
32
- };
@@ -1,14 +0,0 @@
1
- import { createPluginManager } from "../plugin-manager.js";
2
- import { inject } from "vue";
3
- const PLUGIN_MANAGER_SYMBOL = /* @__PURE__ */ Symbol();
4
- const usePluginManager = () => {
5
- const manager = inject(PLUGIN_MANAGER_SYMBOL);
6
- if (!manager) {
7
- return createPluginManager({});
8
- }
9
- return manager;
10
- };
11
- export {
12
- PLUGIN_MANAGER_SYMBOL,
13
- usePluginManager
14
- };
@@ -1,48 +0,0 @@
1
- import { debounce } from "@scalar/helpers/general/debounce";
2
- import { clientStorage, authStorage } from "../helpers/storage.js";
3
- const persistencePlugin = ({
4
- debounceDelay = 500,
5
- maxWait = 1e4,
6
- prefix = "",
7
- persistAuth = false
8
- }) => {
9
- const { execute } = debounce({ delay: debounceDelay, maxWait });
10
- const authPersistence = authStorage();
11
- const clientPersistence = clientStorage();
12
- const getPrefix = () => {
13
- if (typeof prefix === "string") {
14
- return prefix;
15
- }
16
- return prefix();
17
- };
18
- const getPersistAuth = () => {
19
- if (typeof persistAuth === "function") {
20
- return persistAuth();
21
- }
22
- return persistAuth;
23
- };
24
- return {
25
- hooks: {
26
- /**
27
- * Handles all workspace state change events.
28
- * Each write is debounced by a key to prevent frequent writes for the same entity.
29
- */
30
- onWorkspaceStateChanges(event) {
31
- if (event.type === "meta") {
32
- const defaultClient = event.value["x-scalar-default-client"];
33
- if (defaultClient !== void 0) {
34
- execute("x-scalar-default-client", () => clientPersistence.set(defaultClient));
35
- }
36
- return;
37
- }
38
- if (getPersistAuth() && event.type === "auth") {
39
- execute("auth", () => authPersistence.setAuth(getPrefix(), event.value));
40
- }
41
- return;
42
- }
43
- }
44
- };
45
- };
46
- export {
47
- persistencePlugin
48
- };
@@ -1,39 +0,0 @@
1
- const createPluginManager = ({ plugins = [] }) => {
2
- const registeredPlugins = /* @__PURE__ */ new Map();
3
- plugins.forEach((plugin) => {
4
- const pluginInstance = plugin();
5
- registeredPlugins.set(pluginInstance.name, pluginInstance);
6
- });
7
- return {
8
- /**
9
- * Get all extensions with the given name from registered plugins
10
- */
11
- getSpecificationExtensions: (name) => {
12
- const extensions = [];
13
- for (const plugin of registeredPlugins.values()) {
14
- for (const extension of plugin.extensions) {
15
- if (extension.name === name) {
16
- extensions.push(extension);
17
- }
18
- }
19
- }
20
- return extensions;
21
- },
22
- /**
23
- * Get all components for a specific view from registered plugins
24
- */
25
- getViewComponents: (viewName) => {
26
- const components = [];
27
- for (const plugin of registeredPlugins.values()) {
28
- const viewComponents = plugin.views?.[viewName];
29
- if (viewComponents) {
30
- components.push(...viewComponents);
31
- }
32
- }
33
- return components;
34
- }
35
- };
36
- };
37
- export {
38
- createPluginManager
39
- };
@@ -1,81 +0,0 @@
1
- import { createHead } from "@unhead/vue/client";
2
- import { reactive, createApp, h } from "vue";
3
- import ApiReference from "../../components/ApiReference.vue.js";
4
- const createApiReference = (elementOrSelectorOrConfig, optionalConfiguration) => {
5
- const idPrefix = "scalar-refs";
6
- const props = reactive({
7
- // Either the configuration will be the second argument or it MUST be the first (configuration only)
8
- configuration: optionalConfiguration ?? elementOrSelectorOrConfig ?? {}
9
- });
10
- let app = createApp(() => h(ApiReference, props));
11
- app.use(createHead());
12
- app.config.idPrefix = idPrefix;
13
- if (optionalConfiguration) {
14
- const element = typeof elementOrSelectorOrConfig === "string" ? document.querySelector(elementOrSelectorOrConfig) : elementOrSelectorOrConfig;
15
- if (element) {
16
- app.mount(element);
17
- } else {
18
- console.error("Could not find a mount point for API References:", elementOrSelectorOrConfig);
19
- }
20
- }
21
- document.addEventListener(
22
- "scalar:reload-references",
23
- () => {
24
- console.warn(
25
- "scalar:reload-references event has been deprecated, please use the scalarInstance.app.mount method instead."
26
- );
27
- if (!props.configuration) {
28
- return;
29
- }
30
- const currentElement = typeof elementOrSelectorOrConfig === "string" ? document.querySelector(elementOrSelectorOrConfig) : elementOrSelectorOrConfig;
31
- if (!currentElement) {
32
- return;
33
- }
34
- if (currentElement && !document.body.contains(currentElement)) {
35
- document.body.appendChild(currentElement);
36
- }
37
- app.unmount();
38
- app = createApp(() => h(ApiReference, props));
39
- app.use(createHead());
40
- app.config.idPrefix = idPrefix;
41
- app.mount(currentElement);
42
- },
43
- false
44
- );
45
- const destroy = () => {
46
- props.configuration = {};
47
- app.unmount();
48
- };
49
- document.addEventListener(
50
- "scalar:destroy-references",
51
- () => {
52
- console.warn("scalar:destroy-references event has been deprecated, please use scalarInstance.destroy instead.");
53
- destroy();
54
- },
55
- false
56
- );
57
- document.addEventListener(
58
- "scalar:update-references-config",
59
- (ev) => {
60
- console.warn(
61
- "scalar:update-references-config event has been deprecated, please use scalarInstance.updateConfiguration instead."
62
- );
63
- if ("detail" in ev) {
64
- Object.assign(props, ev.detail);
65
- }
66
- },
67
- false
68
- );
69
- const instance = {
70
- app,
71
- getConfiguration: () => props.configuration ?? {},
72
- updateConfiguration: (newConfig) => {
73
- props.configuration = newConfig;
74
- },
75
- destroy
76
- };
77
- return instance;
78
- };
79
- export {
80
- createApiReference
81
- };