@scalar/api-client 3.0.0 → 3.2.0

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 (218) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +41 -0
  3. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  4. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts +2 -2
  5. package/dist/plugins/posthog/index.d.ts +23 -0
  6. package/dist/plugins/posthog/index.d.ts.map +1 -0
  7. package/dist/plugins/posthog/index.js +58 -0
  8. package/dist/plugins/posthog/index.js.map +1 -0
  9. package/dist/style.css +121 -61
  10. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  12. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +15 -12
  13. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  14. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts +5 -2
  15. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts.map +1 -1
  16. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +5 -2
  17. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
  18. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts +8 -9
  19. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts.map +1 -1
  20. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +8 -10
  21. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
  22. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts +2 -1
  23. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
  25. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +11 -3
  26. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/send-request.js +19 -12
  28. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  29. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  31. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  32. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +4 -0
  33. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  34. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +1 -1
  35. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  37. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  38. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -0
  39. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  40. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  41. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  42. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +1 -0
  43. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  44. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  45. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +3 -2
  46. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  48. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  49. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +12 -6
  50. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  51. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts +2 -0
  52. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
  53. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
  54. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
  55. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +34 -14
  56. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
  57. package/dist/v2/blocks/response-block/helpers/process-response-body.d.ts +1 -1
  58. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -3
  59. package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
  60. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts +11 -0
  61. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts.map +1 -0
  62. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js +44 -0
  63. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -0
  64. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts +14 -0
  65. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts.map +1 -0
  66. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +13 -0
  67. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -0
  68. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +1 -1
  69. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
  70. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +3 -3
  71. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
  72. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  73. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  74. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  75. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +131 -48
  76. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  77. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +2 -2
  78. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  80. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +16 -0
  81. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  82. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +43 -1
  83. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  84. package/dist/v2/components/code-input/CodeInput.vue.d.ts +6 -2
  85. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  86. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  87. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  88. package/dist/v2/components/code-input/CodeInput.vue.script.js +9 -4
  89. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  90. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -0
  91. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  92. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  93. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  94. package/dist/v2/components/data-table/DataTableInput.vue.script.js +7 -1
  95. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  96. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +2 -2
  97. package/dist/v2/constants.js +1 -1
  98. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  99. package/dist/v2/features/app/App.vue.js.map +1 -1
  100. package/dist/v2/features/app/App.vue.script.js +17 -4
  101. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  102. package/dist/v2/features/app/app-state.d.ts +6 -1
  103. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  104. package/dist/v2/features/app/app-state.js +5 -3
  105. package/dist/v2/features/app/app-state.js.map +1 -1
  106. package/dist/v2/features/app/components/DesktopTab.vue.d.ts +2 -2
  107. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +9 -1
  108. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  109. package/dist/v2/features/app/helpers/create-api-client-app.js +3 -2
  110. package/dist/v2/features/app/helpers/create-api-client-app.js.map +1 -1
  111. package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +1 -1
  112. package/dist/v2/features/app/helpers/create-temp-operation.js +4 -1
  113. package/dist/v2/features/app/helpers/create-temp-operation.js.map +1 -1
  114. package/dist/v2/features/app/helpers/routes.d.ts +4 -2
  115. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  116. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  117. package/dist/v2/features/collection/DocumentCollection.vue.script.js +2 -1
  118. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  119. package/dist/v2/features/collection/OperationCollection.vue.script.js +2 -1
  120. package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
  121. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +2 -1
  122. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
  123. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  124. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  125. package/dist/v2/features/collection/components/Authentication.vue.js.map +1 -1
  126. package/dist/v2/features/collection/components/Authentication.vue.script.js +10 -1
  127. package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
  128. package/dist/v2/features/collection/components/Cookies.vue.script.js +1 -0
  129. package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
  130. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +1 -0
  131. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
  132. package/dist/v2/features/collection/components/Environment.vue.script.js +1 -0
  133. package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
  134. package/dist/v2/features/collection/components/Form.vue.d.ts +2 -0
  135. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  136. package/dist/v2/features/collection/components/Form.vue.js.map +1 -1
  137. package/dist/v2/features/collection/components/Form.vue.script.js +4 -1
  138. package/dist/v2/features/collection/components/Form.vue.script.js.map +1 -1
  139. package/dist/v2/features/collection/components/LabelInput.vue.d.ts +1 -1
  140. package/dist/v2/features/collection/components/Overview.vue.script.js +1 -0
  141. package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
  142. package/dist/v2/features/collection/components/Runner/components/Runner.vue.d.ts.map +1 -1
  143. package/dist/v2/features/collection/components/Runner/components/Runner.vue.js.map +1 -1
  144. package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js +4 -2
  145. package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js.map +1 -1
  146. package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.d.ts +2 -2
  147. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts +4 -2
  148. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts.map +1 -1
  149. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js +3 -2
  150. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js.map +1 -1
  151. package/dist/v2/features/collection/components/Scripts.vue.script.js +1 -0
  152. package/dist/v2/features/collection/components/Scripts.vue.script.js.map +1 -1
  153. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  154. package/dist/v2/features/collection/components/Servers.vue.js.map +1 -1
  155. package/dist/v2/features/collection/components/Servers.vue.script.js +3 -1
  156. package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
  157. package/dist/v2/features/collection/components/Settings.vue.script.js +1 -0
  158. package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
  159. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts +2 -2
  160. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  161. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js.map +1 -1
  162. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js +1 -1
  163. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js.map +1 -1
  164. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.d.ts.map +1 -1
  165. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.js.map +1 -1
  166. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js +26 -21
  167. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js.map +1 -1
  168. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js +1 -1
  169. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js.map +1 -1
  170. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js +1 -1
  171. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js.map +1 -1
  172. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts +14 -0
  173. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts.map +1 -0
  174. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js +19 -0
  175. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js.map +1 -0
  176. package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +1 -1
  177. package/dist/v2/features/command-palette/helpers/get-postman-document-details.js.map +1 -1
  178. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -1
  179. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +1 -1
  180. package/dist/v2/features/command-palette/helpers/load-document-from-source.js.map +1 -1
  181. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts +2 -2
  182. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts +1 -1
  183. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  184. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  185. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +2 -2
  186. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  187. package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
  188. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +1 -1
  189. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js.map +1 -1
  190. package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js +2 -0
  191. package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js.map +1 -1
  192. package/dist/v2/features/modal/Modal.vue.d.ts +7 -6
  193. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  194. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  195. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  196. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +5 -5
  197. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  198. package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
  199. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  200. package/dist/v2/features/modal/helpers/types.d.ts +1 -7
  201. package/dist/v2/features/modal/helpers/types.d.ts.map +1 -1
  202. package/dist/v2/features/modal/index.d.ts +1 -1
  203. package/dist/v2/features/modal/index.d.ts.map +1 -1
  204. package/dist/v2/features/operation/Operation.vue.d.ts +0 -5
  205. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  206. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  207. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  208. package/dist/v2/types/options.d.ts +15 -0
  209. package/dist/v2/types/options.d.ts.map +1 -0
  210. package/package.json +21 -16
  211. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts +0 -11
  212. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts.map +0 -1
  213. package/dist/v2/features/command-palette/helpers/is-postman-collection.js +0 -24
  214. package/dist/v2/features/command-palette/helpers/is-postman-collection.js.map +0 -1
  215. package/dist/v2/posthog.d.ts +0 -3
  216. package/dist/v2/posthog.d.ts.map +0 -1
  217. package/dist/v2/posthog.js +0 -20
  218. package/dist/v2/posthog.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Form.vue.script.js","names":["$slots"],"sources":["../../../../../src/v2/features/collection/components/Form.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { useId } from 'vue'\n\nimport ViewLayoutSection from '@/components/ViewLayout/ViewLayoutSection.vue'\nimport DataTable from '@/v2/components/data-table/DataTable.vue'\nimport DataTableInput from '@/v2/components/data-table/DataTableInput.vue'\nimport DataTableRow from '@/v2/components/data-table/DataTableRow.vue'\n\ndefineProps<{\n title?: string\n options: {\n key: string\n label: string\n placeholder: string\n lineWrapping?: boolean\n }[]\n data: Record<string, any>\n onUpdate: (key: string, value: string | number) => void\n environment: XScalarEnvironment\n}>()\n\nconst id = useId()\n</script>\n<template>\n <ViewLayoutSection class=\"last:rounded-b-lg\">\n <template\n v-if=\"title || $slots.title\"\n #title>\n <span v-if=\"title\">{{ title }}</span>\n <slot\n v-else\n name=\"title\" />\n </template>\n <div class=\"flex flex-1 flex-col gap-1.5\">\n <DataTable\n v-if=\"Object.keys(data).length > 0\"\n class=\"rounded-b-lg\"\n :columns=\"['']\">\n <DataTableRow\n v-for=\"(option, index) in options\"\n :key=\"index\">\n <DataTableInput\n :id=\"id\"\n class=\"pr-9\"\n :environment=\"environment\"\n :lineWrapping=\"option.lineWrapping ?? false\"\n :modelValue=\"data[option.key] ?? ''\"\n :placeholder=\"option.placeholder\"\n @update:modelValue=\"onUpdate(option.key, $event)\">\n <template #default>\n <label :for=\"id\">\n {{ option.label }}\n </label>\n </template>\n <template\n v-if=\"option.key === 'description'\"\n #icon>\n <div\n class=\"centered-y bg-b-2 flex-center absolute right-1 z-1 rounded px-1 py-0.5\">\n <ScalarIcon\n icon=\"Markdown\"\n size=\"lg\" />\n </div>\n </template>\n </DataTableInput>\n </DataTableRow>\n </DataTable>\n </div>\n </ViewLayoutSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,KAAK,OAAM;;uBAGf,YA4CoB,2BAAA,EA5CD,OAAM,qBAAmB,EAAA,YAAA;2BA2CpC,CAlCN,mBAkCM,OAlCN,YAkCM,CAhCI,OAAO,KAAK,QAAA,KAAI,CAAE,SAAM,KAAA,WAAA,EADhC,YAgCY,mBAAA;;KA9BV,OAAM;KACL,SAAS,CAAA,GAAI;;4BAEsB,EAAA,UAAA,KAAA,EADpC,mBA2Be,UAAA,MAAA,WA1Ba,QAAA,UAAlB,QAAQ,UAAK;0BADvB,YA2Be,sBAAA,EAzBZ,KAAK,OAAK,EAAA;8BAwBM,CAvBjB,YAuBiB,wBAAA;QAtBd,IAAI,MAAA,GAAE;QACP,OAAM;QACL,aAAa,QAAA;QACb,cAAc,OAAO,gBAAY;QACjC,YAAY,QAAA,KAAK,OAAO,QAAG;QAC3B,aAAa,OAAO;QACpB,wBAAiB,WAAE,QAAA,SAAS,OAAO,KAAK,OAAM;;QACpC,SAAO,cAGR,CAFR,mBAEQ,SAAA,EAFA,KAAK,MAAA,GAAE,EAAA,EAAA,gBACV,OAAO,MAAK,EAAA,GAAA,WAAA,CAAA,CAAA;;WAIX,OAAO,QAAG,gBAAA;cACf;0BAMK,CALN,mBAKM,OALN,YAKM,CAHJ,YAEc,MAAA,WAAA,EAAA;SADZ,MAAK;SACL,MAAK;;;;;;;;;;;;;;;;;OAnCX,QAAA,SAASA,KAAAA,OAAO,QAAA;UACrB;sBACoC,CAAzB,QAAA,SAAA,WAAA,EAAZ,mBAAqC,QAAA,YAAA,gBAAf,QAAA,MAAK,EAAA,EAAA,IAC3B,WAEiB,KAAA,QAAA,SAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"Form.vue.script.js","names":["$slots"],"sources":["../../../../../src/v2/features/collection/components/Form.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { useId } from 'vue'\n\nimport ViewLayoutSection from '@/components/ViewLayout/ViewLayoutSection.vue'\nimport DataTable from '@/v2/components/data-table/DataTable.vue'\nimport DataTableInput from '@/v2/components/data-table/DataTableInput.vue'\nimport DataTableRow from '@/v2/components/data-table/DataTableRow.vue'\n\ndefineProps<{\n title?: string\n options: {\n key: string\n label: string\n placeholder: string\n lineWrapping?: boolean\n }[]\n data: Record<string, any>\n onUpdate: (key: string, value: string | number) => void\n environment: XScalarEnvironment\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n}>()\n\nconst id = useId()\n</script>\n<template>\n <ViewLayoutSection class=\"last:rounded-b-lg\">\n <template\n v-if=\"title || $slots.title\"\n #title>\n <span v-if=\"title\">{{ title }}</span>\n <slot\n v-else\n name=\"title\" />\n </template>\n <div class=\"flex flex-1 flex-col gap-1.5\">\n <DataTable\n v-if=\"Object.keys(data).length > 0\"\n class=\"rounded-b-lg\"\n :columns=\"['']\">\n <DataTableRow\n v-for=\"(option, index) in options\"\n :key=\"index\">\n <DataTableInput\n :id=\"id\"\n class=\"pr-9\"\n :environment=\"environment\"\n :lineWrapping=\"option.lineWrapping ?? false\"\n :modelValue=\"data[option.key] ?? ''\"\n :placeholder=\"option.placeholder\"\n :withFakeData=\"withFakeData ?? true\"\n @update:modelValue=\"onUpdate(option.key, $event)\">\n <template #default>\n <label :for=\"id\">\n {{ option.label }}\n </label>\n </template>\n <template\n v-if=\"option.key === 'description'\"\n #icon>\n <div\n class=\"centered-y bg-b-2 flex-center absolute right-1 z-1 rounded px-1 py-0.5\">\n <ScalarIcon\n icon=\"Markdown\"\n size=\"lg\" />\n </div>\n </template>\n </DataTableInput>\n </DataTableRow>\n </DataTable>\n </div>\n </ViewLayoutSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAyBA,MAAM,KAAK,OAAM;;uBAGf,YA6CoB,2BAAA,EA7CD,OAAM,qBAAmB,EAAA,YAAA;2BA4CpC,CAnCN,mBAmCM,OAnCN,YAmCM,CAjCI,OAAO,KAAK,QAAA,KAAI,CAAE,SAAM,KAAA,WAAA,EADhC,YAiCY,mBAAA;;KA/BV,OAAM;KACL,SAAS,CAAA,GAAI;;4BAEsB,EAAA,UAAA,KAAA,EADpC,mBA4Be,UAAA,MAAA,WA3Ba,QAAA,UAAlB,QAAQ,UAAK;0BADvB,YA4Be,sBAAA,EA1BZ,KAAK,OAAK,EAAA;8BAyBM,CAxBjB,YAwBiB,wBAAA;QAvBd,IAAI,MAAA,GAAE;QACP,OAAM;QACL,aAAa,QAAA;QACb,cAAc,OAAO,gBAAY;QACjC,YAAY,QAAA,KAAK,OAAO,QAAG;QAC3B,aAAa,OAAO;QACpB,cAAc,QAAA,gBAAY;QAC1B,wBAAiB,WAAE,QAAA,SAAS,OAAO,KAAK,OAAM;;QACpC,SAAO,cAGR,CAFR,mBAEQ,SAAA,EAFA,KAAK,MAAA,GAAE,EAAA,EAAA,gBACV,OAAO,MAAK,EAAA,GAAA,WAAA,CAAA,CAAA;;WAIX,OAAO,QAAG,gBAAA;cACf;0BAMK,CALN,mBAKM,OALN,YAKM,CAHJ,YAEc,MAAA,WAAA,EAAA;SADZ,MAAK;SACL,MAAK;;;;;;;;;;;;;;;;;;OApCX,QAAA,SAASA,KAAAA,OAAO,QAAA;UACrB;sBACoC,CAAzB,QAAA,SAAA,WAAA,EAAZ,mBAAqC,QAAA,YAAA,gBAAf,QAAA,MAAK,EAAA,EAAA,IAC3B,WAEiB,KAAA,QAAA,SAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -10,8 +10,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
10
10
  } & {
11
11
  blur: (value: string) => any;
12
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
14
13
  onBlur?: ((value: string) => any) | undefined;
14
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
17
17
  export default _default;
@@ -35,6 +35,7 @@ var Overview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
35
35
  fetchRegistryDocument: { type: Function },
36
36
  telemetry: { type: Boolean },
37
37
  onUpdateTelemetry: { type: Function },
38
+ options: {},
38
39
  collectionType: {}
39
40
  },
