@scalar/api-client 2.23.4 → 2.25.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 (103) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  3. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +8 -0
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +33 -29
  8. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +6 -0
  9. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  10. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  11. package/dist/v2/blocks/operation-block/components/Header.vue2.js +46 -29
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts +15 -0
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -0
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +125 -0
  16. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue2.js +4 -0
  17. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -2
  18. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  19. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -2
  20. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  21. package/dist/v2/features/app/App.vue.d.ts +8 -0
  22. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  23. package/dist/v2/features/app/App.vue.js +95 -108
  24. package/dist/v2/features/app/app-state.d.ts +46 -16
  25. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  26. package/dist/v2/features/app/app-state.js +174 -161
  27. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
  28. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  29. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  30. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +3 -3
  31. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  32. package/dist/v2/features/app/helpers/filter-workspaces.d.ts +49 -0
  33. package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -0
  34. package/dist/v2/features/app/helpers/filter-workspaces.js +5 -0
  35. package/dist/v2/features/app/helpers/group-workspaces.d.ts +24 -0
  36. package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -0
  37. package/dist/v2/features/app/helpers/group-workspaces.js +23 -0
  38. package/dist/v2/features/app/hooks/use-document-watcher.js +8 -8
  39. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  40. package/dist/v2/features/collection/components/Environment.vue.js +12 -11
  41. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  42. package/dist/v2/features/collection/components/Settings.vue.js +17 -25
  43. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +1 -1
  44. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  45. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +115 -118
  46. package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts.map +1 -1
  47. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +14 -4
  48. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -1
  49. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +5 -6
  50. package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts.map +1 -1
  51. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +16 -0
  52. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -0
  53. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +34 -0
  54. package/dist/v2/features/command-palette/index.d.ts +4 -0
  55. package/dist/v2/features/command-palette/index.d.ts.map +1 -0
  56. package/dist/v2/features/command-palette/index.js +8 -0
  57. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +4 -0
  58. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  59. package/dist/v2/features/environments/EnvironmentsList.vue.js +29 -27
  60. package/dist/v2/features/environments/components/Environment.vue.d.ts +1 -0
  61. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  62. package/dist/v2/features/environments/components/Environment.vue.js +37 -24
  63. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  64. package/dist/v2/features/modal/Modal.vue.js +2 -2
  65. package/dist/v2/features/modal/Modal.vue2.js +39 -38
  66. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  67. package/dist/v2/features/operation/Operation.vue.js +35 -26
  68. package/dist/v2/workspace-events.d.ts.map +1 -1
  69. package/dist/v2/workspace-events.js +7 -0
  70. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  71. package/package.json +15 -15
  72. package/dist/v2/features/import-listener/ImportListener.vue.d.ts +0 -52
  73. package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +0 -1
  74. package/dist/v2/features/import-listener/ImportListener.vue.js +0 -91
  75. package/dist/v2/features/import-listener/ImportListener.vue2.js +0 -4
  76. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +0 -7
  77. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +0 -1
  78. package/dist/v2/features/import-listener/components/DropEventListener.vue.js +0 -81
  79. package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +0 -4
  80. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +0 -40
  81. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +0 -1
  82. package/dist/v2/features/import-listener/components/ImportModal.vue.js +0 -170
  83. package/dist/v2/features/import-listener/components/ImportModal.vue3.js +0 -5
  84. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +0 -29
  85. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +0 -1
  86. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +0 -83
  87. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +0 -4
  88. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +0 -8
  89. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +0 -1
  90. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +0 -4
  91. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +0 -15
  92. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +0 -1
  93. package/dist/v2/features/import-listener/helpers/load-document-from-source.js +0 -28
  94. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +0 -15
  95. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +0 -1
  96. package/dist/v2/features/import-listener/helpers/wait-for-condition.js +0 -16
  97. package/dist/v2/features/import-listener/index.d.ts +0 -2
  98. package/dist/v2/features/import-listener/index.d.ts.map +0 -1
  99. package/dist/v2/features/import-listener/index.js +0 -4
  100. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts +0 -0
  101. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.js +0 -0
  102. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts +0 -0
  103. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.js +0 -0
