@scalar/api-client 2.2.32 → 2.2.34

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 (90) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  3. package/dist/components/AddressBar/AddressBar.vue2.js +27 -26
  4. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +9 -3
  5. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -54
  7. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +13 -3
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  9. package/dist/components/DataTable/DataTable.vue.js +7 -7
  10. package/dist/components/DataTable/DataTableCell.vue.js +6 -6
  11. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  12. package/dist/components/Form/Form.vue.js +5 -5
  13. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  14. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +72 -71
  15. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  16. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +23 -22
  17. package/dist/components/Search/useSearch.d.ts.map +1 -1
  18. package/dist/components/Search/useSearch.js +61 -48
  19. package/dist/components/SideNav/SideNavLink.vue.js +2 -2
  20. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  21. package/dist/components/Sidebar/Sidebar.vue2.js +5 -5
  22. package/dist/components/Sidebar/SidebarList.vue.js +1 -1
  23. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +1 -1
  24. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  25. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  26. package/dist/components/Sidebar/SidebarListElement.vue2.js +12 -12
  27. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  28. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  29. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  30. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  31. package/dist/constants.d.ts +4 -0
  32. package/dist/constants.d.ts.map +1 -1
  33. package/dist/constants.js +2 -2
  34. package/dist/layouts/App/create-api-client-app.d.ts +171 -128
  35. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  36. package/dist/layouts/Modal/create-api-client-modal.d.ts +342 -256
  37. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  38. package/dist/layouts/Web/create-api-client-web.d.ts +171 -128
  39. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  40. package/dist/libs/create-client.d.ts +172 -129
  41. package/dist/libs/create-client.d.ts.map +1 -1
  42. package/dist/libs/create-client.js +8 -7
  43. package/dist/libs/find-request.d.ts +2 -0
  44. package/dist/libs/find-request.d.ts.map +1 -1
  45. package/dist/libs/send-request/send-request.d.ts.map +1 -1
  46. package/dist/libs/send-request/send-request.js +93 -93
  47. package/dist/routes.d.ts +1 -0
  48. package/dist/routes.d.ts.map +1 -1
  49. package/dist/routes.js +12 -7
  50. package/dist/store/active-entities.d.ts +29 -27
  51. package/dist/store/active-entities.d.ts.map +1 -1
  52. package/dist/store/collections.d.ts +4 -4
  53. package/dist/store/events.d.ts +3 -1
  54. package/dist/store/events.d.ts.map +1 -1
  55. package/dist/store/request-example.d.ts +134 -134
  56. package/dist/store/request-example.d.ts.map +1 -1
  57. package/dist/store/requests.d.ts +26 -4
  58. package/dist/store/requests.d.ts.map +1 -1
  59. package/dist/store/store.d.ts +174 -129
  60. package/dist/store/store.d.ts.map +1 -1
  61. package/dist/store/store.js +48 -46
  62. package/dist/store/tags.d.ts +24 -4
  63. package/dist/store/tags.d.ts.map +1 -1
  64. package/dist/style.css +1 -1
  65. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  66. package/dist/views/Cookies/CookieForm.vue.js +12 -12
  67. package/dist/views/Cookies/Cookies.vue2.js +12 -12
  68. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  69. package/dist/views/Environment/Environment.vue2.js +98 -97
  70. package/dist/views/Environment/EnvironmentModal.vue.js +1 -1
  71. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +6 -6
  72. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  74. package/dist/views/Request/RequestSidebar.vue2.js +14 -14
  75. package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -2
  76. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  77. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  78. package/dist/views/Request/RequestSidebarItem.vue2.js +132 -125
  79. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  80. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  81. package/dist/views/Request/RequestSubpageHeader.vue2.js +21 -21
  82. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  83. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  84. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +12 -12
  85. package/dist/views/Servers/ServerForm.vue.d.ts +8 -1
  86. package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
  87. package/dist/views/Servers/ServerForm.vue.js +28 -59
  88. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  89. package/dist/views/Servers/Servers.vue2.js +141 -53
  90. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"CookieForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/CookieForm.vue"],"names":[],"mappings":";AAyLA,wBAMG"}
1
+ {"version":3,"file":"CookieForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/CookieForm.vue"],"names":[],"mappings":";AA0LA,wBAMG"}
@@ -1,11 +1,11 @@
1
- import { defineComponent as c, computed as p, openBlock as m, createBlock as d, withCtx as k, createElementVNode as t } from "vue";
1
+ import { defineComponent as c, computed as p, openBlock as d, createBlock as m, withCtx as k, createElementVNode as t } from "vue";
2
2
  import v from "../../components/Form/Form.vue.js";
3
3
  import { useActiveEntities as f } from "../../store/active-entities.js";
