@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,27 +1,27 @@
1
- import { defineComponent as V, openBlock as r, createElementBlock as u, createElementVNode as n, unref as e, createBlock as g, normalizeClass as x, createCommentVNode as i, createVNode as a } from "vue";
2
- import v from "../../components/AddressBar/AddressBar.vue.js";
3
- import w from "../../components/Sidebar/SidebarToggle.vue.js";
4
- import { useActiveEntities as h } from "../../store/active-entities.js";
1
+ import { defineComponent as x, openBlock as r, createElementBlock as u, createElementVNode as n, unref as e, createBlock as g, normalizeClass as v, createCommentVNode as i, createVNode as a } from "vue";
2
+ import w from "../../components/AddressBar/AddressBar.vue.js";
3
+ import h from "../../components/Sidebar/SidebarToggle.vue.js";
4
+ import { useActiveEntities as B } from "../../store/active-entities.js";
5
5
  import { ScalarIcon as b } from "@scalar/components";
6
- import { useRouter as B } from "vue-router";
7
- import $ from "../../components/OpenApiClientButton.vue.js";
8
- import { useWorkspace as R } from "../../store/store.js";
9
- import { useLayout as S } from "../../hooks/useLayout.js";
10
- const z = { class: "lg:min-h-client-header flex items-center w-full justify-center p-2 pt-2 lg:pt-1 lg:p-1 flex-wrap t-app__top-container border-b-1/2" }, A = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-2 lg:flex-1 w-1/2" }, E = { class: "flex flex-row items-center gap-1 lg:px-2.5 lg:mb-0 mb-2 lg:flex-1 justify-end w-1/2" }, D = /* @__PURE__ */ V({
6
+ import { useRouter as $ } from "vue-router";
7
+ import R from "../../components/OpenApiClientButton.vue.js";
8
+ import { useWorkspace as S } from "../../store/store.js";
9
+ import { useLayout as z } from "../../hooks/useLayout.js";
10
+ const A = { class: "lg:min-h-client-header flex items-center w-full justify-center p-2 pt-2 lg:pt-1 lg:p-1 flex-wrap t-app__top-container border-b-1/2" }, E = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-2 lg:flex-1 w-1/2" }, M = { class: "flex flex-row items-center gap-1 lg:px-2.5 lg:mb-0 mb-2 lg:flex-1 justify-end w-1/2" }, F = /* @__PURE__ */ x({
11
11
  __name: "RequestSubpageHeader",
12
12
  props: {
13
13
  modelValue: { type: Boolean }
14
14
  },
15
15
  emits: ["update:modelValue", "hideModal", "importCurl"],