@@ -1,24 +1,24 @@
1
- import { defineComponent as W, computed as d, createBlock as p, openBlock as i, unref as t, withCtx as u, createElementVNode as m, createVNode as n, createElementBlock as v, renderSlot as T, normalizeProps as h, guardReactiveProps as y } from "vue";
2
- import { useModal as g, ScalarTeleportRoot as C } from "@scalar/components";
3
- import { getThemeStyles as x } from "@scalar/themes";
4
- import { ScalarToasts as B } from "@scalar/use-toasts";
1
+ import { defineComponent as h, computed as c, createBlock as u, openBlock as l, unref as t, withCtx as v, createElementVNode as p, createVNode as n, createElementBlock as k, renderSlot as w, normalizeProps as y, guardReactiveProps as T } from "vue";
2
+ import { useModal as g, ScalarTeleportRoot as B } from "@scalar/components";
3
+ import { getThemeStyles as C } from "@scalar/themes";
4
+ import { ScalarToasts as x } from "@scalar/use-toasts";
5
5
  import { extensions as E } from "@scalar/workspace-store/schemas/extensions";
6
- import { RouterView as M } from "vue-router";
7
- import O from "./components/CreateWorkspaceModal.vue.js";
8
- import _ from "./components/SplashScreen.vue.js";
9
- import { useDocumentWatcher as A } from "./hooks/use-document-watcher.js";
10
- import U from "../command-palette/TheCommandPalette.vue.js";
6
+ import { RouterView as O } from "vue-router";
7
+ import _ from "./components/CreateWorkspaceModal.vue.js";
8
+ import A from "./components/SplashScreen.vue.js";
9
+ import { groupWorkspacesByTeam as U } from "./helpers/group-workspaces.js";
10
+ import { useDocumentWatcher as M } from "./hooks/use-document-watcher.js";
11
+ import I from "../command-palette/TheCommandPalette.vue.js";
11
12
  import { useColorMode as D } from "../../hooks/use-color-mode.js";
