@scalar/api-client 2.2.23 → 2.2.25

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.2.25
4
+
5
+ ### Patch Changes
6
+
7
+ - 00feb3e: fix: params not saving or sending
8
+
9
+ ## 2.2.24
10
+
11
+ ### Patch Changes
12
+
13
+ - 6890d7e: style: updates address bar server ui for multi server type
14
+ - ca2d98b: fix: sets active server on send request for non draft request only
15
+ - 6890d7e: fix: updates selected server logic on collection server selection
16
+ - Updated dependencies [ca2d98b]
17
+ - @scalar/oas-utils@0.2.93
18
+ - @scalar/import@0.2.13
19
+ - @scalar/postman-to-openapi@0.1.16
20
+
3
21
  ## 2.2.23
4
22
 
5
23
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA6UA,wBAMG"}
1
+ {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAyVA,wBAMG"}
@@ -1,88 +1,96 @@
1
- import { defineComponent as B, computed as i, watch as U, openBlock as o, createBlock as v, unref as l, withCtx as m, createElementBlock as a, createCommentVNode as p, Fragment as d, renderList as _, createVNode as c, createElementVNode as n, createTextVNode as V, toDisplayString as E } from "vue";
2
- import { useActiveEntities as O } from "../../store/active-entities.js";
3
- import { ScalarDropdown as R, ScalarDropdownDivider as b, ScalarDropdownItem as W, ScalarIcon as I } from "@scalar/components";
4
- import h from "./AddressBarServerItem.vue.js";
5
- import { useWorkspace as L } from "../../store/store.js";
6
- const T = {
1
+ import { defineComponent as U, computed as i, watch as V, openBlock as l, createBlock as p, unref as o, withCtx as m, createElementBlock as a, createCommentVNode as x, Fragment as d, renderList as b, createVNode as c, createElementVNode as n, createTextVNode as E, toDisplayString as O } from "vue";
2
+ import { useActiveEntities as R } from "../../store/active-entities.js";
3
+ import { ScalarDropdown as W, ScalarDropdownDivider as h, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
4
+ import g from "./AddressBarServerItem.vue.js";
5
+ import { useWorkspace as T } from "../../store/store.js";
6
+ const j = {
7
7
  class: "font-code lg:text-sm text-xs whitespace-nowrap border border-b-3 border-solid rounded px-1.5 py-0.5 text-c-2 -outline-offset-1",
8
8
  type: "button"
9
- }, j = {
9
+ }, z = {
10
10
  key: 0,
11
- class: "text-xxs text-c-2 ml-8"
12
- }, z = { class: "flex items-center justify-center h-4 w-4" }, H = /* @__PURE__ */ B({
11
+ class: "text-xxs text-c-2 px-2.5 py-1"
12
+ }, F = { class: "flex items-center justify-center h-4 w-4" }, J = /* @__PURE__ */ U({
13
13
  __name: "AddressBarServer",
14
- setup(F) {
15
- const { activeRequest: f, activeCollection: x, activeServer: u } = O(), { isReadOnly: g, servers: S, collectionMutators: A, events: C } = L(), w = i(
14
+ setup(M) {
15
+ const { activeRequest: u, activeCollection: f, activeServer: v } = R(), { isReadOnly: A, servers: S, collectionMutators: C, events: D } = T(), y = i(
16
16
  () => {
17
- var t, e;
18
- return (e = (t = f.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
17
+ var r, e;
18
+ return (e = (r = u.value) == null ? void 0 : r.servers) == null ? void 0 : e.map((t) => {
19
19
  var s;
20
20
  return {
21
- id: r,
22
- label: ((s = S[r]) == null ? void 0 : s.url) ?? "Unknown server"
21
+ id: t,
22
+ label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
23
23
  };
24
24
  });
25
25
  }
26
- ), y = i(
26
+ ), w = i(
27
27
  () => {
28
- var t, e;
29
- return (e = (t = x.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
30
- var s;
31
- return {
32
- id: r,
33
- label: ((s = S[r]) == null ? void 0 : s.url) ?? "Unknown server"
34
- };
35
- });
28
+ var r, e;
29
+ return (
30
+ // Filters out servers already present in the request
31
+ (e = (r = f.value) == null ? void 0 : r.servers) == null ? void 0 : e.filter(
32
+ (t) => {
33
+ var s, _;
34
+ return !((_ = (s = u.value) == null ? void 0 : s.servers) != null && _.includes(t));
35
+ }
36
+ ).map((t) => {
37
+ var s;
38
+ return {
39
+ id: t,
40
+ label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
41
+ };
42
+ })
43
+ );
36
44
  }
37
45
  ), k = i(
38
46
  () => {
39
- var t, e;
40
- return ((t = w.value) == null ? void 0 : t.length) && ((e = y.value) == null ? void 0 : e.length);
47
+ var r, e;
48
+ return ((r = y.value) == null ? void 0 : r.length) && ((e = w.value) == null ? void 0 : e.length);
41
49
  }
42
50
  );
43
- U([x, f], ([t, e]) => {
51
+ V([f, u], ([r, e]) => {
44
52
  var s;
45
- if (!t || t.selectedServerUid || e != null && e.selectedServerUid)
53
+ if (!r || r.selectedServerUid || e != null && e.selectedServerUid)
46
54
  return;
47
- const r = (s = t.servers) == null ? void 0 : s[0];
48
- r && A.edit(t.uid, "selectedServerUid", r);
55
+ const t = (s = r.servers) == null ? void 0 : s[0];
56
+ t && C.edit(r.uid, "selectedServerUid", t);
49
57
  });
50
- const D = () => C.commandPalette.emit({
58
+ const N = () => D.commandPalette.emit({
51
59
  commandName: "Add Server"
52
- }), N = i(() => {
53
- var t, e, r;
54
- return (e = (t = u.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? u.value.url.slice(0, -1) : ((r = u.value) == null ? void 0 : r.url) || "";
60
+ }), B = i(() => {
61
+ var r, e, t;
62
+ return (e = (r = v.value) == null ? void 0 : r.url) != null && e.endsWith("/") ? v.value.url.slice(0, -1) : ((t = v.value) == null ? void 0 : t.url) || "";
55
63
  });
56
- return (t, e) => (o(), v(l(R), {
64
+ return (r, e) => (l(), p(o(W), {
57
65
  class: "w-max",
58
66
  teleport: ""
59
67
  }, {
60
68
  items: m(() => [
61
- k.value ? (o(), a("div", j, " Request Servers ")) : p("", !0),
62
- (o(!0), a(d, null, _(w.value, (r) => (o(), v(h, {
63
- key: r.id,
64
- serverOption: r,
69
+ k.value ? (l(), a("div", z, " Request ")) : x("", !0),
70
+ (l(!0), a(d, null, b(y.value, (t) => (l(), p(g, {
71
+ key: t.id,
72
+ serverOption: t,
65
73
  type: "request"
66
74
  }, null, 8, ["serverOption"]))), 128)),
67
- k.value ? (o(), a(d, { key: 1 }, [
68
- c(l(b)),
69
- e[1] || (e[1] = n("div", { class: "text-xxs text-c-2 ml-8" }, "Collection Servers", -1))
70
- ], 64)) : p("", !0),
71
- (o(!0), a(d, null, _(y.value, (r) => (o(), v(h, {
72
- key: r.id,
73
- serverOption: r,
75
+ k.value ? (l(), a(d, { key: 1 }, [
76
+ c(o(h)),
77
+ e[1] || (e[1] = n("div", { class: "text-xxs text-c-2 px-2.5 py-1" }, "Collection", -1))
78
+ ], 64)) : x("", !0),
79
+ (l(!0), a(d, null, b(w.value, (t) => (l(), p(g, {
80
+ key: t.id,
81
+ serverOption: t,
74
82
  type: "collection"
75
83
  }, null, 8, ["serverOption"]))), 128)),
76
- l(g) ? p("", !0) : (o(), a(d, { key: 2 }, [
77
- c(l(b)),
78
- c(l(W), null, {
84
+ o(A) ? x("", !0) : (l(), a(d, { key: 2 }, [
85
+ c(o(h)),
86
+ c(o(I), null, {
79
87
  default: m(() => [
80
88
  n("div", {
81
89
  class: "font-code text-xxs flex items-center gap-1.5",
82
- onClick: D
90
+ onClick: N
83
91
  }, [
84
- n("div", z, [
85
- c(l(I), {
92
+ n("div", F, [
93
+ c(o(L), {
86
94
  icon: "Add",
87
95
  size: "sm"
88
96
  })
@@ -95,9 +103,9 @@ const T = {
95
103
  ], 64))
96
104
  ]),
97
105
  default: m(() => [
98
- n("button", T, [
106
+ n("button", j, [
99
107
  e[0] || (e[0] = n("span", { class: "sr-only" }, "Server:", -1)),
100
- V(" " + E(N.value), 1)
108
+ E(" " + O(B.value), 1)
101
109
  ])
102
110
  ]),
103
111
  _: 1
@@ -105,5 +113,5 @@ const T = {
105
113
  }
106
114
  });
107
115
  export {
108
- H as default
116
+ J as default
109
117
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAqEA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CACvD;;kBAIe,YAAY;UACpB,YAAY,GAAG,SAAS;;kBADhB,YAAY;UACpB,YAAY,GAAG,SAAS;;AAJhC,wBAqJK"}
1
+ {"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAyEA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CACvD;;kBAIe,YAAY;UACpB,YAAY,GAAG,SAAS;;kBADhB,YAAY;UACpB,YAAY,GAAG,SAAS;;AAJhC,wBAyJK"}
@@ -1,48 +1,49 @@
1
- import { defineComponent as v, openBlock as m, createBlock as f, unref as i, withCtx as S, createElementVNode as n, normalizeClass as w, createVNode as h, toDisplayString as k } from "vue";
2
- import { useActiveEntities as x } from "../../store/active-entities.js";
1
+ import { defineComponent as m, openBlock as f, createBlock as S, unref as l, withCtx as h, createElementVNode as n, normalizeClass as w, createVNode as k, toDisplayString as x } from "vue";
2
+ import { useActiveEntities as g } from "../../store/active-entities.js";
3
3
  import { ScalarDropdownItem as y, ScalarIcon as C } from "@scalar/components";
4
4
  import { useWorkspace as O } from "../../store/store.js";
5
- const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ v({
5
+ const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ m({
6
6
  __name: "AddressBarServerItem",
7
7
  props: {
8
8
  serverOption: {},
9
9
  type: {}
10
10
  },
11
- setup(l) {
12
- const r = l, { activeCollection: o, activeRequest: s, activeServer: a } = x(), { collectionMutators: c, requestMutators: p } = O(), d = (e) => {
13
- r.type === "collection" && o.value ? c.edit(
11
+ setup(a) {
12
+ const i = a, { activeCollection: o, activeRequest: r, activeServer: c } = g(), { collectionMutators: p, requestMutators: d } = O(), u = (e) => {
13
+ var t, s;
14
+ i.type === "collection" && o.value ? ((s = (t = r.value) == null ? void 0 : t.servers) != null && s.length && (r.value.selectedServerUid = ""), p.edit(
14
15
  o.value.uid,
15
16
  "selectedServerUid",
16
17
  e
17
- ) : r.type === "request" && s.value && p.edit(
18
- s.value.uid,
18
+ )) : i.type === "request" && r.value && d.edit(
19
+ r.value.uid,
19
20
  "selectedServerUid",
20
21
  e
21
22
  );
22
- }, u = (e) => {
23
+ }, v = (e) => {
23
24
  var t;
24
- return ((t = a.value) == null ? void 0 : t.uid) === e;
25
+ return ((t = c.value) == null ? void 0 : t.uid) === e;
25
26
  };
26
- return (e, t) => (m(), f(i(y), {
27
+ return (e, t) => (f(), S(l(y), {
27
28
  key: "serverOption.id",
28
29
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
29
30
  value: e.serverOption.id,
30
- onClick: t[0] || (t[0] = (g) => d(e.serverOption.id))
31
+ onClick: t[0] || (t[0] = (s) => u(e.serverOption.id))
31
32
  }, {
32
- default: S(() => [
33
+ default: h(() => [
33
34
  n("div", {
34
35
  class: w([
35
36
  "flex size-4 items-center justify-center p-0.75 text-b-1 rounded-full",
36
- u(e.serverOption.id) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
37
+ v(e.serverOption.id) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
37
38
  ])
38
39
  }, [
39
- h(i(C), {
40
+ k(l(C), {
40
41
  icon: "Checkmark",
41
42
  size: "xs",
42
43
  thickness: "2.5"
43
44
  })
44
45
  ], 2),
45
- n("span", b, k(e.serverOption.label), 1)
46
+ n("span", b, x(e.serverOption.label), 1)
46
47
  ]),
47
48
  _: 1
48
49
  }, 8, ["value"]));