40
41
  setup(__props) {
@@ -1 +1 @@
1
- {"version":3,"file":"Overview.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Overview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarMarkdown,\n ScalarModal,\n ScalarToggle,\n useModal,\n} from '@scalar/components'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { ScalarIconPencil } from '@scalar/icons'\nimport {\n computed,\n nextTick,\n ref,\n useTemplateRef,\n type ComputedRef,\n type Ref,\n} from 'vue'\n\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport { CodeInput } from '@/v2/components/code-input'\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst {\n document,\n eventBus,\n layout,\n collectionType,\n path,\n method,\n documentSlug,\n} = defineProps<CollectionProps>()\n\nconst operationLabel = computed(() => {\n if (!method || !path) {\n return 'this operation'\n }\n const upperMethod = typeof method === 'string' ? method.toUpperCase() : method\n return `${upperMethod} ${path}`\n})\n\nconst description: ComputedRef<string> = computed(() => {\n if (collectionType === 'operation') {\n if (!path || !method || !isHttpMethod(method)) {\n return ''\n }\n\n return document?.paths?.[path]?.[method]?.description ?? ''\n }\n\n return document?.info?.description ?? ''\n})\n\nconst deprecated: ComputedRef<boolean> = computed(() => {\n if (collectionType !== 'operation' || !path || !isHttpMethod(method)) {\n return false\n }\n\n const operation = document?.paths?.[path]?.[method] as\n | { deprecated?: boolean }\n | undefined\n return operation?.deprecated ?? false\n})\n\nconst mode: Ref<'edit' | 'preview'> = ref('preview')\n\nconst codeInputRef = useTemplateRef('codeInputRef')\n\n/**\n * Switch between edit and preview modes.\n * When switching to edit mode, focus the input after the DOM updates.\n */\nconst switchMode = async (newMode: 'edit' | 'preview'): Promise<void> => {\n mode.value = newMode\n\n if (newMode === 'edit') {\n await nextTick()\n codeInputRef.value?.focus()\n }\n}\n\n/**\n * Updates the description of the collection\n * @param payload - The new description\n * @returns void\n */\nconst handleDescriptionUpdate = async (payload: string) => {\n await switchMode('preview')\n\n /** If the collection type is a document, update the description of the document */\n if (collectionType === 'document') {\n return eventBus.emit('document:update:info', { description: payload })\n }\n\n /** If the collection type is an operation, update the description of the operation */\n if (collectionType === 'operation') {\n if (!path || !method) {\n console.error('Invalid path or method', { path, method })\n return\n }\n\n return eventBus.emit('operation:update:meta', {\n meta: { path, method },\n payload: {\n description: payload,\n },\n })\n }\n\n console.error('Invalid collection type', { collectionType })\n}\n\nconst handleDeprecatedChange = (value: boolean) => {\n if (collectionType !== 'operation' || !path || !method) {\n return\n }\n\n eventBus.emit('operation:update:meta', {\n meta: { path, method },\n payload: { deprecated: value },\n })\n}\n\nconst deleteOperationModal = useModal()\n\nconst handleDeleteOperation = () => {\n if (collectionType !== 'operation' || !path || !method || !documentSlug) {\n return\n }\n\n eventBus.emit('operation:delete:operation', {\n documentName: documentSlug,\n meta: { path, method },\n })\n deleteOperationModal.hide()\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-8\">\n <Section>\n <template #title>Description</template>\n <template #actions>\n <ScalarButton\n v-if=\"mode === 'preview'\"\n class=\"text-c-2 hover:text-c-1 flex items-center gap-2\"\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"switchMode('edit')\">\n <ScalarIconPencil\n size=\"sm\"\n thickness=\"1.5\" />\n <span>Edit</span>\n </ScalarButton>\n </template>\n <div class=\"has-focus-visible:bg-b-1 group rounded-lg\">\n <!-- Preview -->\n <template v-if=\"mode === 'preview'\">\n <template v-if=\"description.trim().length\">\n <ScalarMarkdown\n class=\"flex-1 rounded border border-transparent p-1.5 hover:border-(--scalar-background-3)\"\n :value=\"description\"\n withImages\n @dblclick=\"switchMode('edit')\" />\n <div\n class=\"brightness-lifted bg-b-1 absolute inset-0 -z-1 hidden rounded group-hover:block group-has-focus-visible:hidden\" />\n </template>\n\n <div\n v-else\n class=\"text-c-3 flex items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 text-c-2 flex items-center gap-2\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"switchMode('edit')\">\n <ScalarIconPencil\n size=\"sm\"\n thickness=\"1.5\" />\n <span>Write a description</span>\n </ScalarButton>\n </div>\n </template>\n\n <!-- Edit -->\n <template v-else>\n <CodeInput\n ref=\"codeInputRef\"\n class=\"border px-0.5 py-0\"\n :environment=\"undefined\"\n :layout=\"layout\"\n :modelValue=\"description\"\n @blur=\"handleDescriptionUpdate\" />\n </template>\n </div>\n </Section>\n\n <!-- Operation-only: Status and Danger Zone -->\n <template v-if=\"collectionType === 'operation'\">\n <Section>\n <template #title>Status</template>\n <div\n class=\"rounded-lg border text-sm transition-colors\"\n :class=\"\n deprecated\n ? 'border-(--scalar-color-alert) bg-(--scalar-background-alert)'\n : 'bg-b-2 border-(--scalar-background-3)'\n \">\n <div class=\"flex items-center justify-between gap-4 rounded-lg p-4\">\n <div class=\"min-w-0 flex-1\">\n <h4\n class=\"font-medium\"\n :class=\"\n deprecated ? 'text-(--scalar-color-alert)' : 'text-c-1'\n \">\n Deprecated\n </h4>\n <p class=\"text-c-2 mt-1.5\">\n Mark this operation as deprecated. Consumers SHOULD refrain from\n using it.\n </p>\n </div>\n <ScalarToggle\n class=\"shrink-0\"\n :modelValue=\"deprecated\"\n @update:modelValue=\"handleDeprecatedChange\" />\n </div>\n </div>\n </Section>\n\n <Section>\n <template #title>Danger Zone</template>\n <div\n class=\"bg-b-2 flex items-center justify-between gap-4 rounded-lg border border-(--scalar-background-3) p-4 text-sm\">\n <div class=\"min-w-0 flex-1\">\n <h4 class=\"text-c-1 font-medium\">Delete Operation</h4>\n <p class=\"text-c-2 mt-1.5\">\n Be careful, my friend. Once deleted, there is no way to recover\n the operation.\n </p>\n </div>\n <ScalarButton\n class=\"shrink-0\"\n size=\"sm\"\n variant=\"danger\"\n @click=\"deleteOperationModal.show()\">\n Delete Operation\n </ScalarButton>\n </div>\n </Section>\n </template>\n </div>\n\n <!-- Delete Operation Modal -->\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"deleteOperationModal\"\n :title=\"`Delete ${operationLabel}`\">\n <DeleteSidebarListElement\n :variableName=\"operationLabel\"\n warningMessage=\"This action cannot be undone.\"\n @close=\"deleteOperationModal.hide()\"\n @delete=\"handleDeleteOperation\" />\n </ScalarModal>\n</template>\n\n<style scoped>\n:deep(.cm-content) {\n min-height: fit-content;\n}\n:deep(.cm-scroller) {\n max-width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,MAAM,iBAAiB,eAAe;AACpC,OAAI,CAAC,QAAA,UAAU,CAAC,QAAA,KACd,QAAO;AAGT,UAAO,GADa,OAAO,QAAA,WAAW,WAAW,QAAA,OAAO,aAAa,GAAG,QAAA,OACl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A,CAAA,EAAA,CAAA;2BAiBtB,CAhBN,mBAgBM,OAhBN,YAgBM,CAAA,OAAA,QAAA,OAAA,MAdJ,mBAMM,OAAA,EAND,OAAM,kBAAgB,EAAA,CACzB,mBAAsD,MAAA,EAAlD,OAAM,wBAAsB,EAAC,mBAAgB,EACjD,mBAGI,KAAA,EAHD,OAAM,mBAAiB,EAAC,mFAG3B,CAAA,EAAA,GAAA,GAEF,YAMe,MAAA,aAAA,EAAA;KALb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,qBAAoB,CAAC,MAAI;;4BAEnC,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAFuC,sBAEvC,GAAA,CAAA,EAAA,CAAA;;;;+CAOR,YASc,MAAA,YAAA,EAAA;IARX,MAAM;IACN,OAAO,MAAA,qBAAoB;IAC3B,OAAK,UAAY,eAAA;;2BAKkB,CAJpC,YAIoC,kCAAA;KAHjC,cAAc,eAAA;KACf,gBAAe;KACd,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,qBAAoB,CAAC,MAAI;KAChC,UAAQ"}
1
+ {"version":3,"file":"Overview.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Overview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarMarkdown,\n ScalarModal,\n ScalarToggle,\n useModal,\n} from '@scalar/components'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { ScalarIconPencil } from '@scalar/icons'\nimport {\n computed,\n nextTick,\n ref,\n useTemplateRef,\n type ComputedRef,\n type Ref,\n} from 'vue'\n\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport { CodeInput } from '@/v2/components/code-input'\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst {\n document,\n eventBus,\n layout,\n collectionType,\n path,\n method,\n documentSlug,\n} = defineProps<CollectionProps>()\n\nconst operationLabel = computed(() => {\n if (!method || !path) {\n return 'this operation'\n }\n const upperMethod = typeof method === 'string' ? method.toUpperCase() : method\n return `${upperMethod} ${path}`\n})\n\nconst description: ComputedRef<string> = computed(() => {\n if (collectionType === 'operation') {\n if (!path || !method || !isHttpMethod(method)) {\n return ''\n }\n\n return document?.paths?.[path]?.[method]?.description ?? ''\n }\n\n return document?.info?.description ?? ''\n})\n\nconst deprecated: ComputedRef<boolean> = computed(() => {\n if (collectionType !== 'operation' || !path || !isHttpMethod(method)) {\n return false\n }\n\n const operation = document?.paths?.[path]?.[method] as\n | { deprecated?: boolean }\n | undefined\n return operation?.deprecated ?? false\n})\n\nconst mode: Ref<'edit' | 'preview'> = ref('preview')\n\nconst codeInputRef = useTemplateRef('codeInputRef')\n\n/**\n * Switch between edit and preview modes.\n * When switching to edit mode, focus the input after the DOM updates.\n */\nconst switchMode = async (newMode: 'edit' | 'preview'): Promise<void> => {\n mode.value = newMode\n\n if (newMode === 'edit') {\n await nextTick()\n codeInputRef.value?.focus()\n }\n}\n\n/**\n * Updates the description of the collection\n * @param payload - The new description\n * @returns void\n */\nconst handleDescriptionUpdate = async (payload: string) => {\n await switchMode('preview')\n\n /** If the collection type is a document, update the description of the document */\n if (collectionType === 'document') {\n return eventBus.emit('document:update:info', { description: payload })\n }\n\n /** If the collection type is an operation, update the description of the operation */\n if (collectionType === 'operation') {\n if (!path || !method) {\n console.error('Invalid path or method', { path, method })\n return\n }\n\n return eventBus.emit('operation:update:meta', {\n meta: { path, method },\n payload: {\n description: payload,\n },\n })\n }\n\n console.error('Invalid collection type', { collectionType })\n}\n\nconst handleDeprecatedChange = (value: boolean) => {\n if (collectionType !== 'operation' || !path || !method) {\n return\n }\n\n eventBus.emit('operation:update:meta', {\n meta: { path, method },\n payload: { deprecated: value },\n })\n}\n\nconst deleteOperationModal = useModal()\n\nconst handleDeleteOperation = () => {\n if (collectionType !== 'operation' || !path || !method || !documentSlug) {\n return\n }\n\n eventBus.emit('operation:delete:operation', {\n documentName: documentSlug,\n meta: { path, method },\n })\n deleteOperationModal.hide()\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-8\">\n <Section>\n <template #title>Description</template>\n <template #actions>\n <ScalarButton\n v-if=\"mode === 'preview'\"\n class=\"text-c-2 hover:text-c-1 flex items-center gap-2\"\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"switchMode('edit')\">\n <ScalarIconPencil\n size=\"sm\"\n thickness=\"1.5\" />\n <span>Edit</span>\n </ScalarButton>\n </template>\n <div class=\"has-focus-visible:bg-b-1 group rounded-lg\">\n <!-- Preview -->\n <template v-if=\"mode === 'preview'\">\n <template v-if=\"description.trim().length\">\n <ScalarMarkdown\n class=\"flex-1 rounded border border-transparent p-1.5 hover:border-(--scalar-background-3)\"\n :value=\"description\"\n withImages\n @dblclick=\"switchMode('edit')\" />\n <div\n class=\"brightness-lifted bg-b-1 absolute inset-0 -z-1 hidden rounded group-hover:block group-has-focus-visible:hidden\" />\n </template>\n\n <div\n v-else\n class=\"text-c-3 flex items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 text-c-2 flex items-center gap-2\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"switchMode('edit')\">\n <ScalarIconPencil\n size=\"sm\"\n thickness=\"1.5\" />\n <span>Write a description</span>\n </ScalarButton>\n </div>\n </template>\n\n <!-- Edit -->\n <template v-else>\n <CodeInput\n ref=\"codeInputRef\"\n class=\"border px-0.5 py-0\"\n :environment=\"undefined\"\n :layout=\"layout\"\n :modelValue=\"description\"\n @blur=\"handleDescriptionUpdate\" />\n </template>\n </div>\n </Section>\n\n <!-- Operation-only: Status and Danger Zone -->\n <template v-if=\"collectionType === 'operation'\">\n <Section>\n <template #title>Status</template>\n <div\n class=\"rounded-lg border text-sm transition-colors\"\n :class=\"\n deprecated\n ? 'border-(--scalar-color-alert) bg-(--scalar-background-alert)'\n : 'bg-b-2 border-(--scalar-background-3)'\n \">\n <div class=\"flex items-center justify-between gap-4 rounded-lg p-4\">\n <div class=\"min-w-0 flex-1\">\n <h4\n class=\"font-medium\"\n :class=\"\n deprecated ? 'text-(--scalar-color-alert)' : 'text-c-1'\n \">\n Deprecated\n </h4>\n <p class=\"text-c-2 mt-1.5\">\n Mark this operation as deprecated. Consumers SHOULD refrain from\n using it.\n </p>\n </div>\n <ScalarToggle\n class=\"shrink-0\"\n :modelValue=\"deprecated\"\n @update:modelValue=\"handleDeprecatedChange\" />\n </div>\n </div>\n </Section>\n\n <Section>\n <template #title>Danger Zone</template>\n <div\n class=\"bg-b-2 flex items-center justify-between gap-4 rounded-lg border border-(--scalar-background-3) p-4 text-sm\">\n <div class=\"min-w-0 flex-1\">\n <h4 class=\"text-c-1 font-medium\">Delete Operation</h4>\n <p class=\"text-c-2 mt-1.5\">\n Be careful, my friend. Once deleted, there is no way to recover\n the operation.\n </p>\n </div>\n <ScalarButton\n class=\"shrink-0\"\n size=\"sm\"\n variant=\"danger\"\n @click=\"deleteOperationModal.show()\">\n Delete Operation\n </ScalarButton>\n </div>\n </Section>\n </template>\n </div>\n\n <!-- Delete Operation Modal -->\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"deleteOperationModal\"\n :title=\"`Delete ${operationLabel}`\">\n <DeleteSidebarListElement\n :variableName=\"operationLabel\"\n warningMessage=\"This action cannot be undone.\"\n @close=\"deleteOperationModal.hide()\"\n @delete=\"handleDeleteOperation\" />\n </ScalarModal>\n</template>\n\n<style scoped>\n:deep(.cm-content) {\n min-height: fit-content;\n}\n:deep(.cm-scroller) {\n max-width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,MAAM,iBAAiB,eAAe;AACpC,OAAI,CAAC,QAAA,UAAU,CAAC,QAAA,KACd,QAAO;AAGT,UAAO,GADa,OAAO,QAAA,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AAA,QAAA,OAAA,MAAA,CAAA,gBAAX,eAAW,GAAA,CAAA,EAAA,CAAA;2BAiBtB,CAhBN,mBAgBM,OAhBN,YAgBM,CAAA,OAAA,QAAA,OAAA,MAdJ,mBAMM,OAAA,EAND,OAAM,kBAAgB,EAAA,CACzB,mBAAsD,MAAA,EAAlD,OAAM,wBAAsB,EAAC,mBAAgB,EACjD,mBAGI,KAAA,EAHD,OAAM,mBAAiB,EAAC,mFAG3B,CAAA,EAAA,GAAA,GAEF,YAMe,MAAA,aAAA,EAAA;KALb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,qBAAoB,CAAC,MAAI;;4BAEnC,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAFuC,sBAEvC,GAAA,CAAA,EAAA,CAAA;;;;+CAOR,YASc,MAAA,YAAA,EAAA;IARX,MAAM;IACN,OAAO,MAAA,qBAAoB;IAC3B,OAAK,UAAY,eAAA;;2BAKkB,CAJpC,YAIoC,kCAAA;KAHjC,cAAc,eAAA;KACf,gBAAe;KACd,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,qBAAoB,CAAC,MAAI;KAChC,UAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Runner.vue.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Runner/components/Runner.vue"],"names":[],"mappings":"AA4xBA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Runner.vue.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Runner/components/Runner.vue"],"names":[],"mappings":"AA0yBA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Runner.vue.js","names":[],"sources":["../../../../../../../src/v2/features/collection/components/Runner/components/Runner.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components'\nimport { ScalarIconArrowCounterClockwise, ScalarIconPlay } from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport { useRunnerExecution, useRunnerSelection } from '../hooks'\nimport RunnerCard from './RunnerCard.vue'\nimport RunnerOrderItem from './RunnerOrderItem.vue'\nimport RunnerResults from './RunnerResults.vue'\nimport RunnerTree from './RunnerTree.vue'\n\nconst { document, collectionType, workspaceStore, documentSlug, layout } =\n defineProps<CollectionProps>()\n\nconst {\n selectedOrder,\n hasSelection,\n isSelected,\n toggle,\n clearAll,\n removeFromOrder,\n dragState,\n handleDragStart,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n handleDragEnd,\n} = useRunnerSelection({\n isLocked: () => isLocked.value,\n})\n\nconst {\n isRunning,\n hasRunCompleted,\n currentRunIndex,\n runLoader,\n runSummary,\n run,\n rerun,\n clearResults,\n getResultAtIndex,\n isResultPassed,\n isResultSkipped,\n getFailedTests,\n} = useRunnerExecution({\n workspaceStore,\n document,\n documentName: documentSlug,\n isWeb: layout === 'web',\n selectedOrder: computed(() => selectedOrder.value),\n})\n\nconst isLocked = computed(() => isRunning.value || hasRunCompleted.value)\n\nconst { draggedIndex, dragOverIndex, dragOffset } = dragState\n\nconst navigationChildren = computed(() => {\n return document?.['x-scalar-navigation']?.children ?? []\n})\n\nconst hasOperations = computed(() => navigationChildren.value.length > 0)\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Runner</template>\n <template #description>\n Select operation examples, set the run order, then run them in sequence.\n Variables set by pre-request or post-response scripts are shared between\n runs.\n </template>\n\n <div class=\"flex flex-col gap-8 lg:flex-row lg:items-start\">\n <!-- Left: Document operations tree -->\n <RunnerCard\n class=\"min-w-0 flex-1\"\n subtitle=\"Check the examples you want to run. They will be added to the run order.\"\n title=\"Select operations\">\n <div\n v-if=\"hasOperations\"\n class=\"max-h-[28rem] overflow-y-auto\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerTree\n :disabled=\"isLocked\"\n :entries=\"navigationChildren\"\n :isSelected=\"isSelected\"\n :selectedOrder=\"selectedOrder\"\n @toggle=\"toggle\" />\n </div>\n <div\n v-else\n class=\"py-6 text-center\">\n <p class=\"text-c-3 text-sm\">No operations in this document.</p>\n <p class=\"text-c-3 mt-1 text-xs\">\n Add paths and methods to your API description to see them here.\n </p>\n </div>\n </RunnerCard>\n\n <!-- Right: Run order + actions + results -->\n <div class=\"flex w-full shrink-0 flex-col gap-4 lg:w-96\">\n <!-- Run order card -->\n <RunnerCard title=\"Run order\">\n <template #header>\n <ScalarButton\n class=\"transition-opacity duration-100\"\n :class=\"\n hasSelection && !isLocked\n ? 'opacity-100'\n : 'pointer-events-none opacity-0'\n \"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"clearAll\">\n <span class=\"hover:underline\">Clear all</span>\n </ScalarButton>\n </template>\n <template #subtitle>\n {{ selectedOrder.length }}\n {{ selectedOrder.length === 1 ? 'item' : 'items' }} selected.\n <template v-if=\"!isLocked\">Drag to reorder.</template>\n <template v-else-if=\"hasRunCompleted\">\n Clear results to modify.\n </template>\n </template>\n <template #default>\n <div\n v-if=\"selectedOrder.length > 0\"\n class=\"flex flex-col gap-0.5\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerOrderItem\n v-for=\"(item, index) in selectedOrder\"\n :key=\"item.id\"\n :draggable=\"!isLocked\"\n :exampleKey=\"item.exampleKey\"\n :index=\"index\"\n :isDragAfter=\"dragOverIndex === index && dragOffset === 'after'\"\n :isDragBefore=\"\n dragOverIndex === index && dragOffset === 'before'\n \"\n :isDragging=\"draggedIndex === index\"\n :isLocked=\"isLocked\"\n :method=\"item.method\"\n :path=\"item.path\"\n @dragend=\"handleDragEnd\"\n @dragleave=\"handleDragLeave\"\n @dragover=\"handleDragOver(index, $event)\"\n @dragstart=\"handleDragStart(index, $event)\"\n @drop=\"handleDrop\"\n @remove=\"removeFromOrder(item)\" />\n </div>\n <div\n v-else\n class=\"py-4 text-center\">\n <p class=\"text-c-3 text-sm\">No items yet.</p>\n <p class=\"text-c-3 mt-0.5 text-xs\">\n Select operations from the list on the left.\n </p>\n </div>\n </template>\n </RunnerCard>\n\n <!-- Run button -->\n <div class=\"flex justify-end pt-1\">\n <ScalarButton\n v-if=\"!hasRunCompleted\"\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconPlay\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"run\">\n Run sequence\n </ScalarButton>\n <ScalarButton\n v-else\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconArrowCounterClockwise\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"rerun\">\n Re-run sequence\n </ScalarButton>\n </div>\n\n <!-- Running progress -->\n <RunnerCard\n v-if=\"\n isRunning && currentRunIndex != null && selectedOrder.length > 0\n \"\n compact>\n <p class=\"text-c-2 text-sm\">\n Running step\n <span class=\"text-c-1 font-medium\">\n {{ currentRunIndex }} / {{ selectedOrder.length }}\n </span>\n </p>\n <div\n :aria-valuemax=\"selectedOrder.length\"\n :aria-valuemin=\"0\"\n :aria-valuenow=\"currentRunIndex\"\n class=\"bg-b-3 mt-2 h-1.5 overflow-hidden rounded-full\"\n role=\"progressbar\">\n <div\n class=\"bg-accent-color h-full rounded-full transition-[width] duration-200 ease-out\"\n :style=\"{\n width: `${(currentRunIndex / selectedOrder.length) * 100}%`,\n }\" />\n </div>\n </RunnerCard>\n\n <!-- Results -->\n <RunnerResults\n v-if=\"runSummary && hasRunCompleted\"\n :getFailedTests=\"getFailedTests\"\n :getResultAtIndex=\"getResultAtIndex\"\n :isResultPassed=\"isResultPassed\"\n :isResultSkipped=\"isResultSkipped\"\n :selectedOrder=\"selectedOrder\"\n :summary=\"runSummary\"\n @clear=\"clearResults\" />\n </div>\n </div>\n </Section>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Runner.vue.js","names":[],"sources":["../../../../../../../src/v2/features/collection/components/Runner/components/Runner.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components'\nimport { ScalarIconArrowCounterClockwise, ScalarIconPlay } from '@scalar/icons'\nimport { computed, toValue } from 'vue'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport { useRunnerExecution, useRunnerSelection } from '../hooks'\nimport RunnerCard from './RunnerCard.vue'\nimport RunnerOrderItem from './RunnerOrderItem.vue'\nimport RunnerResults from './RunnerResults.vue'\nimport RunnerTree from './RunnerTree.vue'\n\nconst {\n document,\n collectionType,\n workspaceStore,\n documentSlug,\n layout,\n options,\n} = defineProps<CollectionProps>()\n\nconst {\n selectedOrder,\n hasSelection,\n isSelected,\n toggle,\n clearAll,\n removeFromOrder,\n dragState,\n handleDragStart,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n handleDragEnd,\n} = useRunnerSelection({\n isLocked: () => isLocked.value,\n})\n\nconst {\n isRunning,\n hasRunCompleted,\n currentRunIndex,\n runLoader,\n runSummary,\n run,\n rerun,\n clearResults,\n getResultAtIndex,\n isResultPassed,\n isResultSkipped,\n getFailedTests,\n} = useRunnerExecution({\n workspaceStore,\n document,\n documentName: documentSlug,\n isWeb: layout === 'web',\n selectedOrder: computed(() => selectedOrder.value),\n customFetch: toValue(options)?.customFetch,\n})\n\nconst isLocked = computed(() => isRunning.value || hasRunCompleted.value)\n\nconst { draggedIndex, dragOverIndex, dragOffset } = dragState\n\nconst navigationChildren = computed(() => {\n return document?.['x-scalar-navigation']?.children ?? []\n})\n\nconst hasOperations = computed(() => navigationChildren.value.length > 0)\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Runner</template>\n <template #description>\n Select operation examples, set the run order, then run them in sequence.\n Variables set by pre-request or post-response scripts are shared between\n runs.\n </template>\n\n <div class=\"flex flex-col gap-8 lg:flex-row lg:items-start\">\n <!-- Left: Document operations tree -->\n <RunnerCard\n class=\"min-w-0 flex-1\"\n subtitle=\"Check the examples you want to run. They will be added to the run order.\"\n title=\"Select operations\">\n <div\n v-if=\"hasOperations\"\n class=\"max-h-[28rem] overflow-y-auto\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerTree\n :disabled=\"isLocked\"\n :entries=\"navigationChildren\"\n :isSelected=\"isSelected\"\n :selectedOrder=\"selectedOrder\"\n @toggle=\"toggle\" />\n </div>\n <div\n v-else\n class=\"py-6 text-center\">\n <p class=\"text-c-3 text-sm\">No operations in this document.</p>\n <p class=\"text-c-3 mt-1 text-xs\">\n Add paths and methods to your API description to see them here.\n </p>\n </div>\n </RunnerCard>\n\n <!-- Right: Run order + actions + results -->\n <div class=\"flex w-full shrink-0 flex-col gap-4 lg:w-96\">\n <!-- Run order card -->\n <RunnerCard title=\"Run order\">\n <template #header>\n <ScalarButton\n class=\"transition-opacity duration-100\"\n :class=\"\n hasSelection && !isLocked\n ? 'opacity-100'\n : 'pointer-events-none opacity-0'\n \"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"clearAll\">\n <span class=\"hover:underline\">Clear all</span>\n </ScalarButton>\n </template>\n <template #subtitle>\n {{ selectedOrder.length }}\n {{ selectedOrder.length === 1 ? 'item' : 'items' }} selected.\n <template v-if=\"!isLocked\">Drag to reorder.</template>\n <template v-else-if=\"hasRunCompleted\">\n Clear results to modify.\n </template>\n </template>\n <template #default>\n <div\n v-if=\"selectedOrder.length > 0\"\n class=\"flex flex-col gap-0.5\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerOrderItem\n v-for=\"(item, index) in selectedOrder\"\n :key=\"item.id\"\n :draggable=\"!isLocked\"\n :exampleKey=\"item.exampleKey\"\n :index=\"index\"\n :isDragAfter=\"dragOverIndex === index && dragOffset === 'after'\"\n :isDragBefore=\"\n dragOverIndex === index && dragOffset === 'before'\n \"\n :isDragging=\"draggedIndex === index\"\n :isLocked=\"isLocked\"\n :method=\"item.method\"\n :path=\"item.path\"\n @dragend=\"handleDragEnd\"\n @dragleave=\"handleDragLeave\"\n @dragover=\"handleDragOver(index, $event)\"\n @dragstart=\"handleDragStart(index, $event)\"\n @drop=\"handleDrop\"\n @remove=\"removeFromOrder(item)\" />\n </div>\n <div\n v-else\n class=\"py-4 text-center\">\n <p class=\"text-c-3 text-sm\">No items yet.</p>\n <p class=\"text-c-3 mt-0.5 text-xs\">\n Select operations from the list on the left.\n </p>\n </div>\n </template>\n </RunnerCard>\n\n <!-- Run button -->\n <div class=\"flex justify-end pt-1\">\n <ScalarButton\n v-if=\"!hasRunCompleted\"\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconPlay\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"run\">\n Run sequence\n </ScalarButton>\n <ScalarButton\n v-else\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconArrowCounterClockwise\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"rerun\">\n Re-run sequence\n </ScalarButton>\n </div>\n\n <!-- Running progress -->\n <RunnerCard\n v-if=\"\n isRunning && currentRunIndex != null && selectedOrder.length > 0\n \"\n compact>\n <p class=\"text-c-2 text-sm\">\n Running step\n <span class=\"text-c-1 font-medium\">\n {{ currentRunIndex }} / {{ selectedOrder.length }}\n </span>\n </p>\n <div\n :aria-valuemax=\"selectedOrder.length\"\n :aria-valuemin=\"0\"\n :aria-valuenow=\"currentRunIndex\"\n class=\"bg-b-3 mt-2 h-1.5 overflow-hidden rounded-full\"\n role=\"progressbar\">\n <div\n class=\"bg-accent-color h-full rounded-full transition-[width] duration-200 ease-out\"\n :style=\"{\n width: `${(currentRunIndex / selectedOrder.length) * 100}%`,\n }\" />\n </div>\n </RunnerCard>\n\n <!-- Results -->\n <RunnerResults\n v-if=\"runSummary && hasRunCompleted\"\n :getFailedTests=\"getFailedTests\"\n :getResultAtIndex=\"getResultAtIndex\"\n :isResultPassed=\"isResultPassed\"\n :isResultSkipped=\"isResultSkipped\"\n :selectedOrder=\"selectedOrder\"\n :summary=\"runSummary\"\n @clear=\"clearResults\" />\n </div>\n </div>\n </Section>\n</template>\n"],"mappings":""}
@@ -5,7 +5,7 @@ import RunnerCard_default from "./RunnerCard.vue.js";
5
5
  import RunnerOrderItem_default from "./RunnerOrderItem.vue.js";