4
- import { useWorkspace as h } from "../../store/store.js";
5
- const y = { class: "flex items-center pointer-events-none" }, _ = ["value"], F = /* @__PURE__ */ c({
4
+ import { useWorkspace as b } from "../../store/store.js";
5
+ const h = { class: "flex items-center pointer-events-none" }, y = ["value"], F = /* @__PURE__ */ c({
6
6
  __name: "CookieForm",
7
- setup(b) {
8
- const { activeCookieId: o } = f(), { cookies: r, cookieMutators: i } = h(), s = [
7
+ setup(_) {
8
+ const { activeCookieId: o } = f(), { cookies: n, cookieMutators: i } = b(), s = [
9
9
  { label: "Key", key: "key", placeholder: "Username" },
10
10
  { label: "Value", key: "value", placeholder: "123" },
11
11
  { label: "Domain", key: "domain", placeholder: "scalar.com" },
@@ -14,24 +14,24 @@ const y = { class: "flex items-center pointer-events-none" }, _ = ["value"], F =
14
14
  { label: "Secure", key: "secure", placeholder: "True/False" },
15
15
  { label: "HttpOnly", key: "httpOnly", placeholder: "True/False" }
16
16
  ], l = p(
17
- () => r[o.value] || {
17
+ () => n[o.value] || {
18
18
  value: "",
19
19
  uid: "",
20
20
  name: "",
21
21
  sameSite: "Lax"
22
22
  }
23
- ), a = (n, e) => {
24
- o.value && i.edit(o.value, n, e);
23
+ ), a = (r, e) => {
24
+ o.value && i.edit(o.value, r, e);
25
25
  };
26
- return (n, e) => (m(), d(v, {
26
+ return (r, e) => (d(), m(v, {
27
27
  data: l.value,
28
28
  onUpdate: a,
29
29
  options: s
30
30
  }, {
31
31
  title: k(() => [
32
- t("div", y, [
32
+ t("div", h, [
33
33
  e[1] || (e[1] = t("label", {
34
- class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
34
+ class: "absolute border-b w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
35
35
  for: "cookiename"
36
36
  }, null, -1)),
37
37
  t("input", {
@@ -40,7 +40,7 @@ const y = { class: "flex items-center pointer-events-none" }, _ = ["value"], F =
40
40
  placeholder: "Cookie Name",
41
41
  value: l.value.name,
42
42
  onInput: e[0] || (e[0] = (u) => a("name", u.target.value))
43
- }, null, 40, _)
43
+ }, null, 40, y)
44
44
  ])
45
45
  ]),
46
46
  _: 1
@@ -1,4 +1,4 @@
1
- import { defineComponent as D, computed as K, onMounted as R, onBeforeUnmount as F, openBlock as l, createBlock as $, withCtx as a, createVNode as s, unref as n, createElementVNode as c, createElementBlock as p, Fragment as k, renderList as x, normalizeClass as j, toDisplayString as N, withDirectives as O, createTextVNode as z, withModifiers as A, vShow as E } from "vue";
1
+ import { defineComponent as D, computed as K, onMounted as R, onBeforeUnmount as F, openBlock as l, createBlock as $, withCtx as a, createVNode as s, unref as n, createElementVNode as c, createElementBlock as d, Fragment as k, renderList as _, normalizeClass as j, toDisplayString as N, withDirectives as O, createTextVNode as z, withModifiers as A, vShow as E } from "vue";
2
2
  import H from "../../components/Sidebar/SidebarButton.vue.js";
3
3
  import I from "../../components/Sidebar/SidebarList.vue.js";
4
4
  import P from "../../components/Sidebar/SidebarListElement.vue.js";
@@ -15,7 +15,7 @@ import { useSidebar as Z } from "../../hooks/useSidebar.js";
15
15
  const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-3 before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, re = ["onClick"], se = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(1.75rem_-1px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, ve = /* @__PURE__ */ D({
16
16
  __name: "Cookies",
17
17
  setup(le) {
18
- const { cookies: b, cookieMutators: _, events: v } = X(), { collapsedSidebarFolders: u, toggleSidebarFolder: g } = Z(), d = q(), M = G(), y = () => {
18
+ const { cookies: b, cookieMutators: x, events: v } = X(), { collapsedSidebarFolders: u, toggleSidebarFolder: g } = Z(), p = q(), M = G(), y = () => {
19
19
  const e = Object.keys(b).length, t = W.parse({
20
20
  name: `Cookie ${e}`,
21
21
  value: "",
@@ -25,17 +25,17 @@ const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-borde
25
25
  httpOnly: !1,
26
26
  sameSite: "None"
27
27
  });
28
- _.add(t), d.push(t.uid);
28
+ x.add(t), p.push(t.uid);
29
29
  }, V = (e) => {
30
30
  var o;
31
- _.delete(e);
31
+ x.delete(e);
32
32
  const t = Object.values(b).filter(
33
33
  (r) => r.uid !== e
34
34
  );
35
35
  if (t.length > 1) {
36
36
  const r = t[t.length - 1];
37
- r && d.push(r.uid);
38
- } else t.length === 1 && ((o = t[0]) == null ? void 0 : o.uid) === "default" && d.push("default");
37
+ r && p.push(r.uid);
38
+ } else t.length === 1 && ((o = t[0]) == null ? void 0 : o.uid) === "default" && p.push("default");
39
39
  }, h = K(() => {
40
40
  const e = {};
41
41
  return Object.values(b).forEach((t) => {
@@ -46,7 +46,7 @@ const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-borde
46
46
  e != null && e.createNew && M.name === "cookies" && y();
47
47
  }, B = (e, t) => {
48
48
  const o = `/workspace/default/cookies/${t}`;
49
- e.metaKey ? window.open(o, "_blank") : d.push({ path: o });
49
+ e.metaKey ? window.open(o, "_blank") : p.push({ path: o });
50
50
  };
51
51
  return R(() => {
52
52
  const e = Object.keys(h.value), t = Object.entries(h.value).flatMap(
@@ -64,9 +64,9 @@ const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-borde
64
64
  c("div", ee, [
65
65
  s(I, null, {
66
66
  default: a(() => [
67
- (l(!0), p(k, null, x(h.value, (o, r) => (l(), p("div", {
67
+ (l(!0), d(k, null, _(h.value, (o, r) => (l(), d("div", {
68
68
  key: r,
69
- class: "flex flex-col gap-px"
69
+ class: "flex flex-col gap-1/2"
70
70
  }, [
71
71
  c("button", {
72
72
  class: "hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded text-left text-sm p-1.5 focus-visible:z-10 hover:bg-sidebar-active-b indent-padding-left",
@@ -83,9 +83,9 @@ const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-borde
83
83
  c("span", null, N(r), 1)
84
84
  ], 8, te),
85
85
  O(c("div", oe, [
86
- (l(!0), p(k, null, x(o, (m, f) => (l(), p("div", {
86
+ (l(!0), d(k, null, _(o, (m, f) => (l(), d("div", {
87
87
  key: f,
88
- class: "flex flex-col gap-px"
88
+ class: "flex flex-col gap-1/2"
89
89
  }, [
90
90
  c("button", {
91
91
  class: "flex gap-1.5 items-center pl-5 pr-2 py-1.5 text-left text-sm w-full break-words rounded hover:bg-b-2",
@@ -102,7 +102,7 @@ const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-borde
102
102
  z(" " + N(f), 1)
103
103
  ], 8, re),
104
104
  O(c("div", se, [
105
- (l(!0), p(k, null, x(m, (i) => (l(), $(P, {
105
+ (l(!0), d(k, null, _(m, (i) => (l(), $(P, {
106
106
  key: i.uid,
107
107
  class: "cookie text-xs",
108
108
  type: "cookies",
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";AAk2CA,wBAMG"}
1
+ {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";AAm2CA,wBAMG"}
@@ -1,26 +1,26 @@
1
- import { defineComponent as re, ref as x, watch as se, onMounted as ie, onBeforeUnmount as ue, openBlock as m, createBlock as C, withCtx as d, createVNode as u, createElementVNode as f, createElementBlock as M, Fragment as U, renderList as z, unref as s, normalizeClass as A, createTextVNode as B, toDisplayString as W, withDirectives as de, withModifiers as ce, createCommentVNode as K, vShow as me, createSlots as ve } from "vue";
1
+ import { defineComponent as re, ref as b, watch as se, onMounted as ie, onBeforeUnmount as ue, openBlock as v, createBlock as E, withCtx as d, createVNode as u, createElementVNode as p, createElementBlock as M, Fragment as U, renderList as z, unref as s, normalizeClass as A, createTextVNode as B, toDisplayString as K, withDirectives as de, withModifiers as me, createCommentVNode as F, vShow as ce, createSlots as ve } from "vue";
2
2
  import fe from "../../components/CodeInput/CodeInput.vue.js";
3
3
  import pe from "../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
4
4
  import xe from "../../components/Sidebar/Sidebar.vue.js";
5
5
  import be from "../../components/Sidebar/SidebarButton.vue.js";
6
6
  import he from "../../components/Sidebar/SidebarList.vue.js";
7
- import F from "../../components/Sidebar/SidebarListElement.vue.js";
7
+ import G from "../../components/Sidebar/SidebarListElement.vue.js";
8
8
  import ye from "../../components/ViewLayout/ViewLayout.vue.js";
9
9
  import Ce from "../../components/ViewLayout/ViewLayoutContent.vue.js";
10
- import ke from "../../components/ViewLayout/ViewLayoutSection.vue.js";
11
- import { useActiveEntities as Ee } from "../../store/active-entities.js";
12
- import { useModal as $, ScalarIcon as G, ScalarButton as ge, ScalarModal as _e } from "@scalar/components";
10
+ import Ee from "../../components/ViewLayout/ViewLayoutSection.vue.js";
11
+ import { useActiveEntities as ke } from "../../store/active-entities.js";
12
+ import { useModal as V, ScalarIcon as J, ScalarButton as ge, ScalarModal as _e } from "@scalar/components";
13
13
  import { LibraryIcon as we } from "@scalar/icons";
14
14
  import { useToasts as Ie } from "@scalar/use-toasts";
15
- import { useRouter as Se, useRoute as Me } from "vue-router";
16
- import $e from "./EnvironmentColorModal.vue.js";
15
+ import { useRouter as Se, useRoute as $e } from "vue-router";
16
+ import Me from "./EnvironmentColorModal.vue.js";
17
17
  import Ve from "./EnvironmentModal.vue.js";
18
18
  import { useWorkspace as Ne } from "../../store/store.js";
19
19
  import { useSidebar as Oe } from "../../hooks/useSidebar.js";
20
20
  const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-center justify-center max-w-[14px]" }, tn = /* @__PURE__ */ re({
21
21
  __name: "Environment",
22
22
  setup(Le) {
23
- const b = Se(), k = Me(), { activeWorkspace: V, activeEnvironment: J, activeWorkspaceCollections: i } = Ee(), { events: N, workspaceMutators: T, collectionMutators: h } = Ne(), { collapsedSidebarFolders: y, toggleSidebarFolder: E } = Oe(), g = $(), _ = $(), w = $(), O = x(null), l = x("default"), R = x(""), p = x(void 0), c = x(void 0), I = x(void 0), { toast: j } = Ie(), H = (e) => JSON.parse(e);
23
+ const h = Se(), k = $e(), { activeWorkspace: c, activeEnvironment: T, activeWorkspaceCollections: i } = ke(), { events: N, workspaceMutators: H, collectionMutators: y } = Ne(), { collapsedSidebarFolders: C, toggleSidebarFolder: g } = Oe(), _ = V(), w = V(), I = V(), O = b(null), r = b("default"), R = b(""), x = b(void 0), m = b(void 0), S = b(void 0), { toast: j } = Ie(), W = (e) => JSON.parse(e);
24
24
  function D(e, o, n) {
25
25
  var t;
26
26
  e && (o.uid === n ? j(
@@ -36,41 +36,41 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
36
36
  ).includes(e.name);
37
37
  return D(t, n, e.collectionId), t;
38
38
  }
39
- ) || (e.collectionId && (h.addEnvironment(
39
+ ) || (e.collectionId && (y.addEnvironment(
40
40
  e.name,
41
41
  {
42
42
  variables: {},
43
43
  color: e.color
44
44
  },
45
45
  e.collectionId
46
- ), y[e.collectionId] || E(e.collectionId), b.push({
46
+ ), C[e.collectionId] || g(e.collectionId), h.push({
47
47
  name: "environment.collection",
48
48
  params: {
49
49
  collectionId: e.collectionId,
50
50
  environmentId: e.name
51
51
  }
52
- })), _.hide());
52
+ })), w.hide());
53
53
  }
54
54
  function P(e) {
55
55
  var o, n;
56
- if (J) {
57
- const t = H(e);
58
- if (l.value === "default")
59
- T.edit(
60
- ((o = V.value) == null ? void 0 : o.uid) ?? "",
56
+ if (T) {
57
+ const t = W(e);
58
+ if (r.value === "default")
59
+ H.edit(
60
+ ((o = c.value) == null ? void 0 : o.uid) ?? "",
61
61
  "environments",
62
62
  t
63
63
  );
64
64
  else {
65
65
  const a = i.value.find(
66
- (r) => {
67
- var v;
68
- return (v = r["x-scalar-environments"]) == null ? void 0 : v[l.value ?? ""];
66
+ (l) => {
67
+ var f;
68
+ return (f = l["x-scalar-environments"]) == null ? void 0 : f[r.value ?? ""];
69
69
  }
70
70
  );
71
- if ((n = a == null ? void 0 : a["x-scalar-environments"]) != null && n[l.value ?? ""]) {
72
- const r = a["x-scalar-environments"][l.value ?? ""];
73
- r && (r.variables = t, h.edit(
71
+ if ((n = a == null ? void 0 : a["x-scalar-environments"]) != null && n[r.value ?? ""]) {
72
+ const l = a["x-scalar-environments"][r.value ?? ""];
73
+ l && (l.variables = t, y.edit(
74
74
  a.uid,
75
75
  "x-scalar-environments",
76
76
  a["x-scalar-environments"]
@@ -79,18 +79,18 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
79
79
  }
80
80
  }
81
81
  }
82
- const S = (e) => {
83
- p.value = e, _.show();
82
+ const $ = (e) => {
83
+ x.value = e, w.show();
84
84
  }, Q = (e, o) => {
85
- c.value = e, p.value = o, I.value = e, w.show();
85
+ m.value = e, x.value = o, S.value = e, I.show();
86
86
  }, X = (e) => {
87
87
  var o, n, t;
88
88
  O.value = e, R.value = ((t = (n = (o = i.value.find(
89
89
  (a) => {
90
- var r;
91
- return (r = a["x-scalar-environments"]) == null ? void 0 : r[e];
90
+ var l;
91
+ return (l = a["x-scalar-environments"]) == null ? void 0 : l[e];
92
92
  }
93
- )) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[e]) == null ? void 0 : t.color) ?? "", g.show();
93
+ )) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[e]) == null ? void 0 : t.color) ?? "", _.show();
94
94
  }, Y = (e) => {
95
95
  const o = O.value;
96
96
  typeof o == "string" && (i.value.some(
@@ -100,16 +100,16 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
100
100
  }
101
101
  ) && i.value.forEach((t) => {
102
102
  var a;
103
- (a = t["x-scalar-environments"]) != null && a[o] && (t["x-scalar-environments"][o].color = e, h.edit(
103
+ (a = t["x-scalar-environments"]) != null && a[o] && (t["x-scalar-environments"][o].color = e, y.edit(
104
104
  t.uid,
105
105
  "x-scalar-environments",
106
106
  t["x-scalar-environments"]
107
107
  ));
108
- }), g.hide());
108
+ }), _.hide());
109
109
  };
110
110
  function Z(e) {
111
111
  i.value.forEach((n) => {
112
- h.removeEnvironment(e, n.uid);
112
+ y.removeEnvironment(e, n.uid);
113
113
  });
114
114
  const o = i.value.flatMap(
115
115
  (n) => Object.keys(n["x-scalar-environments"] || {})
@@ -122,50 +122,51 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
122
122
  n
123
123
  )
124
124
  );
125
- l.value = n, b.push({
125
+ r.value = n, h.push({
126
126
  name: "environment.collection",
127
127
  params: {
128
128
  collectionId: t == null ? void 0 : t.uid,
129
129
  environmentId: n
130
130
  }
131
- }), t && !y[t.uid] && E(t.uid);
131
+ }), t && !C[t.uid] && g(t.uid);
132
132
  } else
133
- l.value = "default", b.push({
133
+ r.value = "default", h.push({
134
134
  name: "environment",
135
135
  params: { environment: "default" }
136
136
  });
137
137
  }
138
- const ee = () => l.value === "default" ? "Global Environment" : l.value, ne = () => {
138
+ const ee = () => r.value === "default" ? "Global Environment" : r.value, ne = () => {
139
139
  var e, o, n, t;
140
- return l.value === "default" ? JSON.stringify((e = V.value) == null ? void 0 : e.environments, null, 2) : JSON.stringify(
140
+ return r.value === "default" ? JSON.stringify((e = c.value) == null ? void 0 : e.environments, null, 2) : JSON.stringify(
141
141
  (t = (n = (o = i.value.find(
142
142
  (a) => {
143
- var r;
144
- return (r = a["x-scalar-environments"]) == null ? void 0 : r[l.value ?? ""];
143
+ var l;
144
+ return (l = a["x-scalar-environments"]) == null ? void 0 : l[r.value ?? ""];
145
145
  }
146
- )) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[l.value ?? ""]) == null ? void 0 : t.variables,
146
+ )) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[r.value ?? ""]) == null ? void 0 : t.variables,
147
147
  null,
148
148
  2
149
149
  );
150
- }, te = (e) => y[e], L = (e) => {
151
- e != null && e.createNew && k.name === "environment" && S();
150
+ }, te = (e) => C[e], L = (e) => {
151
+ e != null && e.createNew && k.name === "environment" && $();
152
152
  };
153
153
  se(
154
154
  () => [k.params.collectionId, k.params.environmentId],
155
155
  ([e, o]) => {
156
- e ? l.value = o : l.value = "default";
156
+ e ? r.value = o : r.value = "default";
157
157
  }
158
158
  ), ie(() => {
159
- l.value = k.params.environmentId || "default", N.hotKeys.on(L);
160
- const { collectionId: e } = b.currentRoute.value.params;
161
- e && !y[e] && E(e);
159
+ r.value = k.params.environmentId || "default", N.hotKeys.on(L);
160
+ const { collectionId: e } = h.currentRoute.value.params;
161
+ e && !C[e] && g(e);
162
162
  }), ue(() => N.hotKeys.off(L));
163
163
  const oe = (e, o, n) => {
164
- const t = n ? `/workspace/default/environment/${n}/${o}` : `/workspace/default/environment/${o}`;
165
- e.metaKey ? window.open(t, "_blank") : b.push({ path: t });
164
+ var a, l;
165
+ const t = n ? `/workspace/${(a = c == null ? void 0 : c.value) == null ? void 0 : a.uid}/environment/${n}/${o}` : `/workspace/${(l = c == null ? void 0 : c.value) == null ? void 0 : l.uid}/environment/${o}`;
166
+ e.metaKey ? window.open(t, "_blank") : h.push({ path: t });
166
167
  };
167
168
  function ae() {
168
- c.value = void 0, p.value = void 0, I.value = void 0, w.hide();
169
+ m.value = void 0, x.value = void 0, S.value = void 0, I.hide();
169
170
  }
170
171
  function le(e) {
171
172
  i.value.some(
@@ -176,29 +177,29 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
176
177
  return D(
177
178
  t,
178
179
  n,
179
- p.value
180
+ x.value
180
181
  ), t;
181
182
  }
182
- ) || (e && c.value !== "default" && i.value.forEach((n) => {
183
+ ) || (e && m.value !== "default" && i.value.forEach((n) => {
183
184
  var t;
184
- if ((t = n["x-scalar-environments"]) != null && t[c.value ?? ""]) {
185
- const a = n["x-scalar-environments"][c.value ?? ""];
186
- a && (delete n["x-scalar-environments"][c.value ?? ""], n["x-scalar-environments"][e] = a, h.edit(
185
+ if ((t = n["x-scalar-environments"]) != null && t[m.value ?? ""]) {
186
+ const a = n["x-scalar-environments"][m.value ?? ""];
187
+ a && (delete n["x-scalar-environments"][m.value ?? ""], n["x-scalar-environments"][e] = a, y.edit(
187
188
  n.uid,
188
189
  "x-scalar-environments",
189
190
  n["x-scalar-environments"]
190
191
  ));
191
192
  }
192
- }), e && l.value === c.value && (l.value = e), c.value = void 0, p.value = void 0, I.value = void 0, w.hide());
193
+ }), e && r.value === m.value && (r.value = e), m.value = void 0, x.value = void 0, S.value = void 0, I.hide());
193
194
  }
194
- return (e, o) => (m(), C(ye, null, {
195
+ return (e, o) => (v(), E(ye, null, {
195
196
  default: d(() => [
196
197
  u(xe, { title: "Collections" }, {
197
198
  content: d(() => [
198
- f("div", Re, [
199
+ p("div", Re, [
199
200
  u(he, null, {
200
201
  default: d(() => [
201
- (m(), C(F, {
202
+ (v(), E(G, {
202
203
  key: "default",
203
204
  class: "text-xs",
204
205
  isCopyable: !1,
@@ -210,43 +211,43 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
210
211
  isDefault: !0
211
212
  }
212
213
  })),
213
- (m(!0), M(U, null, z(s(i), (n) => {
214
+ (v(!0), M(U, null, z(s(i), (n) => {
214
215
  var t;
215
- return m(), M("div", {
216
+ return v(), M("div", {
216
217
  key: n.uid,
217
218
  class: "flex flex-col gap-0.25"
218
219
  }, [
219
- f("button", {
220
+ p("button", {
220
221
  class: "flex font-medium gap-1.5 group items-center p-1.5 text-left text-sm w-full break-words rounded hover:bg-b-2",
221
222
  type: "button",
222
- onClick: (a) => s(E)(n.uid)
223
+ onClick: (a) => s(g)(n.uid)
223
224
  }, [
224
- f("span", De, [
225
+ p("span", De, [
225
226
  u(s(we), {
226
227
  class: "min-w-3.5 text-sidebar-c-2 size-3.5 stroke-2 group-hover:hidden",
227
228
  src: n["x-scalar-icon"] || "interface-content-folder"
228
229
  }, null, 8, ["src"]),
229
- f("div", {
230
+ p("div", {
230
231
  class: A({
231
- "rotate-90": s(y)[n.uid]
232
+ "rotate-90": s(C)[n.uid]
232
233
  })
233
234
  }, [
234
- u(s(G), {
235
+ u(s(J), {
235
236
  class: "text-c-3 hidden text-sm group-hover:block",
236
237
  icon: "ChevronRight",
237
238
  size: "md"
238
239
  })
239
240
  ], 2)
240
241
  ]),
241
- B(" " + W(((t = n.info) == null ? void 0 : t.title) ?? ""), 1)
242
+ B(" " + K(((t = n.info) == null ? void 0 : t.title) ?? ""), 1)
242
243
  ], 8, je),
243
- de(f("div", {
244
+ de(p("div", {
244
245
  class: A({
245
246
  "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-3 before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative": Object.keys(n["x-scalar-environments"] || {}).length > 0
246
247
  })
247
248
  }, [
248
- (m(!0), M(U, null, z(n["x-scalar-environments"], (a, r) => (m(), C(F, {
249
- key: r,
249
+ (v(!0), M(U, null, z(n["x-scalar-environments"], (a, l) => (v(), E(G, {
250
+ key: l,
250
251
  class: "text-xs [&>a]:pl-5",
251
252
  collectionId: n.uid,
252
253
  isCopyable: !1,
@@ -254,35 +255,35 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
254
255
  isRenameable: !0,
255
256
  type: "environment",
256
257
  variable: {
257
- name: r,
258
- uid: r,
258
+ name: l,
259
+ uid: l,
259
260
  color: a.color ?? "#8E8E8E",
260
261
  isDefault: !1
261
262
  },
262
263
  warningMessage: "Are you sure you want to delete this environment?",
263
- onClick: ce((v) => oe(v, r, n.uid), ["prevent"]),
264
- onColorModal: (v) => X(r),
265
- onDelete: (v) => Z(r),
266
- onRename: (v) => Q(r, n.uid)
264
+ onClick: me((f) => oe(f, l, n.uid), ["prevent"]),
265
+ onColorModal: (f) => X(l),
266
+ onDelete: (f) => Z(l),
267
+ onRename: (f) => Q(l, n.uid)
267
268
  }, null, 8, ["collectionId", "variable", "onClick", "onColorModal", "onDelete", "onRename"]))), 128)),
268
- Object.keys(n["x-scalar-environments"] || {}).length === 0 ? (m(), C(s(ge), {
269
+ Object.keys(n["x-scalar-environments"] || {}).length === 0 ? (v(), E(s(ge), {
269
270
  key: 0,
270
271
  class: "mb-[.5px] flex gap-1.5 h-8 text-c-1 pl-6 py-0 justify-start text-xs w-full hover:bg-b-2",
271
272
  variant: "ghost",
272
- onClick: (a) => S(n.uid)
273
+ onClick: (a) => $(n.uid)
273
274
  }, {
274
275
  default: d(() => [
275
- u(s(G), {
276
+ u(s(J), {
276
277
  class: "ml-0.5 h-2.5 w-2.5",
277
278
  icon: "Add",
278
279
  thickness: "3"
279
280
  }),
280
- o[2] || (o[2] = f("span", null, "Add Environment", -1))
281
+ o[2] || (o[2] = p("span", null, "Add Environment", -1))
281
282
  ]),
282
283
  _: 2
283
- }, 1032, ["onClick"])) : K("", !0)
284
+ }, 1032, ["onClick"])) : F("", !0)
284
285
  ], 2), [
285
- [me, te(n.uid)]
286
+ [ce, te(n.uid)]
286
287
  ])
287
288
  ]);
288
289
  }), 128))
@@ -293,7 +294,7 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
293
294
  ]),
294
295
  button: d(() => [
295
296
  u(be, {
296
- click: S,
297
+ click: $,
297
298
  hotkey: "N"
298
299
  }, {
299
300
  title: d(() => o[3] || (o[3] = [
@@ -306,25 +307,25 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
306
307
  }),
307
308
  u(Ce, { class: "flex-1" }, {
308
309
  default: d(() => [
309
- u(ke, null, ve({
310
+ u(Ee, null, ve({
310
311
  default: d(() => [
311
- l.value ? (m(), C(fe, {
312
+ r.value ? (v(), E(fe, {
312
313
  key: 0,
313
- class: "pl-px pr-2 md:px-4 py-2",
314
+ class: "border-t pl-px pr-2 md:px-4 py-2",
314
315
  isCopyable: "",
315
316
  language: "json",
316
317
  lineNumbers: "",
317
318
  lint: "",
318
319
  modelValue: ne(),
319
320
  "onUpdate:modelValue": P
320
- }, null, 8, ["modelValue"])) : K("", !0)
321
+ }, null, 8, ["modelValue"])) : F("", !0)
321
322
  ]),
322
323
  _: 2
323
324
  }, [
324
- l.value ? {
325
+ r.value ? {
325
326
  name: "title",
326
327
  fn: d(() => [
327
- f("span", null, W(ee()), 1)
328
+ p("span", null, K(ee()), 1)
328
329
  ]),
329
330
  key: "0"
330
331
  } : void 0
@@ -332,27 +333,27 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
332
333
  ]),
333
334
  _: 1
334
335
  }),
335
- u($e, {
336
+ u(Me, {
336
337
  selectedColor: R.value,
337
- state: s(g),
338
- onCancel: o[0] || (o[0] = (n) => s(g).hide()),
338
+ state: s(_),
339
+ onCancel: o[0] || (o[0] = (n) => s(_).hide()),
339
340
  onSubmit: Y
340
341
  }, null, 8, ["selectedColor", "state"]),
341
342
  u(Ve, {
342
343
  activeWorkspaceCollections: s(i),
343
- collectionId: p.value,
344
- state: s(_),
345
- onCancel: o[1] || (o[1] = (n) => s(_).hide()),
344
+ collectionId: x.value,
345
+ state: s(w),
346
+ onCancel: o[1] || (o[1] = (n) => s(w).hide()),
346
347
  onSubmit: q
347
348
  }, null, 8, ["activeWorkspaceCollections", "collectionId", "state"]),
348
349
  u(s(_e), {
349
350
  size: "xxs",
350
- state: s(w),
351
- title: `Edit ${c.value}`
351
+ state: s(I),
352
+ title: `Edit ${m.value}`
352
353
  }, {
353
354
  default: d(() => [
354
355
  u(pe, {
355
- name: I.value ?? "",
356
+ name: S.value ?? "",
356
357
  onClose: ae,
357
358
  onEdit: le
358
359
  }, null, 8, ["name"])
@@ -54,7 +54,7 @@ const P = { class: "flex gap-2 items-start" }, K = /* @__PURE__ */ _({
54
54
  n.state.hide(), E.commandPalette.emit({ commandName: "Create Collection" });
55
55
  };
56
56
  return (t, e) => (m(), v(i(B), {
57
- bodyClass: "!border-t-0 !rounded-t-lg",
57
+ bodyClass: "border-t-0 rounded-t-lg",
58
58
  size: "xs",
59
59
  state: t.state
60
60
  }, {
@@ -1,4 +1,4 @@
1
- import { defineComponent as R, ref as m, computed as h, onMounted as I, openBlock as r, createBlock as v, unref as l, withCtx as x, createElementVNode as c, normalizeStyle as y, createElementBlock as u, Fragment as P, renderList as T, normalizeClass as j, createTextVNode as b, toDisplayString as k, createVNode as q, createCommentVNode as g } from "vue";
1
+ import { defineComponent as R, ref as m, computed as h, onMounted as I, openBlock as r, createBlock as v, unref as l, withCtx as y, createElementVNode as c, normalizeStyle as x, createElementBlock as u, Fragment as P, renderList as T, normalizeClass as j, createTextVNode as b, toDisplayString as k, createVNode as q, createCommentVNode as g } from "vue";
2
2
  import { getEnvColor as D } from "../../libs/env-helpers.js";
3
3
  import { ScalarTeleport as F, ScalarIcon as V, ScalarButton as K } from "@scalar/components";
4
4
  import { onClickOutside as O } from "@vueuse/core";
@@ -7,7 +7,7 @@ import { useRouter as L } from "vue-router";
7
7
  import { parseEnvVariables as _ } from "../../libs/environment-parser.js";
8
8
  const M = {
9
9
  key: 0,
10
- class: "flex flex-col gap-px"
10
+ class: "flex flex-col gap-1/2"
11
11
  }, Q = ["onClick"], $ = { class: "flex items-center gap-1.5 whitespace-nowrap" }, H = { class: "w-20 overflow-hidden text-ellipsis text-right whitespace-nowrap" }, ne = /* @__PURE__ */ R({
12
12
  __name: "EnvironmentVariableDropdown",
13
13
  props: {
@@ -70,12 +70,12 @@ const M = {
70
70
  key: 0,
71
71
  class: "scalar-client"
72
72
  }, {
73
- default: x(() => [
73
+ default: y(() => [
74
74
  c("div", {
75
75
  ref_key: "dropdownRef",
76
76
  ref: p,
77
77
  class: "fixed left-0 top-0 flex flex-col p-0.75 max-h-[60svh] w-56 rounded border custom-scroll",
78
- style: y(N.value)
78
+ style: x(N.value)
79
79
  }, [
80
80
  i.value.length ? (r(), u("ul", M, [
81
81
  (r(!0), u(P, null, T(i.value, (e, a) => (r(), u("li", {
@@ -87,7 +87,7 @@ const M = {
87
87
  e.source === "collection" ? (r(), u("span", {
88
88
  key: 0,
89
89
  class: "h-2.5 w-2.5 min-w-2.5 rounded-full",
90
- style: y({
90
+ style: x({
91
91
  backgroundColor: l(D)(t.environment)
92
92
  })
93
93
  }, null, 4)) : (r(), v(l(V), {
@@ -105,7 +105,7 @@ const M = {
105
105
  variant: "secondary",
106
106
  onClick: A
107
107
  }, {
108
- default: x(() => [
108
+ default: y(() => [
109
109
  q(l(V), {
110
110
  icon: "Add",
111
111
  size: "sm"
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AAyfA,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC;;;;;cAMqC,MAAM;aAAO,MAAM;;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAiwB1D,wBAOG"}
1
+ {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AAyfA,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC;;;;;cAMqC,MAAM;aAAO,MAAM;;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAkwB1D,wBAOG"}