@scalar/agent-chat 0.12.44 → 0.12.46

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 (224) hide show
  1. package/dist/App.test.d.ts +2 -0
  2. package/dist/App.test.d.ts.map +1 -0
  3. package/dist/App.vue.d.ts +5 -1
  4. package/dist/App.vue.d.ts.map +1 -1
  5. package/dist/App.vue.js +1 -1
  6. package/dist/App.vue.js.map +1 -1
  7. package/dist/{App.vue.script.js → App.vue_vue_type_script_setup_true_lang.js} +3 -1
  8. package/dist/App.vue_vue_type_script_setup_true_lang.js.map +1 -0
  9. package/dist/Chat.vue.d.ts.map +1 -1
  10. package/dist/Chat.vue.js +1 -1
  11. package/dist/Chat.vue.js.map +1 -1
  12. package/dist/{Chat.vue.script.js → Chat.vue_vue_type_script_setup_true_lang.js} +14 -6
  13. package/dist/Chat.vue_vue_type_script_setup_true_lang.js.map +1 -0
  14. package/dist/client-tools/execute-request.js +3 -2
  15. package/dist/client-tools/execute-request.js.map +1 -1
  16. package/dist/components/ActionsDropdown.vue.js +2 -2
  17. package/dist/components/ActionsDropdown.vue.js.map +1 -1
  18. package/dist/components/{ActionsDropdown.vue.script.js → ActionsDropdown.vue_vue_type_script_setup_true_lang.js} +1 -1
  19. package/dist/components/ActionsDropdown.vue_vue_type_script_setup_true_lang.js.map +1 -0
  20. package/dist/components/ApprovalSection.vue.js +2 -2
  21. package/dist/components/ApprovalSection.vue.js.map +1 -1
  22. package/dist/components/{ApprovalSection.vue.script.js → ApprovalSection.vue_vue_type_script_setup_true_lang.js} +1 -1
  23. package/dist/components/ApprovalSection.vue_vue_type_script_setup_true_lang.js.map +1 -0
  24. package/dist/components/AuthenticationProvided.vue.js +1 -1
  25. package/dist/components/AuthenticationProvided.vue.js.map +1 -1
  26. package/dist/components/AuthenticationRequired.vue.js +1 -1
  27. package/dist/components/AuthenticationRequired.vue.js.map +1 -1
  28. package/dist/components/AutosendPaused.vue.js +1 -1
  29. package/dist/components/AutosendPaused.vue.js.map +1 -1
  30. package/dist/components/BuildingRequest.vue.js +1 -1
  31. package/dist/components/BuildingRequest.vue.js.map +1 -1
  32. package/dist/components/ContextItem.vue.js +2 -2
  33. package/dist/components/ContextItem.vue.js.map +1 -1
  34. package/dist/components/{ContextItem.vue.script.js → ContextItem.vue_vue_type_script_setup_true_lang.js} +1 -1
  35. package/dist/components/ContextItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  36. package/dist/components/ErrorMessage.vue.js +2 -2
  37. package/dist/components/ErrorMessage.vue.js.map +1 -1
  38. package/dist/components/{ErrorMessage.vue.script.js → ErrorMessage.vue_vue_type_script_setup_true_lang.js} +1 -1
  39. package/dist/components/ErrorMessage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  40. package/dist/components/FreeMessagesInfoSection.vue.js +2 -2
  41. package/dist/components/FreeMessagesInfoSection.vue.js.map +1 -1
  42. package/dist/components/{FreeMessagesInfoSection.vue.script.js → FreeMessagesInfoSection.vue_vue_type_script_setup_true_lang.js} +1 -1
  43. package/dist/components/FreeMessagesInfoSection.vue_vue_type_script_setup_true_lang.js.map +1 -0
  44. package/dist/components/LoadingOpenAPISpecsSummary.vue.js +1 -1
  45. package/dist/components/LoadingOpenAPISpecsSummary.vue.js.map +1 -1
  46. package/dist/components/LoadingSearchOpenAPIOperations.vue.js +1 -1
  47. package/dist/components/LoadingSearchOpenAPIOperations.vue.js.map +1 -1
  48. package/dist/components/Logo.vue.js.map +1 -1
  49. package/dist/components/PaymentSection.vue.js +2 -2
  50. package/dist/components/PaymentSection.vue.js.map +1 -1
  51. package/dist/components/{PaymentSection.vue.script.js → PaymentSection.vue_vue_type_script_setup_true_lang.js} +1 -1
  52. package/dist/components/PaymentSection.vue_vue_type_script_setup_true_lang.js.map +1 -0
  53. package/dist/components/RequestApproved.vue.js +1 -1
  54. package/dist/components/RequestApproved.vue.js.map +1 -1
  55. package/dist/components/RequestFailed.vue.js +1 -1
  56. package/dist/components/RequestFailed.vue.js.map +1 -1
  57. package/dist/components/RequestPreview.vue.js +2 -2
  58. package/dist/components/RequestPreview.vue.js.map +1 -1
  59. package/dist/components/{RequestPreview.vue.script.js → RequestPreview.vue_vue_type_script_setup_true_lang.js} +1 -1
  60. package/dist/components/RequestPreview.vue_vue_type_script_setup_true_lang.js.map +1 -0
  61. package/dist/components/RequestRejected.vue.js +1 -1
  62. package/dist/components/RequestRejected.vue.js.map +1 -1
  63. package/dist/components/RequestSuccess.vue.js +1 -1
  64. package/dist/components/RequestSuccess.vue.js.map +1 -1
  65. package/dist/components/ResponseBody/ResponseBody.vue.d.ts +2 -2
  66. package/dist/components/ResponseBody/ResponseBody.vue.js +1 -1
  67. package/dist/components/ResponseBody/ResponseBody.vue.js.map +1 -1
  68. package/dist/components/ResponseBody/{ResponseBody.vue.script.js → ResponseBody.vue_vue_type_script_setup_true_lang.js} +1 -1
  69. package/dist/components/ResponseBody/ResponseBody.vue_vue_type_script_setup_true_lang.js.map +1 -0
  70. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js.map +1 -1
  71. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
  72. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +2 -2
  73. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js.map +1 -1
  74. package/dist/components/ResponseBody/{ResponseBodyPreview.vue.script.js → ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js} +1 -1
  75. package/dist/components/ResponseBody/ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js.map +1 -0
  76. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +1 -1
  77. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js.map +1 -1
  78. package/dist/components/ResponseBody/{ResponseBodyRaw.vue.script.js → ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js} +1 -1
  79. package/dist/components/ResponseBody/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js.map +1 -0
  80. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +1 -1
  81. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js.map +1 -1
  82. package/dist/components/ResponseBody/{ResponseBodyToggle.vue.script.js → ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js} +1 -1
  83. package/dist/components/ResponseBody/ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js.map +1 -0
  84. package/dist/components/SearchPopover.vue.js +2 -2
  85. package/dist/components/SearchPopover.vue.js.map +1 -1
  86. package/dist/components/{SearchPopover.vue.script.js → SearchPopover.vue_vue_type_script_setup_true_lang.js} +1 -1
  87. package/dist/components/SearchPopover.vue_vue_type_script_setup_true_lang.js.map +1 -0
  88. package/dist/components/Selector.vue.js +1 -1
  89. package/dist/components/Selector.vue.js.map +1 -1
  90. package/dist/components/{Selector.vue.script.js → Selector.vue_vue_type_script_setup_true_lang.js} +1 -1
  91. package/dist/components/Selector.vue_vue_type_script_setup_true_lang.js.map +1 -0
  92. package/dist/components/SendingRequest.vue.js +1 -1
  93. package/dist/components/SendingRequest.vue.js.map +1 -1
  94. package/dist/components/ServerSelector.vue.js +1 -1
  95. package/dist/components/ServerSelector.vue.js.map +1 -1
  96. package/dist/components/{ServerSelector.vue.script.js → ServerSelector.vue_vue_type_script_setup_true_lang.js} +1 -1
  97. package/dist/components/ServerSelector.vue_vue_type_script_setup_true_lang.js.map +1 -0
  98. package/dist/components/UploadSection.vue.js +3 -3
  99. package/dist/components/UploadSection.vue.js.map +1 -1
  100. package/dist/components/{UploadSection.vue.script.js → UploadSection.vue_vue_type_script_setup_true_lang.js} +3 -3
  101. package/dist/components/UploadSection.vue_vue_type_script_setup_true_lang.js.map +1 -0
  102. package/dist/entities/tools/execute-request.d.ts +1 -1
  103. package/dist/entities/tools/get-openapi-specs-summary.d.ts +3 -2
  104. package/dist/entities/tools/get-openapi-specs-summary.d.ts.map +1 -1
  105. package/dist/entities/tools/get-openapi-specs-summary.js.map +1 -1
  106. package/dist/entities/tools/search-openapi-operations.d.ts +2 -1
  107. package/dist/entities/tools/search-openapi-operations.d.ts.map +1 -1
  108. package/dist/entities/tools/search-openapi-operations.js.map +1 -1
  109. package/dist/helpers/get-search-result-labels.d.ts +3 -0
  110. package/dist/helpers/get-search-result-labels.d.ts.map +1 -0
  111. package/dist/helpers/get-search-result-labels.js +38 -0
  112. package/dist/helpers/get-search-result-labels.js.map +1 -0
  113. package/dist/helpers/get-search-result-labels.test.d.ts +2 -0
  114. package/dist/helpers/get-search-result-labels.test.d.ts.map +1 -0
  115. package/dist/helpers.d.ts +0 -3
  116. package/dist/helpers.d.ts.map +1 -1
  117. package/dist/helpers.js +6 -7
  118. package/dist/helpers.js.map +1 -1
  119. package/dist/hooks/use-agent-key-documents.js +1 -1
  120. package/dist/hooks/use-agent-key-documents.js.map +1 -1
  121. package/dist/hooks/use-upload-tmp-document.d.ts +1 -1
  122. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -1
  123. package/dist/hooks/use-upload-tmp-document.js +24 -17
  124. package/dist/hooks/use-upload-tmp-document.js.map +1 -1
  125. package/dist/index.js +1 -2
  126. package/dist/package.json +2 -1
  127. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  128. package/dist/registry/add-documents-to-store.js.map +1 -1
  129. package/dist/state/state.d.ts +6 -2
  130. package/dist/state/state.d.ts.map +1 -1
  131. package/dist/state/state.js +15 -6
  132. package/dist/state/state.js.map +1 -1
  133. package/dist/state/state.test.d.ts +2 -0
  134. package/dist/state/state.test.d.ts.map +1 -0
  135. package/dist/style.css +137 -109
  136. package/dist/views/Catalog/Catalog.vue.js +3 -3
  137. package/dist/views/Catalog/Catalog.vue.js.map +1 -1
  138. package/dist/views/Catalog/{Catalog.vue.script.js → Catalog.vue_vue_type_script_setup_true_lang.js} +1 -1
  139. package/dist/views/Catalog/Catalog.vue_vue_type_script_setup_true_lang.js.map +1 -0
  140. package/dist/views/Chat/Chat.vue.js +2 -2
  141. package/dist/views/Chat/Chat.vue.js.map +1 -1
  142. package/dist/views/Chat/{Chat.vue.script.js → Chat.vue_vue_type_script_setup_true_lang.js} +1 -1
  143. package/dist/views/Chat/Chat.vue_vue_type_script_setup_true_lang.js.map +1 -0
  144. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
  145. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +3 -3
  146. package/dist/views/Chat/Messages/AskForAuthentication.vue.js.map +1 -1
  147. package/dist/views/Chat/Messages/{AskForAuthentication.vue.script.js → AskForAuthentication.vue_vue_type_script_setup_true_lang.js} +45 -36
  148. package/dist/views/Chat/Messages/AskForAuthentication.vue_vue_type_script_setup_true_lang.js.map +1 -0
  149. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
  150. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +3 -3
  151. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js.map +1 -1
  152. package/dist/views/Chat/Messages/{ExecuteRequestTool.vue.script.js → ExecuteRequestTool.vue_vue_type_script_setup_true_lang.js} +9 -4
  153. package/dist/views/Chat/Messages/ExecuteRequestTool.vue_vue_type_script_setup_true_lang.js.map +1 -0
  154. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +1 -1
  155. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js.map +1 -1
  156. package/dist/views/Chat/Messages/{GetOpenAPISpecsSummary.vue.script.js → GetOpenAPISpecsSummary.vue_vue_type_script_setup_true_lang.js} +1 -1
  157. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue_vue_type_script_setup_true_lang.js.map +1 -0
  158. package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.d.ts.map +1 -1
  159. package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.js +3 -3
  160. package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.js.map +1 -1
  161. package/dist/views/Chat/Messages/{SearchOpenAPIOperationsTool.vue.script.js → SearchOpenAPIOperationsTool.vue_vue_type_script_setup_true_lang.js} +7 -10
  162. package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue_vue_type_script_setup_true_lang.js.map +1 -0
  163. package/dist/views/Chat/Messages/Text.vue.js +1 -1
  164. package/dist/views/Chat/Messages/Text.vue.js.map +1 -1
  165. package/dist/views/Chat/Messages/{Text.vue.script.js → Text.vue_vue_type_script_setup_true_lang.js} +1 -1
  166. package/dist/views/Chat/Messages/Text.vue_vue_type_script_setup_true_lang.js.map +1 -0
  167. package/dist/views/Layout.vue.js +2 -2
  168. package/dist/views/Layout.vue.js.map +1 -1
  169. package/dist/views/{Layout.vue.script.js → Layout.vue_vue_type_script_setup_true_lang.js} +1 -1
  170. package/dist/views/Layout.vue_vue_type_script_setup_true_lang.js.map +1 -0
  171. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  172. package/dist/views/PromptForm.vue.js +3 -3
  173. package/dist/views/PromptForm.vue.js.map +1 -1
  174. package/dist/views/{PromptForm.vue.script.js → PromptForm.vue_vue_type_script_setup_true_lang.js} +1 -2
  175. package/dist/views/PromptForm.vue_vue_type_script_setup_true_lang.js.map +1 -0
  176. package/dist/views/Settings/Auth.vue.js +1 -1
  177. package/dist/views/Settings/Auth.vue.js.map +1 -1
  178. package/dist/views/Settings/{Auth.vue.script.js → Auth.vue_vue_type_script_setup_true_lang.js} +1 -1
  179. package/dist/views/Settings/Auth.vue_vue_type_script_setup_true_lang.js.map +1 -0
  180. package/dist/views/Settings/DocSettings.vue.js +2 -2
  181. package/dist/views/Settings/DocSettings.vue.js.map +1 -1
  182. package/dist/views/Settings/{DocSettings.vue.script.js → DocSettings.vue_vue_type_script_setup_true_lang.js} +1 -1
  183. package/dist/views/Settings/DocSettings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  184. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  185. package/dist/views/Settings/Settings.vue.js +4 -4
  186. package/dist/views/Settings/Settings.vue.js.map +1 -1
  187. package/dist/views/Settings/{Settings.vue.script.js → Settings.vue_vue_type_script_setup_true_lang.js} +11 -7
  188. package/dist/views/Settings/Settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  189. package/dist/views/Start.vue.js +3 -3
  190. package/dist/views/Start.vue.js.map +1 -1
  191. package/dist/views/{Start.vue.script.js → Start.vue_vue_type_script_setup_true_lang.js} +2 -2
  192. package/dist/views/Start.vue_vue_type_script_setup_true_lang.js.map +1 -0
  193. package/dist/vue-styles.css +71 -71
  194. package/package.json +23 -22
  195. package/dist/App.vue.script.js.map +0 -1
  196. package/dist/Chat.vue.script.js.map +0 -1
  197. package/dist/components/ActionsDropdown.vue.script.js.map +0 -1
  198. package/dist/components/ApprovalSection.vue.script.js.map +0 -1
  199. package/dist/components/ContextItem.vue.script.js.map +0 -1
  200. package/dist/components/ErrorMessage.vue.script.js.map +0 -1
  201. package/dist/components/FreeMessagesInfoSection.vue.script.js.map +0 -1
  202. package/dist/components/PaymentSection.vue.script.js.map +0 -1
  203. package/dist/components/RequestPreview.vue.script.js.map +0 -1
  204. package/dist/components/ResponseBody/ResponseBody.vue.script.js.map +0 -1
  205. package/dist/components/ResponseBody/ResponseBodyPreview.vue.script.js.map +0 -1
  206. package/dist/components/ResponseBody/ResponseBodyRaw.vue.script.js.map +0 -1
  207. package/dist/components/ResponseBody/ResponseBodyToggle.vue.script.js.map +0 -1
  208. package/dist/components/SearchPopover.vue.script.js.map +0 -1
  209. package/dist/components/Selector.vue.script.js.map +0 -1
  210. package/dist/components/ServerSelector.vue.script.js.map +0 -1
  211. package/dist/components/UploadSection.vue.script.js.map +0 -1
  212. package/dist/views/Catalog/Catalog.vue.script.js.map +0 -1
  213. package/dist/views/Chat/Chat.vue.script.js.map +0 -1
  214. package/dist/views/Chat/Messages/AskForAuthentication.vue.script.js.map +0 -1
  215. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.script.js.map +0 -1
  216. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.script.js.map +0 -1
  217. package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.script.js.map +0 -1
  218. package/dist/views/Chat/Messages/Text.vue.script.js.map +0 -1
  219. package/dist/views/Layout.vue.script.js.map +0 -1
  220. package/dist/views/PromptForm.vue.script.js.map +0 -1
  221. package/dist/views/Settings/Auth.vue.script.js.map +0 -1
  222. package/dist/views/Settings/DocSettings.vue.script.js.map +0 -1
  223. package/dist/views/Settings/Settings.vue.script.js.map +0 -1
  224. package/dist/views/Start.vue.script.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SendingRequest.vue.js","names":[],"sources":["../../src/components/SendingRequest.vue"],"sourcesContent":["<template>\n <div class=\"sendingRequest\">\n <div class=\"playIcon\">\n <svg\n fill=\"currentColor\"\n height=\"32\"\n viewBox=\"0 0 256 256\"\n width=\"32\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z\"></path>\n </svg>\n </div>\n Sending Request to Endpoint\n </div>\n</template>\n\n<style scoped>\n.playIcon {\n padding: 4px;\n height: 16px;\n width: 16px;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background: var(--scalar-background-1);\n border-radius: var(--scalar-radius-full);\n}\n\n.playIcon::before {\n content: '';\n width: 16px;\n height: 16px;\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n border-width: 1.75px;\n border-style: solid;\n border-color: currentcolor currentcolor transparent;\n border-image: initial;\n border-radius: var(--scalar-radius-full);\n background: var(--scalar-background-1);\n animation: 0.42s linear 0s infinite normal none running rotation;\n}\n\n.sendingRequest {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--scalar-color-blue);\n font-weight: var(--scalar-semibold);\n min-height: 40px;\n font-size: var(--scalar-font-size-3);\n position: relative;\n}\n\n.sendingRequest svg {\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: var(--scalar-radius-full);\n}\n\n@keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n</style>\n"],"mappings":";;;;;mBACO,OAAM,iBAAgB;;qBAA3B,mBAaM,OAbN,YAaM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAZJ,mBAUM,OAAA,EAVD,OAAM,WAAU,GAAA,CACnB,mBAQM,OAAA;EAPJ,MAAK;EACL,QAAO;EACP,SAAQ;EACR,OAAM;EACN,OAAM;KACN,mBAC4M,QAAA,EAA1M,GAAE,iMAAgM,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,GAAA,gBAElM,iCAER,EAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"SendingRequest.vue.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createTextVNode"],"sources":["../../src/components/SendingRequest.vue"],"sourcesContent":["<template>\n <div class=\"sendingRequest\">\n <div class=\"playIcon\">\n <svg\n fill=\"currentColor\"\n height=\"32\"\n viewBox=\"0 0 256 256\"\n width=\"32\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z\"></path>\n </svg>\n </div>\n Sending Request to Endpoint\n </div>\n</template>\n\n<style scoped>\n.playIcon {\n padding: 4px;\n height: 16px;\n width: 16px;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background: var(--scalar-background-1);\n border-radius: var(--scalar-radius-full);\n}\n\n.playIcon::before {\n content: '';\n width: 16px;\n height: 16px;\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n border-width: 1.75px;\n border-style: solid;\n border-color: currentcolor currentcolor transparent;\n border-image: initial;\n border-radius: var(--scalar-radius-full);\n background: var(--scalar-background-1);\n animation: 0.42s linear 0s infinite normal none running rotation;\n}\n\n.sendingRequest {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--scalar-color-blue);\n font-weight: var(--scalar-semibold);\n min-height: 40px;\n font-size: var(--scalar-font-size-3);\n position: relative;\n}\n\n.sendingRequest svg {\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: var(--scalar-radius-full);\n}\n\n@keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n</style>\n"],"mappings":";;;;;AACO,IAAA,aAAA,EAAA,OAAM,iBAAgB;;CAA3B,OAAAA,UAAA,GAAAC,mBAaM,OAbN,YAaM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAZJC,mBAUM,OAAA,EAVD,OAAM,WAAU,GAAA,CACnBA,mBAQM,OAAA;EAPJ,MAAK;EACL,QAAO;EACP,SAAQ;EACR,OAAM;EACN,OAAM;C,IACNA,mBAC4M,QAAA,EAA1M,GAAE,iMAAgM,CAAA,C,UAElMC,gBAAA,iCAER,EAAA,C"}