6
6
  import RunnerResults_default from "./RunnerResults.vue.js";
7
7
  import RunnerTree_default from "./RunnerTree.vue.js";
8
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
8
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderList, toDisplayString, toValue, unref, withCtx } from "vue";
9
9
  import { ScalarButton } from "@scalar/components";
10
10
  import { ScalarIconArrowCounterClockwise, ScalarIconPlay } from "@scalar/icons";
11
11
  //#region src/v2/features/collection/components/Runner/components/Runner.vue?vue&type=script&setup=true&lang.ts
@@ -43,6 +43,7 @@ var Runner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
43
43
  fetchRegistryDocument: { type: Function },
44
44
  telemetry: { type: Boolean },
45
45
  onUpdateTelemetry: { type: Function },
46
+ options: {},
46
47
  collectionType: {}
47
48
  },
48
49
  setup(__props) {
@@ -52,7 +53,8 @@ var Runner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
52
53
  document: __props.document,
53
54
  documentName: __props.documentSlug,
54
55
  isWeb: __props.layout === "web",
55
- selectedOrder: computed(() => selectedOrder.value)
56
+ selectedOrder: computed(() => selectedOrder.value),
57
+ customFetch: toValue(__props.options)?.customFetch
56
58
  });
57
59
  const isLocked = computed(() => isRunning.value || hasRunCompleted.value);
58
60
  const { draggedIndex, dragOverIndex, dragOffset } = dragState;
