@scalar/api-client 2.0.54 → 2.0.56

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 (34) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  4. package/dist/components/CodeInput/CodeInput.vue2.js +6 -6
  5. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  7. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +45 -45
  8. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  9. package/dist/components/Search/useSearch.d.ts +29 -0
  10. package/dist/components/Search/useSearch.d.ts.map +1 -0
  11. package/dist/components/Search/useSearch.js +62 -0
  12. package/dist/layouts/App/create-api-client-app.d.ts +260 -260
  13. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  14. package/dist/layouts/Modal/create-api-client-modal.d.ts +520 -520
  15. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  16. package/dist/libs/create-client.d.ts +260 -260
  17. package/dist/libs/create-client.d.ts.map +1 -1
  18. package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -3
  19. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
  20. package/dist/libs/event-busses/hot-keys-bus.js +17 -16
  21. package/dist/libs/local-storage.js +1 -1
  22. package/dist/store/workspace.d.ts +520 -520
  23. package/dist/store/workspace.d.ts.map +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  26. package/dist/views/Request/Request.vue.js +2 -2
  27. package/dist/views/Request/Request.vue2.js +259 -215
  28. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  29. package/dist/views/Request/RequestSection/RequestParams.vue.js +45 -41
  30. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  31. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +31 -25
  32. package/package.json +5 -5
  33. package/dist/components/Search/SearchButton.vue.js +0 -7
  34. package/dist/components/Search/SearchButton.vue2.js +0 -30
@@ -1,88 +1,92 @@
1
- import { defineComponent as K, computed as d, onMounted as P, ref as $, watch as x, openBlock as E, createBlock as T, withCtx as i, createTextVNode as y, toDisplayString as A, createElementVNode as R, createVNode as g, unref as B, withModifiers as M, nextTick as h } from "vue";
1
+ import { defineComponent as x, computed as d, onMounted as C, ref as K, watch as $, openBlock as E, createBlock as T, withCtx as i, createTextVNode as y, toDisplayString as A, createElementVNode as R, createVNode as g, unref as B, withModifiers as M, nextTick as h } from "vue";
2
2
  import N from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
3
  import { useWorkspace as S } from "../../../store/workspace.js";
4
4
  import V from "./RequestTable.vue.js";
5
5
  import { ScalarButton as W } from "@scalar/components";
6
6
  import { createRequestExampleParameter as _ } from "@scalar/oas-utils/entities/workspace/spec";
7
- const z = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 request-meta-buttons" }, O = /* @__PURE__ */ K({
7
+ const z = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 request-meta-buttons" }, O = /* @__PURE__ */ x({
8
8
  __name: "RequestParams",
9
9
  props: {
10
10
  title: {},
11
11
  paramKey: {}
12
12
  },