12
- import { useGlobalHotKeys as I } from "../../hooks/use-global-hot-keys.js";
13
- import L from "./components/AppSidebar.vue.js";
14
- import N from "./components/DesktopTabs.vue.js";
15
- import $ from "./components/WebTopNav.vue.js";
16
- import { mergeSecurity as P } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
17
- import H from "../import-listener/ImportListener.vue.js";
13
+ import { useGlobalHotKeys as $ } from "../../hooks/use-global-hot-keys.js";
14
+ import N from "./components/AppSidebar.vue.js";
15
+ import L from "./components/DesktopTabs.vue.js";
16
+ import P from "./components/WebTopNav.vue.js";
17
+ import { mergeSecurity as H } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
18
18
  const F = ["innerHTML"], V = {
19
19
  key: 0,
20
20
  class: "flex flex-1 flex-col"
21
- }, R = { class: "flex min-h-0 flex-1" }, z = { class: "bg-b-1 flex-1" }, G = { key: 1 }, K = {}, ue = /* @__PURE__ */ W({
21
+ }, R = { class: "flex min-h-0 flex-1" }, z = { class: "bg-b-1 flex-1" }, G = { key: 1 }, K = {}, pe = /* @__PURE__ */ h({
22
22
  ...K,
23
23
  __name: "App",
24
24
  props: {
@@ -27,32 +27,30 @@ const F = ["innerHTML"], V = {
27
27
  getAppState: { type: Function },
28
28
  getCommandPaletteState: { type: Function }
29
29
  },
30
- setup(r, { expose: k }) {
31
- k({
32
- openCreateWorkspace: () => c.show()
30
+ setup(s, { expose: f }) {
31
+ f({
32
+ openCreateWorkspace: () => i.show()
33
33
  });
34
- const e = r.getAppState(), w = r.getCommandPaletteState();
35
- typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e);
36
- const { isDarkMode: f } = D({ workspaceStore: e.store });
37
- I(e.eventBus, r.layout), A({
34
+ const e = s.getAppState(), S = s.getCommandPaletteState();
35
+ typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), D({ workspaceStore: e.store }), $(e.eventBus, s.layout), M({
38
36
  documentName: () => e.store.value?.workspace[E.workspace.activeDocument],
39
37
  store: e.store,
40
38
  initialTimeout: 5e3
41
39
  });
42
- const S = d(() => {
40
+ const b = c(() => {
43
41
  if (e.store.value === null)
44
42
  return "";
45
- const s = e.store.value.workspace["x-scalar-theme"];
46
- return s ? `<style>${x(s)}</style>` : "";
47
- }), l = (s) => {
48
- if (!s)
43
+ const o = e.store.value.workspace["x-scalar-theme"];
44
+ return o ? `<style>${C(o)}</style>` : "";
45
+ }), m = (o) => {
46
+ if (!o)
49
47
  return;
50
48
  const a = e.workspace.workspaceList.value?.find(
51
- (o) => o.id === s
49
+ (r) => r.id === o
52
50
  );
53
51
  a && e.workspace.navigateToWorkspace(a.namespace, a.slug);
54
- }, c = g(), b = d(() => {
55
- const s = e.store.value?.auth ? P(
52
+ }, i = g(), W = c(() => {
53
+ const o = e.store.value?.auth ? H(
56
54
  e.document.value?.components?.securitySchemes ?? {},
57
55
  {},
58
56
  e.store.value.auth,
@@ -64,94 +62,83 @@ const F = ["innerHTML"], V = {
64
62
  environment: e.environment.value,
65
63
  eventBus: e.eventBus,
66
64
  exampleName: e.activeEntities.exampleName.value,
67
- layout: r.layout,
65
+ layout: s.layout,
68
66
  method: e.activeEntities.method.value,
69
67
  path: e.activeEntities.path.value,
70
68
  workspaceStore: e.store.value,
71
69
  activeWorkspace: e.workspace.activeWorkspace.value,
72
- plugins: r.plugins,
73
- securitySchemes: s
70
+ plugins: s.plugins,
71
+ securitySchemes: o
74
72
  };
75
- });
76
- return (s, a) => (i(), p(t(C), null, {
77
- default: u(() => [
78
- m("div", { innerHTML: S.value }, null, 8, F),
79
- n(t(B)),
80
- n(t(H), {
81
- activeWorkspace: t(e).workspace.activeWorkspace.value,
82
- darkMode: t(f),
83
- workspaceStore: t(e).store.value,
84
- workspaces: t(e).workspace.workspaceList.value,
85
- "onCreate:workspace": a[4] || (a[4] = (o) => t(e).workspace.create(o)),
86
- "onNavigateTo:document": a[5] || (a[5] = (o) => t(e).router.value?.push({
87
- name: "document.overview",
88
- params: {
89
- documentSlug: o
90
- }
91
- })),
92
- "onSelect:workspace": l
93
- }, {
94
- default: u(() => [
95
- t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), v("main", V, [
96
- r.layout === "desktop" ? (i(), p(N, {
97
- key: 0,
98
- activeTabIndex: t(e).tabs.activeTabIndex.value,
99
- eventBus: t(e).eventBus,
100
- tabs: t(e).tabs.state.value
101
- }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), p($, {
102
- key: 1,
103
- activeWorkspace: t(e).workspace.activeWorkspace.value,
104
- workspaces: t(e).workspace.workspaceList.value,
105
- "onCreate:workspace": a[0] || (a[0] = (o) => t(c).show()),
106
- "onSelect:workspace": l
107
- }, null, 8, ["activeWorkspace", "workspaces"])),
108
- m("div", R, [
109
- n(L, {
110
- isSidebarOpen: t(e).sidebar.isOpen.value,
111
- "onUpdate:isSidebarOpen": a[1] || (a[1] = (o) => t(e).sidebar.isOpen.value = o),
112
- activeWorkspace: t(e).workspace.activeWorkspace.value,
113
- eventBus: t(e).eventBus,
114
- isWorkspaceOpen: t(e).workspace.isOpen.value,
115
- layout: r.layout,
116
- sidebarState: t(e).sidebar.state,
117
- sidebarWidth: t(e).sidebar.width.value,
118
- store: t(e).store.value,
119
- workspaces: t(e).workspace.workspaceList.value,
120
- "onClick:workspace": t(e).workspace.navigateToWorkspace,
121
- "onCreate:workspace": a[2] || (a[2] = (o) => t(c).show()),
122
- "onSelect:workspace": l,
123
- onSelectItem: t(e).sidebar.handleSelectItem,
124
- "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
125
- }, {
126
- sidebarMenuActions: u(() => [
127
- T(s.$slots, "sidebar-menu-actions")
128
- ]),
129
- _: 3
130
- }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
131
- m("div", z, [
132
- n(t(M), h(y(b.value)), null, 16)
133
- ])
73
+ }), d = c(
74
+ () => U(
75
+ e.workspace.filteredWorkspaceList.value,
76
+ e.activeEntities.teamUid.value
77
+ )
78
+ );
79
+ return (o, a) => (l(), u(t(B), null, {
80
+ default: v(() => [
81
+ p("div", { innerHTML: b.value }, null, 8, F),
82
+ n(t(x)),
83
+ t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (l(), k("main", V, [
84
+ s.layout === "desktop" ? (l(), u(L, {
85
+ key: 0,
86
+ activeTabIndex: t(e).tabs.activeTabIndex.value,
87
+ eventBus: t(e).eventBus,
88
+ tabs: t(e).tabs.state.value
89
+ }, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (l(), u(P, {
90
+ key: 1,
91
+ activeWorkspace: t(e).workspace.activeWorkspace.value,
92
+ workspaces: d.value,
93
+ "onCreate:workspace": a[0] || (a[0] = (r) => t(i).show()),
94
+ "onSelect:workspace": m
95
+ }, null, 8, ["activeWorkspace", "workspaces"])),
96
+ p("div", R, [
97
+ n(N, {
98
+ isSidebarOpen: t(e).sidebar.isOpen.value,
99
+ "onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
100
+ activeWorkspace: t(e).workspace.activeWorkspace.value,
101
+ eventBus: t(e).eventBus,
102
+ isWorkspaceOpen: t(e).workspace.isOpen.value,
103
+ layout: s.layout,
104
+ sidebarState: t(e).sidebar.state,
105
+ sidebarWidth: t(e).sidebar.width.value,
106
+ store: t(e).store.value,
107
+ workspaces: d.value,
108
+ "onClick:workspace": t(e).workspace.navigateToWorkspace,
109
+ "onCreate:workspace": a[2] || (a[2] = (r) => t(i).show()),
110
+ "onSelect:workspace": m,
111
+ onSelectItem: t(e).sidebar.handleSelectItem,
112
+ "onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
113
+ }, {
114
+ sidebarMenuActions: v(() => [
115
+ w(o.$slots, "sidebar-menu-actions")
134
116
  ]),
135
- n(O, {
136
- state: t(c),
137
- "onCreate:workspace": a[3] || (a[3] = (o) => t(e).workspace.create(o))
138
- }, null, 8, ["state"]),
139
- n(U, {
140
- eventBus: t(e).eventBus,
141
- paletteState: t(w),
142
- workspaceStore: t(e).store.value
143
- }, null, 8, ["eventBus", "paletteState", "workspaceStore"])
144
- ])) : (i(), v("main", G, [
145
- n(_)
146
- ]))
117
+ _: 3
118
+ }, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
119
+ p("div", z, [
120
+ n(t(O), y(T(W.value)), null, 16)
121
+ ])
122
+ ]),
123
+ w(o.$slots, "create-workspace", { state: t(i) }, () => [
124
+ n(_, {
125
+ state: t(i),
126
+ "onCreate:workspace": a[3] || (a[3] = (r) => t(e).workspace.create(r))
127
+ }, null, 8, ["state"])
147
128
  ]),
148
- _: 3
149
- }, 8, ["activeWorkspace", "darkMode", "workspaceStore", "workspaces"])
129
+ n(I, {
130
+ eventBus: t(e).eventBus,
131
+ paletteState: t(S),
132
+ workspaceStore: t(e).store.value
133
+ }, null, 8, ["eventBus", "paletteState", "workspaceStore"])
134
+ ])) : (l(), k("main", G, [
135
+ n(A)
136
+ ]))
150
137
  ]),
151
138
  _: 3
152
139
  }));
153
140
  }
154
141
  });
155
142
  export {
156
- ue as default
143
+ pe as default
157
144
  };
@@ -23,7 +23,7 @@ type WorkspaceOption = ScalarListboxOption & {
23
23
  declare const navigateToWorkspace: (namespace?: string, slug?: string) => Promise<void>;
24
24
  /**
25
25
  * Creates a new workspace with the provided name.
26
- * - Generates a unique slug for the workspace (sluggified from the name and guaranteed unique).
26
+ * - Generates a unique slug for the workspace (uses the provided slug if it is unique, otherwise generates a unique slug).
27
27
  * - Adds a default blank document ("drafts") to the workspace.
28
28
  * - Persists the workspace and navigates to it.
29
29
  *
@@ -31,12 +31,10 @@ declare const navigateToWorkspace: (namespace?: string, slug?: string) => Promis
31
31
  * await createWorkspace({ name: 'My Awesome API' })
32
32
  * // -> Navigates to /workspace/my-awesome-api (if available)
33
33
  */
34
- declare const createWorkspace: ({ key, name, }: {
35
- key?: {
36
- teamUid?: string;
37
- namespace?: string;
38
- slug: string;
39
- };
34
+ declare const createWorkspace: ({ teamUid, namespace, slug, name, }: {
35
+ teamUid?: string;
36
+ namespace?: string;
37
+ slug?: string;
40
38
  name: string;
41
39
  }) => Promise<{
42
40
  name: string;
@@ -96,48 +94,80 @@ export type GetEntryByLocation = (location: {
96
94
  declare const handleSelectItem: (id: string) => Promise<void | import("vue-router").NavigationFailure | undefined> | undefined;
97
95
  /** Handler for sidebar width changes. */
98
96
  declare const handleSidebarWidthUpdate: (width: number) => void | undefined;
99
- /**
100
- * Copies the URL of the tab at the given index to the clipboard.
101
- * Constructs the full URL using the current origin and the tab path.
102
- *
103
- * @throws Will silently fail if clipboard API is unavailable or the tab does not exist.
104
- */
105
- declare const copyTabUrl: (index: number) => Promise<void>;
97
+ /** Defines the overall application state structure and its main feature modules */
106
98
  export type AppState = {
99
+ /** The workspace store */
107
100
  store: ShallowRef<WorkspaceStore | null>;
101
+ /** The sidebar management */
108
102
  sidebar: {
103
+ /** The sidebar state */
109
104
  state: typeof sidebarState;
105
+ /** The width of the sidebar */
110
106
  width: ComputedRef<number>;
107
+ /** Whether the sidebar is open */
111
108
  isOpen: Ref<boolean>;
109
+ /** Handles the selection of an item in the sidebar */
112
110
  handleSelectItem: typeof handleSelectItem;
111
+ /** Handles the width update of the sidebar */
113
112
  handleSidebarWidthUpdate: typeof handleSidebarWidthUpdate;
113
+ /** Gets the entry by location */
114
114
  getEntryByLocation: typeof getEntryByLocation;
115
115
  };
116
+ /** The tabs management */
116
117
  tabs: {
118
+ /** The tabs state */
117
119
  state: Ref<Tab[]>;
120
+ /** The active tab index */
118
121
  activeTabIndex: Ref<number>;
119
- copyTabUrl: typeof copyTabUrl;
122
+ /** Copies the URL of the tab at the given index to the clipboard */
123
+ copyTabUrl: (index: number) => Promise<void>;
120
124
  };
125
+ /** The workspace management */
121
126
  workspace: {
127
+ /** Creates a new workspace and navigates to it */
122
128
  create: typeof createWorkspace;
129
+ /** All workspace list */
123
130
  workspaceList: Ref<WorkspaceOption[]>;
124
- activeWorkspace: ShallowRef<ScalarListboxOption | null>;
131
+ /** Filtered workspace list, based on the current teamUid */
132
+ filteredWorkspaceList: ComputedRef<WorkspaceOption[]>;
133
+ /** The currently active workspace */
134
+ activeWorkspace: ShallowRef<{
135
+ id: string;
136
+ label: string;
137
+ } | null>;
138
+ /** Navigates to the specified workspace */
125
139
  navigateToWorkspace: typeof navigateToWorkspace;
140
+ /** Whether the workspace page is open */
126
141
  isOpen: ComputedRef<boolean>;
127
142
  };
143
+ /** The workspace event bus for handling workspace-level events */
128
144
  eventBus: WorkspaceEventBus;
145
+ /** The router instance */
129
146
  router: ShallowRef<Router | null>;
147
+ /** The current route derived from the router */
130
148
  currentRoute: Ref<RouteLocationNormalizedGeneric | null>;
149
+ /** Whether the workspace is currently syncing */
131
150
  loading: Ref<boolean>;
151
+ /** The currently active entities */
132
152
  activeEntities: {
153
+ /** The namespace of the current entity, e.g. "default" or a custom namespace */
133
154
  namespace: Ref<string | undefined>;
155
+ /** The slug identifying the current workspace */
134
156
  workspaceSlug: Ref<string | undefined>;
157
+ /** The slug of the currently selected document in the workspace */
135
158
  documentSlug: Ref<string | undefined>;
159
+ /** The API path currently selected (e.g. "/users/{id}") */
136
160
  path: Ref<string | undefined>;
161
+ /** The HTTP method for the currently selected API path (e.g. GET, POST) */
137
162
  method: Ref<HttpMethod | undefined>;
163
+ /** The name of the currently selected example (for examples within an endpoint) */
138
164
  exampleName: Ref<string | undefined>;
165
+ /** The unique identifier for the selected team context */
166
+ teamUid: Ref<string>;
139
167
  };
168
+ /** The currently active environment */
140
169
  environment: ComputedRef<XScalarEnvironment>;
170
+ /** The currently active document */
141
171
  document: ComputedRef<WorkspaceDocument | null>;
142
172
  };
143
173
  export declare function useAppState(_router: Router): AppState;
@@ -1 +1 @@
1
- {"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CA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