@@ -1 +1 @@
1
- {"version":3,"file":"Runner.vue.script.js","names":[],"sources":["../../../../../../../src/v2/features/collection/components/Runner/components/Runner.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components'\nimport { ScalarIconArrowCounterClockwise, ScalarIconPlay } from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport { useRunnerExecution, useRunnerSelection } from '../hooks'\nimport RunnerCard from './RunnerCard.vue'\nimport RunnerOrderItem from './RunnerOrderItem.vue'\nimport RunnerResults from './RunnerResults.vue'\nimport RunnerTree from './RunnerTree.vue'\n\nconst { document, collectionType, workspaceStore, documentSlug, layout } =\n defineProps<CollectionProps>()\n\nconst {\n selectedOrder,\n hasSelection,\n isSelected,\n toggle,\n clearAll,\n removeFromOrder,\n dragState,\n handleDragStart,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n handleDragEnd,\n} = useRunnerSelection({\n isLocked: () => isLocked.value,\n})\n\nconst {\n isRunning,\n hasRunCompleted,\n currentRunIndex,\n runLoader,\n runSummary,\n run,\n rerun,\n clearResults,\n getResultAtIndex,\n isResultPassed,\n isResultSkipped,\n getFailedTests,\n} = useRunnerExecution({\n workspaceStore,\n document,\n documentName: documentSlug,\n isWeb: layout === 'web',\n selectedOrder: computed(() => selectedOrder.value),\n})\n\nconst isLocked = computed(() => isRunning.value || hasRunCompleted.value)\n\nconst { draggedIndex, dragOverIndex, dragOffset } = dragState\n\nconst navigationChildren = computed(() => {\n return document?.['x-scalar-navigation']?.children ?? []\n})\n\nconst hasOperations = computed(() => navigationChildren.value.length > 0)\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Runner</template>\n <template #description>\n Select operation examples, set the run order, then run them in sequence.\n Variables set by pre-request or post-response scripts are shared between\n runs.\n </template>\n\n <div class=\"flex flex-col gap-8 lg:flex-row lg:items-start\">\n <!-- Left: Document operations tree -->\n <RunnerCard\n class=\"min-w-0 flex-1\"\n subtitle=\"Check the examples you want to run. They will be added to the run order.\"\n title=\"Select operations\">\n <div\n v-if=\"hasOperations\"\n class=\"max-h-[28rem] overflow-y-auto\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerTree\n :disabled=\"isLocked\"\n :entries=\"navigationChildren\"\n :isSelected=\"isSelected\"\n :selectedOrder=\"selectedOrder\"\n @toggle=\"toggle\" />\n </div>\n <div\n v-else\n class=\"py-6 text-center\">\n <p class=\"text-c-3 text-sm\">No operations in this document.</p>\n <p class=\"text-c-3 mt-1 text-xs\">\n Add paths and methods to your API description to see them here.\n </p>\n </div>\n </RunnerCard>\n\n <!-- Right: Run order + actions + results -->\n <div class=\"flex w-full shrink-0 flex-col gap-4 lg:w-96\">\n <!-- Run order card -->\n <RunnerCard title=\"Run order\">\n <template #header>\n <ScalarButton\n class=\"transition-opacity duration-100\"\n :class=\"\n hasSelection && !isLocked\n ? 'opacity-100'\n : 'pointer-events-none opacity-0'\n \"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"clearAll\">\n <span class=\"hover:underline\">Clear all</span>\n </ScalarButton>\n </template>\n <template #subtitle>\n {{ selectedOrder.length }}\n {{ selectedOrder.length === 1 ? 'item' : 'items' }} selected.\n <template v-if=\"!isLocked\">Drag to reorder.</template>\n <template v-else-if=\"hasRunCompleted\">\n Clear results to modify.\n </template>\n </template>\n <template #default>\n <div\n v-if=\"selectedOrder.length > 0\"\n class=\"flex flex-col gap-0.5\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerOrderItem\n v-for=\"(item, index) in selectedOrder\"\n :key=\"item.id\"\n :draggable=\"!isLocked\"\n :exampleKey=\"item.exampleKey\"\n :index=\"index\"\n :isDragAfter=\"dragOverIndex === index && dragOffset === 'after'\"\n :isDragBefore=\"\n dragOverIndex === index && dragOffset === 'before'\n \"\n :isDragging=\"draggedIndex === index\"\n :isLocked=\"isLocked\"\n :method=\"item.method\"\n :path=\"item.path\"\n @dragend=\"handleDragEnd\"\n @dragleave=\"handleDragLeave\"\n @dragover=\"handleDragOver(index, $event)\"\n @dragstart=\"handleDragStart(index, $event)\"\n @drop=\"handleDrop\"\n @remove=\"removeFromOrder(item)\" />\n </div>\n <div\n v-else\n class=\"py-4 text-center\">\n <p class=\"text-c-3 text-sm\">No items yet.</p>\n <p class=\"text-c-3 mt-0.5 text-xs\">\n Select operations from the list on the left.\n </p>\n </div>\n </template>\n </RunnerCard>\n\n <!-- Run button -->\n <div class=\"flex justify-end pt-1\">\n <ScalarButton\n v-if=\"!hasRunCompleted\"\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconPlay\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"run\">\n Run sequence\n </ScalarButton>\n <ScalarButton\n v-else\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconArrowCounterClockwise\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"rerun\">\n Re-run sequence\n </ScalarButton>\n </div>\n\n <!-- Running progress -->\n <RunnerCard\n v-if=\"\n isRunning && currentRunIndex != null && selectedOrder.length > 0\n \"\n compact>\n <p class=\"text-c-2 text-sm\">\n Running step\n <span class=\"text-c-1 font-medium\">\n {{ currentRunIndex }} / {{ selectedOrder.length }}\n </span>\n </p>\n <div\n :aria-valuemax=\"selectedOrder.length\"\n :aria-valuemin=\"0\"\n :aria-valuenow=\"currentRunIndex\"\n class=\"bg-b-3 mt-2 h-1.5 overflow-hidden rounded-full\"\n role=\"progressbar\">\n <div\n class=\"bg-accent-color h-full rounded-full transition-[width] duration-200 ease-out\"\n :style=\"{\n width: `${(currentRunIndex / selectedOrder.length) * 100}%`,\n }\" />\n </div>\n </RunnerCard>\n\n <!-- Results -->\n <RunnerResults\n v-if=\"runSummary && hasRunCompleted\"\n :getFailedTests=\"getFailedTests\"\n :getResultAtIndex=\"getResultAtIndex\"\n :isResultPassed=\"isResultPassed\"\n :isResultSkipped=\"isResultSkipped\"\n :selectedOrder=\"selectedOrder\"\n :summary=\"runSummary\"\n @clear=\"clearResults\" />\n </div>\n </div>\n </Section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,EACJ,eACA,cACA,YACA,QACA,UACA,iBACA,WACA,iBACA,gBACA,iBACA,YACA,kBACE,mBAAmB,EACrB,gBAAgB,SAAS,OAC1B,CAAA;EAED,MAAM,EACJ,WACA,iBACA,iBACA,WACA,YACA,KACA,OACA,cACA,kBACA,gBACA,iBACA,mBACE,mBAAmB;GACrB,gBAAa,QAAA;GACb,UAAO,QAAA;GACP,cAAc,QAAA;GACd,OAAO,QAAA,WAAW;GAClB,eAAe,eAAe,cAAc,MAAM;GACnD,CAAA;EAED,MAAM,WAAW,eAAe,UAAU,SAAS,gBAAgB,MAAK;EAExE,MAAM,EAAE,cAAc,eAAe,eAAe;EAEpD,MAAM,qBAAqB,eAAe;AACxC,UAAO,QAAA,WAAW,wBAAwB,YAAY,EAAC;IACxD;EAED,MAAM,gBAAgB,eAAe,mBAAmB,MAAM,SAAS,EAAC;;UAIvD,QAAA,mBAAc,cAAA,WAAA,EAA7B,YAkKU,iBAAA,EAAA,KAAA,GAAA,EAAA;IAjKG,OAAK,cAAO,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAN,UAAM,GAAA,CAAA,EAAA,CAAA;IACZ,aAAW,cAItB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAJuB,6JAIvB,GAAA,CAAA,EAAA,CAAA;2BA2JM,CAzJN,mBAyJM,OAzJN,YAyJM,CAvJJ,YAuBa,oBAAA;KAtBX,OAAM;K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S,MAAA,WAAU;MACnB,SAAO,MAAA,aAAY"}
1
+ {"version":3,"file":"Runner.vue.script.js","names":[],"sources":["../../../../../../../src/v2/features/collection/components/Runner/components/Runner.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components'\nimport { ScalarIconArrowCounterClockwise, ScalarIconPlay } from '@scalar/icons'\nimport { computed, toValue } from 'vue'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport { useRunnerExecution, useRunnerSelection } from '../hooks'\nimport RunnerCard from './RunnerCard.vue'\nimport RunnerOrderItem from './RunnerOrderItem.vue'\nimport RunnerResults from './RunnerResults.vue'\nimport RunnerTree from './RunnerTree.vue'\n\nconst {\n document,\n collectionType,\n workspaceStore,\n documentSlug,\n layout,\n options,\n} = defineProps<CollectionProps>()\n\nconst {\n selectedOrder,\n hasSelection,\n isSelected,\n toggle,\n clearAll,\n removeFromOrder,\n dragState,\n handleDragStart,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n handleDragEnd,\n} = useRunnerSelection({\n isLocked: () => isLocked.value,\n})\n\nconst {\n isRunning,\n hasRunCompleted,\n currentRunIndex,\n runLoader,\n runSummary,\n run,\n rerun,\n clearResults,\n getResultAtIndex,\n isResultPassed,\n isResultSkipped,\n getFailedTests,\n} = useRunnerExecution({\n workspaceStore,\n document,\n documentName: documentSlug,\n isWeb: layout === 'web',\n selectedOrder: computed(() => selectedOrder.value),\n customFetch: toValue(options)?.customFetch,\n})\n\nconst isLocked = computed(() => isRunning.value || hasRunCompleted.value)\n\nconst { draggedIndex, dragOverIndex, dragOffset } = dragState\n\nconst navigationChildren = computed(() => {\n return document?.['x-scalar-navigation']?.children ?? []\n})\n\nconst hasOperations = computed(() => navigationChildren.value.length > 0)\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Runner</template>\n <template #description>\n Select operation examples, set the run order, then run them in sequence.\n Variables set by pre-request or post-response scripts are shared between\n runs.\n </template>\n\n <div class=\"flex flex-col gap-8 lg:flex-row lg:items-start\">\n <!-- Left: Document operations tree -->\n <RunnerCard\n class=\"min-w-0 flex-1\"\n subtitle=\"Check the examples you want to run. They will be added to the run order.\"\n title=\"Select operations\">\n <div\n v-if=\"hasOperations\"\n class=\"max-h-[28rem] overflow-y-auto\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerTree\n :disabled=\"isLocked\"\n :entries=\"navigationChildren\"\n :isSelected=\"isSelected\"\n :selectedOrder=\"selectedOrder\"\n @toggle=\"toggle\" />\n </div>\n <div\n v-else\n class=\"py-6 text-center\">\n <p class=\"text-c-3 text-sm\">No operations in this document.</p>\n <p class=\"text-c-3 mt-1 text-xs\">\n Add paths and methods to your API description to see them here.\n </p>\n </div>\n </RunnerCard>\n\n <!-- Right: Run order + actions + results -->\n <div class=\"flex w-full shrink-0 flex-col gap-4 lg:w-96\">\n <!-- Run order card -->\n <RunnerCard title=\"Run order\">\n <template #header>\n <ScalarButton\n class=\"transition-opacity duration-100\"\n :class=\"\n hasSelection && !isLocked\n ? 'opacity-100'\n : 'pointer-events-none opacity-0'\n \"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"clearAll\">\n <span class=\"hover:underline\">Clear all</span>\n </ScalarButton>\n </template>\n <template #subtitle>\n {{ selectedOrder.length }}\n {{ selectedOrder.length === 1 ? 'item' : 'items' }} selected.\n <template v-if=\"!isLocked\">Drag to reorder.</template>\n <template v-else-if=\"hasRunCompleted\">\n Clear results to modify.\n </template>\n </template>\n <template #default>\n <div\n v-if=\"selectedOrder.length > 0\"\n class=\"flex flex-col gap-0.5\"\n :class=\"{ 'opacity-60': isLocked }\">\n <RunnerOrderItem\n v-for=\"(item, index) in selectedOrder\"\n :key=\"item.id\"\n :draggable=\"!isLocked\"\n :exampleKey=\"item.exampleKey\"\n :index=\"index\"\n :isDragAfter=\"dragOverIndex === index && dragOffset === 'after'\"\n :isDragBefore=\"\n dragOverIndex === index && dragOffset === 'before'\n \"\n :isDragging=\"draggedIndex === index\"\n :isLocked=\"isLocked\"\n :method=\"item.method\"\n :path=\"item.path\"\n @dragend=\"handleDragEnd\"\n @dragleave=\"handleDragLeave\"\n @dragover=\"handleDragOver(index, $event)\"\n @dragstart=\"handleDragStart(index, $event)\"\n @drop=\"handleDrop\"\n @remove=\"removeFromOrder(item)\" />\n </div>\n <div\n v-else\n class=\"py-4 text-center\">\n <p class=\"text-c-3 text-sm\">No items yet.</p>\n <p class=\"text-c-3 mt-0.5 text-xs\">\n Select operations from the list on the left.\n </p>\n </div>\n </template>\n </RunnerCard>\n\n <!-- Run button -->\n <div class=\"flex justify-end pt-1\">\n <ScalarButton\n v-if=\"!hasRunCompleted\"\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconPlay\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"run\">\n Run sequence\n </ScalarButton>\n <ScalarButton\n v-else\n class=\"min-w-40\"\n :disabled=\"!hasSelection || isRunning\"\n :icon=\"ScalarIconArrowCounterClockwise\"\n :loader=\"runLoader\"\n size=\"md\"\n variant=\"gradient\"\n @click=\"rerun\">\n Re-run sequence\n </ScalarButton>\n </div>\n\n <!-- Running progress -->\n <RunnerCard\n v-if=\"\n isRunning && currentRunIndex != null && selectedOrder.length > 0\n \"\n compact>\n <p class=\"text-c-2 text-sm\">\n Running step\n <span class=\"text-c-1 font-medium\">\n {{ currentRunIndex }} / {{ selectedOrder.length }}\n </span>\n </p>\n <div\n :aria-valuemax=\"selectedOrder.length\"\n :aria-valuemin=\"0\"\n :aria-valuenow=\"currentRunIndex\"\n class=\"bg-b-3 mt-2 h-1.5 overflow-hidden rounded-full\"\n role=\"progressbar\">\n <div\n class=\"bg-accent-color h-full rounded-full transition-[width] duration-200 ease-out\"\n :style=\"{\n width: `${(currentRunIndex / selectedOrder.length) * 100}%`,\n }\" />\n </div>\n </RunnerCard>\n\n <!-- Results -->\n <RunnerResults\n v-if=\"runSummary && hasRunCompleted\"\n :getFailedTests=\"getFailedTests\"\n :getResultAtIndex=\"getResultAtIndex\"\n :isResultPassed=\"isResultPassed\"\n :isResultSkipped=\"isResultSkipped\"\n :selectedOrder=\"selectedOrder\"\n :summary=\"runSummary\"\n @clear=\"clearResults\" />\n </div>\n </div>\n </Section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,EACJ,eACA,cACA,YACA,QACA,UACA,iBACA,WACA,iBACA,gBACA,iBACA,YACA,kBACE,mBAAmB,EACrB,gBAAgB,SAAS,OAC1B,CAAA;EAED,MAAM,EACJ,WACA,iBACA,iBACA,WACA,YACA,KACA,OACA,cACA,kBACA,gBACA,iBACA,mBACE,mBAAmB;GACrB,gBAAa,QAAA;GACb,UAAO,QAAA;GACP,cAAc,QAAA;GACd,OAAO,QAAA,WAAW;GAClB,eAAe,eAAe,cAAc,MAAM;GAClD,aAAa,QAAQ,QAAA,QAAQ,EAAE;GAChC,CAAA;EAED,MAAM,WAAW,eAAe,UAAU,SAAS,gBAAgB,MAAK;EAExE,MAAM,EAAE,cAAc,eAAe,eAAe;EAEpD,MAAM,qBAAqB,eAAe;AACxC,UAAO,QAAA,WAAW,wBAAwB,YAAY,EAAC;IACxD;EAED,MAAM,gBAAgB,eAAe,mBAAmB,MAAM,SAAS,EAAC;;UAIvD,QAAA,mBAAc,cAAA,WAAA,EAA7B,YAkKU,iBAAA,EAAA,KAAA,GAAA,EAAA;IAjKG,OAAK,cAAO,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAN,UAAM,GAAA,CAAA,EAAA,CAAA;IACZ,aAAW,cAItB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAJuB,6JAIvB,GAAA,CAAA,EAAA,CAAA;2BA2JM,CAzJN,mBAyJM,OAzJN,YAyJM,CAvJJ,YAuBa,oBAAA;KAtBX,OAAM;KACN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MAAA,WAAU;MACnB,SAAO,MAAA,aAAY"}
@@ -9,9 +9,9 @@ type __VLS_Props = {
9
9
  disabled?: boolean;
10
10
  };
11
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
- toggle: (path: string, method: "delete" | "head" | "get" | "options" | "put" | "post" | "patch" | "trace", exampleKey: string, label: string) => any;
12
+ toggle: (path: string, method: "head" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace", exampleKey: string, label: string) => any;
13
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
- onToggle?: ((path: string, method: "delete" | "head" | "get" | "options" | "put" | "post" | "patch" | "trace", exampleKey: string, label: string) => any) | undefined;
14
+ onToggle?: ((path: string, method: "head" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace", exampleKey: string, label: string) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
17
17
  export default _default;
@@ -2,7 +2,7 @@ import { useLoadingState } from '@scalar/components';
2
2
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
3
  import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
4
  import { type ComputedRef, type Ref } from 'vue';
5
- import { type ResponseInstance } from '../../../../../../v2/blocks/operation-block/helpers/send-request.js';
5
+ import { type CustomFetch, type ResponseInstance } from '../../../../../../v2/blocks/operation-block/helpers/send-request.js';
6
6
  import type { SelectedItem } from './use-runner-selection.js';
7
7
  export type TestResult = {
8
8
  title: string;
@@ -36,6 +36,8 @@ type UseRunnerExecutionOptions = {
36
36
  isWeb: boolean;
37
37
  /** Ordered list of selected items to run */
38
38
  selectedOrder: ComputedRef<SelectedItem[]>;
39
+ /** Optional custom fetch implementation, overrides the global fetch for request execution */
40
+ customFetch?: CustomFetch;
39
41
  };
40
42
  type UseRunnerExecutionReturn = {
41
43
  /** Whether a run is currently in progress */
@@ -68,6 +70,6 @@ type UseRunnerExecutionReturn = {
68
70
  /**
69
71
  * Composable for managing runner execution state and logic.
70
72
  */
71
- export declare function useRunnerExecution({ workspaceStore, document, documentName, isWeb, selectedOrder, }: UseRunnerExecutionOptions): UseRunnerExecutionReturn;
73
+ export declare function useRunnerExecution({ workspaceStore, document, documentName, isWeb, selectedOrder, customFetch, }: UseRunnerExecutionOptions): UseRunnerExecutionReturn;
72
74
  export {};
73
75
  //# sourceMappingURL=use-runner-execution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-runner-execution.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Runner/hooks/use-runner-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AASpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAiB,MAAM,KAAK,CAAA;AAE/D,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,kDAAkD,CAAA;AAIrG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,YAAY,CAAA;IAClB,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC/B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,WAAW,EAAE,UAAU,EAAE,CA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AG,IAAI,CAAA;IACrD,+BAA+B;IAC/B,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,KAAK,OAAO,CAAA;IACrD,oCAAoC;IACpC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IAC3C,qCAAqC;IACrC,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,KAAK,UAAU,EAAE,CAAA;CAC3D,CAAA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,aAAa,GACd,EAAE,yBAAyB,GAAG,wBAAwB,CA8NtD"}
1
+ {"version":3,"file":"use-runner-execution.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Runner/hooks/use-runner-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AASpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAiB,MAAM,KAAK,CAAA;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAe,MAAM,kDAAkD,CAAA;AAIvH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,YAAY,CAAA;IAClB,MAAM,EAAE,gBAAgB,GAAG,IAAI,C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AI,CAAA;IACjB,wBAAwB;IACxB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,yCAAyC;IACzC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,GAAG,IAAI,CAAA;IACrD,+BAA+B;IAC/B,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,KAAK,OAAO,CAAA;IACrD,oCAAoC;IACpC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IAC3C,qCAAqC;IACrC,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,KAAK,UAAU,EAAE,CAAA;CAC3D,CAAA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,aAAa,EACb,WAAW,GACZ,EAAE,yBAAyB,GAAG,wBAAwB,CA+NtD"}
@@ -10,7 +10,7 @@ import { executePostResponseScript, executePreRequestScript, getScript } from "@
10
10
  /**
11
11
  * Composable for managing runner execution state and logic.
12
12
  */
13
- function useRunnerExecution({ workspaceStore, document, documentName, isWeb, selectedOrder }) {
13
+ function useRunnerExecution({ workspaceStore, document, documentName, isWeb, selectedOrder, customFetch }) {
14
14
  const isRunning = ref(false);
15
15
  const hasRunCompleted = ref(false);
16
16
  const currentRunIndex = ref(null);
@@ -136,7 +136,8 @@ function useRunnerExecution({ workspaceStore, document, documentName, isWeb, sel
136
136
  }
137
137
  const [sendError, sendResult] = await sendRequest({
138
138
  isUsingProxy: requestResult.data.isUsingProxy,
139
- request: requestResult.data.request
139
+ requestPayload: requestResult.data.requestPayload,
140
+ customFetch
140
141
  });
141
142
  if (sendError) {
142
143
  runResult.error = sendError;
@@ -1 +1 @@
1
- {"version":3,"file":"use-runner-execution.js","names":[],"sources":["../../../../../../../src/v2/features/collection/components/Runner/hooks/use-runner-execution.ts"],"sourcesContent":["import { useLoadingState } from '@scalar/components'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { executePostResponseScript, executePreRequestScript, getScript } from '@scalar/pre-post-request-scripts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport {\n type BuildRequestExampleContext,\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n getRequestExampleContext,\n requestFactory,\n} from '@scalar/workspace-store/request-example'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { type ComputedRef, type Ref, computed, ref } from 'vue'\n\nimport { type ResponseInstance, sendRequest } from '@/v2/blocks/operation-block/helpers/send-request'\nimport { APP_VERSION } from '@/v2/constants'\nimport { tryCatch } from '@/v2/helpers/safe-run'\n\nimport type { SelectedItem } from './use-runner-selection'\n\nexport type TestResult = {\n title: string\n passed: boolean\n duration: number\n error?: string\n status: 'pending' | 'passed' | 'failed'\n}\n\nexport type RunResult = {\n item: SelectedItem\n result: ResponseInstance | null\n error: Error | null\n testResults: TestResult[]\n}\n\nexport type RunSummary = {\n total: number\n passed: number\n failed: number\n skipped: number\n duration: number | null\n allPassed: boolean\n}\n\ntype UseRunnerExecutionOptions = {\n /** Workspace store */\n workspaceStore: WorkspaceStore\n /** Document */\n document: OpenApiDocument | null\n /** Document name */\n documentName: string\n /** Whether the layout is web */\n isWeb: boolean\n /** Ordered list of selected items to run */\n selectedOrder: ComputedRef<SelectedItem[]>\n}\n\ntype UseRunnerExecutionReturn = {\n /** Whether a run is currently in progress */\n isRunning: Ref<boolean>\n /** Whether a run has completed */\n hasRunCompleted: Ref<boolean>\n /** Current index being run (1-based) */\n currentRunIndex: Ref<number | null>\n /** Loading state for the run button */\n runLoader: ReturnType<typeof useLoadingState>\n /** Results from the run */\n runResults: Ref<RunResult[]>\n /** Summary of the run results */\n runSummary: ComputedRef<RunSummary | null>\n /** Start running the selected items */\n run: () => Promise<void>\n /** Clear results and run again */\n rerun: () => void\n /** Clear all results */\n clearResults: () => void\n /** Get the result at a specific index */\n getResultAtIndex: (index: number) => RunResult | null\n /** Check if a result passed */\n isResultPassed: (result: RunResult | null) => boolean\n /** Check if a result was skipped */\n isResultSkipped: (index: number) => boolean\n /** Get failed tests from a result */\n getFailedTests: (result: RunResult | null) => TestResult[]\n}\n\n/**\n * Composable for managing runner execution state and logic.\n */\nexport function useRunnerExecution({\n workspaceStore,\n document,\n documentName,\n isWeb,\n selectedOrder,\n}: UseRunnerExecutionOptions): UseRunnerExecutionReturn {\n const isRunning = ref(false)\n const hasRunCompleted = ref(false)\n const currentRunIndex = ref<number | null>(null)\n const runLoader = useLoadingState()\n const runResults = ref<RunResult[]>([])\n const runStartTime = ref<number | null>(null)\n const runEndTime = ref<number | null>(null)\n\n const runSummary = computed<RunSummary | null>(() => {\n if (runResults.value.length === 0 && !hasRunCompleted.value) {\n return null\n }\n const ran = runResults.value.length\n const total = selectedOrder.value.length\n const passed = runResults.value.filter((r) => !r.error && r.testResults.every((t) => t.passed)).length\n const failed = ran - passed\n const skipped = total - ran\n const duration = runStartTime.value && runEndTime.value ? runEndTime.value - runStartTime.value : null\n const allPassed = failed === 0 && skipped === 0\n return { total, passed, failed, skipped, duration, allPassed }\n })\n\n const clearResults = () => {\n runResults.value = []\n hasRunCompleted.value = false\n runStartTime.value = null\n runEndTime.value = null\n }\n\n const rerun = () => {\n clearResults()\n void run()\n }\n\n const getResultAtIndex = (index: number): RunResult | null => {\n return runResults.value[index] ?? null\n }\n\n const isResultPassed = (result: RunResult | null): boolean => {\n if (!result) {\n return false\n }\n if (result.error) {\n return false\n }\n if (result.testResults.some((t) => !t.passed)) {\n return false\n }\n return true\n }\n\n const isResultSkipped = (index: number): boolean => {\n return hasRunCompleted.value && getResultAtIndex(index) === null\n }\n\n const getFailedTests = (result: RunResult | null): TestResult[] => {\n if (!result) {\n return []\n }\n return result.testResults.filter((t) => !t.passed)\n }\n\n const getContext = (item: SelectedItem) => {\n const contextResult = getRequestExampleContext(\n workspaceStore,\n documentName,\n { path: item.path, method: item.method, exampleName: item.exampleKey },\n {\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: isWeb ? 'web' : 'other',\n appVersion: APP_VERSION,\n },\n )\n\n return contextResult\n }\n\n const getRequestFactory = (ctx: BuildRequestExampleContext, item: SelectedItem) => {\n const globalCookies = [...ctx.cookies.workspace, ...ctx.cookies.document]\n return requestFactory({\n defaultHeaders: ctx.headers.default,\n environment: ctx.environment.environment,\n exampleName: item.exampleKey,\n globalCookies,\n method: item.method,\n operation: ctx.operation,\n path: item.path,\n proxyUrl: ctx.proxy.url ?? '',\n server: ctx.servers.selected,\n selectedSecuritySchemes: ctx.security.selectedSchemes,\n isElectron: isElectron(),\n })\n }\n\n const run = async () => {\n if (isRunning.value || !document || selectedOrder.value.length === 0) {\n return\n }\n\n isRunning.value = true\n hasRunCompleted.value = false\n runLoader.start()\n runResults.value = []\n currentRunIndex.value = 0\n runStartTime.value = performance.now()\n runEndTime.value = null\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Run each item in the selected order\n for (let i = 0; i < selectedOrder.value.length; i++) {\n currentRunIndex.value = i + 1\n const item = selectedOrder.value[i]!\n\n // Create a run result for the current item\n const runResult: RunResult = {\n item,\n result: null,\n error: null,\n testResults: [],\n }\n\n try {\n const contextResult = getContext(item)\n\n if (!contextResult.ok) {\n runResult.error = new Error(contextResult.error)\n runResults.value = [...runResults.value, runResult]\n continue\n }\n\n const { request: requestBuilder } = getRequestFactory(contextResult.data, item)\n\n const preRequestScript = getScript(document['x-pre-request'], contextResult.data.operation['x-pre-request'])\n await executePreRequestScript(preRequestScript, {\n requestBuilder,\n variablesStore,\n onTestResultsUpdate: (newResults) => {\n runResult.testResults = [...newResults]\n },\n })\n\n const envVariables = {\n ...getEnvironmentVariables(contextResult.data.environment.environment),\n ...variablesStore.getVariables(),\n }\n\n const requestResult = await tryCatch(() => {\n return buildRequest(requestBuilder, { envVariables })\n })\n\n if (!requestResult.ok) {\n runResult.error = new Error(requestResult.error)\n runResults.value = [...runResults.value, runResult]\n continue\n }\n\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.data.isUsingProxy,\n request: requestResult.data.request,\n })\n\n if (sendError) {\n runResult.error = sendError\n runResults.value = [...runResults.value, runResult]\n continue\n }\n\n runResult.result = sendResult.response\n\n const postResponseScript = getScript(\n document['x-post-response'],\n contextResult.data.operation['x-post-response'],\n )\n\n const preRequestResults = [...runResult.testResults]\n await executePostResponseScript(postResponseScript, {\n requestBuilder,\n response: sendResult.originalResponse.clone(),\n variablesStore,\n onTestResultsUpdate: (postResponseResults) => {\n runResult.testResults = [...preRequestResults, ...postResponseResults]\n },\n })\n\n runResults.value = [...runResults.value, runResult]\n\n const hasTestFailure = runResult.testResults.some((t) => !t.passed)\n if (hasTestFailure) {\n break\n }\n } catch (error) {\n runResult.error = error instanceof Error ? error : new Error(String(error))\n runResults.value = [...runResults.value, runResult]\n break\n }\n }\n\n isRunning.value = false\n hasRunCompleted.value = true\n runEndTime.value = performance.now()\n void runLoader.clear()\n currentRunIndex.value = null\n }\n\n return {\n isRunning,\n hasRunCompleted,\n currentRunIndex,\n runLoader,\n runResults,\n runSummary,\n run,\n rerun,\n clearResults,\n getResultAtIndex,\n isResultPassed,\n isResultSkipped,\n getFailedTests,\n }\n}\n"],"mappings":";;;;;;;;;;;;AA0FA,SAAgB,mBAAmB,EACjC,gBACA,UACA,cACA,OACA,iBACsD;CACtD,MAAM,YAAY,IAAI,MAAM;CAC5B,MAAM,kBAAkB,IAAI,MAAM;CAClC,MAAM,kBAAkB,IAAmB,KAAK;CAChD,MAAM,YAAY,iBAAiB;CACnC,MAAM,aAAa,IAAiB,EAAE,CAAC;CACvC,MAAM,eAAe,IAAmB,KAAK;CAC7C,MAAM,aAAa,IAAmB,KAAK;CAE3C,MAAM,aAAa,eAAkC;AACnD,MAAI,WAAW,MAAM,WAAW,KAAK,CAAC,gBAAgB,MACpD,QAAO;EAET,MAAM,MAAM,WAAW,MAAM;EAC7B,MAAM,QAAQ,cAAc,MAAM;EAClC,MAAM,SAAS,WAAW,M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;MACrD;AAEF,QAAI,CAAC,cAAc,IAAI;AACrB,eAAU,QAAQ,IAAI,MAAM,cAAc,MAAM;AAChD,gBAAW,QAAQ,CAAC,GAAG,WAAW,OAAO,UAAU;AACnD;;IAGF,MAAM,CAAC,WAAW,cAAc,MAAM,YAAY;KAChD,cAAc,cAAc,KAAK;KACjC,SAAS,cAAc,KAAK;KAC7B,CAAC;AAEF,QAAI,WAAW;AACb,eAAU,QAAQ;AAClB,gBAAW,QAAQ,CAAC,GAAG,WAAW,OAAO,UAAU;AACnD;;AAGF,cAAU,SAAS,WAAW;IAE9B,MAAM,qBAAqB,UACzB,SAAS,oBACT,cAAc,KAAK,UAAU,mBAC9B;IAED,MAAM,oBAAoB,CAAC,GAAG,UAAU,YAAY;AACpD,UAAM,0BAA0B,oBAAoB;KAClD;KACA,UAAU,WAAW,iBAAiB,OAAO;KAC7C;KACA,sBAAsB,wBAAwB;AAC5C,gBAAU,cAAc,CAAC,GAAG,mBAAmB,GAAG,oBAAoB;;KAEzE,CAAC;AAEF,eAAW,QAAQ,CAAC,GAAG,WAAW,OAAO,UAAU;AAGnD,QADuB,UAAU,YAAY,MAAM,MAAM,CAAC,EAAE,OAAO,CAEjE;YAEK,OAAO;AACd,cAAU,QAAQ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;AAC3E,eAAW,QAAQ,CAAC,GAAG,WAAW,OAAO,UAAU;AACnD;;;AAIJ,YAAU,QAAQ;AAClB,kBAAgB,QAAQ;AACxB,aAAW,QAAQ,YAAY,KAAK;AAC/B,YAAU,OAAO;AACtB,kBAAgB,QAAQ;;AAG1B,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"use-runner-execution.js","names":[],"sources":["../../../../../../../src/v2/features/collection/components/Runner/hooks/use-runner-execution.ts"],"sourcesContent":["import { useLoadingState } from '@scalar/components'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { executePostResponseScript, executePreRequestScript, getScript } from '@scalar/pre-post-request-scripts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport {\n type BuildRequestExampleContext,\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n getRequestExampleContext,\n requestFactory,\n} from '@scalar/workspace-store/request-example'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { type ComputedRef, type Ref, computed, ref } from 'vue'\n\nimport { type CustomFetch, type ResponseInstance, sendRequest } from '@/v2/blocks/operation-block/helpers/send-request'\nimport { APP_VERSION } from '@/v2/constants'\nimport { tryCatch } from '@/v2/helpers/safe-run'\n\nimport type { SelectedItem } from './use-runner-selection'\n\nexport type TestResult = {\n title: string\n passed: boolean\n duration: number\n error?: string\n status: 'pending' | 'passed' | 'failed'\n}\n\nexport type RunResult = {\n item: SelectedItem\n result: ResponseInstance | null\n error: Error | null\n testResults: TestResult[]\n}\n\nexport type RunSummary = {\n total: number\n passed: number\n failed: number\n skipped: number\n duration: number | null\n allPassed: boolean\n}\n\ntype UseRunnerExecutionOptions = {\n /** Workspace store */\n workspaceStore: WorkspaceStore\n /** Document */\n document: OpenApiDocument | null\n /** Document name */\n documentName: string\n /** Whether the layout is web */\n isWeb: boolean\n /** Ordered list of selected items to run */\n selectedOrder: ComputedRef<SelectedItem[]>\n /** Optional custom fetch implementation, overrides the global fetch for request execution */\n customFetch?: CustomFetch\n}\n\ntype UseRunnerExecutionReturn = {\n /** Whether a run is currently in progress */\n isRunning: Ref<boolean>\n /** Whether a run has completed */\n hasRunCompleted: Ref<boolean>\n /** Current index being run (1-based) */\n currentRunIndex: Ref<number | null>\n /** Loading state for the run button */\n runLoader: ReturnType<typeof useLoadingState>\n /** Results from the run */\n runResults: Ref<RunResult[]>\n /** Summary of the run results */\n runSummary: ComputedRef<RunSummary | null>\n /** Start running the selected items */\n run: () => Promise<void>\n /** Clear results and run again */\n rerun: () => void\n /** Clear all results */\n clearResults: () => void\n /** Get the result at a specific index */\n getResultAtIndex: (index: number) => RunResult | null\n /** Check if a result passed */\n isResultPassed: (result: RunResult | null) => boolean\n /** Check if a result was skipped */\n isResultSkipped: (index: number) => boolean\n /** Get failed tests from a result */\n getFailedTests: (result: RunResult | null) => TestResult[]\n}\n\n/**\n * Composable for managing runner execution state and logic.\n */\nexport function useRunnerExecution({\n workspaceStore,\n document,\n documentName,\n isWeb,\n selectedOrder,\n customFetch,\n}: UseRunnerExecutionOptions): UseRunnerExecutionReturn {\n const isRunning = ref(false)\n const hasRunCompleted = ref(false)\n const currentRunIndex = ref<number | null>(null)\n const runLoader = useLoadingState()\n const runResults = ref<RunResult[]>([])\n const runStartTime = ref<number | null>(null)\n const runEndTime = ref<number | null>(null)\n\n const runSummary = computed<RunSummary | null>(() => {\n if (runResults.value.length === 0 && !hasRunCompleted.value) {\n return null\n }\n const ran = runResults.value.length\n const total = selectedOrder.value.length\n const passed = runResults.value.filter((r) => !r.error && r.testResults.every((t) => t.passed)).length\n const failed = ran - passed\n const skipped = total - ran\n const duration = runStartTime.value && runEndTime.value ? runEndTime.value - runStartTime.value : null\n const allPassed = failed === 0 && skipped === 0\n return { total, passed, failed, skipped, duration, allPassed }\n })\n\n const clearResults = () => {\n runResults.value = []\n hasRunCompleted.value = false\n runStartTime.value = null\n runEndTime.value = null\n }\n\n const rerun = () => {\n clearResults()\n void run()\n }\n\n const getResultAtIndex = (index: number): RunResult | null => {\n return runResults.value[index] ?? null\n }\n\n const isResultPassed = (result: RunResult | null): boolean => {\n if (!result) {\n return false\n }\n if (result.error) {\n return false\n }\n if (result.testResults.some((t) => !t.passed)) {\n return false\n }\n return true\n }\n\n const isResultSkipped = (index: number): boolean => {\n return hasRunCompleted.value && getResultAtIndex(index) === null\n }\n\n const getFailedTests = (result: RunResult | null): TestResult[] => {\n if (!result) {\n return []\n }\n return result.testResults.filter((t) => !t.passed)\n }\n\n const getContext = (item: SelectedItem) => {\n const contextResult = getRequestExampleContext(\n workspaceStore,\n documentName,\n { path: item.path, method: item.method, exampleName: item.exampleKey },\n {\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: isWeb ? 'web' : 'other',\n appVersion: APP_VERSION,\n },\n )\n\n return contextResult\n }\n\n const getRequestFactory = (ctx: BuildRequestExampleContext, item: SelectedItem) => {\n const globalCookies = [...ctx.cookies.workspace, ...ctx.cookies.document]\n return requestFactory({\n defaultHeaders: ctx.headers.default,\n environment: ctx.environment.environment,\n exampleName: item.exampleKey,\n globalCookies,\n method: item.method,\n operation: ctx.operation,\n path: item.path,\n proxyUrl: ctx.proxy.url ?? '',\n server: ctx.servers.selected,\n selectedSecuritySchemes: ctx.security.selectedSchemes,\n isElectron: isElectron(),\n })\n }\n\n const run = async () => {\n if (isRunning.value || !document || selectedOrder.value.length === 0) {\n return\n }\n\n isRunning.value = true\n hasRunCompleted.value = false\n runLoader.start()\n runResults.value = []\n currentRunIndex.value = 0\n runStartTime.value = performance.now()\n runEndTime.value = null\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Run each item in the selected order\n for (let i = 0; i < selectedOrder.value.length; i++) {\n currentRunIndex.value = i + 1\n const item = selectedOrder.value[i]!\n\n // Create a run result for the current item\n const runResult: RunResult = {\n item,\n result: null,\n error: null,\n testResults: [],\n }\n\n try {\n const contextResult = getContext(item)\n\n if (!contextResult.ok) {\n runResult.error = new Error(contextResult.error)\n runResults.value = [...runResults.value, runResult]\n continue\n }\n\n const { request: requestBuilder } = getRequestFactory(contextResult.data, item)\n\n const preRequestScript = getScript(document['x-pre-request'], contextResult.data.operation['x-pre-request'])\n await executePreRequestScript(preRequestScript, {\n requestBuilder,\n variablesStore,\n onTestResultsUpdate: (newResults) => {\n runResult.testResults = [...newResults]\n },\n })\n\n const envVariables = {\n ...getEnvironmentVariables(contextResult.data.environment.environment),\n ...variablesStore.getVariables(),\n }\n\n const requestResult = await tryCatch(() => {\n return buildRequest(requestBuilder, { envVariables })\n })\n\n if (!requestResult.ok) {\n runResult.error = new Error(requestResult.error)\n runResults.value = [...runResults.value, runResult]\n continue\n }\n\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.data.isUsingProxy,\n requestPayload: requestResult.data.requestPayload,\n customFetch,\n })\n\n if (sendError) {\n runResult.error = sendError\n runResults.value = [...runResults.value, runResult]\n continue\n }\n\n runResult.result = sendResult.response\n\n const postResponseScript = getScript(\n document['x-post-response'],\n contextResult.data.operation['x-post-response'],\n )\n\n const preRequestResults = [...runResult.testResults]\n await executePostResponseScript(postResponseScript, {\n requestBuilder,\n response: sendResult.originalResponse.clone(),\n variablesStore,\n onTestResultsUpdate: (postResponseResults) => {\n runResult.testResults = [...preRequestResults, ...postResponseResults]\n },\n })\n\n runResults.value = [...runResults.value, runResult]\n\n const hasTestFailure = runResult.testResults.some((t) => !t.passed)\n if (hasTestFailure) {\n break\n }\n } catch (error) {\n runResult.error = error instanceof Error ? error : new Error(String(error))\n runResults.value = [...runResults.value, runResult]\n break\n }\n }\n\n isRunning.value = false\n hasRunCompleted.value = true\n runEndTime.value = performance.now()\n void runLoader.clear()\n currentRunIndex.value = null\n }\n\n return {\n isRunning,\n hasRunCompleted,\n currentRunIndex,\n runLoader,\n runResults,\n runSummary,\n run,\n rerun,\n clearResults,\n getResultAtIndex,\n isResultPassed,\n isResultSkipped,\n getFailedTests,\n }\n}\n"],"mappings":";;;;;;;;;;;;AA4FA,SAAgB,mBAAmB,EACjC,gBACA,UACA,cACA,OACA,eACA,eACsD;CACtD,MAAM,YAAY,IAAI,MAAM;CAC5B,MAAM,kBAAkB,IAAI,MAAM;CAClC,MAAM,kBAAkB,IAAmB,KAAK;CAChD,MAAM,YAAY,iBAAiB;CACnC,MAAM,aAAa,IAAiB,EAAE,CAAC;CACvC,MAAM,eAAe,IAAmB,KAAK;CAC7C,MAAM,aAAa,IAAmB,KAAK;CAE3C,MAAM,aAAa,eAAkC;AACnD,MAAI,WAAW,MAAM,WAAW,KAAK,CAAC,gBAAgB,MACpD,QAAO;E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__PURE__ */ define
22
22
  fetchRegistryDocument: { type: Function },
23
23
  telemetry: { type: Boolean },
24
24
  onUpdateTelemetry: { type: Function },
25
+ options: {},
25
26
  collectionType: {}
26
27
  },
27
28
  setup(__props) {
@@ -1 +1 @@
1
- {"version":3,"file":"Scripts.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Scripts.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport DocumentScriptsEditors from '@/v2/features/collection/components/DocumentScriptsEditors.vue'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst { document, eventBus, collectionType } = defineProps<CollectionProps>()\n\nconst handleUpdateExtension = (payload: Record<string, unknown>) => {\n eventBus.emit('document:update:extension', payload)\n}\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Pre-request &amp; Post-response Scripts</template>\n <template #description>\n Scripts at the document level run for every request in this document.\n Operation-level scripts (in the request editor) run in addition to these.\n </template>\n <DocumentScriptsEditors\n :document=\"document\"\n @update:extension=\"handleUpdateExtension\" />\n </Section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA,MAAM,yBAAyB,YAAqC;AAClE,WAAA,SAAS,KAAK,6BAA6B,QAAO;;;UAKnC,QAAA,mBAAc,cAAA,WAAA,EAA7B,YASU,iBAAA,EAAA,KAAA,GAAA,EAAA;IARG,OAAK,cAAwC,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAvC,uCAAuC,GAAA,CAAA,EAAA,CAAA;IAC7C,aAAW,cAGtB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAHuB,qJAGvB,GAAA,CAAA,EAAA,CAAA;2BAG8C,CAF9C,YAE8C,gCAAA;KAD3C,UAAU,QAAA;KACV,sBAAkB"}
1
+ {"version":3,"file":"Scripts.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Scripts.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport DocumentScriptsEditors from '@/v2/features/collection/components/DocumentScriptsEditors.vue'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst { document, eventBus, collectionType } = defineProps<CollectionProps>()\n\nconst handleUpdateExtension = (payload: Record<string, unknown>) => {\n eventBus.emit('document:update:extension', payload)\n}\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Pre-request &amp; Post-response Scripts</template>\n <template #description>\n Scripts at the document level run for every request in this document.\n Operation-level scripts (in the request editor) run in addition to these.\n </template>\n <DocumentScriptsEditors\n :document=\"document\"\n @update:extension=\"handleUpdateExtension\" />\n </Section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA,MAAM,yBAAyB,YAAqC;AAClE,WAAA,SAAS,KAAK,6BAA6B,QAAO;;;UAKnC,QAAA,mBAAc,cAAA,WAAA,EAA7B,YASU,iBAAA,EAAA,KAAA,GAAA,EAAA;IARG,OAAK,cAAwC,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAvC,uCAAuC,GAAA,CAAA,EAAA,CAAA;IAC7C,aAAW,cAGtB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAHuB,qJAGvB,GAAA,CAAA,EAAA,CAAA;2BAG8C,CAF9C,YAE8C,gCAAA;KAD3C,UAAU,QAAA;KACV,sBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Servers.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Servers.vue"],"names":[],"mappings":"AAg0BA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Servers.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Servers.vue"],"names":[],"mappings":"AAm0BA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Servers.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Servers.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarMarkdown,\n ScalarModal,\n ScalarToggle,\n useModal,\n} from '@scalar/components'\nimport { debounce } from '@scalar/helpers/general/debounce'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { ScalarIconPlus, ScalarIconTrash } from '@scalar/icons'\nimport type { ServerMeta } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watchEffect } from 'vue'\n\nimport { ServerVariablesForm } from '@/components/Server'\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport Form from './Form.vue'\n\nconst { document, eventBus, collectionType, path, method } =\n defineProps<CollectionProps>()\n\nconst deleteModal = useModal()\nconst selectedServerIndex = ref<number>(-1)\n\nconst isOperation = computed(() => collectionType === 'operation')\n\nconst operation = computed(() => {\n if (!isOperation.value) {\n return null\n }\n // Operation not found\n if (!path || !isHttpMethod(method)) {\n return null\n }\n // Operation found, return the servers\n return getResolvedRef(document?.paths?.[path]?.[method])\n})\n\nconst useOperationServers = ref(false)\nwatchEffect(() => {\n useOperationServers.value = operation.value?.servers !== undefined\n})\n\n/** Grab the servers for the collection */\nconst servers = computed(() => {\n if (collectionType === 'operation' && operation.value) {\n return operation.value.servers ?? []\n }\n return document?.servers ?? []\n})\n\n/** Grab whichever server we are working on */\nconst selectedServer = computed(() => servers.value[selectedServerIndex.value])\n\n/** Meta for server events: document-level or operation-level based on collection type */\nconst serverMeta = computed<ServerMeta>(() => {\n if (collectionType === 'operation' && path && isHttpMethod(method)) {\n return { type: 'operation', path, method }\n }\n return { type: 'document' }\n})\n\n// Form field configuration\nconst FORM_OPTIONS = [\n {\n label: 'URL',\n key: 'url',\n placeholder: 'https://void.scalar.com',\n },\n {\n label: 'Description',\n key: 'description',\n placeholder: 'Production',\n lineWrapping: true,\n },\n]\n\n/** Opens the delete confirmation modal for a server */\nconst openDeleteModal = (index: number) => {\n selectedServerIndex.value = index\n deleteModal.show()\n}\n\n/** Closes the delete modal and resets the selected server */\nconst resetState = () => {\n deleteModal.hide()\n selectedServerIndex.value = -1\n}\n\n/** Handles server deletion */\nconst handleDeleteServer = () => {\n if (selectedServerIndex.value < 0) {\n return\n }\n\n eventBus.emit('server:delete:server', {\n index: selectedServerIndex.value,\n meta: serverMeta.value,\n })\n resetState()\n}\n\n/** Debounced execute function for server updates, keyed so we only debounce by server + key */\nconst { execute } = debounce({ delay: 328, maxWait: 1000 })\n\n/** Handles server property updates with debouncing */\nconst handleServerUpdate = (\n index: number,\n key: string,\n value: string | number,\n) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:server', {\n index,\n server: { [key]: value },\n meta: serverMeta.value,\n }),\n )\n\n/** Handles server variable updates with debouncing */\nconst handleVariableUpdate = (index: number, key: string, value: string) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: serverMeta.value,\n }),\n )\n\n/** Handles adding a new server */\nconst handleAddServer = () =>\n eventBus.emit('server:add:server', { meta: serverMeta.value })\n\n/**\n * Gets the display name for a server\n */\nconst getServerDisplayName = (server?: ServerObject, index = 0): string =>\n server?.description || `Server ${index + 1}`\n\n/** Handles toggling the operation servers */\nconst handleToggleOperationServers = (value: boolean) => {\n // Only toggle for operation collections\n if (serverMeta.value.type !== 'operation') {\n return\n }\n\n // update the operation servers\n useOperationServers.value = value\n\n if (value) {\n // Initialize the servers with an empty array so we will infer the servers from the operation\n return eventBus.emit('server:initialize:servers', {\n meta: serverMeta.value,\n })\n }\n return eventBus.emit('server:clear:servers', { meta: serverMeta.value })\n}\n</script>\n\n<template>\n <Section>\n <template #title>Servers</template>\n <template #description>\n <template v-if=\"isOperation\">\n <span class=\"block\">\n Override servers for this operation with the toggle.\n </span>\n <span class=\"mt-1 block\">\n <strong>On</strong> — Servers below apply only to this operation.\n </span>\n <span class=\"mt-1 block\">\n <strong>Off</strong> — Removes operation servers; this operation uses\n document or path servers from the OpenAPI spec.\n </span>\n <span class=\"text-c-3 mt-1 block\">\n Use <code class=\"font-code text-c-2\">{variables}</code> for dynamic\n URL parts.\n </span>\n </template>\n <template v-else>\n Add different base URLs for your API. Use\n <code class=\"font-code text-c-2\">{variables}</code> for dynamic parts.\n </template>\n </template>\n <!-- Operation Servers Toggle to use the operation servers instead of the document servers -->\n <template\n v-if=\"isOperation\"\n #actions>\n <div class=\"flex h-8 items-center\">\n <ScalarToggle\n class=\"w-4\"\n :modelValue=\"useOperationServers\"\n @update:modelValue=\"handleToggleOperationServers\" />\n </div>\n </template>\n\n <div :class=\"isOperation && !useOperationServers && 'cursor-not-allowed'\">\n <div\n class=\"flex flex-col gap-4\"\n :class=\"\n isOperation &&\n !useOperationServers &&\n 'pointer-events-none cursor-not-allowed opacity-50 mix-blend-luminosity'\n \">\n <!-- Server List -->\n <div class=\"flex flex-col gap-4\">\n <div\n v-for=\"(server, index) in servers\"\n :key=\"index\"\n class=\"rounded-lg border\">\n <!-- Server Header -->\n <div\n class=\"bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm\">\n <ScalarMarkdown\n v-if=\"server.description\"\n class=\"self-center\"\n :value=\"server.description\" />\n <span\n v-else\n class=\"self-center\">\n {{ getServerDisplayName(server, index) }}\n </span>\n <ScalarButton\n class=\"hover:bg-b-3 hover:text-c-1 h-fit p-1.25\"\n data-testid=\"delete-server-button\"\n variant=\"ghost\"\n @click=\"openDeleteModal(index)\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n </div>\n\n <!-- Server Variables Form -->\n <div\n class=\"divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm\">\n <Form\n :data=\"server\"\n :environment=\"environment\"\n :onUpdate=\"\n (key, value) => handleServerUpdate(index, key, value)\n \"\n :options=\"FORM_OPTIONS\" />\n <ServerVariablesForm\n v-if=\"server.variables\"\n :variables=\"server.variables\"\n @update:variable=\"\n (name, value) => handleVariableUpdate(index, name, value)\n \" />\n </div>\n </div>\n </div>\n\n <!-- Add Server Button -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"handleAddServer\">\n <ScalarIconPlus />\n <span>Add Server</span>\n </ScalarButton>\n </div>\n </div>\n </div>\n </Section>\n\n <!-- Delete Confirmation Modal -->\n <ScalarModal\n size=\"xxs\"\n :state=\"deleteModal\"\n :title=\"`Delete ${getServerDisplayName(selectedServer, selectedServerIndex)}`\">\n <DeleteSidebarListElement\n variableName=\"Server\"\n warningMessage=\"Are you sure you want to delete this server? This action cannot be undone.\"\n @close=\"resetState\"\n @delete=\"handleDeleteServer\" />\n </ScalarModal>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Servers.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Servers.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarMarkdown,\n ScalarModal,\n ScalarToggle,\n useModal,\n} from '@scalar/components'\nimport { debounce } from '@scalar/helpers/general/debounce'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { ScalarIconPlus, ScalarIconTrash } from '@scalar/icons'\nimport type { ServerMeta } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watchEffect } from 'vue'\n\nimport { ServerVariablesForm } from '@/components/Server'\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport Form from './Form.vue'\n\nconst { document, eventBus, collectionType, path, method } =\n defineProps<CollectionProps>()\n\nconst deleteModal = useModal()\nconst selectedServerIndex = ref<number>(-1)\n\nconst isOperation = computed(() => collectionType === 'operation')\n\nconst operation = computed(() => {\n if (!isOperation.value) {\n return null\n }\n // Operation not found\n if (!path || !isHttpMethod(method)) {\n return null\n }\n // Operation found, return the servers\n return getResolvedRef(document?.paths?.[path]?.[method])\n})\n\nconst useOperationServers = ref(false)\nwatchEffect(() => {\n useOperationServers.value = operation.value?.servers !== undefined\n})\n\n/** Grab the servers for the collection */\nconst servers = computed(() => {\n if (collectionType === 'operation' && operation.value) {\n return operation.value.servers ?? []\n }\n return document?.servers ?? []\n})\n\n/** Grab whichever server we are working on */\nconst selectedServer = computed(() => servers.value[selectedServerIndex.value])\n\n/** Meta for server events: document-level or operation-level based on collection type */\nconst serverMeta = computed<ServerMeta>(() => {\n if (collectionType === 'operation' && path && isHttpMethod(method)) {\n return { type: 'operation', path, method }\n }\n return { type: 'document' }\n})\n\n// Form field configuration\nconst FORM_OPTIONS = [\n {\n label: 'URL',\n key: 'url',\n placeholder: 'https://void.scalar.com',\n },\n {\n label: 'Description',\n key: 'description',\n placeholder: 'Production',\n lineWrapping: true,\n },\n]\n\n/** Opens the delete confirmation modal for a server */\nconst openDeleteModal = (index: number) => {\n selectedServerIndex.value = index\n deleteModal.show()\n}\n\n/** Closes the delete modal and resets the selected server */\nconst resetState = () => {\n deleteModal.hide()\n selectedServerIndex.value = -1\n}\n\n/** Handles server deletion */\nconst handleDeleteServer = () => {\n if (selectedServerIndex.value < 0) {\n return\n }\n\n eventBus.emit('server:delete:server', {\n index: selectedServerIndex.value,\n meta: serverMeta.value,\n })\n resetState()\n}\n\n/** Debounced execute function for server updates, keyed so we only debounce by server + key */\nconst { execute } = debounce({ delay: 328, maxWait: 1000 })\n\n/** Handles server property updates with debouncing */\nconst handleServerUpdate = (\n index: number,\n key: string,\n value: string | number,\n) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:server', {\n index,\n server: { [key]: value },\n meta: serverMeta.value,\n }),\n )\n\n/** Handles server variable updates with debouncing */\nconst handleVariableUpdate = (index: number, key: string, value: string) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: serverMeta.value,\n }),\n )\n\n/** Handles adding a new server */\nconst handleAddServer = () =>\n eventBus.emit('server:add:server', { meta: serverMeta.value })\n\n/**\n * Gets the display name for a server\n */\nconst getServerDisplayName = (server?: ServerObject, index = 0): string =>\n server?.description || `Server ${index + 1}`\n\n/** Handles toggling the operation servers */\nconst handleToggleOperationServers = (value: boolean) => {\n // Only toggle for operation collections\n if (serverMeta.value.type !== 'operation') {\n return\n }\n\n // update the operation servers\n useOperationServers.value = value\n\n if (value) {\n // Initialize the servers with an empty array so we will infer the servers from the operation\n return eventBus.emit('server:initialize:servers', {\n meta: serverMeta.value,\n })\n }\n return eventBus.emit('server:clear:servers', { meta: serverMeta.value })\n}\n</script>\n\n<template>\n <Section>\n <template #title>Servers</template>\n <template #description>\n <template v-if=\"isOperation\">\n <span class=\"block\">\n Override servers for this operation with the toggle.\n </span>\n <span class=\"mt-1 block\">\n <strong>On</strong> — Servers below apply only to this operation.\n </span>\n <span class=\"mt-1 block\">\n <strong>Off</strong> — Removes operation servers; this operation uses\n document or path servers from the OpenAPI spec.\n </span>\n <span class=\"text-c-3 mt-1 block\">\n Use <code class=\"font-code text-c-2\">{variables}</code> for dynamic\n URL parts.\n </span>\n </template>\n <template v-else>\n Add different base URLs for your API. Use\n <code class=\"font-code text-c-2\">{variables}</code> for dynamic parts.\n </template>\n </template>\n <!-- Operation Servers Toggle to use the operation servers instead of the document servers -->\n <template\n v-if=\"isOperation\"\n #actions>\n <div class=\"flex h-8 items-center\">\n <ScalarToggle\n class=\"w-4\"\n :modelValue=\"useOperationServers\"\n @update:modelValue=\"handleToggleOperationServers\" />\n </div>\n </template>\n\n <div :class=\"isOperation && !useOperationServers && 'cursor-not-allowed'\">\n <div\n class=\"flex flex-col gap-4\"\n :class=\"\n isOperation &&\n !useOperationServers &&\n 'pointer-events-none cursor-not-allowed opacity-50 mix-blend-luminosity'\n \">\n <!-- Server List -->\n <div class=\"flex flex-col gap-4\">\n <div\n v-for=\"(server, index) in servers\"\n :key=\"index\"\n class=\"rounded-lg border\">\n <!-- Server Header -->\n <div\n class=\"bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm\">\n <ScalarMarkdown\n v-if=\"server.description\"\n class=\"self-center\"\n :value=\"server.description\" />\n <span\n v-else\n class=\"self-center\">\n {{ getServerDisplayName(server, index) }}\n </span>\n <ScalarButton\n class=\"hover:bg-b-3 hover:text-c-1 h-fit p-1.25\"\n data-testid=\"delete-server-button\"\n variant=\"ghost\"\n @click=\"openDeleteModal(index)\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n </div>\n\n <!-- Server Variables Form -->\n <div\n class=\"divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm\">\n <Form\n :data=\"server\"\n :environment=\"environment\"\n :onUpdate=\"\n (key, value) => handleServerUpdate(index, key, value)\n \"\n :options=\"FORM_OPTIONS\"\n :withFakeData=\"false\" />\n <ServerVariablesForm\n v-if=\"server.variables\"\n :variables=\"server.variables\"\n @update:variable=\"\n (name, value) => handleVariableUpdate(index, name, value)\n \" />\n </div>\n </div>\n </div>\n\n <!-- Add Server Button -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"handleAddServer\">\n <ScalarIconPlus />\n <span>Add Server</span>\n </ScalarButton>\n </div>\n </div>\n </div>\n </Section>\n\n <!-- Delete Confirmation Modal -->\n <ScalarModal\n size=\"xxs\"\n :state=\"deleteModal\"\n :title=\"`Delete ${getServerDisplayName(selectedServer, selectedServerIndex)}`\">\n <DeleteSidebarListElement\n variableName=\"Server\"\n warningMessage=\"Are you sure you want to delete this server? This action cannot be undone.\"\n @close=\"resetState\"\n @delete=\"handleDeleteServer\" />\n </ScalarModal>\n</template>\n"],"mappings":""}
@@ -38,6 +38,7 @@ var Servers_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
38
38
  fetchRegistryDocument: { type: Function },
39
39
  telemetry: { type: Boolean },
40
40
  onUpdateTelemetry: { type: Function },
41
+ options: {},
41
42
  collectionType: {}
42
43
  },
43
44
  setup(__props) {
@@ -166,7 +167,8 @@ var Servers_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
166
167
  data: server,
167
168
  environment: __props.environment,
168
169
  onUpdate: (key, value) => handleServerUpdate(index, key, value),
169
- options: FORM_OPTIONS
170
+ options: FORM_OPTIONS,
171
+ withFakeData: false
170
172
  }, null, 8, [
171
173
  "data",
172
174
  "environment",
@@ -1 +1 @@
1
- {"version":3,"file":"Servers.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Servers.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarMarkdown,\n ScalarModal,\n ScalarToggle,\n useModal,\n} from '@scalar/components'\nimport { debounce } from '@scalar/helpers/general/debounce'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { ScalarIconPlus, ScalarIconTrash } from '@scalar/icons'\nimport type { ServerMeta } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watchEffect } from 'vue'\n\nimport { ServerVariablesForm } from '@/components/Server'\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport Form from './Form.vue'\n\nconst { document, eventBus, collectionType, path, method } =\n defineProps<CollectionProps>()\n\nconst deleteModal = useModal()\nconst selectedServerIndex = ref<number>(-1)\n\nconst isOperation = computed(() => collectionType === 'operation')\n\nconst operation = computed(() => {\n if (!isOperation.value) {\n return null\n }\n // Operation not found\n if (!path || !isHttpMethod(method)) {\n return null\n }\n // Operation found, return the servers\n return getResolvedRef(document?.paths?.[path]?.[method])\n})\n\nconst useOperationServers = ref(false)\nwatchEffect(() => {\n useOperationServers.value = operation.value?.servers !== undefined\n})\n\n/** Grab the servers for the collection */\nconst servers = computed(() => {\n if (collectionType === 'operation' && operation.value) {\n return operation.value.servers ?? []\n }\n return document?.servers ?? []\n})\n\n/** Grab whichever server we are working on */\nconst selectedServer = computed(() => servers.value[selectedServerIndex.value])\n\n/** Meta for server events: document-level or operation-level based on collection type */\nconst serverMeta = computed<ServerMeta>(() => {\n if (collectionType === 'operation' && path && isHttpMethod(method)) {\n return { type: 'operation', path, method }\n }\n return { type: 'document' }\n})\n\n// Form field configuration\nconst FORM_OPTIONS = [\n {\n label: 'URL',\n key: 'url',\n placeholder: 'https://void.scalar.com',\n },\n {\n label: 'Description',\n key: 'description',\n placeholder: 'Production',\n lineWrapping: true,\n },\n]\n\n/** Opens the delete confirmation modal for a server */\nconst openDeleteModal = (index: number) => {\n selectedServerIndex.value = index\n deleteModal.show()\n}\n\n/** Closes the delete modal and resets the selected server */\nconst resetState = () => {\n deleteModal.hide()\n selectedServerIndex.value = -1\n}\n\n/** Handles server deletion */\nconst handleDeleteServer = () => {\n if (selectedServerIndex.value < 0) {\n return\n }\n\n eventBus.emit('server:delete:server', {\n index: selectedServerIndex.value,\n meta: serverMeta.value,\n })\n resetState()\n}\n\n/** Debounced execute function for server updates, keyed so we only debounce by server + key */\nconst { execute } = debounce({ delay: 328, maxWait: 1000 })\n\n/** Handles server property updates with debouncing */\nconst handleServerUpdate = (\n index: number,\n key: string,\n value: string | number,\n) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:server', {\n index,\n server: { [key]: value },\n meta: serverMeta.value,\n }),\n )\n\n/** Handles server variable updates with debouncing */\nconst handleVariableUpdate = (index: number, key: string, value: string) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: serverMeta.value,\n }),\n )\n\n/** Handles adding a new server */\nconst handleAddServer = () =>\n eventBus.emit('server:add:server', { meta: serverMeta.value })\n\n/**\n * Gets the display name for a server\n */\nconst getServerDisplayName = (server?: ServerObject, index = 0): string =>\n server?.description || `Server ${index + 1}`\n\n/** Handles toggling the operation servers */\nconst handleToggleOperationServers = (value: boolean) => {\n // Only toggle for operation collections\n if (serverMeta.value.type !== 'operation') {\n return\n }\n\n // update the operation servers\n useOperationServers.value = value\n\n if (value) {\n // Initialize the servers with an empty array so we will infer the servers from the operation\n return eventBus.emit('server:initialize:servers', {\n meta: serverMeta.value,\n })\n }\n return eventBus.emit('server:clear:servers', { meta: serverMeta.value })\n}\n</script>\n\n<template>\n <Section>\n <template #title>Servers</template>\n <template #description>\n <template v-if=\"isOperation\">\n <span class=\"block\">\n Override servers for this operation with the toggle.\n </span>\n <span class=\"mt-1 block\">\n <strong>On</strong> — Servers below apply only to this operation.\n </span>\n <span class=\"mt-1 block\">\n <strong>Off</strong> — Removes operation servers; this operation uses\n document or path servers from the OpenAPI spec.\n </span>\n <span class=\"text-c-3 mt-1 block\">\n Use <code class=\"font-code text-c-2\">{variables}</code> for dynamic\n URL parts.\n </span>\n </template>\n <template v-else>\n Add different base URLs for your API. Use\n <code class=\"font-code text-c-2\">{variables}</code> for dynamic parts.\n </template>\n </template>\n <!-- Operation Servers Toggle to use the operation servers instead of the document servers -->\n <template\n v-if=\"isOperation\"\n #actions>\n <div class=\"flex h-8 items-center\">\n <ScalarToggle\n class=\"w-4\"\n :modelValue=\"useOperationServers\"\n @update:modelValue=\"handleToggleOperationServers\" />\n </div>\n </template>\n\n <div :class=\"isOperation && !useOperationServers && 'cursor-not-allowed'\">\n <div\n class=\"flex flex-col gap-4\"\n :class=\"\n isOperation &&\n !useOperationServers &&\n 'pointer-events-none cursor-not-allowed opacity-50 mix-blend-luminosity'\n \">\n <!-- Server List -->\n <div class=\"flex flex-col gap-4\">\n <div\n v-for=\"(server, index) in servers\"\n :key=\"index\"\n class=\"rounded-lg border\">\n <!-- Server Header -->\n <div\n class=\"bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm\">\n <ScalarMarkdown\n v-if=\"server.description\"\n class=\"self-center\"\n :value=\"server.description\" />\n <span\n v-else\n class=\"self-center\">\n {{ getServerDisplayName(server, index) }}\n </span>\n <ScalarButton\n class=\"hover:bg-b-3 hover:text-c-1 h-fit p-1.25\"\n data-testid=\"delete-server-button\"\n variant=\"ghost\"\n @click=\"openDeleteModal(index)\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n </div>\n\n <!-- Server Variables Form -->\n <div\n class=\"divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm\">\n <Form\n :data=\"server\"\n :environment=\"environment\"\n :onUpdate=\"\n (key, value) => handleServerUpdate(index, key, value)\n \"\n :options=\"FORM_OPTIONS\" />\n <ServerVariablesForm\n v-if=\"server.variables\"\n :variables=\"server.variables\"\n @update:variable=\"\n (name, value) => handleVariableUpdate(index, name, value)\n \" />\n </div>\n </div>\n </div>\n\n <!-- Add Server Button -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"handleAddServer\">\n <ScalarIconPlus />\n <span>Add Server</span>\n </ScalarButton>\n </div>\n </div>\n </div>\n </Section>\n\n <!-- Delete Confirmation Modal -->\n <ScalarModal\n size=\"xxs\"\n :state=\"deleteModal\"\n :title=\"`Delete ${getServerDisplayName(selectedServer, selectedServerIndex)}`\">\n <DeleteSidebarListElement\n variableName=\"Server\"\n warningMessage=\"Are you sure you want to delete this server? This action cannot be undone.\"\n @close=\"resetState\"\n @delete=\"handleDeleteServer\" />\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,cAAc,UAAS;EAC7B,MAAM,sBAAsB,IAAY,GAAE;EAE1C,MAAM,cAAc,eAAe,QAAA,mBAAmB,YAAW;EAEjE,MAAM,YAAY,eAAe;AAC/B,OAAI,CAAC,YAAY,MACf,QAAO;AAGT,OAAI,CAAC,QAAA,QAAQ,CAAC,aAAa,QAAA,OAAO,CAChC,QAAO;AAGT,UAAO,eAAe,QAAA,UAAU,QAAQ,QAAA,QAAQ,QAAA,QAAO;IACxD;EAED,MAAM,sBAAsB,IAAI,MAAK;AACrC,oBAAkB;AAChB,uBAAoB,QAAQ,UAAU,OAAO,YAAY,KAAA;IAC1D;;EAGD,MAAM,UAAU,eAAe;AAC7B,OAAI,QAAA,mBAAmB,eAAe,UAAU,MAC9C,QAAO,UAAU,MAAM,WAAW,EAAC;AAErC,UAAO,QAAA,UAAU,WAAW,EAAC;IAC9B;;EAGD,MAAM,iBAAiB,eAAe,QAAQ,MAAM,oBAAoB,OAAM;;EAG9E,MAAM,aAAa,eAA2B;AAC5C,OAAI,QAAA,mBAAmB,eAAe,QAAA,QAAQ,aAAa,QAAA,OAAO,CAChE,QAAO;IAAE,MAAM;IAAa,MAAG,QAAA;IAAG,QAAK,QAAA;IAAE;AAE3C,UAAO,EAAE,MAAM,YAAW;IAC3B;EAGD,MAAM,eAAe,CACnB;GACE,OAAO;GACP,KAAK;GACL,aAAa;GACd,EACD;GACE,OAAO;GACP,KAAK;GACL,aAAa;GACb,cAAc;GACf,CACH;;EAG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AAA;MALb,OAAM;MACN,eAAY;MACZ,SAAQ;MACP,UAAK,WAAE,gBAAgB,MAAK;;6BACO,CAApC,YAAoC,MAAA,gBAAA,EAAA,EAAnB,OAAM,YAAU,CAAA,CAAA,CAAA;;2BAKrC,mBAeM,OAfN,YAeM,CAbJ,YAM4B,cAAA;MALzB,MAAM;MACN,aAAa,QAAA;MACb,WAA8B,KAAK,UAAU,mBAAmB,OAAO,KAAK,MAAK;MAGjF,SAAS;;;;;SAEJ,OAAO,aAAA,WAAA,EADf,YAKM,MAAA,4BAAA,EAAA;;MAHH,WAAW,OAAO;MAClB,sBAAqC,MAAM,UAAU,qBAAqB,OAAO,MAAM,MAAK;;iBAQrG,mBAUM,OAVN,YAUM,CARJ,YAOe,MAAA,aAAA,EAAA;KANb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAO;;4BACU,CAAlB,YAAkB,MAAA,eAAA,CAAA,EAAA,OAAA,OAAA,OAAA,KAClB,mBAAuB,QAAA,MAAjB,cAAU,GAAA,EAAA,CAAA;;;;OA1EhB,YAAA,QAAA;UACL;sBAMK,CALN,mBAKM,OALN,YAKM,CAJJ,YAGsD,MAAA,aAAA,EAAA;KAFpD,OAAM;KACL,YAAY,oBAAA;KACZ,uBAAmB;;;wBA4E5B,YASc,MAAA,YAAA,EAAA;IARZ,MAAK;IACJ,OAAO,MAAA,YAAW;IAClB,OAAK,UAAY,qBAAqB,eAAA,OAAgB,oBAAA,MAAmB;;2BAKzC,CAJjC,YAIiC,kCAAA;KAH/B,cAAa;KACb,gBAAe;KACd,SAAO;KACP,UAAQ"}
1
+ {"version":3,"file":"Servers.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Servers.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarMarkdown,\n ScalarModal,\n ScalarToggle,\n useModal,\n} from '@scalar/components'\nimport { debounce } from '@scalar/helpers/general/debounce'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { ScalarIconPlus, ScalarIconTrash } from '@scalar/icons'\nimport type { ServerMeta } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watchEffect } from 'vue'\n\nimport { ServerVariablesForm } from '@/components/Server'\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nimport Form from './Form.vue'\n\nconst { document, eventBus, collectionType, path, method } =\n defineProps<CollectionProps>()\n\nconst deleteModal = useModal()\nconst selectedServerIndex = ref<number>(-1)\n\nconst isOperation = computed(() => collectionType === 'operation')\n\nconst operation = computed(() => {\n if (!isOperation.value) {\n return null\n }\n // Operation not found\n if (!path || !isHttpMethod(method)) {\n return null\n }\n // Operation found, return the servers\n return getResolvedRef(document?.paths?.[path]?.[method])\n})\n\nconst useOperationServers = ref(false)\nwatchEffect(() => {\n useOperationServers.value = operation.value?.servers !== undefined\n})\n\n/** Grab the servers for the collection */\nconst servers = computed(() => {\n if (collectionType === 'operation' && operation.value) {\n return operation.value.servers ?? []\n }\n return document?.servers ?? []\n})\n\n/** Grab whichever server we are working on */\nconst selectedServer = computed(() => servers.value[selectedServerIndex.value])\n\n/** Meta for server events: document-level or operation-level based on collection type */\nconst serverMeta = computed<ServerMeta>(() => {\n if (collectionType === 'operation' && path && isHttpMethod(method)) {\n return { type: 'operation', path, method }\n }\n return { type: 'document' }\n})\n\n// Form field configuration\nconst FORM_OPTIONS = [\n {\n label: 'URL',\n key: 'url',\n placeholder: 'https://void.scalar.com',\n },\n {\n label: 'Description',\n key: 'description',\n placeholder: 'Production',\n lineWrapping: true,\n },\n]\n\n/** Opens the delete confirmation modal for a server */\nconst openDeleteModal = (index: number) => {\n selectedServerIndex.value = index\n deleteModal.show()\n}\n\n/** Closes the delete modal and resets the selected server */\nconst resetState = () => {\n deleteModal.hide()\n selectedServerIndex.value = -1\n}\n\n/** Handles server deletion */\nconst handleDeleteServer = () => {\n if (selectedServerIndex.value < 0) {\n return\n }\n\n eventBus.emit('server:delete:server', {\n index: selectedServerIndex.value,\n meta: serverMeta.value,\n })\n resetState()\n}\n\n/** Debounced execute function for server updates, keyed so we only debounce by server + key */\nconst { execute } = debounce({ delay: 328, maxWait: 1000 })\n\n/** Handles server property updates with debouncing */\nconst handleServerUpdate = (\n index: number,\n key: string,\n value: string | number,\n) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:server', {\n index,\n server: { [key]: value },\n meta: serverMeta.value,\n }),\n )\n\n/** Handles server variable updates with debouncing */\nconst handleVariableUpdate = (index: number, key: string, value: string) =>\n execute(`${index}-${key}-${serverMeta.value.type}`, () =>\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: serverMeta.value,\n }),\n )\n\n/** Handles adding a new server */\nconst handleAddServer = () =>\n eventBus.emit('server:add:server', { meta: serverMeta.value })\n\n/**\n * Gets the display name for a server\n */\nconst getServerDisplayName = (server?: ServerObject, index = 0): string =>\n server?.description || `Server ${index + 1}`\n\n/** Handles toggling the operation servers */\nconst handleToggleOperationServers = (value: boolean) => {\n // Only toggle for operation collections\n if (serverMeta.value.type !== 'operation') {\n return\n }\n\n // update the operation servers\n useOperationServers.value = value\n\n if (value) {\n // Initialize the servers with an empty array so we will infer the servers from the operation\n return eventBus.emit('server:initialize:servers', {\n meta: serverMeta.value,\n })\n }\n return eventBus.emit('server:clear:servers', { meta: serverMeta.value })\n}\n</script>\n\n<template>\n <Section>\n <template #title>Servers</template>\n <template #description>\n <template v-if=\"isOperation\">\n <span class=\"block\">\n Override servers for this operation with the toggle.\n </span>\n <span class=\"mt-1 block\">\n <strong>On</strong> — Servers below apply only to this operation.\n </span>\n <span class=\"mt-1 block\">\n <strong>Off</strong> — Removes operation servers; this operation uses\n document or path servers from the OpenAPI spec.\n </span>\n <span class=\"text-c-3 mt-1 block\">\n Use <code class=\"font-code text-c-2\">{variables}</code> for dynamic\n URL parts.\n </span>\n </template>\n <template v-else>\n Add different base URLs for your API. Use\n <code class=\"font-code text-c-2\">{variables}</code> for dynamic parts.\n </template>\n </template>\n <!-- Operation Servers Toggle to use the operation servers instead of the document servers -->\n <template\n v-if=\"isOperation\"\n #actions>\n <div class=\"flex h-8 items-center\">\n <ScalarToggle\n class=\"w-4\"\n :modelValue=\"useOperationServers\"\n @update:modelValue=\"handleToggleOperationServers\" />\n </div>\n </template>\n\n <div :class=\"isOperation && !useOperationServers && 'cursor-not-allowed'\">\n <div\n class=\"flex flex-col gap-4\"\n :class=\"\n isOperation &&\n !useOperationServers &&\n 'pointer-events-none cursor-not-allowed opacity-50 mix-blend-luminosity'\n \">\n <!-- Server List -->\n <div class=\"flex flex-col gap-4\">\n <div\n v-for=\"(server, index) in servers\"\n :key=\"index\"\n class=\"rounded-lg border\">\n <!-- Server Header -->\n <div\n class=\"bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm\">\n <ScalarMarkdown\n v-if=\"server.description\"\n class=\"self-center\"\n :value=\"server.description\" />\n <span\n v-else\n class=\"self-center\">\n {{ getServerDisplayName(server, index) }}\n </span>\n <ScalarButton\n class=\"hover:bg-b-3 hover:text-c-1 h-fit p-1.25\"\n data-testid=\"delete-server-button\"\n variant=\"ghost\"\n @click=\"openDeleteModal(index)\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n </div>\n\n <!-- Server Variables Form -->\n <div\n class=\"divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm\">\n <Form\n :data=\"server\"\n :environment=\"environment\"\n :onUpdate=\"\n (key, value) => handleServerUpdate(index, key, value)\n \"\n :options=\"FORM_OPTIONS\"\n :withFakeData=\"false\" />\n <ServerVariablesForm\n v-if=\"server.variables\"\n :variables=\"server.variables\"\n @update:variable=\"\n (name, value) => handleVariableUpdate(index, name, value)\n \" />\n </div>\n </div>\n </div>\n\n <!-- Add Server Button -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"handleAddServer\">\n <ScalarIconPlus />\n <span>Add Server</span>\n </ScalarButton>\n </div>\n </div>\n </div>\n </Section>\n\n <!-- Delete Confirmation Modal -->\n <ScalarModal\n size=\"xxs\"\n :state=\"deleteModal\"\n :title=\"`Delete ${getServerDisplayName(selectedServer, selectedServerIndex)}`\">\n <DeleteSidebarListElement\n variableName=\"Server\"\n warningMessage=\"Are you sure you want to delete this server? This action cannot be undone.\"\n @close=\"resetState\"\n @delete=\"handleDeleteServer\" />\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,cAAc,UAAS;EAC7B,MAAM,sBAAsB,IAAY,GAAE;EAE1C,MAAM,cAAc,eAAe,QAAA,mBAAmB,YAAW;EAEjE,MAAM,YAAY,eAAe;AAC/B,OAAI,CAAC,YAAY,MACf,QAAO;AAGT,OAAI,CAAC,QAAA,QAAQ,CAAC,aAAa,QAAA,OAAO,CAChC,QAAO;AAGT,UAAO,eAAe,QAAA,UAAU,QAAQ,QAAA,QAAQ,QAAA,QAAO;IACxD;EAED,MAAM,sBAAsB,IAAI,MAAK;AACrC,oBAAkB;AAChB,uBAAoB,QAAQ,UAAU,OAAO,YAAY,KAAA;IAC1D;;EAGD,MAAM,UAAU,eAAe;AAC7B,OAAI,QAAA,mBAAmB,eAAe,UAAU,MAC9C,QAAO,UAAU,MAAM,WAAW,EAAC;AAErC,UAAO,QAAA,UAAU,WAAW,EAAC;IAC9B;;EAGD,MAAM,iBAAiB,eAAe,QAAQ,MAAM,oBAAoB,OAAM;;EAG9E,MAAM,aAAa,eAA2B;AAC5C,OAAI,QAAA,mBAAmB,eAAe,QAAA,QAAQ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ACP,UAAQ"}
@@ -23,6 +23,7 @@ var Settings_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
23
23
  fetchRegistryDocument: { type: Function },
24
24
  telemetry: { type: Boolean },
25
25
  onUpdateTelemetry: { type: Function },
26
+ options: {},
26
27
  collectionType: {}
27
28
  },
28
29
  setup(__props) {