16
- setup(M) {
17
- const { activeCollection: s } = h(), { isReadOnly: m, hideClientButton: C, showSidebar: k } = R(), { layout: d } = S(), { currentRoute: y } = B();
16
+ setup(N) {
17
+ const { activeCollection: s } = B(), { isReadOnly: m, hideClientButton: C, showSidebar: k, integration: y } = S(), { layout: d } = z(), { currentRoute: V } = $();
18
18
  return (t, o) => {
19
19
  var p, f, c;
20
- return r(), u("div", z, [
21
- n("div", A, [
22
- e(k) ? (r(), g(w, {
20
+ return r(), u("div", A, [
21
+ n("div", E, [
22
+ e(k) ? (r(), g(h, {
23
23
  key: 0,
24
- class: x(["ml-1", [
24
+ class: v(["ml-1", [
25
25
  { hidden: t.modelValue },
26
26
  { "xl:!flex": !t.modelValue },
27
27
  { "!flex": e(d) === "modal" },
@@ -31,16 +31,16 @@ const z = { class: "lg:min-h-client-header flex items-center w-full justify-cent
31
31
  "onUpdate:modelValue": o[0] || (o[0] = (l) => t.$emit("update:modelValue", l))
32
32
  }, null, 8, ["class", "modelValue"])) : i("", !0)
33
33
  ]),
34
- a(v, {
34
+ a(w, {
35
35
  onImportCurl: o[1] || (o[1] = (l) => t.$emit("importCurl", l))
36
36
  }),
37
- n("div", E, [
38
- e(m) && ((p = e(s)) != null && p.documentUrl) && !e(C) ? (r(), g(e($), {
37
+ n("div", M, [
38
+ e(m) && ((p = e(s)) != null && p.documentUrl) && !e(C) ? (r(), g(e(R), {
39
39
  key: 0,
40
40
  buttonSource: "modal",
41
41
  class: "!w-fit lg:-mr-1",
42
- integration: (f = e(s)) == null ? void 0 : f.integration,
43
- source: e(y).query.source === "gitbook" ? "gitbook" : "api-reference",
42
+ integration: e(y) || ((f = e(s)) == null ? void 0 : f.integration),
43
+ source: e(V).query.source === "gitbook" ? "gitbook" : "api-reference",
44
44
  url: (c = e(s)) == null ? void 0 : c.documentUrl
45
45
  }, null, 8, ["integration", "source", "url"])) : i("", !0),
46
46
  e(m) ? (r(), u("button", {
@@ -75,5 +75,5 @@ const z = { class: "lg:min-h-client-header flex items-center w-full justify-cent
75
75
  }
76
76
  });
77
77
  export {
78
- D as default
78
+ F as default
79
79
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseEmpty.vue"],"names":[],"mappings":";AA4YA,wBAMG"}
1
+ {"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseEmpty.vue"],"names":[],"mappings":";AA6YA,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseEmpty.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-78a00890"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-db8143f4"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,31 +1,31 @@
1
1
  import { defineComponent as _, onMounted as R, onBeforeUnmount as C, openBlock as r, createElementBlock as l, createElementVNode as o, normalizeClass as k, unref as t, createTextVNode as c, toDisplayString as w, createCommentVNode as m, createVNode as s } from "vue";
2
2
  import N from "../../../assets/computer.ascii.js";
3
3
  import x from "../../../assets/keycap.ascii.js";
4
- import u from "../../../components/ScalarAsciiArt.vue.js";
4
+ import d from "../../../components/ScalarAsciiArt.vue.js";
5
5
  import p from "../../../components/ScalarHotkey.vue.js";
6
6
  import { useActiveEntities as q } from "../../../store/active-entities.js";
7
7
  import { useRoute as S } from "vue-router";
8
8
  import { useWorkspace as V } from "../../../store/store.js";
9
9
  import { useLayout as B } from "../../../hooks/useLayout.js";
10
- const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
10
+ const K = { class: "border-t relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
11
11
  key: 0,
12
12
  class: "scalar-version-number"
13
13
  }, E = { class: "scale-75 flex" }, P = { class: "relative" }, $ = { class: "relative -ml-12" }, j = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, F = /* @__PURE__ */ _({
14
14
  __name: "ResponseEmpty",
15
15
  setup(z) {
16
- const { activeWorkspaceRequests: d } = q(), { isReadOnly: g, events: a } = V(), v = S(), { layout: n } = B(), f = () => {
16
+ const { activeWorkspaceRequests: u } = q(), { isReadOnly: g, events: a } = V(), v = S(), { layout: n } = B(), f = () => {
17
17
  a.commandPalette.emit({ commandName: "Create Request" });
18
18
  }, y = (i) => {
19
19
  i != null && i.createNew && v.name === "request" && f();
20
- }, h = "2.2.32";
20
+ }, b = "2.2.34";
21
21
  return R(() => a.hotKeys.on(y)), C(() => a.hotKeys.off(y)), (i, e) => (r(), l("div", K, [
22
22
  o("div", {
23
23
  class: k(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
24
- "hidden opacity-0": t(d).length <= 1 && t(n) !== "modal"
24
+ "hidden opacity-0": t(u).length <= 1 && t(n) !== "modal"
25
25
  }])
26
26
  }, [
27
27
  t(g) ? m("", !0) : (r(), l("div", A, [
28
- c(" Scalar App V" + w(t(h)) + " Beta ", 1),
28
+ c(" Scalar App V" + w(t(b)) + " Beta ", 1),
29
29
  e[2] || (e[2] = o("div", { class: "mt-2" }, [
30
30
  o("a", {
31
31
  href: "https://github.com/scalar/scalar/issues/2669",
@@ -38,7 +38,7 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
38
38
  href: "https://www.scalar.com",
39
39
  target: "_blank"
40
40
  }, " Powered By Scalar.com ", -1)),
41
- s(u, {
41
+ s(d, {
42
42
  art: t(N),
43
43
  class: "text-c-3"
44
44
  }, null, 8, ["art"])
@@ -46,7 +46,7 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
46
46
  t(n) !== "modal" ? (r(), l("div", {
47
47
  key: 0,
48
48
  class: k(["h-[calc(100%_-_50px)] items-center justify-center hidden pb-5", {
49
- "!flex opacity-100": t(d).length == 1
49
+ "!flex opacity-100": t(u).length == 1
50
50
  }])
51
51
  }, [
52
52
  o("div", E, [
@@ -55,14 +55,14 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
55
55
  class: "keycap-hotkey",
56
56
  hotkey: ""
57
57
  }),
58
- s(u, {
58
+ s(d, {
59
59
  art: t(x),
60
60
  class: "!leading-[6px] text-c-3"
61
61
  }, null, 8, ["art"])
62
62
  ]),
63
63
  o("div", $, [
64
64
  e[4] || (e[4] = o("div", { class: "keycap-hotkey !right-[60px]" }, "K", -1)),
65
- s(u, {
65
+ s(d, {
66
66
  art: t(x),
67
67
  class: "!leading-[6px] keycap-n"
68
68
  }, null, 8, ["art"])
@@ -74,7 +74,7 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
74
74
  key: 0,
75
75
  class: "flex items-center gap-1.5",
76
76
  type: "button",
77
- onClick: e[0] || (e[0] = (b) => t(a).commandPalette.emit())
77
+ onClick: e[0] || (e[0] = (h) => t(a).commandPalette.emit())
78
78
  }, [
79
79
  e[5] || (e[5] = c(" Get Started ")),
80
80
  s(p, { hotkey: "k" })
@@ -91,7 +91,7 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
91
91
  o("button", {
92
92
  class: "flex items-center gap-1.5",
93
93
  type: "button",
94
- onClick: e[1] || (e[1] = (b) => t(a).executeRequest.emit())
94
+ onClick: e[1] || (e[1] = (h) => t(a).executeRequest.emit())
95
95
  }, [
96
96
  e[7] || (e[7] = c(" Send Request ")),
97
97
  s(p, { hotkey: "↵" })
@@ -1,3 +1,10 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, HTMLDivElement>;
1
+ type __VLS_Props = {
2
+ collectionId: string | string[];
3
+ serverUid: string | string[];
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
6
+ collectionId: string | string[];
7
+ serverUid: string | string[];
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
2
9
  export default _default;
3
10
  //# sourceMappingURL=ServerForm.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServerForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/ServerForm.vue"],"names":[],"mappings":";AA6NA,wBAMG"}
1
+ {"version":3,"file":"ServerForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/ServerForm.vue"],"names":[],"mappings":"AAqEA,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC/B,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC7B,CAAC;;kBAFc,MAAM,GAAG,MAAM,EAAE;eACpB,MAAM,GAAG,MAAM,EAAE;;AA+GhC,wBAQG"}
@@ -1,71 +1,40 @@
1
- import { defineComponent as b, computed as l, openBlock as u, createElementBlock as p, Fragment as g, createVNode as y, createBlock as O, createCommentVNode as v } from "vue";
2
- import m from "../../components/Form/Form.vue.js";
3
- import { useActiveEntities as V } from "../../store/active-entities.js";
4
- import { useRoute as j } from "vue-router";
5
- import { useWorkspace as B } from "../../store/store.js";
6
- const C = { class: "w-full" }, R = /* @__PURE__ */ b({
1
+ import { defineComponent as u, computed as p, openBlock as a, createElementBlock as v, createBlock as m, createCommentVNode as f } from "vue";
2
+ import _ from "../../components/Form/Form.vue.js";
3
+ import { useActiveEntities as k } from "../../store/active-entities.js";
4
+ import { useWorkspace as U } from "../../store/store.js";
5
+ const h = { class: "divide-0.5 divide-x flex w-full" }, B = /* @__PURE__ */ u({
7
6
  __name: "ServerForm",
8
- setup(U) {
9
- const { activeCollection: s } = V(), { servers: f, serverMutators: n } = B(), _ = [
7
+ props: {
8
+ collectionId: { default: "" },
9
+ serverUid: { default: "" }
10
+ },
11
+ setup(i) {
12
+ const t = i, { activeWorkspaceCollections: s } = k(), { servers: c, serverMutators: l } = U(), d = [
10
13
  { label: "URL", key: "url", placeholder: "https://void.scalar.com/api" },
11
14
  {
12
15
  label: "Label",
13
16
  key: "description",
14
17
  placeholder: "Production"
15
18
  }
16
- ], c = j(), r = l(
17
- () => {
18
- var e, t;
19
- return f[(s.value && c.params.server === "default" ? (e = s.value) == null ? void 0 : e.servers[0] : (t = s.value) == null ? void 0 : t.servers.find(
20
- (o) => o === c.params.server
21
- )) ?? ""];
22
- }
23
- ), k = (e, t) => {
24
- !s.value || !r.value || n.edit(r.value.uid, e, t);
25
- }, h = (e, t) => {
26
- !s.value || !r.value || n.edit(r.value.uid, `variables.${e}.value`, t);
27
- }, S = l(
28
- () => {
29
- var e;
30
- return Object.entries(((e = r.value) == null ? void 0 : e.variables) ?? {}).map(
31
- ([t, o]) => {
32
- var a;
33
- return {
34
- key: t,
35
- label: t,
36
- placeholder: (o.default ?? ((a = o == null ? void 0 : o.enum) == null ? void 0 : a[0]) ?? "").toString()
37
- };
38
- }
39
- );
40
- }
41
- ), i = l(
42
- () => {
43
- var e;
44
- return Object.entries(((e = r.value) == null ? void 0 : e.variables) ?? {}).reduce((t, [o, a]) => {
45
- var d;
46
- return t[o] = (a.default ?? ((d = a == null ? void 0 : a.enum) == null ? void 0 : d[0]) ?? "").toString(), t;
47
- }, {});
48
- }
49
- );
50
- return (e, t) => (u(), p("div", C, [
51
- r.value ? (u(), p(g, { key: 0 }, [
52
- y(m, {
53
- data: r.value,
54
- onUpdate: k,
55
- options: _,
56
- title: "Server"
57
- }, null, 8, ["data"]),
58
- Object.keys(i.value).length ? (u(), O(m, {
59
- key: 0,
60
- data: i.value,
61
- onUpdate: h,
62
- options: S.value,
63
- title: "Variables"
64
- }, null, 8, ["data", "options"])) : v("", !0)
65
- ], 64)) : v("", !0)
19
+ ], o = p(() => {
20
+ const e = s.value.find(
21
+ (r) => r.uid === t.collectionId
22
+ );
23
+ return c[e && typeof t.serverUid == "string" && t.serverUid === "default" ? e.servers[0] ?? "" : (e == null ? void 0 : e.servers.find((r) => r === t.serverUid)) ?? ""];
24
+ }), n = (e, r) => {
25
+ !s.value || !o.value || l.edit(o.value.uid, e, r);
26
+ };
27
+ return (e, r) => (a(), v("div", h, [
28
+ o.value ? (a(), m(_, {
29
+ key: 0,
30
+ data: o.value,
31
+ onUpdate: n,
32
+ options: d,
33
+ title: "Server"
34
+ }, null, 8, ["data"])) : f("", !0)
66
35
  ]));
67
36
  }
68
37
  });
69
38
  export {
70
- R as default
39
+ B as default
71
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Servers.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/Servers.vue"],"names":[],"mappings":";AAqOA,wBAMG"}
1
+ {"version":3,"file":"Servers.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/Servers.vue"],"names":[],"mappings":";AAujBA,wBAMG"}
@@ -1,68 +1,156 @@
1
- import { defineComponent as v, openBlock as a, createBlock as u, withCtx as e, createVNode as r, unref as n, createElementVNode as _, createElementBlock as S, Fragment as x, renderList as b, createTextVNode as k } from "vue";
2
- import h from "../../components/Sidebar/SidebarButton.vue.js";
3
- import L from "../../components/Sidebar/SidebarList.vue.js";
4
- import V from "../../components/Sidebar/SidebarListElement.vue.js";
5
- import w from "../../components/ViewLayout/ViewLayout.vue.js";
6
- import y from "../../components/ViewLayout/ViewLayoutContent.vue.js";
7
- import { useActiveEntities as C } from "../../store/active-entities.js";
8
- import { serverSchema as E } from "@scalar/oas-utils/entities/spec";
9
- import { useRouter as B } from "vue-router";
10
- import N from "./ServerForm.vue.js";
11
- import { useWorkspace as A } from "../../store/store.js";
12
- import $ from "../../components/Sidebar/Sidebar.vue.js";
13
- const g = { class: "flex-1" }, K = /* @__PURE__ */ v({
1
+ import { defineComponent as P, computed as f, openBlock as n, createBlock as p, withCtx as i, createVNode as s, unref as a, createElementVNode as l, createElementBlock as v, Fragment as g, renderList as w, normalizeClass as y, toDisplayString as F, withModifiers as R, withDirectives as M, createCommentVNode as O, vShow as q, createTextVNode as K } from "vue";
2
+ import T from "../../components/Sidebar/SidebarButton.vue.js";
3
+ import U from "../../components/Sidebar/SidebarList.vue.js";
4
+ import W from "../../components/Sidebar/SidebarListElement.vue.js";
5
+ import G from "../../components/ViewLayout/ViewLayout.vue.js";
6
+ import H from "../../components/ViewLayout/ViewLayoutContent.vue.js";
7
+ import { useActiveEntities as J } from "../../store/active-entities.js";
8
+ import { ScalarIcon as b, ScalarButton as C } from "@scalar/components";
9
+ import { LibraryIcon as Q } from "@scalar/icons";
10
+ import { useRouter as X, useRoute as Y } from "vue-router";
11
+ import Z from "./ServerForm.vue.js";
12
+ import { useWorkspace as ee } from "../../store/store.js";
13
+ import te from "../../components/Sidebar/Sidebar.vue.js";
14
+ import { useSidebar as re } from "../../hooks/useSidebar.js";
15
+ const oe = { class: "flex-1" }, se = ["onClick"], ae = { class: "flex h-5 items-center justify-center max-w-[14px] pr-px" }, ie = { class: "break-all line-clamp-1 font-medium text-left w-full" }, we = /* @__PURE__ */ P({
14
16
  __name: "Servers",
15
- setup(F) {
16
- const { activeCollection: t } = C(), { servers: c, serverMutators: f } = A(), { push: p } = B(), d = () => {
17
- if (!t.value) return;
18
- const o = E.parse({ url: "http://localhost" });
19
- f.add(o, t.value.uid), p({
20
- name: "servers",
21
- params: {
22
- server: o.uid
23
- }
17
+ setup(le) {
18
+ const { activeWorkspaceCollections: S, activeWorkspace: c, activeCollection: d } = J(), { servers: I, events: $, serverMutators: D } = ee(), { push: z } = X(), h = Y(), { collapsedSidebarFolders: x, toggleSidebarFolder: A } = re(), k = f(() => h.params.collectionId), L = f(() => h.params.servers), N = (r) => x[r];
19
+ function m(r) {
20
+ $.commandPalette.emit({
21
+ commandName: "Add Server",
22
+ metaData: { parentUid: r }
24
23
  });
24
+ }
25
+ const V = f(() => S.value.filter(
26
+ (r) => {
27
+ var t;
28
+ return ((t = r.info) == null ? void 0 : t.title) !== "Drafts";
29
+ }
30
+ )), j = (r, t, e) => {
31
+ var o;
32
+ const u = `/workspace/${(o = c == null ? void 0 : c.value) == null ? void 0 : o.uid}/servers/${e}/${t}`;
33
+ r.metaKey ? window.open(u, "_blank") : z({ path: u });
25
34
  };
26
- return (o, i) => (a(), u(w, null, {
27
- default: e(() => [
28
- r(n($), { title: "Servers" }, {
29
- content: e(() => [
30
- _("div", g, [
31
- r(L, null, {
32
- default: e(() => {
33
- var l;
34
- return [
35
- (a(!0), S(x, null, b((l = n(t)) == null ? void 0 : l.servers, (s) => {
36
- var m;
37
- return a(), u(V, {
38
- key: s,
39
- class: "text-xs",
40
- type: "server",
41
- variable: {
42
- name: ((m = n(c)[s]) == null ? void 0 : m.url) ?? "",
43
- uid: s
44
- }
45
- }, null, 8, ["variable"]);
46
- }), 128))
47
- ];
48
- }),
35
+ function B(r) {
36
+ var t;
37
+ (t = d == null ? void 0 : d.value) != null && t.uid && D.delete(r, k.value);
38
+ }
39
+ return (r, t) => (n(), p(G, null, {
40
+ default: i(() => [
41
+ s(a(te), { title: "Servers" }, {
42
+ content: i(() => [
43
+ l("div", oe, [
44
+ s(U, null, {
45
+ default: i(() => [
46
+ (n(!0), v(g, null, w(V.value, (e) => {
47
+ var u;
48
+ return n(), v("div", {
49
+ key: e.uid,
50
+ class: "flex flex-col gap-1/2"
51
+ }, [
52
+ l("button", {
53
+ 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",
54
+ type: "button",
55
+ onClick: (o) => a(A)(e.uid)
56
+ }, [
57
+ l("span", ae, [
58
+ s(a(Q), {
59
+ class: "min-w-3.5 text-sidebar-c-2 size-3.5 stroke-2 group-hover:hidden",
60
+ src: e["x-scalar-icon"] || "interface-content-folder"
61
+ }, null, 8, ["src"]),
62
+ l("div", {
63
+ class: y({
64
+ "rotate-90": a(x)[e.uid]
65
+ })
66
+ }, [
67
+ s(a(b), {
68
+ class: "text-c-3 hidden text-sm group-hover:block",
69
+ icon: "ChevronRight",
70
+ size: "md"
71
+ })
72
+ ], 2)
73
+ ]),
74
+ l("span", ie, F(((u = e.info) == null ? void 0 : u.title) ?? ""), 1),
75
+ s(a(C), {
76
+ class: "hidden group-hover:block px-0.5 py-0 hover:bg-b-3 hover:text-c-1 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100 aspect-square h-fit",
77
+ size: "sm",
78
+ variant: "ghost",
79
+ onClick: R((o) => m(e.uid), ["stop", "prevent"])
80
+ }, {
81
+ default: i(() => [
82
+ s(a(b), {
83
+ icon: "Add",
84
+ size: "md",
85
+ thickness: "2"
86
+ })
87
+ ]),
88
+ _: 2
89
+ }, 1032, ["onClick"])
90
+ ], 8, se),
91
+ M(l("div", {
92
+ class: y({
93
+ "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] flex flex-col gap-1/2 mb-[.5px] last:mb-0 relative": Object.keys(e.servers || {}).length > 0
94
+ })
95
+ }, [
96
+ (n(!0), v(g, null, w(e.servers, (o) => {
97
+ var _;
98
+ return n(), p(W, {
99
+ key: o,
100
+ class: "[&>a]:pl-[1.625rem]",
101
+ collectionId: e.uid,
102
+ isDeletable: !0,
103
+ type: "servers",
104
+ variable: {
105
+ name: ((_ = a(I)[o]) == null ? void 0 : _.url) ?? "",
106
+ uid: o
107
+ },
108
+ onClick: (E) => j(E, o, e.uid),
109
+ onDelete: B
110
+ }, null, 8, ["collectionId", "variable", "onClick"]);
111
+ }), 128)),
112
+ Object.keys(e.servers || {}).length === 0 ? (n(), p(a(C), {
113
+ key: 0,
114
+ 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",
115
+ variant: "ghost",
116
+ onClick: (o) => m(e.uid)
117
+ }, {
118
+ default: i(() => [
119
+ s(a(b), {
120
+ class: "ml-0.5 h-2.5 w-2.5",
121
+ icon: "Add",
122
+ thickness: "3"
123
+ }),
124
+ t[0] || (t[0] = l("span", null, "Add Server", -1))
125
+ ]),
126
+ _: 2
127
+ }, 1032, ["onClick"])) : O("", !0)
128
+ ], 2), [
129
+ [q, N(e.uid)]
130
+ ])
131
+ ]);
132
+ }), 128))
133
+ ]),
49
134
  _: 1
50
135
  })
51
136
  ])
52
137
  ]),
53
- button: e(() => [
54
- r(h, { click: d }, {
55
- title: e(() => i[0] || (i[0] = [
56
- k("Add Server")
138
+ button: i(() => [
139
+ s(T, { click: m }, {
140
+ title: i(() => t[1] || (t[1] = [
141
+ K("Add Server")
57
142
  ])),
58
143
  _: 1
59
144
  })
60
145
  ]),
61
146
  _: 1
62
147
  }),
63
- r(y, { class: "flex-1" }, {
64
- default: e(() => [
65
- r(N)
148
+ s(H, { class: "flex-1" }, {
149
+ default: i(() => [
150
+ s(Z, {
151
+ collectionId: k.value,
152
+ serverUid: L.value
153
+ }, null, 8, ["collectionId", "serverUid"])
66
154
  ]),
67
155
  _: 1
68
156
  })
@@ -72,5 +160,5 @@ const g = { class: "flex-1" }, K = /* @__PURE__ */ v({
72
160
  }
73
161
  });
74
162
  export {
75
- K as default
163
+ we as default
76
164
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.2.32",
21
+ "version": "2.2.34",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -179,21 +179,21 @@
179
179
  "whatwg-mimetype": "^4.0.0",
180
180
  "yaml": "^2.4.5",
181
181
  "zod": "^3.23.8",
182
+ "@scalar/components": "0.13.14",
183
+ "@scalar/draggable": "0.1.8",
182
184
  "@scalar/icons": "0.1.2",
183
- "@scalar/import": "0.2.16",
185
+ "@scalar/import": "0.2.17",
186
+ "@scalar/oas-utils": "0.2.97",
187
+ "@scalar/openapi-parser": "0.10.4",
188
+ "@scalar/openapi-types": "0.1.6",
184
189
  "@scalar/object-utils": "1.1.12",
185
- "@scalar/oas-utils": "0.2.96",
186
- "@scalar/openapi-parser": "0.10.3",
187
- "@scalar/openapi-types": "0.1.5",
188
- "@scalar/postman-to-openapi": "0.1.19",
189
- "@scalar/themes": "0.9.59",
190
- "@scalar/use-codemirror": "0.11.57",
191
- "@scalar/types": "0.0.25",
192
- "@scalar/components": "0.13.13",
193
- "@scalar/use-hooks": "0.1.13",
194
- "@scalar/use-tooltip": "1.0.5",
190
+ "@scalar/postman-to-openapi": "0.1.20",
191
+ "@scalar/themes": "0.9.60",
192
+ "@scalar/types": "0.0.26",
193
+ "@scalar/use-codemirror": "0.11.59",
194
+ "@scalar/use-hooks": "0.1.14",
195
195
  "@scalar/use-toasts": "0.7.8",
196
- "@scalar/draggable": "0.1.8"
196
+ "@scalar/use-tooltip": "1.0.5"
197
197
  },
198
198
  "devDependencies": {
199
199
  "@types/js-cookie": "^3.0.6",