13
13
  setup(k) {
14
- const s = k, { activeRequest: n, activeExample: t, requestExampleMutators: u } = S(), l = d(
14
+ const s = k, { activeRequest: n, activeExample: a, requestExampleMutators: u } = S(), r = d(
15
15
  () => {
16
16
  var e;
17
- return ((e = t.value) == null ? void 0 : e.parameters[s.paramKey]) ?? [];
17
+ return ((e = a.value) == null ? void 0 : e.parameters[s.paramKey]) ?? [];
18
18
  }
19
19
  );
20
- P(() => {
20
+ C(() => {
21
21
  c();
22
22
  });
23
23
  const o = () => {
24
- if (!n.value || !t.value) return;
25
- const e = _({ enabled: !1 }), r = [...l.value, e];
24
+ if (!n.value || !a.value) return;
25
+ const e = _({ enabled: !1 }), t = [...r.value, e];
26
26
  u.edit(
27
- t.value.uid,
27
+ a.value.uid,
28
28
  `parameters.${s.paramKey}`,
29
- r
29
+ t
30
30
  );
31
- }, p = $(null), b = (e, r, m) => {
32
- if (!n.value || !t.value) return;
33
- const f = l.value;
31
+ }, p = K(null), b = (e, t, m) => {
32
+ if (!n.value || !a.value) return;
33
+ const f = r.value;
34
34
  if (f.length > e) {
35
- const a = [...f];
36
- a[e] = { ...a[e], [r]: m }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), u.edit(
37
- t.value.uid,
35
+ const l = [...f];
36
+ l[e] = { ...l[e], [t]: m }, (l[e].key !== "" || l[e].value !== "") && (l[e].enabled = !0), l[e].key === "" && l[e].value === "" && l.splice(e, 1), u.edit(
37
+ a.value.uid,
38
38
  `parameters.${s.paramKey}`,
39
- a
39
+ l
40
40
  );
41
41
  } else {
42
- const a = [_({ [r]: m })];
42
+ const l = [_({ [t]: m })];
43
43
  u.edit(
44
- t.value.uid,
44
+ a.value.uid,
45
45
  `parameters.${s.paramKey}`,
46
- a
46
+ l
47
47
  ), h(() => {
48
48
  var v;
49
49
  if (!p.value) return;
50
- (v = p.value.querySelectorAll("input")[r === "key" ? 0 : 1]) == null || v.focus();
50
+ (v = p.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || v.focus();
51
51
  });
52
52
  }
53
- }, q = (e, r) => n.value && t.value && u.edit(
54
- t.value.uid,
53
+ }, q = (e, t) => n.value && a.value && u.edit(
54
+ a.value.uid,
55
55
  `parameters.${s.paramKey}.${e}.enabled`,
56
- r
57
- ), w = () => {
58
- !n.value || !t.value || (u.edit(
59
- t.value.uid,
56
+ t
57
+ ), P = () => {
58
+ if (!n.value || !a.value) return;
59
+ const e = r.value.filter(
60
+ (t) => t.enabled || t.required
61
+ );
62
+ u.edit(
63
+ a.value.uid,
60
64
  `parameters.${s.paramKey}`,
61
- []
65
+ e
62
66
  ), h(() => {
63
67
  o();
64
- }));
68
+ });
65
69
  };
66
70
  function c() {
67
- if (l.value.length === 0)
71
+ if (r.value.length === 0)
68
72
  o();
69
- else if (l.value.length >= 1) {
70
- const e = l.value[l.value.length - 1];
73
+ else if (r.value.length >= 1) {
74
+ const e = r.value[r.value.length - 1];
71
75
  e.key !== "" && e.value !== "" && o();
72
76
  }
73
77
  }
74
- const C = d(
75
- () => l.value.filter((e) => e.key || e.value).length
78
+ const w = d(
79
+ () => r.value.filter((e) => e.key || e.value).length
76
80
  );
77
- return x(
78
- () => t.value,
79
- (e, r) => {
80
- e !== r && c();
81
+ return $(
82
+ () => a.value,
83
+ (e, t) => {
84
+ e !== t && c();
81
85
  },
82
86
  { immediate: !0 }
83
- ), (e, r) => (E(), T(N, {
87
+ ), (e, t) => (E(), T(N, {
84
88
  class: "group/params",
85
- itemCount: C.value
89
+ itemCount: w.value
86
90
  }, {
87
91
  title: i(() => [
88
92
  y(A(e.title), 1)
@@ -93,7 +97,7 @@ const z = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
93
97
  class: "px-1 transition-none",
94
98
  size: "sm",
95
99
  variant: "ghost",
96
- onClick: M(w, ["stop"])
100
+ onClick: M(P, ["stop"])
97
101
  }, {
98
102
  default: i(() => [
99
103
  y(" Clear ")
@@ -110,7 +114,7 @@ const z = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
110
114
  g(V, {
111
115
  class: "flex-1",
112
116
  columns: ["32px", "", ""],
113
- items: l.value,
117
+ items: r.value,
114
118
  onAddRow: o,
115
119
  onToggleRow: q,
116
120
  onUpdateRow: b
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTableTooltip.vue"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAAE,uBAAuB,EAAE,M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A;KAAE;CACzD,CAAC"}
@@ -1,37 +1,43 @@
1
- import { defineComponent as m, openBlock as t, createBlock as c, unref as i, withCtx as a, createElementVNode as n, createVNode as l, createElementBlock as o, toDisplayString as s, createCommentVNode as r } from "vue";
2
- import { ScalarTooltip as f, ScalarIcon as p } from "@scalar/components";
3
- const d = { class: "pl-1 pr-1.5 py-[9px]" }, b = { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, h = { class: "flex items-center text-c-2" }, u = { key: 0 }, g = {
1
+ import { defineComponent as l, computed as f, openBlock as t, createBlock as p, unref as i, withCtx as n, createElementVNode as m, createVNode as d, createElementBlock as o, toDisplayString as r, createCommentVNode as s } from "vue";
2
+ import { ScalarTooltip as u, ScalarIcon as b } from "@scalar/components";
3
+ const x = { class: "pl-1 pr-1.5 py-[9px]" }, h = { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, _ = {
4
+ key: 0,
5
+ class: "flex items-center text-c-2"
6
+ }, g = { key: 0 }, k = {
4
7
  key: 1,
5
8
  class: "before:content-['·'] before:block before:mx-[0.5ch] flex"
6
- }, x = {
9
+ }, y = {
7
10
  key: 2,
8
11
  class: "before:content-['·'] before:block before:mx-[0.5ch] flex whitespace-nowrap"
9
- }, _ = {
12
+ }, w = {
10
13
  key: 3,
11
14
  class: "before:content-['·'] before:block before:mx-[0.5ch] flex whitespace-nowrap"
12
- }, k = {
15
+ }, v = {
13
16
  key: 4,
14
17
  class: "before:content-['·'] before:block before:mx-[0.5ch] flex whitespace-nowrap"
15
- }, y = {
16
- key: 0,
18
+ }, C = {
19
+ key: 1,
17
20
  class: "leading-snug text-pretty text-sm",
18
21
  style: { maxWidth: "16rem" }
19
- }, B = /* @__PURE__ */ m({
22
+ }, S = /* @__PURE__ */ l({
20
23
  __name: "RequestTableTooltip",
21
24
  props: {
22
25
  item: {}
23
26
  },
24
- setup(w) {
25
- return (e, v) => (t(), c(i(f), {
27
+ setup(a) {
28
+ const e = a, c = f(
29
+ () => e.item.type || e.item.format || e.item.minimum || e.item.maximum || e.item.default
30
+ );
31
+ return (z, B) => (t(), p(i(u), {
26
32
  align: "start",
27
33
  class: "w-full",
28
34
  delay: 0,
29
35
  side: "left",
30
36
  triggerClass: "before:absolute before:content-[''] before:bg-gradient-to-r before:from-transparent before:to-b-1 before:min-h-full before:right-[23px] before:w-3 absolute h-8 right-0"
31
37
  }, {
32
- trigger: a(() => [
33
- n("div", d, [
34
- l(i(p), {
38
+ trigger: n(() => [
39
+ m("div", x, [
40
+ d(i(b), {
35
41
  class: "text-c-3 group-hover/info:text-c-1",
36
42
  icon: "Info",
37
43
  size: "sm",
@@ -39,16 +45,16 @@ const d = { class: "pl-1 pr-1.5 py-[9px]" }, b = { class: "grid gap-1.5 pointer-
39
45
  })
40
46
  ])
41
47
  ]),
42
- content: a(() => [
43
- n("div", b, [
44
- n("div", h, [
45
- e.item.type ? (t(), o("span", u, s(e.item.type), 1)) : r("", !0),
46
- e.item.format ? (t(), o("span", g, s(e.item.format), 1)) : r("", !0),
47
- e.item.minimum ? (t(), o("span", x, "min: " + s(e.item.minimum), 1)) : r("", !0),
48
- e.item.maximum ? (t(), o("span", _, "max: " + s(e.item.maximum), 1)) : r("", !0),
49
- e.item.default ? (t(), o("span", k, "default: " + s(e.item.default), 1)) : r("", !0)
50
- ]),
51
- e.item.description ? (t(), o("span", y, s(e.item.description), 1)) : r("", !0)
48
+ content: n(() => [
49
+ m("div", h, [
50
+ c.value ? (t(), o("div", _, [
51
+ e.item.type ? (t(), o("span", g, r(e.item.type), 1)) : s("", !0),
52
+ e.item.format ? (t(), o("span", k, r(e.item.format), 1)) : s("", !0),
53
+ e.item.minimum ? (t(), o("span", y, "min: " + r(e.item.minimum), 1)) : s("", !0),
54
+ e.item.maximum ? (t(), o("span", w, "max: " + r(e.item.maximum), 1)) : s("", !0),
55
+ e.item.default ? (t(), o("span", v, "default: " + r(e.item.default), 1)) : s("", !0)
56
+ ])) : s("", !0),
57
+ e.item.description ? (t(), o("span", C, r(e.item.description), 1)) : s("", !0)
52
58
  ])
53
59
  ]),
54
60
  _: 1
@@ -56,5 +62,5 @@ const d = { class: "pl-1 pr-1.5 py-[9px]" }, b = { class: "grid gap-1.5 pointer-
56
62
  }
57
63
  });
58
64
  export {
59
- B as default
65
+ S as default
60
66
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.0.54",
21
+ "version": "2.0.56",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -127,14 +127,14 @@
127
127
  "vue-router": "^4.3.0",
128
128
  "whatwg-mimetype": "^4.0.0",
129
129
  "zod": "^3.22.4",
130
- "@scalar/components": "0.12.35",
130
+ "@scalar/components": "0.12.37",
131
131
  "@scalar/draggable": "0.1.4",
132
- "@scalar/oas-utils": "0.2.34",
132
+ "@scalar/oas-utils": "0.2.36",
133
133
  "@scalar/object-utils": "1.1.7",
134
- "@scalar/themes": "0.9.25",
135
- "@scalar/types": "0.0.1",
136
134
  "@scalar/use-codemirror": "0.11.10",
135
+ "@scalar/types": "0.0.2",
137
136
  "@scalar/use-toasts": "0.7.5",
137
+ "@scalar/themes": "0.9.25",
138
138
  "@scalar/use-tooltip": "1.0.2"
139
139
  },
140
140
  "devDependencies": {
@@ -1,7 +0,0 @@
1
- import o from "./SearchButton.vue2.js";
2
- /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2c26b5ad"]]);
5
- export {
6
- m as default
7
- };
@@ -1,30 +0,0 @@
1
- import { defineComponent as n, openBlock as r, createElementBlock as a, createElementVNode as t, createVNode as i, unref as p, pushScopeId as d, popScopeId as l } from "vue";
2
- import { ScalarIcon as m } from "@scalar/components";
3
- const u = (e) => (d("data-v-2c26b5ad"), e = e(), l(), e), f = { class: "search-button-fade sticky top-0 z-50 px-3 py-2.5 pb-2.5" }, h = { class: "w-[15px] flex items-center justify-center" }, _ = /* @__PURE__ */ u(() => /* @__PURE__ */ t("div", { class: "sidebar-search-input ml-1.5 flex w-full items-center justify-between text-sm font-medium" }, [
4
- /* @__PURE__ */ t("span", { class: "sidebar-search-placeholder" }, "Search")
5
- ], -1)), v = /* @__PURE__ */ n({
6
- __name: "SearchButton",
7
- emits: ["openSearchModal"],
8
- setup(e, { emit: s }) {
9
- const c = s;
10
- return (x, o) => (r(), a("div", f, [
11
- t("button", {
12
- class: "border-1/2 text-c-2 flex w-full items-center rounded p-1.5",
13
- type: "button",
14
- onClick: o[0] || (o[0] = (b) => c("openSearchModal"))
15
- }, [
16
- t("div", h, [
17
- i(p(m), {
18
- icon: "Search",
19
- size: "xs",
20
- thickness: "2.5"
21
- })
22
- ]),
23
- _
24
- ])
25
- ]));
26
- }
27
- });
28
- export {
29
- v as default
30
- };