@@ -1,4 +1,4 @@
1
- import ServerSelector_vue_vue_type_script_setup_true_lang_default from "./ServerSelector.vue.script.js";
1
+ import ServerSelector_vue_vue_type_script_setup_true_lang_default from "./ServerSelector.vue_vue_type_script_setup_true_lang.js";
2
2
  //#region src/components/ServerSelector.vue
3
3
  var ServerSelector_default = ServerSelector_vue_vue_type_script_setup_true_lang_default;
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ServerSelector.vue.js","names":[],"sources":["../../src/components/ServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The selected server */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n}\n\n/**\n * ServerSelector\n *\n * Core component for rendering a server selector block.\n * Handles server selection and emits a 'server:update:selected' event when the selected server changes.\n *\n * @event server:update:selected - Emitted when the selected server changes\n * @event server:update:variables - Emitted when a server variable changes\n */\nexport default {}\n</script>\n\n<script lang=\"ts\" setup>\nimport { ServerVariablesForm } from '@scalar/api-client/components/Server'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { useId } from 'vue'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\n\n/** Update the selected server */\nconst updateServer = (newServer: string) => {\n eventBus.emit('server:update:selected', {\n url: selectedServer?.url === newServer ? '' : newServer,\n meta: {\n type: 'document',\n },\n })\n}\n\n/** Update the server variable */\nconst updateServerVariable = (key: string, value: string) => {\n /** Find the index of the selected server */\n const index = servers.findIndex((s) => s.url === selectedServer?.url)\n if (index === -1) {\n return\n }\n\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: {\n type: 'document',\n },\n })\n}\n</script>\n\n<template>\n <label\n class=\"bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium\">\n Server\n </label>\n <div\n :id=\"id\"\n class=\"border\"\n :class=\"{\n 'rounded-b-xl':\n !selectedServer?.description && !selectedServer?.variables,\n }\">\n <Selector\n v-if=\"servers.length\"\n :selectedServer\n :servers=\"servers\"\n :target=\"id\"\n @update:modelValue=\"updateServer\" />\n </div>\n <ServerVariablesForm\n layout=\"reference\"\n :variables=\"selectedServer?.variables\"\n @update:variable=\"updateServerVariable\" />\n\n <!-- Description -->\n <ScalarMarkdown\n v-if=\"selectedServer?.description\"\n class=\"text-c-3 rounded-b-xl border-x border-b px-3 py-1.5\"\n :value=\"selectedServer.description\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ServerSelector.vue.js","names":["_sfc_main"],"sources":["../../src/components/ServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The selected server */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n}\n\n/**\n * ServerSelector\n *\n * Core component for rendering a server selector block.\n * Handles server selection and emits a 'server:update:selected' event when the selected server changes.\n *\n * @event server:update:selected - Emitted when the selected server changes\n * @event server:update:variables - Emitted when a server variable changes\n */\nexport default {}\n</script>\n\n<script lang=\"ts\" setup>\nimport { ServerVariablesForm } from '@scalar/api-client/components/Server'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { useId } from 'vue'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\n\n/** Update the selected server */\nconst updateServer = (newServer: string) => {\n eventBus.emit('server:update:selected', {\n url: selectedServer?.url === newServer ? '' : newServer,\n meta: {\n type: 'document',\n },\n })\n}\n\n/** Update the server variable */\nconst updateServerVariable = (key: string, value: string) => {\n /** Find the index of the selected server */\n const index = servers.findIndex((s) => s.url === selectedServer?.url)\n if (index === -1) {\n return\n }\n\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: {\n type: 'document',\n },\n })\n}\n</script>\n\n<template>\n <label\n class=\"bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium\">\n Server\n </label>\n <div\n :id=\"id\"\n class=\"border\"\n :class=\"{\n 'rounded-b-xl':\n !selectedServer?.description && !selectedServer?.variables,\n }\">\n <Selector\n v-if=\"servers.length\"\n :selectedServer\n :servers=\"servers\"\n :target=\"id\"\n @update:modelValue=\"updateServer\" />\n </div>\n <ServerVariablesForm\n layout=\"reference\"\n :variables=\"selectedServer?.variables\"\n @update:variable=\"updateServerVariable\" />\n\n <!-- Description -->\n <ScalarMarkdown\n v-if=\"selectedServer?.description\"\n class=\"text-c-3 rounded-b-xl border-x border-b px-3 py-1.5\"\n :value=\"selectedServer.description\" />\n</template>\n"],"mappings":""}
@@ -66,4 +66,4 @@ var ServerSelector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
66
66
  //#endregion
67
67
  export { ServerSelector_vue_vue_type_script_setup_true_lang_default as default };
68
68
 
