@scalar/api-client 3.3.1 → 3.4.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 (185) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/monacoeditorwork/yaml.worker.bundle.js +92 -79
  3. package/dist/style.css +87 -57
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +2 -0
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +5 -0
  8. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  9. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +4 -0
  10. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  12. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  13. package/dist/v2/blocks/operation-block/components/Header.vue.script.js +6 -0
  14. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  15. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts +2 -1
  16. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts.map +1 -1
  17. package/dist/v2/blocks/operation-block/helpers/response-cache.js +9 -2
  18. package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
  19. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  20. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
  21. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -2
  22. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -0
  23. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  24. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  25. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  26. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +84 -71
  27. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  28. package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.d.ts +13 -0
  29. package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.d.ts.map +1 -0
  30. package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js +28 -0
  31. package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js.map +1 -0
  32. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.d.ts +16 -0
  33. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.d.ts.map +1 -0
  34. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js +28 -0
  35. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -0
  36. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.d.ts +31 -0
  37. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.d.ts.map +1 -0
  38. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js +18 -0
  39. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js.map +1 -0
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  41. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  42. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  43. package/dist/v2/components/code-input/CodeInput.vue.script.js +1 -1
  44. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  45. package/dist/v2/constants.js +1 -1
  46. package/dist/v2/features/app/App.vue.d.ts +25 -1
  47. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  48. package/dist/v2/features/app/App.vue.js.map +1 -1
  49. package/dist/v2/features/app/App.vue.script.js +54 -39
  50. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  51. package/dist/v2/features/app/app-events.js +4 -4
  52. package/dist/v2/features/app/app-events.js.map +1 -1
  53. package/dist/v2/features/app/app-state.d.ts +20 -14
  54. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  55. package/dist/v2/features/app/app-state.js +89 -55
  56. package/dist/v2/features/app/app-state.js.map +1 -1
  57. package/dist/v2/features/app/components/AppHeader.vue.d.ts +26 -3
  58. package/dist/v2/features/app/components/AppHeader.vue.d.ts.map +1 -1
  59. package/dist/v2/features/app/components/AppHeader.vue.js.map +1 -1
  60. package/dist/v2/features/app/components/AppHeader.vue.script.js +15 -6
  61. package/dist/v2/features/app/components/AppHeader.vue.script.js.map +1 -1
  62. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
  63. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  64. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  65. package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
  66. package/dist/v2/features/app/components/AppSidebar.vue.script.js +86 -108
  67. package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
  68. package/dist/v2/features/app/components/CreateVersionModal.vue.d.ts +28 -0
  69. package/dist/v2/features/app/components/CreateVersionModal.vue.d.ts.map +1 -0
  70. package/dist/v2/features/app/components/CreateVersionModal.vue.js +7 -0
  71. package/dist/v2/features/app/components/CreateVersionModal.vue.js.map +1 -0
  72. package/dist/v2/features/app/components/CreateVersionModal.vue.script.js +84 -0
  73. package/dist/v2/features/app/components/CreateVersionModal.vue.script.js.map +1 -0
  74. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts +26 -0
  75. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts.map +1 -0
  76. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js +9 -0
  77. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js.map +1 -0
  78. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js +376 -0
  79. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js.map +1 -0
  80. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts +16 -0
  81. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts.map +1 -0
  82. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js +7 -0
  83. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js.map +1 -0
  84. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js +51 -0
  85. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js.map +1 -0
  86. package/dist/v2/features/app/components/SidebarDocument.vue.d.ts +45 -0
  87. package/dist/v2/features/app/components/SidebarDocument.vue.d.ts.map +1 -0
  88. package/dist/v2/features/app/components/SidebarDocument.vue.js +7 -0
  89. package/dist/v2/features/app/components/SidebarDocument.vue.js.map +1 -0
  90. package/dist/v2/features/app/components/SidebarDocument.vue.script.js +137 -0
  91. package/dist/v2/features/app/components/SidebarDocument.vue.script.js.map +1 -0
  92. package/dist/v2/features/app/helpers/check-version-conflict.d.ts +51 -0
  93. package/dist/v2/features/app/helpers/check-version-conflict.d.ts.map +1 -0
  94. package/dist/v2/features/app/helpers/check-version-conflict.js +79 -0
  95. package/dist/v2/features/app/helpers/check-version-conflict.js.map +1 -0
  96. package/dist/v2/features/app/helpers/compute-version-status.d.ts +45 -0
  97. package/dist/v2/features/app/helpers/compute-version-status.d.ts.map +1 -0
  98. package/dist/v2/features/app/helpers/compute-version-status.js +18 -0
  99. package/dist/v2/features/app/helpers/compute-version-status.js.map +1 -0
  100. package/dist/v2/features/app/helpers/create-draft-registry-document.d.ts +39 -0
  101. package/dist/v2/features/app/helpers/create-draft-registry-document.d.ts.map +1 -0
  102. package/dist/v2/features/app/helpers/create-draft-registry-document.js +64 -0
  103. package/dist/v2/features/app/helpers/create-draft-registry-document.js.map +1 -0
  104. package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +1 -1
  105. package/dist/v2/features/app/helpers/create-temp-operation.js +5 -8
  106. package/dist/v2/features/app/helpers/create-temp-operation.js.map +1 -1
  107. package/dist/v2/features/app/helpers/detect-document-conflicts.d.ts +26 -0
  108. package/dist/v2/features/app/helpers/detect-document-conflicts.d.ts.map +1 -0
  109. package/dist/v2/features/app/helpers/detect-document-conflicts.js +27 -0
  110. package/dist/v2/features/app/helpers/detect-document-conflicts.js.map +1 -0
  111. package/dist/v2/features/app/helpers/filter-workspaces.d.ts +14 -14
  112. package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -1
  113. package/dist/v2/features/app/helpers/filter-workspaces.js +15 -15
  114. package/dist/v2/features/app/helpers/filter-workspaces.js.map +1 -1
  115. package/dist/v2/features/app/helpers/group-workspaces.d.ts +23 -3
  116. package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -1
  117. package/dist/v2/features/app/helpers/group-workspaces.js +22 -7
  118. package/dist/v2/features/app/helpers/group-workspaces.js.map +1 -1
  119. package/dist/v2/features/app/helpers/load-registry-document.d.ts +16 -1
  120. package/dist/v2/features/app/helpers/load-registry-document.d.ts.map +1 -1
  121. package/dist/v2/features/app/helpers/load-registry-document.js +7 -6
  122. package/dist/v2/features/app/helpers/load-registry-document.js.map +1 -1
  123. package/dist/v2/features/app/helpers/routes.d.ts +5 -1
  124. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  125. package/dist/v2/features/app/helpers/routes.js +1 -1
  126. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  127. package/dist/v2/features/app/helpers/version-status-presentation.d.ts +24 -0
  128. package/dist/v2/features/app/helpers/version-status-presentation.d.ts.map +1 -0
  129. package/dist/v2/features/app/helpers/version-status-presentation.js +43 -0
  130. package/dist/v2/features/app/helpers/version-status-presentation.js.map +1 -0
  131. package/dist/v2/features/app/hooks/use-active-document-version.d.ts +41 -0
  132. package/dist/v2/features/app/hooks/use-active-document-version.d.ts.map +1 -0
  133. package/dist/v2/features/app/hooks/use-active-document-version.js +60 -0
  134. package/dist/v2/features/app/hooks/use-active-document-version.js.map +1 -0
  135. package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts +71 -23
  136. package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts.map +1 -1
  137. package/dist/v2/features/app/hooks/use-sidebar-documents.js +167 -45
  138. package/dist/v2/features/app/hooks/use-sidebar-documents.js.map +1 -1
  139. package/dist/v2/features/app/hooks/use-version-conflict-check.d.ts +35 -0
  140. package/dist/v2/features/app/hooks/use-version-conflict-check.d.ts.map +1 -0
  141. package/dist/v2/features/app/hooks/use-version-conflict-check.js +62 -0
  142. package/dist/v2/features/app/hooks/use-version-conflict-check.js.map +1 -0
  143. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  144. package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
  145. package/dist/v2/features/collection/DocumentCollection.vue.script.js +6 -1
  146. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  147. package/dist/v2/features/collection/OperationCollection.vue.script.js +1 -0
  148. package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
  149. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +1 -0
  150. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
  151. package/dist/v2/features/collection/components/Authentication.vue.script.js +1 -0
  152. package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
  153. package/dist/v2/features/collection/components/Cookies.vue.script.js +1 -0
  154. package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
  155. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +1 -0
  156. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
  157. package/dist/v2/features/collection/components/Environment.vue.script.js +1 -0
  158. package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
  159. package/dist/v2/features/collection/components/GetStarted.vue.d.ts +12 -4
  160. package/dist/v2/features/collection/components/GetStarted.vue.d.ts.map +1 -1
  161. package/dist/v2/features/collection/components/GetStarted.vue.js.map +1 -1
  162. package/dist/v2/features/collection/components/GetStarted.vue.script.js +56 -13
  163. package/dist/v2/features/collection/components/GetStarted.vue.script.js.map +1 -1
  164. package/dist/v2/features/collection/components/Overview.vue.script.js +1 -0
  165. package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
  166. package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js +1 -0
  167. package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js.map +1 -1
  168. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js +2 -2
  169. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js.map +1 -1
  170. package/dist/v2/features/collection/components/Scripts.vue.script.js +1 -0
  171. package/dist/v2/features/collection/components/Scripts.vue.script.js.map +1 -1
  172. package/dist/v2/features/collection/components/Servers.vue.script.js +1 -0
  173. package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
  174. package/dist/v2/features/collection/components/Settings.vue.script.js +1 -0
  175. package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
  176. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +1 -1
  177. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  178. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  179. package/dist/v2/features/operation/Operation.vue.script.js +3 -0
  180. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  181. package/dist/v2/helpers/safe-run.d.ts +25 -1
  182. package/dist/v2/helpers/safe-run.d.ts.map +1 -1
  183. package/dist/v2/helpers/safe-run.js +26 -2
  184. package/dist/v2/helpers/safe-run.js.map +1 -1
  185. package/package.json +12 -11
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Environment.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Environment variables section for the collection.\n * Renders document or workspace environments and lets users set variables\n * that can be referenced in request inputs via {{ variable }}.\n */\nexport default {\n name: 'Environment',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport { EnvironmentsList } from '@/v2/features/environments'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst { document, eventBus, collectionType, workspaceStore } =\n defineProps<CollectionProps>()\n\n/** Document or workspace environments */\nconst environments = computed(\n () =>\n (collectionType === 'document'\n ? document['x-scalar-environments']\n : workspaceStore.workspace['x-scalar-environments']) ?? {},\n)\n\nconst activeEnvironment = computed(() => {\n return workspaceStore.workspace['x-scalar-active-environment']\n})\n</script>\n\n<template>\n <Section v-if=\"collectionType !== 'operation'\">\n <template #title>Environment Variables</template>\n <template #description>\n Set environment variables at your collection level. Use\n <code\n v-pre\n class=\"font-code text-c-2\">\n {{ variable }}\n </code>\n to add / search among the selected environment's variables in your request\n inputs.\n </template>\n <EnvironmentsList\n :activeEnvironment\n :collectionType\n :environments\n :eventBus />\n </Section>\n</template>\n"],"mappings":";;;;CAOE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;EAeR,MAAM,eAAe,gBAEhB,QAAA,mBAAmB,aAChB,QAAA,SAAS,2BACT,QAAA,eAAe,UAAU,6BAA6B,EAAE,CAChE;EAEA,MAAM,oBAAoB,eAAe;AACvC,UAAO,QAAA,eAAe,UAAU;IACjC;;UAIgB,QAAA,mBAAc,eAAA,WAAA,EAA7B,YAiBU,iBAAA,EAAA,KAAA,GAAA,EAAA;IAhBG,OAAK,cAAsB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAArB,yBAAqB,GAAA,CAAA,EAAA,CAAA;IAC3B,aAAW,cAEpB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA;qBAFqB,6DAErB,GAAA;KAAA,mBAIO,QAAA,EAFL,OAAM,sBAAoB,EAAC,oBAE7B,GAAA;qBAAO,wFAGT,GAAA;;2BAKc,CAJd,YAIc,MAAA,yBAAA,EAAA;KAHX,mBAAA,kBAAA;KACA,gBAAA,QAAA;KACA,cAAA,aAAA;KACA,UAAA,QAAA"}
1
+ {"version":3,"file":"Environment.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Environment.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Environment variables section for the collection.\n * Renders document or workspace environments and lets users set variables\n * that can be referenced in request inputs via {{ variable }}.\n */\nexport default {\n name: 'Environment',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport { EnvironmentsList } from '@/v2/features/environments'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst { document, eventBus, collectionType, workspaceStore } =\n defineProps<CollectionProps>()\n\n/** Document or workspace environments */\nconst environments = computed(\n () =>\n (collectionType === 'document'\n ? document['x-scalar-environments']\n : workspaceStore.workspace['x-scalar-environments']) ?? {},\n)\n\nconst activeEnvironment = computed(() => {\n return workspaceStore.workspace['x-scalar-active-environment']\n})\n</script>\n\n<template>\n <Section v-if=\"collectionType !== 'operation'\">\n <template #title>Environment Variables</template>\n <template #description>\n Set environment variables at your collection level. Use\n <code\n v-pre\n class=\"font-code text-c-2\">\n {{ variable }}\n </code>\n to add / search among the selected environment's variables in your request\n inputs.\n </template>\n <EnvironmentsList\n :activeEnvironment\n :collectionType\n :environments\n :eventBus />\n </Section>\n</template>\n"],"mappings":";;;;CAOE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAeR,MAAM,eAAe,gBAEhB,QAAA,mBAAmB,aAChB,QAAA,SAAS,2BACT,QAAA,eAAe,UAAU,6BAA6B,EAAE,CAChE;EAEA,MAAM,oBAAoB,eAAe;AACvC,UAAO,QAAA,eAAe,UAAU;IACjC;;UAIgB,QAAA,mBAAc,eAAA,WAAA,EAA7B,YAiBU,iBAAA,EAAA,KAAA,GAAA,EAAA;IAhBG,OAAK,cAAsB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAArB,yBAAqB,GAAA,CAAA,EAAA,CAAA;IAC3B,aAAW,cAEpB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA;qBAFqB,6DAErB,GAAA;KAAA,mBAIO,QAAA,EAFL,OAAM,sBAAoB,EAAC,oBAE7B,GAAA;qBAAO,wFAGT,GAAA;;2BAKc,CAJd,YAIc,MAAA,yBAAA,EAAA;KAHX,mBAAA,kBAAA;KACA,gBAAA,QAAA;KACA,cAAA,aAAA;KACA,UAAA,QAAA"}
@@ -2,10 +2,18 @@ import type { RouteProps } from '../../../../v2/features/app/helpers/routes.js';
2
2
  /**
3
3
  * Workspace get started page.
4
4
  *
5
- * Shown as the landing view for a workspace with no request selected. Displays
6
- * an ASCII art mark and a short list of keyboard shortcuts to help the user
7
- * bootstrap their workspace (open the command palette, jump to settings, or
8
- * focus the sidebar filter).
5
+ * Shown as the landing view for a workspace with no request selected.
6
+ *
7
+ * On a local workspace it displays an ASCII art mark and a short list of
8
+ * keyboard shortcuts to help the user bootstrap their workspace (open the
9
+ * command palette, jump to settings, or focus the sidebar filter).
10
+ *
11
+ * On an empty team workspace it instead surfaces a focused "Create a
12
+ * Document" call-to-action: team workspaces are intended to back a real
13
+ * OpenAPI document and the registry, so the keyboard-shortcut helper would
14
+ * be a confusing first impression. The CTA reuses the command palette by
15
+ * opening its `create-openapi-document` action so the actual creation flow
16
+ * remains a single source of truth.
9
17
  */