69
- //# sourceMappingURL=ServerSelector.vue.script.js.map
69
+ //# sourceMappingURL=ServerSelector.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerSelector.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_createElementVNode","_unref","_normalizeClass","_createBlock","Selector","_createCommentVNode","_createVNode"],"sources":["../../src/components/ServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The selected server */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n}\n\n/**\n * ServerSelector\n *\n * Core component for rendering a server selector block.\n * Handles server selection and emits a 'server:update:selected' event when the selected server changes.\n *\n * @event server:update:selected - Emitted when the selected server changes\n * @event server:update:variables - Emitted when a server variable changes\n */\nexport default {}\n</script>\n\n<script lang=\"ts\" setup>\nimport { ServerVariablesForm } from '@scalar/api-client/components/Server'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { useId } from 'vue'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\n\n/** Update the selected server */\nconst updateServer = (newServer: string) => {\n eventBus.emit('server:update:selected', {\n url: selectedServer?.url === newServer ? '' : newServer,\n meta: {\n type: 'document',\n },\n })\n}\n\n/** Update the server variable */\nconst updateServerVariable = (key: string, value: string) => {\n /** Find the index of the selected server */\n const index = servers.findIndex((s) => s.url === selectedServer?.url)\n if (index === -1) {\n return\n }\n\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: {\n type: 'document',\n },\n })\n}\n</script>\n\n<template>\n <label\n class=\"bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium\">\n Server\n </label>\n <div\n :id=\"id\"\n class=\"border\"\n :class=\"{\n 'rounded-b-xl':\n !selectedServer?.description && !selectedServer?.variables,\n }\">\n <Selector\n v-if=\"servers.length\"\n :selectedServer\n :servers=\"servers\"\n :target=\"id\"\n @update:modelValue=\"updateServer\" />\n </div>\n <ServerVariablesForm\n layout=\"reference\"\n :variables=\"selectedServer?.variables\"\n @update:variable=\"updateServerVariable\" />\n\n <!-- Description -->\n <ScalarMarkdown\n v-if=\"selectedServer?.description\"\n class=\"text-c-3 rounded-b-xl border-x border-b px-3 py-1.5\"\n :value=\"selectedServer.description\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAiCA,MAAM,KAAK,MAAM;;EAGjB,MAAM,gBAAgB,cAAsB;GAC1C,QAAA,SAAS,KAAK,0BAA0B;IACtC,KAAK,QAAA,gBAAgB,QAAQ,YAAY,KAAK;IAC9C,MAAM,EACJ,MAAM,WACR;GACF,CAAC;EACH;;EAGA,MAAM,wBAAwB,KAAa,UAAkB;;GAE3D,MAAM,QAAQ,QAAA,QAAQ,WAAW,MAAM,EAAE,QAAQ,QAAA,gBAAgB,GAAG;GACpE,IAAI,UAAU,IACZ;GAGF,QAAA,SAAS,KAAK,2BAA2B;IACvC;IACA;IACA;IACA,MAAM,EACJ,MAAM,WACR;GACF,CAAC;EACH;;;IAIE,OAAA,OAAA,OAAA,KAAAG,mBAGQ,SAAA,EAFN,OAAM,sFAAqF,GAAC,YAE9F,EAAA;IACAA,mBAaM,OAAA;KAZH,IAAIC,MAAA,EAAA;KACL,OAAKC,eAAA,CAAC,UAAQ,E,gBAC2B,CAAA,QAAA,gBAAgB,eAAW,CAAK,QAAA,gBAAgB,U;I,IAKjF,QAAA,QAAQ,UADhBL,UAAA,GAAAM,YAKsCC,kBAAA;;KAHnC,gBAAA,QAAA;KACA,SAAS,QAAA;KACT,QAAQH,MAAA,EAAA;KACR,uBAAmB;;;;;;IAExBK,YAG4CL,MAAA,mBAAA,GAAA;KAF1C,QAAO;KACN,WAAW,QAAA,gBAAgB;KAC3B,qBAAiB;;IAIZ,QAAA,gBAAgB,eADxBJ,UAAA,GAAAM,YAGwCF,MAAA,cAAA,GAAA;;KADtC,OAAM;KACL,OAAO,QAAA,eAAe"}
@@ -1,8 +1,8 @@
1
1
  import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.js";
2
- import UploadSection_vue_vue_type_script_setup_true_lang_default from "./UploadSection.vue.script.js";
3
- /* empty css */
2
+ import UploadSection_vue_vue_type_script_setup_true_lang_default from "./UploadSection.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
4
  //#region src/components/UploadSection.vue
5
- var UploadSection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(UploadSection_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-9621c76b"]]);
5
+ var UploadSection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(UploadSection_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b82d2f3a"]]);
6
6
  //#endregion
7
7
  export { UploadSection_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"UploadSection.vue.js","names":[],"sources":["../../src/components/UploadSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarLoading, useLoadingState } from '@scalar/components/loading'\nimport { ScalarIconCheck, ScalarIconXCircle } from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport { type UploadTmpDocumentState } from '@/hooks/use-upload-tmp-document'\n\nconst { uploadState } = defineProps<{\n uploadState: UploadTmpDocumentState\n}>()\n\nconst loadingState = useLoadingState()\n\nconst isLoading = computed(() =>\n ['uploading', 'processing', 'loading'].includes(uploadState.type),\n)\n</script>\n\n<template>\n <div\n class=\"uploadSection\"\n :class=\"{\n error: uploadState.type === 'error',\n done: uploadState.type === 'done',\n }\">\n <div\n v-if=\"isLoading\"\n class=\"flex items-center gap-1.5\">\n <ScalarLoading\n class=\"text-blue\"\n :loader=\"{\n ...loadingState,\n isLoading: true,\n }\"\n size=\"lg\" />\n <strong\n v-if=\"uploadState.type === 'loading'\"\n class=\"uploadText\">\n Loading OpenAPI document…\n </strong>\n <strong\n v-else-if=\"uploadState.type === 'processing'\"\n class=\"uploadText\">\n Processing OpenAPI document…\n </strong>\n <strong\n v-else\n class=\"uploadText\">\n Uploading OpenAPI document…\n </strong>\n </div>\n <strong\n v-if=\"uploadState.type === 'done'\"\n class=\"uploadText flex items-center gap-1.5\">\n <ScalarIconCheck class=\"icon text-green\" />\n Your OpenAPI document has been processed successfully.\n </strong>\n <strong\n v-if=\"uploadState.type === 'error'\"\n class=\"uploadText flex items-center gap-1.5\">\n <ScalarIconXCircle class=\"icon text-red\" />\n {{ uploadState.error }}\n </strong>\n </div>\n</template>\n\n<style scoped>\n.uploadSection {\n width: 100%;\n margin-bottom: -16px;\n padding: 8px 8px 24px 12px;\n position: relative;\n background: color-mix(\n in srgb,\n var(--scalar-color-blue),\n var(--scalar-background-1) 95%\n );\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-3xl) var(--scalar-radius-3xl) 0 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: absolute;\n top: 0;\n transform: translate3d(0, calc(-100% + 16px), 0);\n}\n\n.uploadSection.error {\n background: color-mix(\n in srgb,\n var(--scalar-color-red),\n var(--scalar-background-1) 95%\n );\n}\n\n.uploadSection.done {\n background: color-mix(\n in srgb,\n var(--scalar-color-green),\n var(--scalar-background-1) 95%\n );\n}\n\n.uploadText {\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-font-size-3);\n}\n\n.icon {\n height: 20px;\n width: 20px;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"UploadSection.vue.js","names":["_sfc_main"],"sources":["../../src/components/UploadSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarLoading, useLoadingState } from '@scalar/components/loading'\nimport { ScalarIconCheck, ScalarIconXCircle } from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport { type UploadTmpDocumentState } from '@/hooks/use-upload-tmp-document'\n\nconst { uploadState } = defineProps<{\n uploadState: UploadTmpDocumentState\n}>()\n\nconst loadingState = useLoadingState()\n\nconst isLoading = computed(() =>\n ['uploading', 'processing', 'loading'].includes(uploadState.type),\n)\n</script>\n\n<template>\n <div\n class=\"uploadSection\"\n :class=\"{\n error: uploadState.type === 'error',\n done: uploadState.type === 'done',\n }\">\n <div\n v-if=\"isLoading\"\n class=\"flex items-center gap-1.5\">\n <ScalarLoading\n class=\"text-blue\"\n :loader=\"{\n ...loadingState,\n isLoading: true,\n }\"\n size=\"lg\" />\n <strong\n v-if=\"uploadState.type === 'loading'\"\n class=\"uploadText\">\n Loading API description…\n </strong>\n <strong\n v-else-if=\"uploadState.type === 'processing'\"\n class=\"uploadText\">\n Processing API description…\n </strong>\n <strong\n v-else\n class=\"uploadText\">\n Uploading API description…\n </strong>\n </div>\n <strong\n v-if=\"uploadState.type === 'done'\"\n class=\"uploadText flex items-center gap-1.5\">\n <ScalarIconCheck class=\"icon text-green\" />\n Your API description has been processed successfully.\n </strong>\n <strong\n v-if=\"uploadState.type === 'error'\"\n class=\"uploadText flex items-center gap-1.5\">\n <ScalarIconXCircle class=\"icon text-red\" />\n {{ uploadState.error }}\n </strong>\n </div>\n</template>\n\n<style scoped>\n.uploadSection {\n width: 100%;\n margin-bottom: -16px;\n padding: 8px 8px 24px 12px;\n position: relative;\n background: color-mix(\n in srgb,\n var(--scalar-color-blue),\n var(--scalar-background-1) 95%\n );\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-3xl) var(--scalar-radius-3xl) 0 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: absolute;\n top: 0;\n transform: translate3d(0, calc(-100% + 16px), 0);\n}\n\n.uploadSection.error {\n background: color-mix(\n in srgb,\n var(--scalar-color-red),\n var(--scalar-background-1) 95%\n );\n}\n\n.uploadSection.done {\n background: color-mix(\n in srgb,\n var(--scalar-color-green),\n var(--scalar-background-1) 95%\n );\n}\n\n.uploadText {\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-font-size-3);\n}\n\n.icon {\n height: 20px;\n width: 20px;\n}\n</style>\n"],"mappings":""}
@@ -48,8 +48,8 @@ var UploadSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
48
48
  isLoading: true
49
49
  },
50
50
  size: "lg"
51
- }, null, 8, ["loader"]), __props.uploadState.type === "loading" ? (openBlock(), createElementBlock("strong", _hoisted_2, " Loading OpenAPI document… ")) : __props.uploadState.type === "processing" ? (openBlock(), createElementBlock("strong", _hoisted_3, " Processing OpenAPI document… ")) : (openBlock(), createElementBlock("strong", _hoisted_4, " Uploading OpenAPI document… "))])) : createCommentVNode("", true),
52
- __props.uploadState.type === "done" ? (openBlock(), createElementBlock("strong", _hoisted_5, [createVNode(unref(ScalarIconCheck), { class: "icon text-green" }), _cache[0] || (_cache[0] = createTextVNode(" Your OpenAPI document has been processed successfully. ", -1))])) : createCommentVNode("", true),
51
+ }, null, 8, ["loader"]), __props.uploadState.type === "loading" ? (openBlock(), createElementBlock("strong", _hoisted_2, " Loading API description… ")) : __props.uploadState.type === "processing" ? (openBlock(), createElementBlock("strong", _hoisted_3, " Processing API description… ")) : (openBlock(), createElementBlock("strong", _hoisted_4, " Uploading API description… "))])) : createCommentVNode("", true),
52
+ __props.uploadState.type === "done" ? (openBlock(), createElementBlock("strong", _hoisted_5, [createVNode(unref(ScalarIconCheck), { class: "icon text-green" }), _cache[0] || (_cache[0] = createTextVNode(" Your API description has been processed successfully. ", -1))])) : createCommentVNode("", true),
53
53
  __props.uploadState.type === "error" ? (openBlock(), createElementBlock("strong", _hoisted_6, [createVNode(unref(ScalarIconXCircle), { class: "icon text-red" }), createTextVNode(" " + toDisplayString(__props.uploadState.error), 1)])) : createCommentVNode("", true)
54
54
  ], 2);
55
55
  };
@@ -58,4 +58,4 @@ var UploadSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
58
58
  //#endregion
59
59
  export { UploadSection_vue_vue_type_script_setup_true_lang_default as default };
60
60
 
61
- //# sourceMappingURL=UploadSection.vue.script.js.map
61
+ //# sourceMappingURL=UploadSection.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UploadSection.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createVNode","_unref","_createCommentVNode","_createTextVNode","_toDisplayString"],"sources":["../../src/components/UploadSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarLoading, useLoadingState } from '@scalar/components/loading'\nimport { ScalarIconCheck, ScalarIconXCircle } from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport { type UploadTmpDocumentState } from '@/hooks/use-upload-tmp-document'\n\nconst { uploadState } = defineProps<{\n uploadState: UploadTmpDocumentState\n}>()\n\nconst loadingState = useLoadingState()\n\nconst isLoading = computed(() =>\n ['uploading', 'processing', 'loading'].includes(uploadState.type),\n)\n</script>\n\n<template>\n <div\n class=\"uploadSection\"\n :class=\"{\n error: uploadState.type === 'error',\n done: uploadState.type === 'done',\n }\">\n <div\n v-if=\"isLoading\"\n class=\"flex items-center gap-1.5\">\n <ScalarLoading\n class=\"text-blue\"\n :loader=\"{\n ...loadingState,\n isLoading: true,\n }\"\n size=\"lg\" />\n <strong\n v-if=\"uploadState.type === 'loading'\"\n class=\"uploadText\">\n Loading API description…\n </strong>\n <strong\n v-else-if=\"uploadState.type === 'processing'\"\n class=\"uploadText\">\n Processing API description…\n </strong>\n <strong\n v-else\n class=\"uploadText\">\n Uploading API description…\n </strong>\n </div>\n <strong\n v-if=\"uploadState.type === 'done'\"\n class=\"uploadText flex items-center gap-1.5\">\n <ScalarIconCheck class=\"icon text-green\" />\n Your API description has been processed successfully.\n </strong>\n <strong\n v-if=\"uploadState.type === 'error'\"\n class=\"uploadText flex items-center gap-1.5\">\n <ScalarIconXCircle class=\"icon text-red\" />\n {{ uploadState.error }}\n </strong>\n </div>\n</template>\n\n<style scoped>\n.uploadSection {\n width: 100%;\n margin-bottom: -16px;\n padding: 8px 8px 24px 12px;\n position: relative;\n background: color-mix(\n in srgb,\n var(--scalar-color-blue),\n var(--scalar-background-1) 95%\n );\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-3xl) var(--scalar-radius-3xl) 0 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: absolute;\n top: 0;\n transform: translate3d(0, calc(-100% + 16px), 0);\n}\n\n.uploadSection.error {\n background: color-mix(\n in srgb,\n var(--scalar-color-red),\n var(--scalar-background-1) 95%\n );\n}\n\n.uploadSection.done {\n background: color-mix(\n in srgb,\n var(--scalar-color-green),\n var(--scalar-background-1) 95%\n );\n}\n\n.uploadText {\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-font-size-3);\n}\n\n.icon {\n height: 20px;\n width: 20px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,eAAe,gBAAgB;EAErC,MAAM,YAAY,eAChB;GAAC;GAAa;GAAc;EAAS,CAAC,CAAC,SAAS,QAAA,YAAY,IAAI,CAClE;;GAIE,OAAAA,UAAA,GAAAC,mBA4CM,OAAA,EA3CJ,OAAKC,eAAA,CAAC,iBAAe;IACE,OAAA,QAAA,YAAY,SAAI;IAA0B,MAAA,QAAA,YAAY,SAAI;;IAKzE,UAAA,SADRF,UAAA,GAAAC,mBAyBM,OAzBN,YAyBM,CAtBJE,YAMcC,MAAA,aAAA,GAAA;KALZ,OAAM;KACL,QAAM;MAAiB,GAAAA,MAAA,YAAA;;;KAIxB,MAAK;I,yBAEC,QAAA,YAAY,SAAI,aADxBJ,UAAA,GAAAC,mBAIS,UAJT,YAEqB,4BAErB,KAEa,QAAA,YAAY,SAAI,gBAD7BD,UAAA,GAAAC,mBAIS,UAJT,YAEqB,+BAErB,MACAD,UAAA,GAAAC,mBAIS,UAJT,YAEqB,8BAErB,E;IAGM,QAAA,YAAY,SAAI,UADxBD,UAAA,GAAAC,mBAKS,UALT,YAKS,CAFPE,YAA2CC,MAAA,eAAA,GAAA,EAA1B,OAAM,kBAAiB,CAAA,GAAG,OAAA,OAAA,OAAA,KAAAE,gBAAA,2DAE7C,EAAA,E;IAEQ,QAAA,YAAY,SAAI,WADxBN,UAAA,GAAAC,mBAKS,UALT,YAKS,CAFPE,YAA2CC,MAAA,iBAAA,GAAA,EAAxB,OAAM,gBAAe,CAAA,GAAGE,gBAAA,MAC3CC,gBAAG,QAAA,YAAY,KAAK,GAAA,CAAA,C"}
@@ -1,6 +1,6 @@
1
1
  import { type Static } from '@scalar/validation';