10
18
  declare const _default: typeof __VLS_export;
11
19
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"GetStarted.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/GetStarted.vue"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAGlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSAwMd,CAAC"}
1
+ {"version":3,"file":"GetStarted.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/GetStarted.vue"],"names":[],"mappings":"AAuLA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAGlE;;;;;;;;;;;;;;;GAeG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSAqSd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"GetStarted.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/GetStarted.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Workspace get started page.\n *\n * Shown as the landing view for a workspace with no request selected. Displays\n * an ASCII art mark and a short list of keyboard shortcuts to help the user\n * bootstrap their workspace (open the command palette, jump to settings, or\n * focus the sidebar filter).\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarHotkey } from '@scalar/components'\nimport { ScalarIconDownloadSimple } from '@scalar/icons'\n\nimport Computer from '@/assets/computer.ascii?raw'\nimport ScalarAsciiArt from '@/components/ScalarAsciiArt.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\n\nconst { eventBus, layout } = defineProps<RouteProps>()\n\nconst openCommandPalette = () => {\n eventBus.emit('ui:open:command-palette')\n}\n\n/**\n * Open the contextual settings page. Emits the same event as the Cmd/Ctrl+I\n * hotkey so the workspace sidebar handles it uniformly: workspace-level\n * settings from this \"Get started\" screen, document-level settings when the\n * user is viewing a specific document. No `KeyboardEvent` is attached here\n * because the trigger is a click.\n */\nconst openSettings = () => {\n eventBus.emit('ui:open:settings')\n}\n\n/**\n * Open the contextual search affordance. Emits the same event as the Cmd/Ctrl+J\n * hotkey so the workspace sidebar handles it uniformly: the document filter\n * toggles on the workspace page and the search modal opens inside a document.\n * No `KeyboardEvent` is attached here because the trigger is a click.\n */\nconst focusSearch = () => {\n eventBus.emit('ui:focus:search')\n}\n</script>\n\n<template>\n <div class=\"flex h-full w-full flex-col items-center justify-center p-6\">\n <div class=\"flex flex-col items-stretch gap-10\">\n <ScalarAsciiArt\n :art=\"Computer\"\n class=\"text-c-3 self-center\" />\n\n <div class=\"text-c-2 flex flex-col gap-3 text-sm\">\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openCommandPalette\">\n <span>Get Started</span>\n <ScalarHotkey\n hotkey=\"K\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openSettings\">\n <span>Settings</span>\n <ScalarHotkey\n hotkey=\"I\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"focusSearch\">\n <span>Filter</span>\n <ScalarHotkey\n hotkey=\"J\"\n :modifier=\"['default']\" />\n </button>\n <!--\n Browser-only nudge to install the desktop app. Hidden in the desktop\n and modal layouts because the user is already running the native app\n (or embedded in a host page).\n -->\n <a\n v-if=\"layout === 'web'\"\n class=\"text-c-2 hover:text-c-1 flex w-full items-center justify-between gap-8\"\n href=\"https://scalar.com/download?utm_source=web_client&utm_medium=download_button&utm_campaign=topnav\"\n target=\"_blank\">\n <span>Download App</span>\n <ScalarIconDownloadSimple\n class=\"size-3.5\"\n weight=\"bold\" />\n </a>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"GetStarted.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/GetStarted.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Workspace get started page.\n *\n * Shown as the landing view for a workspace with no request selected.\n *\n * On a local workspace it displays an ASCII art mark and a short list of\n * keyboard shortcuts to help the user bootstrap their workspace (open the\n * command palette, jump to settings, or focus the sidebar filter).\n *\n * On an empty team workspace it instead surfaces a focused \"Create a\n * Document\" call-to-action: team workspaces are intended to back a real\n * OpenAPI document and the registry, so the keyboard-shortcut helper would\n * be a confusing first impression. The CTA reuses the command palette by\n * opening its `create-openapi-document` action so the actual creation flow\n * remains a single source of truth.\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton, ScalarHotkey } from '@scalar/components'\nimport {\n ScalarIconBracketsCurly,\n ScalarIconDownloadSimple,\n} from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport Computer from '@/assets/computer.ascii?raw'\nimport ScalarAsciiArt from '@/components/ScalarAsciiArt.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\n\nconst { eventBus, isTeamWorkspace, layout, workspaceStore } =\n defineProps<RouteProps>()\n\nconst openCommandPalette = () => {\n eventBus.emit('ui:open:command-palette')\n}\n\n/**\n * Open the contextual settings page. Emits the same event as the Cmd/Ctrl+I\n * hotkey so the workspace sidebar handles it uniformly: workspace-level\n * settings from this \"Get started\" screen, document-level settings when the\n * user is viewing a specific document. No `KeyboardEvent` is attached here\n * because the trigger is a click.\n */\nconst openSettings = () => {\n eventBus.emit('ui:open:settings')\n}\n\n/**\n * Open the contextual search affordance. Emits the same event as the Cmd/Ctrl+J\n * hotkey so the workspace sidebar handles it uniformly: the document filter\n * toggles on the workspace page and the search modal opens inside a document.\n * No `KeyboardEvent` is attached here because the trigger is a click.\n */\nconst focusSearch = () => {\n eventBus.emit('ui:focus:search')\n}\n\n/**\n * Open the command palette directly on the \"Create OpenAPI Document\" form.\n * The empty team workspace CTA delegates to this action so the create flow\n * stays in one place.\n */\nconst openCreateDocument = () => {\n eventBus.emit('ui:open:command-palette', {\n action: 'create-openapi-document',\n payload: undefined,\n })\n}\n\n/**\n * Whether the active workspace is a team workspace that has no real\n * documents yet. The auto-created `drafts` scratch document does not count\n * as content, so a workspace whose only entry is `drafts` is still treated\n * as empty.\n */\nconst isEmptyTeamWorkspace = computed(() => {\n if (!isTeamWorkspace) {\n return false\n }\n\n const documentNames = Object.keys(workspaceStore?.workspace?.documents ?? {})\n return documentNames.every((name) => name === 'drafts')\n})\n</script>\n\n<template>\n <div class=\"flex h-full w-full flex-col items-center justify-center p-6\">\n <!--\n Empty team workspace: surface a focused CTA pointing the user at the\n command palette's create-document flow rather than the local-workspace\n keyboard cheatsheet.\n -->\n <div\n v-if=\"isEmptyTeamWorkspace && isTeamWorkspace\"\n class=\"flex max-w-sm flex-col gap-4\">\n <ScalarIconBracketsCurly\n class=\"text-c-accent size-10\"\n weight=\"bold\" />\n <h2 class=\"text-c-1 text-base font-semibold\">Create a Document</h2>\n <p class=\"text-c-2 text-sm leading-relaxed\">\n The OpenAPI standard provides a descriptor of your API. Bringing it to\n our Registry allows you to manage, lint &amp; version your OpenAPI\n Documents. Create Docs &amp; SDKs from your OpenAPI Document.\n </p>\n <div>\n <ScalarButton\n class=\"mt-2\"\n @click=\"openCreateDocument\">\n Create Document\n </ScalarButton>\n </div>\n </div>\n\n <!-- Local workspace fallback: ASCII art mark and keyboard shortcuts. -->\n <div\n v-else\n class=\"flex flex-col items-stretch gap-10\">\n <ScalarAsciiArt\n :art=\"Computer\"\n class=\"text-c-3 self-center\" />\n\n <div class=\"text-c-2 flex flex-col gap-3 text-sm\">\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openCommandPalette\">\n <span>Get Started</span>\n <ScalarHotkey\n hotkey=\"K\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openSettings\">\n <span>Settings</span>\n <ScalarHotkey\n hotkey=\"I\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"focusSearch\">\n <span>Filter</span>\n <ScalarHotkey\n hotkey=\"J\"\n :modifier=\"['default']\" />\n </button>\n <!--\n Browser-only nudge to install the desktop app. Hidden in the desktop\n and modal layouts because the user is already running the native app\n (or embedded in a host page).\n -->\n <a\n v-if=\"layout === 'web'\"\n class=\"text-c-2 hover:text-c-1 flex w-full items-center justify-between gap-8\"\n href=\"https://scalar.com/download?utm_source=web_client&utm_medium=download_button&utm_campaign=topnav\"\n target=\"_blank\">\n <span>Download App</span>\n <ScalarIconDownloadSimple\n class=\"size-3.5\"\n weight=\"bold\" />\n </a>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -1,13 +1,20 @@
1
1
  import computer_default from "../../../../assets/computer.ascii.virtual.js";