2
2
  import type { Result } from 'neverpanic';
3
- import type { AgentChatError } from '../../entities/error/constants.js';
3
+ import type { AgentChatError } from '../error/constants.js';
4
4
  export declare const EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME: "execute-request";
5
5
  export declare const executeClientSideRequestToolInputSchema: import("@scalar/validation").ObjectSchema<{
6
6
  method: import("@scalar/validation").StringSchema;
@@ -1,6 +1,7 @@
1
1
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
2
3
  export declare const SUMMARIZE_OPENAPI_SPECS_TOOL_NAME: "summarize-openapi-specs";
3
- export type GetOpenAPISpecsSummaryToolOutput = {
4
+ export type GetOpenAPISpecsSummaryToolOutput = ({
4
5
  paths: string[];
5
6
  components?: {
6
7
  securitySchemes: Record<string, OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SecuritySchemeObject>;
@@ -8,5 +9,5 @@ export type GetOpenAPISpecsSummaryToolOutput = {
8
9
  info?: OpenAPIV3_1.InfoObject;
9
10
  externalDocs: any;
10
11
  servers?: OpenAPIV3_1.ServerObject[];
11
- }[];
12
+ } | Partial<AsyncApiDocument>)[];
12
13
  //# sourceMappingURL=get-openapi-specs-summary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-openapi-specs-summary.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/get-openapi-specs-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,eAAO,MAAM,iCAAiC,EAAG,yBAAkC,CAAA;AAEnF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,UAAU,CAAC,EAAE;QACX,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAA;KAChG,CAAA;IACD,IAAI,CAAC,EAAE,WAAW,CAAC,UAAU,CAAA;IAC7B,YAAY,EAAE,GAAG,CAAA;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC,YAAY,EAAE,CAAA;CACrC,EAAE,CAAA"}
1
+ {"version":3,"file":"get-openapi-specs-summary.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/get-openapi-specs-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,eAAO,MAAM,iCAAiC,EAAG,yBAAkC,CAAA;AAEnF,MAAM,MAAM,gCAAgC,GAAG,CAC3C;IACE,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,UAAU,CAAC,EAAE;QACX,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAA;KAChG,CAAA;IACD,IAAI,CAAC,EAAE,WAAW,CAAC,UAAU,CAAA;IAC7B,YAAY,EAAE,GAAG,CAAA;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC,YAAY,EAAE,CAAA;CACrC,GACD,OAAO,CAAC,gBAAgB,CAAC,CAC5B,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-openapi-specs-summary.js","names":[],"sources":["../../../src/entities/tools/get-openapi-specs-summary.ts"],"sourcesContent":["import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport const SUMMARIZE_OPENAPI_SPECS_TOOL_NAME = 'summarize-openapi-specs' as const\n\nexport type GetOpenAPISpecsSummaryToolOutput = {\n paths: string[]\n components?: {\n securitySchemes: Record<string, OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SecuritySchemeObject>\n }\n info?: OpenAPIV3_1.InfoObject\n externalDocs: any\n servers?: OpenAPIV3_1.ServerObject[]\n}[]\n"],"mappings":";AAEA,IAAa,oCAAoC"}
1
+ {"version":3,"file":"get-openapi-specs-summary.js","names":[],"sources":["../../../src/entities/tools/get-openapi-specs-summary.ts"],"sourcesContent":["import type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\n\nexport const SUMMARIZE_OPENAPI_SPECS_TOOL_NAME = 'summarize-openapi-specs' as const\n\nexport type GetOpenAPISpecsSummaryToolOutput = (\n | {\n paths: string[]\n components?: {\n securitySchemes: Record<string, OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SecuritySchemeObject>\n }\n info?: OpenAPIV3_1.InfoObject\n externalDocs: any\n servers?: OpenAPIV3_1.ServerObject[]\n }\n | Partial<AsyncApiDocument>\n)[]\n"],"mappings":";AAGA,IAAa,oCAAoC"}
@@ -1,9 +1,10 @@
1
1
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
2
3
  import { type Static } from '@scalar/validation';
3
4
  export declare const SEARCH_OPENAPI_OPERATIONS_TOOL_NAME: "search-openapi-operations";
4
5
  export declare const searchOpenAPIOperationsInputSchema: import("@scalar/validation").ObjectSchema<{
5
6
  question: import("@scalar/validation").StringSchema;
6
7
  }>;
7
8
  export type SearchOpenAPIOperationsToolInput = Static<typeof searchOpenAPIOperationsInputSchema>;
8
- export type SearchOpenAPIOperationsToolOutput = Partial<OpenAPIV3_1.Document>[];
9
+ export type SearchOpenAPIOperationsToolOutput = (Partial<OpenAPIV3_1.Document> | Partial<AsyncApiDocument>)[];
9
10
  //# sourceMappingURL=search-openapi-operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-openapi-operations.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/search-openapi-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,oBAAoB,CAAA;AAEhE,eAAO,MAAM,mCAAmC,EAAG,2BAAoC,CAAA;AAEvF,eAAO,MAAM,kCAAkC;;EAE7C,CAAA;AAEF,MAAM,MAAM,gCAAgC,GAAG,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEhG,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAA"}
1
+ {"version":3,"file":"search-openapi-operations.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/search-openapi-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,oBAAoB,CAAA;AAEhE,eAAO,MAAM,mCAAmC,EAAG,2BAAoC,CAAA;AAEvF,eAAO,MAAM,kCAAkC;;EAE7C,CAAA;AAEF,MAAM,MAAM,gCAAgC,GAAG,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEhG,MAAM,MAAM,iCAAiC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"search-openapi-operations.js","names":[],"sources":["../../../src/entities/tools/search-openapi-operations.ts"],"sourcesContent":["import type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { type Static, object, string } from '@scalar/validation'\n\nexport const SEARCH_OPENAPI_OPERATIONS_TOOL_NAME = 'search-openapi-operations' as const\n\nexport const searchOpenAPIOperationsInputSchema = object({\n question: string(),\n})\n\nexport type SearchOpenAPIOperationsToolInput = Static<typeof searchOpenAPIOperationsInputSchema>\n\nexport type SearchOpenAPIOperationsToolOutput = Partial<OpenAPIV3_1.Document>[]\n"],"mappings":";;AAGA,IAAa,sCAAsC;AAEnD,IAAa,qCAAqC,OAAO,EACvD,UAAU,OAAO,EACnB,CAAC"}
1
+ {"version":3,"file":"search-openapi-operations.js","names":[],"sources":["../../../src/entities/tools/search-openapi-operations.ts"],"sourcesContent":["import type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport { type Static, object, string } from '@scalar/validation'\n\nexport const SEARCH_OPENAPI_OPERATIONS_TOOL_NAME = 'search-openapi-operations' as const\n\nexport const searchOpenAPIOperationsInputSchema = object({\n question: string(),\n})\n\nexport type SearchOpenAPIOperationsToolInput = Static<typeof searchOpenAPIOperationsInputSchema>\n\nexport type SearchOpenAPIOperationsToolOutput = (Partial<OpenAPIV3_1.Document> | Partial<AsyncApiDocument>)[]\n"],"mappings":";;AAIA,IAAa,sCAAsC;AAEnD,IAAa,qCAAqC,OAAO,EACvD,UAAU,OAAO,EACnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Display native API identities without treating path metadata as operations. */
2
+ export declare const getSearchResultLabels: (input: unknown) => string[];
3
+ //# sourceMappingURL=get-search-result-labels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-search-result-labels.d.ts","sourceRoot":"","sources":["../../src/helpers/get-search-result-labels.ts"],"names":[],"mappings":"AAQA,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,MAAM,EA0C5D,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { isHttpMethod } from "@scalar/helpers/http/is-http-method";
2
+ import { isObject } from "@scalar/helpers/object/is-object";
3
+ import { createMagicProxy } from "@scalar/json-magic/magic-proxy";
4
+ import { getResolvedAsyncApiRef } from "@scalar/workspace-store/helpers/get-resolved-async-api-ref";
5
+ //#region src/helpers/get-search-result-labels.ts
6
+ var entries = (value) => isObject(value) ? Object.entries(value) : [];
7
+ var label = (value, fallback) => typeof value === "string" && value ? value : fallback;
8
+ /** Display native API identities without treating path metadata as operations. */
9
+ var getSearchResultLabels = (input) => {
10
+ if (!isObject(input)) return [];
11
+ const document = createMagicProxy(input);
12
+ const title = isObject(document.info) ? label(document.info.title, "") : "";
13
+ const prefix = title ? `${title} - ` : "";
14
+ if (typeof document.asyncapi === "string") {
15
+ const operations = entries(document.operations).flatMap(([name, node]) => {
16
+ const operation = getResolvedAsyncApiRef(node);
17
+ if (!isObject(operation)) return [];
18
+ const channel = getResolvedAsyncApiRef(operation.channel);
19
+ const address = isObject(channel) ? label(channel.address, "Unknown address") : "Unknown address";
20
+ return [`${prefix}${label(operation.action, "Operation")} ${address}: ${label(operation.title, label(operation.summary, name))}`];
21
+ });
22
+ const channels = entries(document.channels).flatMap(([name, node]) => {
23
+ const channel = getResolvedAsyncApiRef(node);
24
+ if (!isObject(channel)) return [];
25
+ const address = label(channel.address, "Unknown address");
26
+ return [`${prefix}Channel ${address}: ${label(channel.title, name)}`, ...entries(channel.messages).map(([messageName, node]) => {
27
+ const message = getResolvedAsyncApiRef(node);
28
+ return `${prefix}Message ${isObject(message) ? label(message.title, label(message.name, messageName)) : messageName} (${address})`;
29
+ })];
30
+ });
31
+ return [...operations, ...channels];
32
+ }
33
+ return entries(document.paths).flatMap(([path, node]) => entries(node).flatMap(([method, operation]) => isHttpMethod(method) && isObject(operation) ? [`${prefix}${label(operation.summary, `${method.toUpperCase()} ${path}`)}`] : []));
34
+ };
35
+ //#endregion
36
+ export { getSearchResultLabels };
37
+
38
+ //# sourceMappingURL=get-search-result-labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-search-result-labels.js","names":[],"sources":["../../src/helpers/get-search-result-labels.ts"],"sourcesContent":["import { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { isObject } from '@scalar/helpers/object/is-object'\nimport { createMagicProxy } from '@scalar/json-magic/magic-proxy'\nimport { getResolvedAsyncApiRef } from '@scalar/workspace-store/helpers/get-resolved-async-api-ref'\n\nconst entries = (value: unknown): [string, unknown][] => (isObject(value) ? Object.entries(value) : [])\nconst label = (value: unknown, fallback: string): string => (typeof value === 'string' && value ? value : fallback)\n\n/** Display native API identities without treating path metadata as operations. */\nexport const getSearchResultLabels = (input: unknown): string[] => {\n if (!isObject(input)) {\n return []\n }\n const document = createMagicProxy(input)\n const title = isObject(document.info) ? label(document.info.title, '') : ''\n const prefix = title ? `${title} - ` : ''\n if (typeof document.asyncapi === 'string') {\n const operations = entries(document.operations).flatMap(([name, node]) => {\n const operation = getResolvedAsyncApiRef(node)\n if (!isObject(operation)) {\n return []\n }\n const channel = getResolvedAsyncApiRef(operation.channel)\n const address = isObject(channel) ? label(channel.address, 'Unknown address') : 'Unknown address'\n return [\n `${prefix}${label(operation.action, 'Operation')} ${address}: ${label(operation.title, label(operation.summary, name))}`,\n ]\n })\n const channels = entries(document.channels).flatMap(([name, node]) => {\n const channel = getResolvedAsyncApiRef(node)\n if (!isObject(channel)) {\n return []\n }\n const address = label(channel.address, 'Unknown address')\n return [\n `${prefix}Channel ${address}: ${label(channel.title, name)}`,\n ...entries(channel.messages).map(([messageName, node]) => {\n const message = getResolvedAsyncApiRef(node)\n return `${prefix}Message ${isObject(message) ? label(message.title, label(message.name, messageName)) : messageName} (${address})`\n }),\n ]\n })\n return [...operations, ...channels]\n }\n return entries(document.paths).flatMap(([path, node]) =>\n entries(node).flatMap(([method, operation]) =>\n isHttpMethod(method) && isObject(operation)\n ? [`${prefix}${label(operation.summary, `${method.toUpperCase()} ${path}`)}`]\n : [],\n ),\n )\n}\n"],"mappings":";;;;;AAKA,IAAM,WAAW,UAAyC,SAAS,KAAK,IAAI,OAAO,QAAQ,KAAK,IAAI,CAAC;AACrG,IAAM,SAAS,OAAgB,aAA8B,OAAO,UAAU,YAAY,QAAQ,QAAQ;;AAG1G,IAAa,yBAAyB,UAA6B;CACjE,IAAI,CAAC,SAAS,KAAK,GACjB,OAAO,CAAC;CAEV,MAAM,WAAW,iBAAiB,KAAK;CACvC,MAAM,QAAQ,SAAS,SAAS,IAAI,IAAI,MAAM,SAAS,KAAK,OAAO,EAAE,IAAI;CACzE,MAAM,SAAS,QAAQ,GAAG,MAAM,OAAO;CACvC,IAAI,OAAO,SAAS,aAAa,UAAU;EACzC,MAAM,aAAa,QAAQ,SAAS,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,UAAU;GACxE,MAAM,YAAY,uBAAuB,IAAI;GAC7C,IAAI,CAAC,SAAS,SAAS,GACrB,OAAO,CAAC;GAEV,MAAM,UAAU,uBAAuB,UAAU,OAAO;GACxD,MAAM,UAAU,SAAS,OAAO,IAAI,MAAM,QAAQ,SAAS,iBAAiB,IAAI;GAChF,OAAO,CACL,GAAG,SAAS,MAAM,UAAU,QAAQ,WAAW,EAAE,GAAG,QAAQ,IAAI,MAAM,UAAU,OAAO,MAAM,UAAU,SAAS,IAAI,CAAC,GACvH;EACF,CAAC;EACD,MAAM,WAAW,QAAQ,SAAS,QAAQ,CAAC,CAAC,SAAS,CAAC,MAAM,UAAU;GACpE,MAAM,UAAU,uBAAuB,IAAI;GAC3C,IAAI,CAAC,SAAS,OAAO,GACnB,OAAO,CAAC;GAEV,MAAM,UAAU,MAAM,QAAQ,SAAS,iBAAiB;GACxD,OAAO,CACL,GAAG,OAAO,UAAU,QAAQ,IAAI,MAAM,QAAQ,OAAO,IAAI,KACzD,GAAG,QAAQ,QAAQ,QAAQ,CAAC,CAAC,KAAK,CAAC,aAAa,UAAU;IACxD,MAAM,UAAU,uBAAuB,IAAI;IAC3C,OAAO,GAAG,OAAO,UAAU,SAAS,OAAO,IAAI,MAAM,QAAQ,OAAO,MAAM,QAAQ,MAAM,WAAW,CAAC,IAAI,YAAY,IAAI,QAAQ;GAClI,CAAC,CACH;EACF,CAAC;EACD,OAAO,CAAC,GAAG,YAAY,GAAG,QAAQ;CACpC;CACA,OAAO,QAAQ,SAAS,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,UAC7C,QAAQ,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,eAC9B,aAAa,MAAM,KAAK,SAAS,SAAS,IACtC,CAAC,GAAG,SAAS,MAAM,UAAU,SAAS,GAAG,OAAO,YAAY,EAAE,GAAG,MAAM,GAAG,IAC1E,CAAC,CACP,CACF;AACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=get-search-result-labels.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-search-result-labels.test.d.ts","sourceRoot":"","sources":["../../src/helpers/get-search-result-labels.test.ts"],"names":[],"mappings":""}
package/dist/helpers.d.ts CHANGED
@@ -1,9 +1,6 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
1
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
2
  import { type Auth } from '@scalar/workspace-store/entities/auth';
4
3
  import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
5
- import type { OperationObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
6
- export declare function getOperations(doc: Partial<OpenAPIV3_1.Document>): OperationObject[];
7
4
  /** Generate document settings from workspace store. AsyncAPI docs are skipped — this feature is OpenAPI-native. */
8
5
  export declare function createDocumentSettings(workspaceStore: WorkspaceStore): {
9
6
  [k: string]: {
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AAWzF,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEpH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,GACwB,eAAe,EAAE,CACxG;AAwBD,mHAAmH;AACnH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc;;;;;EAuBpE;AAKD;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAMpB;;OAEG;oBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAItB;;;OAGG;oBACa,MAAM,SAAS,IAAI;CAItC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GAAI,mCAG3C;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;CAC/B,KAAG,IAIH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AAmCzF,mHAAmH;AACnH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc;;;;;EAuBpE;AAKD;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAMpB;;OAEG;oBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAItB;;;OAGG;oBACa,MAAM,SAAS,IAAI;CAItC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GAAI,mCAG3C;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;CAC/B,KAAG,IAIH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C"}
package/dist/helpers.js CHANGED
@@ -1,12 +1,9 @@
1
+ import { isOpenApiDocument } from "@scalar/workspace-store/schemas/type-guards";
1
2
  import { getSecurityRequirements, getSecuritySchemes, getSelectedSecurity, getSelectedServer, getServers, mergeSecurity } from "@scalar/workspace-store/request-example";
2
3
  import { REFERENCE_LS_KEYS, safeLocalStorage } from "@scalar/helpers/object/local-storage";
3
4
  import { AuthSchema } from "@scalar/workspace-store/entities/auth";
4
- import { isOpenApiDocument } from "@scalar/workspace-store/schemas/type-guards";
5
5
  import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
6
6
  //#region src/helpers.ts
7
- function getOperations(doc) {
8
- return Object.values(doc.paths ?? {}).flatMap((path) => Object.values(path ?? {}));
9
- }
10
7
  /** Flattens all security requirements from a document */
11
8
  function getSecurityFromDocument(documentName, document, authStore) {
12
9
  const mergedSecurity = mergeSecurity(document?.components?.securitySchemes, {}, authStore, documentName);
@@ -22,8 +19,9 @@ function createDocumentSettings(workspaceStore) {
22
19
  const openApiEntries = [];
23
20
  for (const [key, document] of Object.entries(workspaceStore.workspace.documents)) if (isOpenApiDocument(document)) openApiEntries.push([key, document]);
24
21
  return Object.fromEntries(openApiEntries.map(([key, document]) => {
22
+ const servers = getServers(document.servers, { documentUrl: document["x-scalar-original-source-url"] });
25
23
  return [key, {
26
- activeServer: getSelectedServer(document, null, null, getServers(document.servers, { documentUrl: document["x-scalar-original-source-url"] })),
24
+ activeServer: getSelectedServer(document, null, null, servers),
27
25
  securitySchemes: getSecurityFromDocument(key, document, workspaceStore.auth)
28
26
  }];
29
27
  }));
@@ -43,7 +41,8 @@ var authStorage = () => {
43
41
  * Retrieves and coerces the authentication schemes stored in local storage.
44
42
  */
45
43
  getAuth: (slug) => {
46
- return coerceValue(AuthSchema, JSON.parse(storage.getItem(getKey(slug)) ?? "{}"));
44
+ const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? "{}");
45
+ return coerceValue(AuthSchema, parsed);
47
46
  },
48
47
  /**
49
48
  * Stores the authentication schemes in local storage.
@@ -75,6 +74,6 @@ function safeParseJson(value) {
75
74
  }
76
75
  }
77
76
  //#endregion
78
- export { authStorage, createDocumentSettings, getOperations, restoreAuthSecretsFromStorage, safeParseJson };
77
+ export { authStorage, createDocumentSettings, restoreAuthSecretsFromStorage, safeParseJson };
79
78
 
80
79
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["import { REFERENCE_LS_KEYS, safeLocalStorage } from '@scalar/helpers/object/local-storage'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport { type Auth, AuthSchema } from '@scalar/workspace-store/entities/auth'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport {\n getSecurityRequirements,\n getSecuritySchemes,\n getSelectedSecurity,\n getSelectedServer,\n getServers,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\nimport type { OpenApiDocument, OperationObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nexport function getOperations(doc: Partial<OpenAPIV3_1.Document>) {\n return Object.values(doc.paths ?? {}).flatMap((path) => Object.values(path ?? {})) as OperationObject[]\n}\n\n/** Flattens all security requirements from a document */\nfunction getSecurityFromDocument(\n documentName: string,\n document: OpenApiDocument,\n authStore: AuthStore,\n): SecuritySchemeObjectSecret[] {\n const mergedSecurity = mergeSecurity(document?.components?.securitySchemes, {}, authStore, documentName)\n\n const securityRequirements = getSecurityRequirements(document.security)\n\n const selectedSecurity = getSelectedSecurity(\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName,\n }),\n undefined,\n securityRequirements,\n )\n\n return getSecuritySchemes(mergedSecurity, selectedSecurity.selectedSchemes[selectedSecurity.selectedIndex] ?? {})\n}\n\n/** Generate document settings from workspace store. AsyncAPI docs are skipped — this feature is OpenAPI-native. */\nexport function createDocumentSettings(workspaceStore: WorkspaceStore) {\n const openApiEntries: [string, OpenApiDocument][] = []\n for (const [key, document] of Object.entries(workspaceStore.workspace.documents)) {\n if (isOpenApiDocument(document)) {\n openApiEntries.push([key, document])\n }\n }\n\n return Object.fromEntries(\n openApiEntries.map(([key, document]) => {\n const servers = getServers(document.servers, {\n documentUrl: document['x-scalar-original-source-url'],\n })\n\n return [\n key,\n {\n activeServer: getSelectedServer(document, null, null, servers),\n securitySchemes: getSecurityFromDocument(key, document, workspaceStore.auth),\n },\n ]\n }),\n )\n}\n\n// Local storage helper instance, safely wrapped.\nconst storage = safeLocalStorage()\n\n/**\n * Provides an interface to store and retrieve authentication scheme\n * information in local storage, including both the available schemes and\n * the user's selected schemes.\n */\nexport const authStorage = () => {\n const getKey = (slug: string) => {\n return `${REFERENCE_LS_KEYS.AUTH}-${slug}`\n }\n\n return {\n /**\n * Retrieves and coerces the authentication schemes stored in local storage.\n */\n getAuth: (slug: string) => {\n const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? '{}')\n return coerceValue(AuthSchema, parsed)\n },\n /**\n * Stores the authentication schemes in local storage.\n * @param value The Auth object to stringify and store.\n */\n setAuth: (slug: string, value: Auth) => {\n storage.setItem(getKey(slug), JSON.stringify(value))\n },\n }\n}\n\n/**\n * Restores authentication secrets from local storage to the workspace store.\n *\n * This function iterates through stored authentication schemes and restores\n * any secret values (keys starting with x-scalar-secret-) to the active\n * document's security schemes. It uses the current security schemes as the\n * source of truth, only restoring secrets for structures that exist in the\n * current document.\n */\nexport const restoreAuthSecretsFromStorage = ({\n documentName,\n workspaceStore,\n}: {\n documentName: string\n workspaceStore: WorkspaceStore\n}): void => {\n const authPersistence = authStorage()\n const auth = authPersistence.getAuth(documentName)\n workspaceStore.auth.load({ [documentName]: auth })\n}\n\nexport function safeParseJson(value: string) {\n try {\n return JSON.parse(value)\n } catch {\n return\n }\n}\n"],"mappings":";;;;;;AAkBA,SAAgB,cAAc,KAAoC;CAChE,OAAO,OAAO,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,OAAO,OAAO,QAAQ,CAAC,CAAC,CAAC;AACnF;;AAGA,SAAS,wBACP,cACA,UACA,WAC8B;CAC9B,MAAM,iBAAiB,cAAc,UAAU,YAAY,iBAAiB,CAAC,GAAG,WAAW,YAAY;CAEvG,MAAM,uBAAuB,wBAAwB,SAAS,QAAQ;CAEtE,MAAM,mBAAmB,oBACvB,UAAU,uBAAuB;EAC/B,MAAM;EACN;CACF,CAAC,GACD,KAAA,GACA,oBACF;CAEA,OAAO,mBAAmB,gBAAgB,iBAAiB,gBAAgB,iBAAiB,kBAAkB,CAAC,CAAC;AAClH;;AAGA,SAAgB,uBAAuB,gBAAgC;CACrE,MAAM,iBAA8C,CAAC;CACrD,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,eAAe,UAAU,SAAS,GAC7E,IAAI,kBAAkB,QAAQ,GAC5B,eAAe,KAAK,CAAC,KAAK,QAAQ,CAAC;CAIvC,OAAO,OAAO,YACZ,eAAe,KAAK,CAAC,KAAK,cAAc;EAKtC,OAAO,CACL,KACA;GACE,cAAc,kBAAkB,UAAU,MAAM,MAPpC,WAAW,SAAS,SAAS,EAC3C,aAAa,SAAS,gCACxB,CAK0D,CAAO;GAC7D,iBAAiB,wBAAwB,KAAK,UAAU,eAAe,IAAI;EAC7E,CACF;CACF,CAAC,CACH;AACF;AAGA,IAAM,UAAU,iBAAiB;;;;;;AAOjC,IAAa,oBAAoB;CAC/B,MAAM,UAAU,SAAiB;EAC/B,OAAO,GAAG,kBAAkB,KAAK,GAAG;CACtC;CAEA,OAAO;;;;EAIL,UAAU,SAAiB;GAEzB,OAAO,YAAY,YADJ,KAAK,MAAM,QAAQ,QAAQ,OAAO,IAAI,CAAC,KAAK,IAC5B,CAAM;EACvC;;;;;EAKA,UAAU,MAAc,UAAgB;GACtC,QAAQ,QAAQ,OAAO,IAAI,GAAG,KAAK,UAAU,KAAK,CAAC;EACrD;CACF;AACF;;;;;;;;;;AAWA,IAAa,iCAAiC,EAC5C,cACA,qBAIU;CAEV,MAAM,OADkB,YACX,CAAA,CAAgB,QAAQ,YAAY;CACjD,eAAe,KAAK,KAAK,GAAG,eAAe,KAAK,CAAC;AACnD;AAEA,SAAgB,cAAc,OAAe;CAC3C,IAAI;EACF,OAAO,KAAK,MAAM,KAAK;CACzB,QAAQ;EACN;CACF;AACF"}
1
+ {"version":3,"file":"helpers.js","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["import { REFERENCE_LS_KEYS, safeLocalStorage } from '@scalar/helpers/object/local-storage'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport { type Auth, AuthSchema } from '@scalar/workspace-store/entities/auth'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport {\n getSecurityRequirements,\n getSecuritySchemes,\n getSelectedSecurity,\n getSelectedServer,\n getServers,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/** Flattens all security requirements from a document */\nfunction getSecurityFromDocument(\n documentName: string,\n document: OpenApiDocument,\n authStore: AuthStore,\n): SecuritySchemeObjectSecret[] {\n const mergedSecurity = mergeSecurity(document?.components?.securitySchemes, {}, authStore, documentName)\n\n const securityRequirements = getSecurityRequirements(document.security)\n\n const selectedSecurity = getSelectedSecurity(\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName,\n }),\n undefined,\n securityRequirements,\n )\n\n return getSecuritySchemes(mergedSecurity, selectedSecurity.selectedSchemes[selectedSecurity.selectedIndex] ?? {})\n}\n\n/** Generate document settings from workspace store. AsyncAPI docs are skipped — this feature is OpenAPI-native. */\nexport function createDocumentSettings(workspaceStore: WorkspaceStore) {\n const openApiEntries: [string, OpenApiDocument][] = []\n for (const [key, document] of Object.entries(workspaceStore.workspace.documents)) {\n if (isOpenApiDocument(document)) {\n openApiEntries.push([key, document])\n }\n }\n\n return Object.fromEntries(\n openApiEntries.map(([key, document]) => {\n const servers = getServers(document.servers, {\n documentUrl: document['x-scalar-original-source-url'],\n })\n\n return [\n key,\n {\n activeServer: getSelectedServer(document, null, null, servers),\n securitySchemes: getSecurityFromDocument(key, document, workspaceStore.auth),\n },\n ]\n }),\n )\n}\n\n// Local storage helper instance, safely wrapped.\nconst storage = safeLocalStorage()\n\n/**\n * Provides an interface to store and retrieve authentication scheme\n * information in local storage, including both the available schemes and\n * the user's selected schemes.\n */\nexport const authStorage = () => {\n const getKey = (slug: string) => {\n return `${REFERENCE_LS_KEYS.AUTH}-${slug}`\n }\n\n return {\n /**\n * Retrieves and coerces the authentication schemes stored in local storage.\n */\n getAuth: (slug: string) => {\n const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? '{}')\n return coerceValue(AuthSchema, parsed)\n },\n /**\n * Stores the authentication schemes in local storage.\n * @param value The Auth object to stringify and store.\n */\n setAuth: (slug: string, value: Auth) => {\n storage.setItem(getKey(slug), JSON.stringify(value))\n },\n }\n}\n\n/**\n * Restores authentication secrets from local storage to the workspace store.\n *\n * This function iterates through stored authentication schemes and restores\n * any secret values (keys starting with x-scalar-secret-) to the active\n * document's security schemes. It uses the current security schemes as the\n * source of truth, only restoring secrets for structures that exist in the\n * current document.\n */\nexport const restoreAuthSecretsFromStorage = ({\n documentName,\n workspaceStore,\n}: {\n documentName: string\n workspaceStore: WorkspaceStore\n}): void => {\n const authPersistence = authStorage()\n const auth = authPersistence.getAuth(documentName)\n workspaceStore.auth.load({ [documentName]: auth })\n}\n\nexport function safeParseJson(value: string) {\n try {\n return JSON.parse(value)\n } catch {\n return\n }\n}\n"],"mappings":";;;;;;;AAkBA,SAAS,wBACP,cACA,UACA,WAC8B;CAC9B,MAAM,iBAAiB,cAAc,UAAU,YAAY,iBAAiB,CAAC,GAAG,WAAW,YAAY;CAEvG,MAAM,uBAAuB,wBAAwB,SAAS,QAAQ;CAEtE,MAAM,mBAAmB,oBACvB,UAAU,uBAAuB;EAC/B,MAAM;EACN;CACF,CAAC,GACD,KAAA,GACA,oBACF;CAEA,OAAO,mBAAmB,gBAAgB,iBAAiB,gBAAgB,iBAAiB,kBAAkB,CAAC,CAAC;AAClH;;AAGA,SAAgB,uBAAuB,gBAAgC;CACrE,MAAM,iBAA8C,CAAC;CACrD,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,eAAe,UAAU,SAAS,GAC7E,IAAI,kBAAkB,QAAQ,GAC5B,eAAe,KAAK,CAAC,KAAK,QAAQ,CAAC;CAIvC,OAAO,OAAO,YACZ,eAAe,KAAK,CAAC,KAAK,cAAc;EACtC,MAAM,UAAU,WAAW,SAAS,SAAS,EAC3C,aAAa,SAAS,gCACxB,CAAC;EAED,OAAO,CACL,KACA;GACE,cAAc,kBAAkB,UAAU,MAAM,MAAM,OAAO;GAC7D,iBAAiB,wBAAwB,KAAK,UAAU,eAAe,IAAI;EAC7E,CACF;CACF,CAAC,CACH;AACF;AAGA,IAAM,UAAU,iBAAiB;;;;;;AAOjC,IAAa,oBAAoB;CAC/B,MAAM,UAAU,SAAiB;EAC/B,OAAO,GAAG,kBAAkB,KAAK,GAAG;CACtC;CAEA,OAAO;;;;EAIL,UAAU,SAAiB;GACzB,MAAM,SAAS,KAAK,MAAM,QAAQ,QAAQ,OAAO,IAAI,CAAC,KAAK,IAAI;GAC/D,OAAO,YAAY,YAAY,MAAM;EACvC;;;;;EAKA,UAAU,MAAc,UAAgB;GACtC,QAAQ,QAAQ,OAAO,IAAI,GAAG,KAAK,UAAU,KAAK,CAAC;EACrD;CACF;AACF;;;;;;;;;;AAWA,IAAa,iCAAiC,EAC5C,cACA,qBAIU;CAEV,MAAM,OADkB,YACX,CAAA,CAAgB,QAAQ,YAAY;CACjD,eAAe,KAAK,KAAK,GAAG,eAAe,KAAK,CAAC;AACnD;AAEA,SAAgB,cAAc,OAAe;CAC3C,IAAI;EACF,OAAO,KAAK,MAAM,KAAK;CACzB,QAAQ;EACN;CACF;AACF"}
@@ -9,7 +9,7 @@ function useAgentKeyDocuments() {
9
9
  if (mode !== "full" || !getAgentKey) return;
10
10
  const keyDocumentsResult = await api.getKeyDocuments();
11
11
  if (!keyDocumentsResult.success) {
12
- toast("Failed to fetch your OpenAPI document. The Agent key may be invalid.", "error");
12
+ toast("Failed to fetch your API description. The Agent key may be invalid.", "error");
13
13
  return;
14
14
  }
15
15
  keyDocumentsResult.data.documents.forEach(({ namespace, slug }) => addDocument({
@@ -1 +1 @@
1
- {"version":3,"file":"use-agent-key-documents.js","names":[],"sources":["../../src/hooks/use-agent-key-documents.ts"],"sourcesContent":["import { useToasts } from '@scalar/use-toasts'\nimport { onMounted } from 'vue'\n\nimport { useState } from '@/state/state'\n\nexport function useAgentKeyDocuments() {\n const { api, addDocument, mode, getAgentKey } = useState()\n const { toast } = useToasts()\n\n onMounted(async () => {\n if (mode !== 'full' || !getAgentKey) {\n return\n }\n\n const keyDocumentsResult = await api.getKeyDocuments()\n\n if (!keyDocumentsResult.success) {\n toast('Failed to fetch your OpenAPI document. The Agent key may be invalid.', 'error')\n return\n }\n\n keyDocumentsResult.data.documents.forEach(({ namespace, slug }) =>\n addDocument({ namespace, slug, removable: false }),\n )\n })\n}\n"],"mappings":";;;;AAKA,SAAgB,uBAAuB;CACrC,MAAM,EAAE,KAAK,aAAa,MAAM,gBAAgB,SAAS;CACzD,MAAM,EAAE,UAAU,UAAU;CAE5B,UAAU,YAAY;EACpB,IAAI,SAAS,UAAU,CAAC,aACtB;EAGF,MAAM,qBAAqB,MAAM,IAAI,gBAAgB;EAErD,IAAI,CAAC,mBAAmB,SAAS;GAC/B,MAAM,wEAAwE,OAAO;GACrF;EACF;EAEA,mBAAmB,KAAK,UAAU,SAAS,EAAE,WAAW,WACtD,YAAY;GAAE;GAAW;GAAM,WAAW;EAAM,CAAC,CACnD;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"use-agent-key-documents.js","names":[],"sources":["../../src/hooks/use-agent-key-documents.ts"],"sourcesContent":["import { useToasts } from '@scalar/use-toasts'\nimport { onMounted } from 'vue'\n\nimport { useState } from '@/state/state'\n\nexport function useAgentKeyDocuments() {\n const { api, addDocument, mode, getAgentKey } = useState()\n const { toast } = useToasts()\n\n onMounted(async () => {\n if (mode !== 'full' || !getAgentKey) {\n return\n }\n\n const keyDocumentsResult = await api.getKeyDocuments()\n\n if (!keyDocumentsResult.success) {\n toast('Failed to fetch your API description. The Agent key may be invalid.', 'error')\n return\n }\n\n keyDocumentsResult.data.documents.forEach(({ namespace, slug }) =>\n addDocument({ namespace, slug, removable: false }),\n )\n })\n}\n"],"mappings":";;;;AAKA,SAAgB,uBAAuB;CACrC,MAAM,EAAE,KAAK,aAAa,MAAM,gBAAgB,SAAS;CACzD,MAAM,EAAE,UAAU,UAAU;CAE5B,UAAU,YAAY;EACpB,IAAI,SAAS,UAAU,CAAC,aACtB;EAGF,MAAM,qBAAqB,MAAM,IAAI,gBAAgB;EAErD,IAAI,CAAC,mBAAmB,SAAS;GAC/B,MAAM,uEAAuE,OAAO;GACpF;EACF;EAEA,mBAAmB,KAAK,UAAU,SAAS,EAAE,WAAW,WACtD,YAAY;GAAE;GAAW;GAAM,WAAW;EAAM,CAAC,CACnD;CACF,CAAC;AACH"}
@@ -16,7 +16,7 @@ export declare function getTmpDocFromLocalStorage(): {
16
16
  } | undefined;
17
17
  export declare function removeTmpDocFromLocalStorage(): void;
18
18
  /**
19
- * Handle uploading a temporary OpenAPI document.
19
+ * Handle uploading a temporary API description.
20
20
  */
21
21
  export declare function useUploadTmpDocument(): {
22
22
  uploadTempDocument: (document: string, isAgent?: boolean) => Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"use-upload-tmp-document.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload-tmp-document.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAapB,wBAAgB,yBAAyB;;;cAOxC;AAED,wBAAgB,4BAA4B,SAO3C;AAED;;GAEG;AACH,wBAAgB,oBAAoB;mCASU,MAAM;;;;;;EAqFnD"}
1
+ {"version":3,"file":"use-upload-tmp-document.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload-tmp-document.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAapB,wBAAgB,yBAAyB;;;cAOxC;AAED,wBAAgB,4BAA4B,SAO3C;AAED;;GAEG;AACH,wBAAgB,oBAAoB;mCAWU,MAAM;;;;;;EAyFnD"}
@@ -1,5 +1,5 @@
1
1
  import { useState } from "../state/state.js";
2
- import { ref } from "vue";
2
+ import { onScopeDispose } from "vue";
3
3
  import { coerce, object, string, validate } from "@scalar/validation";
4
4
  import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
5
5
  //#region src/hooks/use-upload-tmp-document.ts
@@ -25,11 +25,13 @@ function removeTmpDocFromLocalStorage() {
25
25
  localStorage.removeItem(TMP_DOC_LS_KEY);
26
26
  }
27
27
  /**
28
- * Handle uploading a temporary OpenAPI document.
28
+ * Handle uploading a temporary API description.
29
29
  */
30
30
  function useUploadTmpDocument() {
31
31
  const state = useState();
32
- const uploadState = ref();
32
+ const { uploadState } = state;
33
+ const controller = new AbortController();
34
+ onScopeDispose(() => controller.abort());
33
35
  function createUrl(path) {
34
36
  const fullUrl = `${state.baseUrl}${path}`;
35
37
  return redirectToProxy(state.platformProxyUrl, fullUrl);
@@ -39,13 +41,14 @@ function useUploadTmpDocument() {
39
41
  uploadState.value = { type: "uploading" };
40
42
  const response = await fetch(createUrl(`/core/share/upload/apis${isAgent ? "?source=agent" : ""}`), {
41
43
  method: "POST",
44
+ signal: controller.signal,
42
45
  headers: { "Content-Type": "application/json" },
43
46
  body: JSON.stringify({ document })
44
47
  });
45
48
  if (!response.ok) {
46
49
  uploadState.value = {
47
50
  type: "error",
48
- error: "Failed to upload your OpenAPI document."
51
+ error: "Failed to upload your API description."
49
52
  };
50
53
  return;
51
54
  }
@@ -64,24 +67,27 @@ function useUploadTmpDocument() {
64
67
  }
65
68
  const uploadData = coerce(uploadResponseSchema, json);
66
69
  uploadState.value = { type: "processing" };
67
- const embeddingStatusResponse = await fetch(createUrl(`/vector/registry/embeddings/${uploadData.namespace}/${uploadData.slug}`), { method: "GET" });
68
- saveTmpDocumentInLocalStorage({
69
- namespace: uploadData.namespace,
70
- slug: uploadData.slug
71
- });
72
- await state.addDocument({
73
- namespace: uploadData.namespace,
74
- slug: uploadData.slug,
75
- removable: false,
76
- tmp: true
77
- });
78
- if (!embeddingStatusResponse.ok) {
70
+ if (!(await fetch(createUrl(`/vector/registry/embeddings/${uploadData.namespace}/${uploadData.slug}`), {
71
+ method: "GET",
72
+ signal: controller.signal
73
+ })).ok) {
79
74
  uploadState.value = {
80
75
  type: "error",
81
76
  error: "Failed to embed document."
82
77
  };
83
78
  return;
84
79
  }
80
+ await state.addDocument({
81
+ namespace: uploadData.namespace,
82
+ slug: uploadData.slug,
83
+ removable: false,
84
+ tmp: true
85
+ });
86
+ if (controller.signal.aborted) return;
87
+ saveTmpDocumentInLocalStorage({
88
+ namespace: uploadData.namespace,
89
+ slug: uploadData.slug
90
+ });
85
91
  uploadState.value = { type: "done" };
86
92
  state.uploadedTmpDocumentUrl.value = uploadData.url;
87
93
  setTimeout(() => {
@@ -89,9 +95,10 @@ function useUploadTmpDocument() {
89
95
  }, SHOW_UPLOAD_SUCCESS_DELAY);
90
96
  return uploadData;
91
97
  } catch {
98
+ if (controller.signal.aborted) return;
92
99
  uploadState.value = {
93
100
  type: "error",
94
- error: "Failed to upload your OpenAPI document."
101
+ error: "Failed to upload your API description."
95
102
  };
96
103
  return;
97
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-upload-tmp-document.js","names":[],"sources":["../../src/hooks/use-upload-tmp-document.ts"],"sourcesContent":["import { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport { coerce, object, string, validate } from '@scalar/validation'\nimport { ref } from 'vue'\n\nimport { useState } from '@/state/state'\n\nconst SHOW_UPLOAD_SUCCESS_DELAY = 5_000 // 5 seconds\n\nexport type UploadTmpDocumentState =\n | { type: 'error'; error: unknown }\n | { type: 'uploading' }\n | { type: 'processing' }\n | { type: 'loading' }\n | { type: 'done' }\n\nconst TMP_DOC_LS_KEY = 'scalar-tmp-doc'\n\nfunction saveTmpDocumentInLocalStorage({ namespace, slug }: { namespace: string; slug: string }) {\n localStorage.setItem(TMP_DOC_LS_KEY, JSON.stringify({ namespace, slug }))\n}\n\nconst tmpDocSchema = object({\n namespace: string(),\n slug: string(),\n})\n\nexport function getTmpDocFromLocalStorage() {\n const tmpDoc = localStorage.getItem(TMP_DOC_LS_KEY)\n if (!tmpDoc) {\n return\n }\n\n return coerce(tmpDocSchema, JSON.parse(tmpDoc))\n}\n\nexport function removeTmpDocFromLocalStorage() {\n const tmpDoc = localStorage.getItem(TMP_DOC_LS_KEY)\n if (!tmpDoc) {\n return\n }\n\n localStorage.removeItem(TMP_DOC_LS_KEY)\n}\n\n/**\n * Handle uploading a temporary OpenAPI document.\n */\nexport function useUploadTmpDocument() {\n const state = useState()\n const uploadState = ref<UploadTmpDocumentState>()\n\n function createUrl(path: string) {\n const fullUrl = `${state.baseUrl}${path}`\n return redirectToProxy(state.platformProxyUrl, fullUrl)\n }\n\n async function uploadTempDocument(document: string, isAgent = false) {\n try {\n uploadState.value = {\n type: 'uploading',\n }\n\n const response = await fetch(createUrl(`/core/share/upload/apis${isAgent ? '?source=agent' : ''}`), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ document }),\n })\n\n if (!response.ok) {\n uploadState.value = {\n type: 'error',\n error: 'Failed to upload your OpenAPI document.',\n }\n\n return\n }\n\n const json = await response.json()\n\n const uploadResponseSchema = object({ url: string(), namespace: string(), slug: string() })\n\n if (!validate(uploadResponseSchema, json)) {\n uploadState.value = {\n type: 'error',\n error: 'Failed to process document.',\n }\n return\n }\n\n const uploadData = coerce(uploadResponseSchema, json)\n\n uploadState.value = {\n type: 'processing',\n }\n const embeddingStatusResponse = await fetch(\n createUrl(`/vector/registry/embeddings/${uploadData.namespace}/${uploadData.slug}`),\n {\n method: 'GET',\n },\n )\n\n saveTmpDocumentInLocalStorage({\n namespace: uploadData.namespace,\n slug: uploadData.slug,\n })\n\n await state.addDocument({\n namespace: uploadData.namespace,\n slug: uploadData.slug,\n removable: false,\n tmp: true,\n })\n\n if (!embeddingStatusResponse.ok) {\n uploadState.value = {\n type: 'error',\n error: 'Failed to embed document.',\n }\n return\n }\n\n uploadState.value = { type: 'done' }\n state.uploadedTmpDocumentUrl.value = uploadData.url\n\n setTimeout(() => {\n uploadState.value = undefined\n }, SHOW_UPLOAD_SUCCESS_DELAY)\n\n return uploadData\n } catch {\n uploadState.value = { type: 'error', error: 'Failed to upload your OpenAPI document.' }\n return\n }\n }\n\n return {\n uploadTempDocument,\n uploadState,\n }\n}\n"],"mappings":";;;;;AAMA,IAAM,4BAA4B;AASlC,IAAM,iBAAiB;AAEvB,SAAS,8BAA8B,EAAE,WAAW,QAA6C;CAC/F,aAAa,QAAQ,gBAAgB,KAAK,UAAU;EAAE;EAAW;CAAK,CAAC,CAAC;AAC1E;AAEA,IAAM,eAAe,OAAO;CAC1B,WAAW,OAAO;CAClB,MAAM,OAAO;AACf,CAAC;AAED,SAAgB,4BAA4B;CAC1C,MAAM,SAAS,aAAa,QAAQ,cAAc;CAClD,IAAI,CAAC,QACH;CAGF,OAAO,OAAO,cAAc,KAAK,MAAM,MAAM,CAAC;AAChD;AAEA,SAAgB,+BAA+B;CAE7C,IAAI,CADW,aAAa,QAAQ,cAC/B,GACH;CAGF,aAAa,WAAW,cAAc;AACxC;;;;AAKA,SAAgB,uBAAuB;CACrC,MAAM,QAAQ,SAAS;CACvB,MAAM,cAAc,IAA4B;CAEhD,SAAS,UAAU,MAAc;EAC/B,MAAM,UAAU,GAAG,MAAM,UAAU;EACnC,OAAO,gBAAgB,MAAM,kBAAkB,OAAO;CACxD;CAEA,eAAe,mBAAmB,UAAkB,UAAU,OAAO;EACnE,IAAI;GACF,YAAY,QAAQ,EAClB,MAAM,YACR;GAEA,MAAM,WAAW,MAAM,MAAM,UAAU,0BAA0B,UAAU,kBAAkB,IAAI,GAAG;IAClG,QAAQ;IACR,SAAS,EACP,gBAAgB,mBAClB;IACA,MAAM,KAAK,UAAU,EAAE,SAAS,CAAC;GACnC,CAAC;GAED,IAAI,CAAC,SAAS,IAAI;IAChB,YAAY,QAAQ;KAClB,MAAM;KACN,OAAO;IACT;IAEA;GACF;GAEA,MAAM,OAAO,MAAM,SAAS,KAAK;GAEjC,MAAM,uBAAuB,OAAO;IAAE,KAAK,OAAO;IAAG,WAAW,OAAO;IAAG,MAAM,OAAO;GAAE,CAAC;GAE1F,IAAI,CAAC,SAAS,sBAAsB,IAAI,GAAG;IACzC,YAAY,QAAQ;KAClB,MAAM;KACN,OAAO;IACT;IACA;GACF;GAEA,MAAM,aAAa,OAAO,sBAAsB,IAAI;GAEpD,YAAY,QAAQ,EAClB,MAAM,aACR;GACA,MAAM,0BAA0B,MAAM,MACpC,UAAU,+BAA+B,WAAW,UAAU,GAAG,WAAW,MAAM,GAClF,EACE,QAAQ,MACV,CACF;GAEA,8BAA8B;IAC5B,WAAW,WAAW;IACtB,MAAM,WAAW;GACnB,CAAC;GAED,MAAM,MAAM,YAAY;IACtB,WAAW,WAAW;IACtB,MAAM,WAAW;IACjB,WAAW;IACX,KAAK;GACP,CAAC;GAED,IAAI,CAAC,wBAAwB,IAAI;IAC/B,YAAY,QAAQ;KAClB,MAAM;KACN,OAAO;IACT;IACA;GACF;GAEA,YAAY,QAAQ,EAAE,MAAM,OAAO;GACnC,MAAM,uBAAuB,QAAQ,WAAW;GAEhD,iBAAiB;IACf,YAAY,QAAQ,KAAA;GACtB,GAAG,yBAAyB;GAE5B,OAAO;EACT,QAAQ;GACN,YAAY,QAAQ;IAAE,MAAM;IAAS,OAAO;GAA0C;GACtF;EACF;CACF;CAEA,OAAO;EACL;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-upload-tmp-document.js","names":[],"sources":["../../src/hooks/use-upload-tmp-document.ts"],"sourcesContent":["import { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport { coerce, object, string, validate } from '@scalar/validation'\nimport { onScopeDispose } from 'vue'\n\nimport { useState } from '@/state/state'\n\nconst SHOW_UPLOAD_SUCCESS_DELAY = 5_000 // 5 seconds\n\nexport type UploadTmpDocumentState =\n | { type: 'error'; error: unknown }\n | { type: 'uploading' }\n | { type: 'processing' }\n | { type: 'loading' }\n | { type: 'done' }\n\nconst TMP_DOC_LS_KEY = 'scalar-tmp-doc'\n\nfunction saveTmpDocumentInLocalStorage({ namespace, slug }: { namespace: string; slug: string }) {\n localStorage.setItem(TMP_DOC_LS_KEY, JSON.stringify({ namespace, slug }))\n}\n\nconst tmpDocSchema = object({\n namespace: string(),\n slug: string(),\n})\n\nexport function getTmpDocFromLocalStorage() {\n const tmpDoc = localStorage.getItem(TMP_DOC_LS_KEY)\n if (!tmpDoc) {\n return\n }\n\n return coerce(tmpDocSchema, JSON.parse(tmpDoc))\n}\n\nexport function removeTmpDocFromLocalStorage() {\n const tmpDoc = localStorage.getItem(TMP_DOC_LS_KEY)\n if (!tmpDoc) {\n return\n }\n\n localStorage.removeItem(TMP_DOC_LS_KEY)\n}\n\n/**\n * Handle uploading a temporary API description.\n */\nexport function useUploadTmpDocument() {\n const state = useState()\n const { uploadState } = state\n const controller = new AbortController()\n onScopeDispose(() => controller.abort())\n\n function createUrl(path: string) {\n const fullUrl = `${state.baseUrl}${path}`\n return redirectToProxy(state.platformProxyUrl, fullUrl)\n }\n\n async function uploadTempDocument(document: string, isAgent = false) {\n try {\n uploadState.value = {\n type: 'uploading',\n }\n\n const response = await fetch(createUrl(`/core/share/upload/apis${isAgent ? '?source=agent' : ''}`), {\n method: 'POST',\n signal: controller.signal,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ document }),\n })\n\n if (!response.ok) {\n uploadState.value = {\n type: 'error',\n error: 'Failed to upload your API description.',\n }\n\n return\n }\n\n const json = await response.json()\n\n const uploadResponseSchema = object({ url: string(), namespace: string(), slug: string() })\n\n if (!validate(uploadResponseSchema, json)) {\n uploadState.value = {\n type: 'error',\n error: 'Failed to process document.',\n }\n return\n }\n\n const uploadData = coerce(uploadResponseSchema, json)\n\n uploadState.value = {\n type: 'processing',\n }\n const embeddingStatusResponse = await fetch(\n createUrl(`/vector/registry/embeddings/${uploadData.namespace}/${uploadData.slug}`),\n {\n method: 'GET',\n signal: controller.signal,\n },\n )\n\n if (!embeddingStatusResponse.ok) {\n uploadState.value = {\n type: 'error',\n error: 'Failed to embed document.',\n }\n return\n }\n\n await state.addDocument({\n namespace: uploadData.namespace,\n slug: uploadData.slug,\n removable: false,\n tmp: true,\n })\n\n if (controller.signal.aborted) {\n return\n }\n saveTmpDocumentInLocalStorage({ namespace: uploadData.namespace, slug: uploadData.slug })\n uploadState.value = { type: 'done' }\n state.uploadedTmpDocumentUrl.value = uploadData.url\n\n setTimeout(() => {\n uploadState.value = undefined\n }, SHOW_UPLOAD_SUCCESS_DELAY)\n\n return uploadData\n } catch {\n if (controller.signal.aborted) {\n return\n }\n uploadState.value = { type: 'error', error: 'Failed to upload your API description.' }\n return\n }\n }\n\n return {\n uploadTempDocument,\n uploadState,\n }\n}\n"],"mappings":";;;;;AAMA,IAAM,4BAA4B;AASlC,IAAM,iBAAiB;AAEvB,SAAS,8BAA8B,EAAE,WAAW,QAA6C;CAC/F,aAAa,QAAQ,gBAAgB,KAAK,UAAU;EAAE;EAAW;CAAK,CAAC,CAAC;AAC1E;AAEA,IAAM,eAAe,OAAO;CAC1B,WAAW,OAAO;CAClB,MAAM,OAAO;AACf,CAAC;AAED,SAAgB,4BAA4B;CAC1C,MAAM,SAAS,aAAa,QAAQ,cAAc;CAClD,IAAI,CAAC,QACH;CAGF,OAAO,OAAO,cAAc,KAAK,MAAM,MAAM,CAAC;AAChD;AAEA,SAAgB,+BAA+B;CAE7C,IAAI,CADW,aAAa,QAAQ,cAC/B,GACH;CAGF,aAAa,WAAW,cAAc;AACxC;;;;AAKA,SAAgB,uBAAuB;CACrC,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,gBAAgB;CACxB,MAAM,aAAa,IAAI,gBAAgB;CACvC,qBAAqB,WAAW,MAAM,CAAC;CAEvC,SAAS,UAAU,MAAc;EAC/B,MAAM,UAAU,GAAG,MAAM,UAAU;EACnC,OAAO,gBAAgB,MAAM,kBAAkB,OAAO;CACxD;CAEA,eAAe,mBAAmB,UAAkB,UAAU,OAAO;EACnE,IAAI;GACF,YAAY,QAAQ,EAClB,MAAM,YACR;GAEA,MAAM,WAAW,MAAM,MAAM,UAAU,0BAA0B,UAAU,kBAAkB,IAAI,GAAG;IAClG,QAAQ;IACR,QAAQ,WAAW;IACnB,SAAS,EACP,gBAAgB,mBAClB;IACA,MAAM,KAAK,UAAU,EAAE,SAAS,CAAC;GACnC,CAAC;GAED,IAAI,CAAC,SAAS,IAAI;IAChB,YAAY,QAAQ;KAClB,MAAM;KACN,OAAO;IACT;IAEA;GACF;GAEA,MAAM,OAAO,MAAM,SAAS,KAAK;GAEjC,MAAM,uBAAuB,OAAO;IAAE,KAAK,OAAO;IAAG,WAAW,OAAO;IAAG,MAAM,OAAO;GAAE,CAAC;GAE1F,IAAI,CAAC,SAAS,sBAAsB,IAAI,GAAG;IACzC,YAAY,QAAQ;KAClB,MAAM;KACN,OAAO;IACT;IACA;GACF;GAEA,MAAM,aAAa,OAAO,sBAAsB,IAAI;GAEpD,YAAY,QAAQ,EAClB,MAAM,aACR;GASA,IAAI,EAAC,MARiC,MACpC,UAAU,+BAA+B,WAAW,UAAU,GAAG,WAAW,MAAM,GAClF;IACE,QAAQ;IACR,QAAQ,WAAW;GACrB,CACF,EAAA,CAE6B,IAAI;IAC/B,YAAY,QAAQ;KAClB,MAAM;KACN,OAAO;IACT;IACA;GACF;GAEA,MAAM,MAAM,YAAY;IACtB,WAAW,WAAW;IACtB,MAAM,WAAW;IACjB,WAAW;IACX,KAAK;GACP,CAAC;GAED,IAAI,WAAW,OAAO,SACpB;GAEF,8BAA8B;IAAE,WAAW,WAAW;IAAW,MAAM,WAAW;GAAK,CAAC;GACxF,YAAY,QAAQ,EAAE,MAAM,OAAO;GACnC,MAAM,uBAAuB,QAAQ,WAAW;GAEhD,iBAAiB;IACf,YAAY,QAAQ,KAAA;GACtB,GAAG,yBAAyB;GAE5B,OAAO;EACT,QAAQ;GACN,IAAI,WAAW,OAAO,SACpB;GAEF,YAAY,QAAQ;IAAE,MAAM;IAAS,OAAO;GAAyC;GACrF;EACF;CACF;CAEA,OAAO;EACL;EACA;CACF;AACF"}
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- import App_default from "./App.vue.js";
2
- export { App_default as Chat };
1
+ export { default as Chat } from "./App.vue.js";
package/dist/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/scalar/scalar.git",
11
11
  "directory": "packages/agent-chat"
12
12
  },
13
- "version": "0.12.44",
13
+ "version": "0.12.46",
14
14
  "engines": {
15
15
  "node": ">=22"
16
16
  },
@@ -80,6 +80,7 @@
80
80
  "@tailwindcss/vite": "catalog:*",
81
81
  "@types/jsdom": "catalog:*",
82
82
  "@vitejs/plugin-vue": "catalog:*",
83
+ "@vue/test-utils": "catalog:*",
83
84
  "hono": "catalog:*",
84
85
  "jsdom": "catalog:*",
85
86
  "tailwindcss": "catalog:*",
@@ -1 +1 @@
1
- {"version":3,"file":"add-documents-to-store.d.ts","sourceRoot":"","sources":["../../src/registry/add-documents-to-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAGpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI/D,eAAO,MAAM,YAAY;eAYV,MAAM;UACX,MAAM;oBACI,cAAc;qBACb,MAAM,MAAM;uBACV,GAAG,CAAC,WAAW,EAAE,CAAC;iBACxB,MAAM;YACX,OAAO,CAAC,yBAAyB,CAAC;SACrC,GAAG;gBACI,OAAO;;;;;;;;;;;;;;;;;;;;;gHA6DtB,CAAA"}
1
+ {"version":3,"file":"add-documents-to-store.d.ts","sourceRoot":"","sources":["../../src/registry/add-documents-to-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAGpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI/D,eAAO,MAAM,YAAY;eAYV,MAAM;UACX,MAAM;oBACI,cAAc;qBACb,MAAM,MAAM;uBACV,GAAG,CAAC,WAAW,EAAE,CAAC;iBACxB,MAAM;YACX,OAAO,CAAC,yBAAyB,CAAC;SACrC,GAAG;gBACI,OAAO;;;;;;;;;;;;;;;;;;;;;gHA6DtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"add-documents-to-store.js","names":[],"sources":["../../src/registry/add-documents-to-store.ts"],"sourcesContent":["import { bundle } from '@scalar/json-magic/bundle'\nimport { fetchUrls } from '@scalar/json-magic/bundle/plugins/browser'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { openApiDocument } from '@scalar/workspace-store/plugins/bundler'\nimport { n } from 'neverpanic'\nimport type { Ref } from 'vue'\n\nimport type { Api } from '@/api'\nimport { createError } from '@/entities'\nimport type { ApiMetadata } from '@/entities/registry/document'\nimport { restoreAuthSecretsFromStorage } from '@/helpers'\nimport { createDocumentName } from '@/registry/create-document-name'\n\nexport const loadDocument = n.safeFn(\n async ({\n namespace,\n slug,\n workspaceStore,\n registryDocuments,\n getAccessToken,\n registryUrl,\n config,\n api,\n removable,\n }: {\n namespace: string\n slug: string\n workspaceStore: WorkspaceStore\n getAccessToken?: () => string\n registryDocuments: Ref<ApiMetadata[]>\n registryUrl: string\n config: Partial<ApiReferenceConfiguration>\n api: Api\n removable?: boolean\n }) => {\n const getDocumentResult = await api.getDocument({\n namespace,\n slug,\n })\n\n if (!getDocumentResult.success) {\n return getDocumentResult\n }\n\n registryDocuments.value.push({ ...getDocumentResult.data, removable })\n\n const url = new URL(`/@${namespace}/apis/${slug}/latest`, registryUrl)\n\n const headers: {\n headers: HeadersInit\n domains: string[]\n }[] = []\n\n const token = getAccessToken?.()\n\n if (token) {\n headers.push({\n domains: [new URL(registryUrl).host],\n headers: {\n 'x-scalar-auth': token,\n },\n })\n }\n\n const document: OpenAPIV3_1.Document = await bundle(url.toString(), {\n plugins: [\n openApiDocument(),\n fetchUrls({\n headers,\n }),\n ],\n treeShake: false,\n })\n\n const documentName = createDocumentName(namespace, slug)\n\n await workspaceStore.addDocument(\n {\n name: documentName,\n document,\n },\n config,\n )\n\n workspaceStore.update('x-scalar-active-document', documentName)\n\n restoreAuthSecretsFromStorage({ documentName, workspaceStore })\n\n return {\n success: true,\n data: getDocumentResult.data,\n }\n },\n (originalError) => createError('UNABLE_TO_LOAD_DOCUMENT', originalError),\n)\n"],"mappings":";;;;;;;;AAeA,IAAa,eAAe,EAAE,OAC5B,OAAO,EACL,WACA,MACA,gBACA,mBACA,gBACA,aACA,QACA,KACA,gBAWI;CACJ,MAAM,oBAAoB,MAAM,IAAI,YAAY;EAC9C;EACA;CACF,CAAC;CAED,IAAI,CAAC,kBAAkB,SACrB,OAAO;CAGT,kBAAkB,MAAM,KAAK;EAAE,GAAG,kBAAkB;EAAM;CAAU,CAAC;CAErE,MAAM,MAAM,IAAI,IAAI,KAAK,UAAU,QAAQ,KAAK,UAAU,WAAW;CAErE,MAAM,UAGA,CAAC;CAEP,MAAM,QAAQ,iBAAiB;CAE/B,IAAI,OACF,QAAQ,KAAK;EACX,SAAS,CAAC,IAAI,IAAI,WAAW,CAAC,CAAC,IAAI;EACnC,SAAS,EACP,iBAAiB,MACnB;CACF,CAAC;CAGH,MAAM,WAAiC,MAAM,OAAO,IAAI,SAAS,GAAG;EAClE,SAAS,CACP,gBAAgB,GAChB,UAAU,EACR,QACF,CAAC,CACH;EACA,WAAW;CACb,CAAC;CAED,MAAM,eAAe,mBAAmB,WAAW,IAAI;CAEvD,MAAM,eAAe,YACnB;EACE,MAAM;EACN;CACF,GACA,MACF;CAEA,eAAe,OAAO,4BAA4B,YAAY;CAE9D,8BAA8B;EAAE;EAAc;CAAe,CAAC;CAE9D,OAAO;EACL,SAAS;EACT,MAAM,kBAAkB;CAC1B;AACF,IACC,kBAAkB,YAAY,2BAA2B,aAAa,CACzE"}
1
+ {"version":3,"file":"add-documents-to-store.js","names":[],"sources":["../../src/registry/add-documents-to-store.ts"],"sourcesContent":["import { bundle } from '@scalar/json-magic/bundle'\nimport { fetchUrls } from '@scalar/json-magic/bundle/plugins/browser'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { openApiDocument } from '@scalar/workspace-store/plugins/bundler'\nimport { n } from 'neverpanic'\nimport type { Ref } from 'vue'\n\nimport type { Api } from '@/api'\nimport { createError } from '@/entities'\nimport type { ApiMetadata } from '@/entities/registry/document'\nimport { restoreAuthSecretsFromStorage } from '@/helpers'\nimport { createDocumentName } from '@/registry/create-document-name'\n\nexport const loadDocument = n.safeFn(\n async ({\n namespace,\n slug,\n workspaceStore,\n registryDocuments,\n getAccessToken,\n registryUrl,\n config,\n api,\n removable,\n }: {\n namespace: string\n slug: string\n workspaceStore: WorkspaceStore\n getAccessToken?: () => string\n registryDocuments: Ref<ApiMetadata[]>\n registryUrl: string\n config: Partial<ApiReferenceConfiguration>\n api: Api\n removable?: boolean\n }) => {\n const getDocumentResult = await api.getDocument({\n namespace,\n slug,\n })\n\n if (!getDocumentResult.success) {\n return getDocumentResult\n }\n\n registryDocuments.value.push({ ...getDocumentResult.data, removable })\n\n const url = new URL(`/@${namespace}/apis/${slug}/latest`, registryUrl)\n\n const headers: {\n headers: HeadersInit\n domains: string[]\n }[] = []\n\n const token = getAccessToken?.()\n\n if (token) {\n headers.push({\n domains: [new URL(registryUrl).host],\n headers: {\n 'x-scalar-auth': token,\n },\n })\n }\n\n const document: OpenAPIV3_1.Document | AsyncApiDocument = await bundle(url.toString(), {\n plugins: [\n openApiDocument(),\n fetchUrls({\n headers,\n }),\n ],\n treeShake: false,\n })\n\n const documentName = createDocumentName(namespace, slug)\n\n await workspaceStore.addDocument(\n {\n name: documentName,\n document,\n },\n config,\n )\n\n workspaceStore.update('x-scalar-active-document', documentName)\n\n restoreAuthSecretsFromStorage({ documentName, workspaceStore })\n\n return {\n success: true,\n data: getDocumentResult.data,\n }\n },\n (originalError) => createError('UNABLE_TO_LOAD_DOCUMENT', originalError),\n)\n"],"mappings":";;;;;;;;AAgBA,IAAa,eAAe,EAAE,OAC5B,OAAO,EACL,WACA,MACA,gBACA,mBACA,gBACA,aACA,QACA,KACA,gBAWI;CACJ,MAAM,oBAAoB,MAAM,IAAI,YAAY;EAC9C;EACA;CACF,CAAC;CAED,IAAI,CAAC,kBAAkB,SACrB,OAAO;CAGT,kBAAkB,MAAM,KAAK;EAAE,GAAG,kBAAkB;EAAM;CAAU,CAAC;CAErE,MAAM,MAAM,IAAI,IAAI,KAAK,UAAU,QAAQ,KAAK,UAAU,WAAW;CAErE,MAAM,UAGA,CAAC;CAEP,MAAM,QAAQ,iBAAiB;CAE/B,IAAI,OACF,QAAQ,KAAK;EACX,SAAS,CAAC,IAAI,IAAI,WAAW,CAAC,CAAC,IAAI;EACnC,SAAS,EACP,iBAAiB,MACnB;CACF,CAAC;CAGH,MAAM,WAAoD,MAAM,OAAO,IAAI,SAAS,GAAG;EACrF,SAAS,CACP,gBAAgB,GAChB,UAAU,EACR,QACF,CAAC,CACH;EACA,WAAW;CACb,CAAC;CAED,MAAM,eAAe,mBAAmB,WAAW,IAAI;CAEvD,MAAM,eAAe,YACnB;EACE,MAAM;EACN;CACF,GACA,MACF;CAEA,eAAe,OAAO,4BAA4B,YAAY;CAE9D,8BAA8B;EAAE;EAAc;CAAe,CAAC;CAE9D,OAAO;EACL,SAAS;EACT,MAAM,kBAAkB;CAC1B;AACF,IACC,kBAAkB,YAAY,2BAA2B,aAAa,CACzE"}