2
2
  import ScalarAsciiArt_default from "../../../../components/ScalarAsciiArt.vue.js";
3
- import { createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, unref } from "vue";
4
- import { ScalarHotkey } from "@scalar/components";
5
- import { ScalarIconDownloadSimple } from "@scalar/icons";
3
+ import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, unref, withCtx } from "vue";
4
+ import { ScalarButton, ScalarHotkey } from "@scalar/components";
5
+ import { ScalarIconBracketsCurly, ScalarIconDownloadSimple } from "@scalar/icons";
6
6
  //#region src/v2/features/collection/components/GetStarted.vue?vue&type=script&setup=true&lang.ts
7
7
  var _hoisted_1 = { class: "flex h-full w-full flex-col items-center justify-center p-6" };
8
- var _hoisted_2 = { class: "flex flex-col items-stretch gap-10" };
9
- var _hoisted_3 = { class: "text-c-2 flex flex-col gap-3 text-sm" };
10
- var _hoisted_4 = {
8
+ var _hoisted_2 = {
9
+ key: 0,
10
+ class: "flex max-w-sm flex-col gap-4"
11
+ };
12
+ var _hoisted_3 = {
13
+ key: 1,
14
+ class: "flex flex-col items-stretch gap-10"
15
+ };
16
+ var _hoisted_4 = { class: "text-c-2 flex flex-col gap-3 text-sm" };
17
+ var _hoisted_5 = {
11
18
  key: 0,
12
19
  class: "text-c-2 hover:text-c-1 flex w-full items-center justify-between gap-8",
13
20
  href: "https://scalar.com/download?utm_source=web_client&utm_medium=download_button&utm_campaign=topnav",
@@ -26,6 +33,7 @@ var GetStarted_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
26
33
  environment: {},
27
34
  workspaceStore: {},
28
35
  activeWorkspace: {},
36
+ isTeamWorkspace: { type: Boolean },
29
37
  plugins: {},
30
38
  customThemes: {},
31
39
  currentTheme: {},
@@ -58,16 +66,51 @@ var GetStarted_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
58
66
  const focusSearch = () => {
59
67
  __props.eventBus.emit("ui:focus:search");
60
68
  };
69
+ /**
70
+ * Open the command palette directly on the "Create OpenAPI Document" form.
71
+ * The empty team workspace CTA delegates to this action so the create flow
72
+ * stays in one place.
73
+ */
74
+ const openCreateDocument = () => {
75
+ __props.eventBus.emit("ui:open:command-palette", {
76
+ action: "create-openapi-document",
77
+ payload: void 0
78
+ });
79
+ };
80
+ /**
81
+ * Whether the active workspace is a team workspace that has no real
82
+ * documents yet. The auto-created `drafts` scratch document does not count
83
+ * as content, so a workspace whose only entry is `drafts` is still treated
84
+ * as empty.
85
+ */
86
+ const isEmptyTeamWorkspace = computed(() => {
87
+ if (!__props.isTeamWorkspace) return false;
88
+ return Object.keys(__props.workspaceStore?.workspace?.documents ?? {}).every((name) => name === "drafts");
89
+ });
61
90
  return (_ctx, _cache) => {
62
- return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createVNode(ScalarAsciiArt_default, {
91
+ return openBlock(), createElementBlock("div", _hoisted_1, [isEmptyTeamWorkspace.value && __props.isTeamWorkspace ? (openBlock(), createElementBlock("div", _hoisted_2, [
92
+ createVNode(unref(ScalarIconBracketsCurly), {
93
+ class: "text-c-accent size-10",
94
+ weight: "bold"
95
+ }),
96
+ _cache[1] || (_cache[1] = createElementVNode("h2", { class: "text-c-1 text-base font-semibold" }, "Create a Document", -1)),
97
+ _cache[2] || (_cache[2] = createElementVNode("p", { class: "text-c-2 text-sm leading-relaxed" }, " The OpenAPI standard provides a descriptor of your API. Bringing it to our Registry allows you to manage, lint & version your OpenAPI Documents. Create Docs & SDKs from your OpenAPI Document. ", -1)),
98
+ createElementVNode("div", null, [createVNode(unref(ScalarButton), {
99
+ class: "mt-2",
100
+ onClick: openCreateDocument
101
+ }, {
102
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Create Document ", -1)])]),
103
+ _: 1
104
+ })])
105
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(ScalarAsciiArt_default, {
63
106
  art: unref(computer_default),
64
107
  class: "text-c-3 self-center"
65
- }, null, 8, ["art"]), createElementVNode("div", _hoisted_3, [
108
+ }, null, 8, ["art"]), createElementVNode("div", _hoisted_4, [
66
109
  createElementVNode("button", {
67
110
  class: "hover:text-c-1 flex w-full items-center justify-between gap-8",
68
111
  type: "button",
69
112
  onClick: openCommandPalette
70
- }, [_cache[0] || (_cache[0] = createElementVNode("span", null, "Get Started", -1)), createVNode(unref(ScalarHotkey), {
113
+ }, [_cache[3] || (_cache[3] = createElementVNode("span", null, "Get Started", -1)), createVNode(unref(ScalarHotkey), {
71
114
  hotkey: "K",
72
115
  modifier: ["default"]
73
116
  })]),
@@ -75,7 +118,7 @@ var GetStarted_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
75
118
  class: "hover:text-c-1 flex w-full items-center justify-between gap-8",
76
119
  type: "button",
77
120
  onClick: openSettings
78
- }, [_cache[1] || (_cache[1] = createElementVNode("span", null, "Settings", -1)), createVNode(unref(ScalarHotkey), {
121
+ }, [_cache[4] || (_cache[4] = createElementVNode("span", null, "Settings", -1)), createVNode(unref(ScalarHotkey), {
79
122
  hotkey: "I",
80
123
  modifier: ["default"]
81
124
  })]),
@@ -83,15 +126,15 @@ var GetStarted_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
83
126
  class: "hover:text-c-1 flex w-full items-center justify-between gap-8",
84
127
  type: "button",
85
128
  onClick: focusSearch
86
- }, [_cache[2] || (_cache[2] = createElementVNode("span", null, "Filter", -1)), createVNode(unref(ScalarHotkey), {
129
+ }, [_cache[5] || (_cache[5] = createElementVNode("span", null, "Filter", -1)), createVNode(unref(ScalarHotkey), {
87
130
  hotkey: "J",
88
131
  modifier: ["default"]
89
132
  })]),
90
- __props.layout === "web" ? (openBlock(), createElementBlock("a", _hoisted_4, [_cache[3] || (_cache[3] = createElementVNode("span", null, "Download App", -1)), createVNode(unref(ScalarIconDownloadSimple), {
133
+ __props.layout === "web" ? (openBlock(), createElementBlock("a", _hoisted_5, [_cache[6] || (_cache[6] = createElementVNode("span", null, "Download App", -1)), createVNode(unref(ScalarIconDownloadSimple), {
91
134
  class: "size-3.5",
92
135
  weight: "bold"
93
136
  })])) : createCommentVNode("", true)
94
- ])])]);
137
+ ])]))]);
95
138
  };
96
139
  }
97
140
  });
@@ -1 +1 @@
1
- {"version":3,"file":"GetStarted.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/GetStarted.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Workspace get started page.\n *\n * Shown as the landing view for a workspace with no request selected. Displays\n * an ASCII art mark and a short list of keyboard shortcuts to help the user\n * bootstrap their workspace (open the command palette, jump to settings, or\n * focus the sidebar filter).\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarHotkey } from '@scalar/components'\nimport { ScalarIconDownloadSimple } from '@scalar/icons'\n\nimport Computer from '@/assets/computer.ascii?raw'\nimport ScalarAsciiArt from '@/components/ScalarAsciiArt.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\n\nconst { eventBus, layout } = defineProps<RouteProps>()\n\nconst openCommandPalette = () => {\n eventBus.emit('ui:open:command-palette')\n}\n\n/**\n * Open the contextual settings page. Emits the same event as the Cmd/Ctrl+I\n * hotkey so the workspace sidebar handles it uniformly: workspace-level\n * settings from this \"Get started\" screen, document-level settings when the\n * user is viewing a specific document. No `KeyboardEvent` is attached here\n * because the trigger is a click.\n */\nconst openSettings = () => {\n eventBus.emit('ui:open:settings')\n}\n\n/**\n * Open the contextual search affordance. Emits the same event as the Cmd/Ctrl+J\n * hotkey so the workspace sidebar handles it uniformly: the document filter\n * toggles on the workspace page and the search modal opens inside a document.\n * No `KeyboardEvent` is attached here because the trigger is a click.\n */\nconst focusSearch = () => {\n eventBus.emit('ui:focus:search')\n}\n</script>\n\n<template>\n <div class=\"flex h-full w-full flex-col items-center justify-center p-6\">\n <div class=\"flex flex-col items-stretch gap-10\">\n <ScalarAsciiArt\n :art=\"Computer\"\n class=\"text-c-3 self-center\" />\n\n <div class=\"text-c-2 flex flex-col gap-3 text-sm\">\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openCommandPalette\">\n <span>Get Started</span>\n <ScalarHotkey\n hotkey=\"K\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openSettings\">\n <span>Settings</span>\n <ScalarHotkey\n hotkey=\"I\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"focusSearch\">\n <span>Filter</span>\n <ScalarHotkey\n hotkey=\"J\"\n :modifier=\"['default']\" />\n </button>\n <!--\n Browser-only nudge to install the desktop app. Hidden in the desktop\n and modal layouts because the user is already running the native app\n (or embedded in a host page).\n -->\n <a\n v-if=\"layout === 'web'\"\n class=\"text-c-2 hover:text-c-1 flex w-full items-center justify-between gap-8\"\n href=\"https://scalar.com/download?utm_source=web_client&utm_medium=download_button&utm_campaign=topnav\"\n target=\"_blank\">\n <span>Download App</span>\n <ScalarIconDownloadSimple\n class=\"size-3.5\"\n weight=\"bold\" />\n </a>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM,2BAA2B;AAC/B,WAAA,SAAS,KAAK,0BAAyB;;;;;;;;;EAUzC,MAAM,qBAAqB;AACzB,WAAA,SAAS,KAAK,mBAAkB;;;;;;;;EASlC,MAAM,oBAAoB;AACxB,WAAA,SAAS,KAAK,kBAAiB;;;uBAK/B,mBAmDM,OAnDN,YAmDM,CAlDJ,mBAiDM,OAjDN,YAiDM,CAhDJ,YAEiC,wBAAA;IAD9B,KAAK,MAAA,iBAAQ;IACd,OAAM;yBAER,mBA2CM,OA3CN,YA2CM;IA1CJ,mBAQS,UAAA;KAPP,OAAM;KACN,MAAK;KACJ,SAAO;kCACR,mBAAwB,QAAA,MAAlB,eAAW,GAAA,GACjB,YAE4B,MAAA,aAAA,EAAA;KAD1B,QAAO;KACN,UAAU,CAAA,UAAW;;IAE1B,mBAQS,UAAA;KAPP,OAAM;KACN,MAAK;KACJ,SAAO;kCACR,mBAAqB,QAAA,MAAf,YAAQ,GAAA,GACd,YAE4B,MAAA,aAAA,EAAA;KAD1B,QAAO;KACN,UAAU,CAAA,UAAW;;IAE1B,mBAQS,UAAA;KAPP,OAAM;KACN,MAAK;KACJ,SAAO;kCACR,mBAAmB,QAAA,MAAb,UAAM,GAAA,GACZ,YAE4B,MAAA,aAAA,EAAA;KAD1B,QAAO;KACN,UAAU,CAAA,UAAW;;IAQlB,QAAA,WAAM,SAAA,WAAA,EADd,mBASI,KATJ,YASI,CAAA,OAAA,OAAA,OAAA,KAJF,mBAAyB,QAAA,MAAnB,gBAAY,GAAA,GAClB,YAEkB,MAAA,yBAAA,EAAA;KADhB,OAAM;KACN,QAAO"}
1
+ {"version":3,"file":"GetStarted.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/GetStarted.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Workspace get started page.\n *\n * Shown as the landing view for a workspace with no request selected.\n *\n * On a local workspace it displays an ASCII art mark and a short list of\n * keyboard shortcuts to help the user bootstrap their workspace (open the\n * command palette, jump to settings, or focus the sidebar filter).\n *\n * On an empty team workspace it instead surfaces a focused \"Create a\n * Document\" call-to-action: team workspaces are intended to back a real\n * OpenAPI document and the registry, so the keyboard-shortcut helper would\n * be a confusing first impression. The CTA reuses the command palette by\n * opening its `create-openapi-document` action so the actual creation flow\n * remains a single source of truth.\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton, ScalarHotkey } from '@scalar/components'\nimport {\n ScalarIconBracketsCurly,\n ScalarIconDownloadSimple,\n} from '@scalar/icons'\nimport { computed } from 'vue'\n\nimport Computer from '@/assets/computer.ascii?raw'\nimport ScalarAsciiArt from '@/components/ScalarAsciiArt.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\n\nconst { eventBus, isTeamWorkspace, layout, workspaceStore } =\n defineProps<RouteProps>()\n\nconst openCommandPalette = () => {\n eventBus.emit('ui:open:command-palette')\n}\n\n/**\n * Open the contextual settings page. Emits the same event as the Cmd/Ctrl+I\n * hotkey so the workspace sidebar handles it uniformly: workspace-level\n * settings from this \"Get started\" screen, document-level settings when the\n * user is viewing a specific document. No `KeyboardEvent` is attached here\n * because the trigger is a click.\n */\nconst openSettings = () => {\n eventBus.emit('ui:open:settings')\n}\n\n/**\n * Open the contextual search affordance. Emits the same event as the Cmd/Ctrl+J\n * hotkey so the workspace sidebar handles it uniformly: the document filter\n * toggles on the workspace page and the search modal opens inside a document.\n * No `KeyboardEvent` is attached here because the trigger is a click.\n */\nconst focusSearch = () => {\n eventBus.emit('ui:focus:search')\n}\n\n/**\n * Open the command palette directly on the \"Create OpenAPI Document\" form.\n * The empty team workspace CTA delegates to this action so the create flow\n * stays in one place.\n */\nconst openCreateDocument = () => {\n eventBus.emit('ui:open:command-palette', {\n action: 'create-openapi-document',\n payload: undefined,\n })\n}\n\n/**\n * Whether the active workspace is a team workspace that has no real\n * documents yet. The auto-created `drafts` scratch document does not count\n * as content, so a workspace whose only entry is `drafts` is still treated\n * as empty.\n */\nconst isEmptyTeamWorkspace = computed(() => {\n if (!isTeamWorkspace) {\n return false\n }\n\n const documentNames = Object.keys(workspaceStore?.workspace?.documents ?? {})\n return documentNames.every((name) => name === 'drafts')\n})\n</script>\n\n<template>\n <div class=\"flex h-full w-full flex-col items-center justify-center p-6\">\n <!--\n Empty team workspace: surface a focused CTA pointing the user at the\n command palette's create-document flow rather than the local-workspace\n keyboard cheatsheet.\n -->\n <div\n v-if=\"isEmptyTeamWorkspace && isTeamWorkspace\"\n class=\"flex max-w-sm flex-col gap-4\">\n <ScalarIconBracketsCurly\n class=\"text-c-accent size-10\"\n weight=\"bold\" />\n <h2 class=\"text-c-1 text-base font-semibold\">Create a Document</h2>\n <p class=\"text-c-2 text-sm leading-relaxed\">\n The OpenAPI standard provides a descriptor of your API. Bringing it to\n our Registry allows you to manage, lint &amp; version your OpenAPI\n Documents. Create Docs &amp; SDKs from your OpenAPI Document.\n </p>\n <div>\n <ScalarButton\n class=\"mt-2\"\n @click=\"openCreateDocument\">\n Create Document\n </ScalarButton>\n </div>\n </div>\n\n <!-- Local workspace fallback: ASCII art mark and keyboard shortcuts. -->\n <div\n v-else\n class=\"flex flex-col items-stretch gap-10\">\n <ScalarAsciiArt\n :art=\"Computer\"\n class=\"text-c-3 self-center\" />\n\n <div class=\"text-c-2 flex flex-col gap-3 text-sm\">\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openCommandPalette\">\n <span>Get Started</span>\n <ScalarHotkey\n hotkey=\"K\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"openSettings\">\n <span>Settings</span>\n <ScalarHotkey\n hotkey=\"I\"\n :modifier=\"['default']\" />\n </button>\n <button\n class=\"hover:text-c-1 flex w-full items-center justify-between gap-8\"\n type=\"button\"\n @click=\"focusSearch\">\n <span>Filter</span>\n <ScalarHotkey\n hotkey=\"J\"\n :modifier=\"['default']\" />\n </button>\n <!--\n Browser-only nudge to install the desktop app. Hidden in the desktop\n and modal layouts because the user is already running the native app\n (or embedded in a host page).\n -->\n <a\n v-if=\"layout === 'web'\"\n class=\"text-c-2 hover:text-c-1 flex w-full items-center justify-between gap-8\"\n href=\"https://scalar.com/download?utm_source=web_client&utm_medium=download_button&utm_campaign=topnav\"\n target=\"_blank\">\n <span>Download App</span>\n <ScalarIconDownloadSimple\n class=\"size-3.5\"\n weight=\"bold\"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AE4B,MAAA,aAAA,EAAA;KAD1B,QAAO;KACN,UAAU,CAAA,UAAW;;IAE1B,mBAQS,UAAA;KAPP,OAAM;KACN,MAAK;KACJ,SAAO;kCACR,mBAAqB,QAAA,MAAf,YAAQ,GAAA,GACd,YAE4B,MAAA,aAAA,EAAA;KAD1B,QAAO;KACN,UAAU,CAAA,UAAW;;IAE1B,mBAQS,UAAA;KAPP,OAAM;KACN,MAAK;KACJ,SAAO;kCACR,mBAAmB,QAAA,MAAb,UAAM,GAAA,GACZ,YAE4B,MAAA,aAAA,EAAA;KAD1B,QAAO;KACN,UAAU,CAAA,UAAW;;IAQlB,QAAA,WAAM,SAAA,WAAA,EADd,mBASI,KATJ,YASI,CAAA,OAAA,OAAA,OAAA,KAJF,mBAAyB,QAAA,MAAnB,gBAAY,GAAA,GAClB,YAEkB,MAAA,yBAAA,EAAA;KADhB,OAAM;KACN,QAAO"}
@@ -28,6 +28,7 @@ var Overview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
28
28
  environment: {},
29
29
  workspaceStore: {},
30
30
  activeWorkspace: {},
31
+ isTeamWorkspace: { type: Boolean },
31
32
  plugins: {},
32
33
  customThemes: {},
33
34
  currentTheme: {},
@@ -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,QA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AAA,MAAA;IAlBG,OAAK,cAAY,CAAA,GAAA,OAAA,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
+ {"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,iBAAi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,YAAY,WAAA;KACZ,uBAAmB;;;OAK5B,YAmBU,iBAAA,MAAA;IAlBG,OAAK,cAAY,CAAA,GAAA,OAAA,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"}
@@ -36,6 +36,7 @@ var Runner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
36
36
  environment: {},
37
37
  workspaceStore: {},
38
38
  activeWorkspace: {},
39
+ isTeamWorkspace: { type: Boolean },
39
40
  plugins: {},
40
41
  customThemes: {},
41
42
  currentTheme: {},
@@ -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, 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 </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,MAAA,aAAY,IAAI,MAAA,UAAS;MACpC,MAAM,MAAA,gCAA+B;MACrC,QAAQ,MAAA,UAAS;MAClB,MAAK;MACL,SAAQ;MACP,SAAO,MAAA,MAAK;;6BAEf,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFiB,qBAEjB,GAAA,CAAA,EAAA,CAAA;;;;;;;;KAKmB,MAAA,UAAS,IAAI,MAAA,gBAAe,IAAA,QAAY,MAAA,cAAa,CAAC,SAAM,KAAA,WAAA,EADjF,YAuBa,oBAAA;;MAnBX,SAAA;;6BAMI,CALJ,mBAKI,KALJ,YAKI,CAAA,OAAA,OAAA,OAAA,KAAA,gBALwB,kBAE1B,GAAA,GAAA,mBAEO,QAFP,YAEO,gBADF,MAAA,gBAAe,CAAA,GAAG,QAAG,gBAAG,MAAA,cAAa,CAAC,OAAM,EAAA,EAAA,CAAA,CAAA,EAGnD,mBAWM,OAAA;OAVH,iBAAe,MAAA,cAAa,CAAC;OAC7B,iBAAe;OACf,iBAAe,MAAA,gBAAe;OAC/B,OAAM;OACN,MAAK;UACL,mBAIO,OAAA;OAHL,OAAM;OACL,OAAK,eAAA,EAAA,OAAA,GAA+B,MAAA,gBAAe,GAAG,MAAA,cAAa,CAAC,SAAM,IAAA,IAAA,CAAA;;;;KAQzE,MAAA,WAAU,IAAI,MAAA,gBAAe,IAAA,WAAA,EADrC,YAQ0B,uBAAA;;MANvB,gBAAgB,MAAA,eAAc;MAC9B,kBAAkB,MAAA,iBAAgB;MAClC,gBAAgB,MAAA,eAAc;MAC9B,iBAAiB,MAAA,gBAAe;MAChC,eAAe,MAAA,cAAa;MAC5B,SAAS,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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MAAA,aAAY,IAAI,MAAA,UAAS;MACpC,MAAM,MAAA,gCAA+B;MACrC,QAAQ,MAAA,UAAS;MAClB,MAAK;MACL,SAAQ;MACP,SAAO,MAAA,MAAK;;6BAEf,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFiB,qBAEjB,GAAA,CAAA,EAAA,CAAA;;;;;;;;KAKmB,MAAA,UAAS,IAAI,MAAA,gBAAe,IAAA,QAAY,MAAA,cAAa,CAAC,SAAM,KAAA,WAAA,EADjF,YAuBa,oBAAA;;MAnBX,SAAA;;6BAMI,CALJ,mBAKI,KALJ,YAKI,CAAA,OAAA,OAAA,OAAA,KAAA,gBALwB,kBAE1B,GAAA,GAAA,mBAEO,QAFP,YAEO,gBADF,MAAA,gBAAe,CAAA,GAAG,QAAG,gBAAG,MAAA,cAAa,CAAC,OAAM,EAAA,EAAA,CAAA,CAAA,EAGnD,mBAWM,OAAA;OAVH,iBAAe,MAAA,cAAa,CAAC;OAC7B,iBAAe;OACf,iBAAe,MAAA,gBAAe;OAC/B,OAAM;OACN,MAAK;UACL,mBAIO,OAAA;OAHL,OAAM;OACL,OAAK,eAAA,EAAA,OAAA,GAA+B,MAAA,gBAAe,GAAG,MAAA,cAAa,CAAC,SAAM,IAAA,IAAA,CAAA;;;;KAQzE,MAAA,WAAU,IAAI,MAAA,gBAAe,IAAA,WAAA,EADrC,YAQ0B,uBAAA;;MANvB,gBAAgB,MAAA,eAAc;MAC9B,kBAAkB,MAAA,iBAAgB;MAClC,gBAAgB,MAAA,eAAc;MAC9B,iBAAiB,MAAA,gBAAe;MAChC,eAAe,MAAA,cAAa;MAC5B,SAAS,MAAA,WAAU;MACnB,SAAO,MAAA,aAAY"}
@@ -1,6 +1,6 @@
1
1
  import { sendRequest } from "../../../../../blocks/operation-block/helpers/send-request.js";
2
2
  import { APP_VERSION } from "../../../../../constants.js";
3
- import { tryCatch } from "../../../../../helpers/safe-run.js";
3
+ import { safeRun } from "../../../../../helpers/safe-run.js";
4
4
  import { computed, ref } from "vue";
5
5
  import { useLoadingState } from "@scalar/components";
6
6
  import { isElectron } from "@scalar/helpers/general/is-electron";
@@ -126,7 +126,7 @@ function useRunnerExecution({ workspaceStore, document, documentName, isWeb, sel
126
126
  ...getEnvironmentVariables(contextResult.data.environment.environment),
127
127
  ...variablesStore.getVariables()
128
128
  };
129
- const requestResult = await tryCatch(() => {
129
+ const requestResult = await safeRun(() => {
130
130
  return buildRequest(requestBuilder, { envVariables });
131
131
  });
132
132
  if (!requestResult.ok) {
@@ -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 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 run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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 { safeRun } 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 safeRun(() => {\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;EAET,MAAM,MAAM,WAAW,MAAM;EAC7B,MAAM,QAAQ,cAAc,MAAM;EAClC,MAAM,SAAS,WAAW,MAAM,QAAQ,MAAM,CAAC,EAAE,SAAS,EAAE,YAAY,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;EAChG,MAAM,SAAS,MAAM;EACrB,MAAM,UAAU,QAAQ;AAGxB,SAAO;GAAE;GAAO;GAAQ;GAAQ;GAAS,UAFxB,aAAa,SAAS,WAAW,QAAQ,WAAW,QAAQ,aAAa,QAAQ;GAE/C,WADjC,WAAW,KAAK,YAAY;GACgB;GAC9D;CAEF,MAAM,qBAAqB;AACzB,aAAW,QAAQ,EAAE;AACrB,kBAAgB,QAAQ;AACxB,eAAa,QAAQ;AACrB,aAAW,QAAQ;;CAGrB,MAAM,cAAc;AAClB,gBAAc;AACT,OAAK;;CAGZ,MAAM,oBAAoB,UAAoC;AAC5D,SAAO,WAAW,MAAM,UAAU;;CAGpC,MAAM,kBAAkB,WAAsC;AAC5D,MAAI,CAAC,OACH,QAAO;AAET,MAAI,OAAO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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"}
@@ -15,6 +15,7 @@ var Scripts_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
15
15
  environment: {},
16
16
  workspaceStore: {},
17
17
  activeWorkspace: {},
18
+ isTeamWorkspace: { type: Boolean },
18
19
  plugins: {},
19
20
  customThemes: {},
20
21
  currentTheme: {},
@@ -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"}
@@ -31,6 +31,7 @@ var Servers_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
31
31
  environment: {},
32
32
  workspaceStore: {},
33
33
  activeWorkspace: {},
34
+ isTeamWorkspace: { type: Boolean },
34
35
  plugins: {},
35
36
  customThemes: {},
36
37
  currentTheme: {},
@@ -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 :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":";;;;;;;;;;;;;;;;;;;;;;;;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F,SAAS;MACT,cAAc;;;;;SAET,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;;;;OA3EhB,YAAA,QAAA;UACL;sBAMK,CALN,mBAKM,OALN,YAKM,CAJJ,YAGsD,MAAA,aAAA,EAAA;KAFpD,OAAM;KACL,YAAY,oBAAA;KACZ,uBAAmB;;;wBA6E5B,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,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;;EAGA,MAAM,mBAAmB,UAAkB;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Y;MACZ,SAAQ;MACP,UAAK,WAAE,gBAAgB,MAAK;;6BACO,CAApC,YAAoC,MAAA,gBAAA,EAAA,EAAnB,OAAM,YAAU,CAAA,CAAA,CAAA;;2BAKrC,mBAgBM,OAhBN,YAgBM,CAdJ,YAO0B,cAAA;MANvB,MAAM;MACN,aAAa,QAAA;MACb,WAA8B,KAAK,UAAU,mBAAmB,OAAO,KAAK,MAAK;MAGjF,SAAS;MACT,cAAc;;;;;SAET,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;;;;OA3EhB,YAAA,QAAA;UACL;sBAMK,CALN,mBAKM,OALN,YAKM,CAJJ,YAGsD,MAAA,aAAA,EAAA;KAFpD,OAAM;KACL,YAAY,oBAAA;KACZ,uBAAmB;;;wBA6E5B,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"}
@@ -16,6 +16,7 @@ var Settings_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
16
16
  environment: {},
17
17
  workspaceStore: {},
18
18
  activeWorkspace: {},
19
+ isTeamWorkspace: { type: Boolean },
19
20
  plugins: {},
20
21
  customThemes: {},
21
22
  currentTheme: {},