@scalar/api-client 2.0.0 → 2.0.2

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.
@@ -1,40 +1,39 @@
1
- import { defineComponent as j, ref as H, computed as K, openBlock as c, createElementBlock as S, Fragment as R, createElementVNode as d, createVNode as s, unref as e, createCommentVNode as h, withCtx as m, createBlock as b, normalizeClass as C, createTextVNode as B, toDisplayString as P, withModifiers as E, renderList as W } from "vue";
2
- import G from "../../components/ActionModal/ActionModal.vue.js";
3
- import J from "../../components/AddressBar/AddressBar.vue.js";
4
- import Q from "../../components/Search/SearchButton.vue.js";
5
- import X from "../../components/Search/SearchModal.vue.js";
6
- import Y from "../../components/Sidebar/SidebarButton.vue.js";
7
- import Z from "../../components/ViewLayout/ViewLayout.vue.js";
8
- import ee from "../../components/ViewLayout/ViewLayoutContent.vue.js";
9
- import { useWorkspace as te } from "../../store/workspace.js";
10
- import oe from "./RequestSection/RequestSection.vue.js";
1
+ import { defineComponent as K, ref as P, onMounted as W, onBeforeUnmount as G, computed as J, openBlock as c, createElementBlock as S, Fragment as B, createElementVNode as d, createVNode as s, unref as e, createCommentVNode as h, withCtx as m, createBlock as b, normalizeClass as C, createTextVNode as q, toDisplayString as Q, withModifiers as E, renderList as X } from "vue";
2
+ import Y from "../../components/ActionModal/ActionModal.vue.js";
3
+ import Z from "../../components/AddressBar/AddressBar.vue.js";
4
+ import ee from "../../components/Search/SearchButton.vue.js";
5
+ import te from "../../components/Search/SearchModal.vue.js";
6
+ import oe from "../../components/Sidebar/SidebarButton.vue.js";
7
+ import re from "../../components/ViewLayout/ViewLayout.vue.js";
8
+ import se from "../../components/ViewLayout/ViewLayoutContent.vue.js";
9
+ import { useWorkspace as ne } from "../../store/workspace.js";
10
+ import ae from "./RequestSection/RequestSection.vue.js";
11
11
  /* empty css */
12
- import re from "./ResponseSection/ResponseSection.vue.js";
13
- import { useModal as se, ScalarIcon as y } from "@scalar/components";
14
- import { isMacOS as q } from "@scalar/use-tooltip";
15
- import { useMagicKeys as ne, useEventListener as ae } from "@vueuse/core";
16
- import le from "./RequestSidebarItem.vue.js";
17
- import { useActionModal as ie } from "../../hooks/useActionModal.js";
18
- import { sendRequest as ue } from "../../libs/sendRequest.js";
19
- import ce from "../../components/Sidebar/Sidebar.vue.js";
12
+ import le from "./ResponseSection/ResponseSection.vue.js";
13
+ import { useModal as ie, ScalarIcon as y } from "@scalar/components";
14
+ import { isMacOS as $ } from "@scalar/use-tooltip";
15
+ import { useMagicKeys as ue, useEventListener as ce } from "@vueuse/core";
16
+ import de from "./RequestSidebarItem.vue.js";
17
+ import { useActionModal as me } from "../../hooks/useActionModal.js";
18
+ import pe from "../../components/Sidebar/Sidebar.vue.js";
20
19
  /* empty css */
21
- import { useSidebar as de } from "../../hooks/useSidebar.js";
22
- import { executeRequestBus as me } from "../../libs/eventBusses/executeRequestBus.js";
23
- const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full" }, fe = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container" }, ve = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, ge = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 justify-end w-6/12" }, $ = !0, Fe = /* @__PURE__ */ j({
20
+ import { useSidebar as fe } from "../../hooks/useSidebar.js";
21
+ import { sendRequest as ve } from "../../libs/sendRequest.js";
22
+ import { executeRequestBus as I } from "../../libs/eventBusses/executeRequestBus.js";
23
+ const ge = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full" }, xe = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container" }, he = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, be = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 justify-end w-6/12" }, V = !0, je = /* @__PURE__ */ K({
24
24
  __name: "Request",
25
- setup(xe) {
25
+ setup(ye) {
26
26
  const {
27
27
  activeExample: w,
28
28
  activeRequest: p,
29
29
  activeServer: _,
30
- activeSecurityScheme: I,
31
- collections: V,
32
- modalState: z,
30
+ activeSecurityScheme: z,
31
+ collections: L,
32
+ modalState: N,
33
33
  workspace: i
34
- } = te(), { collapsedSidebarFolders: L } = de(), k = ie(), f = se(), l = H(!1), N = (r) => {
34
+ } = ne(), { collapsedSidebarFolders: U } = fe(), k = me(), f = ie(), l = P(!1), A = (r) => {
35
35
  k.tab = r;
36
- };
37
- me.on(async () => {
36
+ }, D = async () => {
38
37
  var n, u;
39
38
  if (!p.value || !w.value) {
40
39
  console.warn(
@@ -45,17 +44,17 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
45
44
  let r = ((n = _.value) == null ? void 0 : n.url) + p.value.path;
46
45
  if ((u = _.value) != null && u.variables) {
47
46
  const g = /{\s*([\w.-]+)\s*}/g;
48
- r = r.replace(g, (x, T) => {
49
- var D, M, O;
50
- const a = (M = (D = _.value) == null ? void 0 : D.variables) == null ? void 0 : M[T];
47
+ r = r.replace(g, (x, H) => {
48
+ var M, R, O;
49
+ const a = (R = (M = _.value) == null ? void 0 : M.variables) == null ? void 0 : R[H];
51
50
  return (a == null ? void 0 : a.value) || (a == null ? void 0 : a.default) || ((O = a == null ? void 0 : a.enum) == null ? void 0 : O[0]) || x;
52
51
  });
53
52
  }
54
- const { request: o, response: t } = await ue(
53
+ const { request: o, response: t } = await ve(
55
54
  p.value,
56
55
  w.value,
57
56
  r,
58
- I.value,
57
+ z.value,
59
58
  i.proxyUrl
60
59
  );
61
60
  o && t ? p.value.history.push({
@@ -63,19 +62,20 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
63
62
  response: t,
64
63
  timestamp: Date.now()
65
64
  }) : console.warn("No response or request was returned");
66
- });
67
- const A = K(
68
- () => i.collectionUids.map((r) => V[r])
69
- ), F = (r, o, t, n) => {
70
- }, U = () => {
65
+ };
66
+ W(() => I.on(D)), G(() => I.off(D));
67
+ const F = J(
68
+ () => i.collectionUids.map((r) => L[r])
69
+ ), T = (r, o, t, n) => {
70
+ }, j = () => {
71
71
  k.show();
72
- }, v = ne();
73
- return ae(document, "keydown", (r) => {
74
- (q() ? v.meta.value : v.ctrl.value) && r.key === "b" && (l.value = !l.value), (q() ? v.meta.value : v.ctrl.value) && r.key === "k" && (f.open ? f.hide() : f.show());
75
- }), (r, o) => (c(), S(R, null, [
76
- d("div", pe, [
77
- d("div", fe, [
78
- d("div", ve, [
72
+ }, v = ue();
73
+ return ce(document, "keydown", (r) => {
74
+ ($() ? v.meta.value : v.ctrl.value) && r.key === "b" && (l.value = !l.value), ($() ? v.meta.value : v.ctrl.value) && r.key === "k" && (f.open ? f.hide() : f.show());
75
+ }), (r, o) => (c(), S(B, null, [
76
+ d("div", ge, [
77
+ d("div", xe, [
78
+ d("div", he, [
79
79
  d("button", {
80
80
  class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
81
81
  type: "button",
@@ -87,13 +87,13 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
87
87
  }, null, 8, ["icon"])
88
88
  ])
89
89
  ]),
90
- s(J),
91
- d("div", ge, [
90
+ s(Z),
91
+ d("div", be, [
92
92
  e(i).isReadOnly ? (c(), S("button", {
93
93
  key: 0,
94
94
  class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
95
95
  type: "button",
96
- onClick: o[1] || (o[1] = (t) => e(z).hide())
96
+ onClick: o[1] || (o[1] = (t) => e(N).hide())
97
97
  }, [
98
98
  s(e(y), {
99
99
  icon: "Close",
@@ -102,17 +102,17 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
102
102
  ])) : h("", !0)
103
103
  ])
104
104
  ]),
105
- s(Z, null, {
105
+ s(re, null, {
106
106
  default: m(() => [
107
- l.value ? (c(), b(e(ce), {
107
+ l.value ? (c(), b(e(pe), {
108
108
  key: 0,
109
109
  class: C([l.value ? "sidebar-active-width" : ""])
110
110
  }, {
111
111
  title: m(() => [
112
- B(P(e(i).name), 1)
112
+ q(Q(e(i).name), 1)
113
113
  ]),
114
114
  content: m(() => [
115
- s(Q, {
115
+ s(ee, {
116
116
  onOpenSearchModal: o[2] || (o[2] = (t) => e(f).show())
117
117
  }),
118
118
  d("div", {
@@ -122,13 +122,13 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
122
122
  onDragover: o[4] || (o[4] = E(() => {
123
123
  }, ["prevent"]))
124
124
  }, [
125
- (c(!0), S(R, null, W(A.value, (t, n) => (c(), b(le, {
125
+ (c(!0), S(B, null, X(F.value, (t, n) => (c(), b(de, {
126
126
  key: t.uid,
127
- isDraggable: $ && !e(i).isReadOnly,
128
- isDroppable: $ && !e(i).isReadOnly,
127
+ isDraggable: V && !e(i).isReadOnly,
128
+ isDroppable: V && !e(i).isReadOnly,
129
129
  item: t,
130
130
  parentUids: [],
131
- onOnDragEnd: (...u) => F(t, n, ...u)
131
+ onOnDragEnd: (...u) => T(t, n, ...u)
132
132
  }, {
133
133
  leftIcon: m(() => [
134
134
  s(e(y), {
@@ -138,7 +138,7 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
138
138
  }),
139
139
  d("div", {
140
140
  class: C({
141
- "rotate-90": e(L)[t.uid]
141
+ "rotate-90": e(U)[t.uid]
142
142
  })
143
143
  }, [
144
144
  s(e(y), {
@@ -153,45 +153,45 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
153
153
  ], 32)
154
154
  ]),
155
155
  button: m(() => [
156
- e(i).isReadOnly ? h("", !0) : (c(), b(Y, {
156
+ e(i).isReadOnly ? h("", !0) : (c(), b(oe, {
157
157
  key: 0,
158
- click: U
158
+ click: j
159
159
  }, {
160
160
  title: m(() => [
161
- B("Add Item")
161
+ q("Add Item")
162
162
  ]),
163
163
  _: 1
164
164
  }))
165
165
  ]),
166
166
  _: 1
167
167
  }, 8, ["class"])) : h("", !0),
168
- e(w) ? (c(), b(ee, {
168
+ e(w) ? (c(), b(se, {
169
169
  key: 1,
170
170
  class: C(["flex-1", [l.value ? "sidebar-active-hide-layout" : ""]])
171
171
  }, {
172
172
  default: m(() => {
173
173
  var t, n, u, g, x;
174
174
  return [
175
- s(oe),
176
- s(re, {
175
+ s(ae),
176
+ s(le, {
177
177
  response: (x = (g = (t = e(p)) == null ? void 0 : t.history) == null ? void 0 : g[((u = (n = e(p)) == null ? void 0 : n.history) == null ? void 0 : u.length) - 1]) == null ? void 0 : x.response
178
178
  }, null, 8, ["response"])
179
179
  ];
180
180
  }),
181
181
  _: 1
182
182
  }, 8, ["class"])) : h("", !0),
183
- s(G, {
183
+ s(Y, {
184
184
  state: e(k),
185
- "onUpdate:tab": N
185
+ "onUpdate:tab": A
186
186
  }, null, 8, ["state"])
187
187
  ]),
188
188
  _: 1
189
189
  })
190
190
  ]),
191
- s(X, { modalState: e(f) }, null, 8, ["modalState"])
191
+ s(te, { modalState: e(f) }, null, 8, ["modalState"])
192
192
  ], 64));
193
193
  }
194
194
  });
195
195
  export {
196
- Fe as default
196
+ je as default
197
197
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.0.0",
21
+ "version": "2.0.2",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -109,11 +109,11 @@
109
109
  "vue": "^3.4.22",
110
110
  "vue-router": "^4.3.0",
111
111
  "zod": "^3.22.4",
112
- "@scalar/draggable": "0.1.3",
113
- "@scalar/components": "0.12.6",
112
+ "@scalar/components": "0.12.7",
114
113
  "@scalar/object-utils": "1.1.2",
115
- "@scalar/use-toasts": "0.7.4",
114
+ "@scalar/draggable": "0.1.3",
116
115
  "@scalar/use-tooltip": "1.0.2",
116
+ "@scalar/use-toasts": "0.7.4",
117
117
  "@scalar/oas-utils": "0.2.7"
118
118
  },
119
119
  "devDependencies": {
@@ -132,9 +132,9 @@
132
132
  "vite-svg-loader": "^5.1.0",
133
133
  "vitest": "^1.6.0",
134
134
  "vue-tsc": "^2.0.13",
135
+ "@scalar/build-tooling": "0.1.8",
135
136
  "@scalar/themes": "0.9.9",
136
- "@scalar/use-codemirror": "0.11.4",
137
- "@scalar/build-tooling": "0.1.7"
137
+ "@scalar/use-codemirror": "0.11.4"
138
138
  },
139
139
  "scripts": {
140
140
  "build": "vite build && pnpm types:build && tsc-alias -p tsconfig.build.json",
@@ -1,5 +0,0 @@
1
- import o from "./ApiClientModal.vue.js";
2
- /* empty css */
3
- export {
4
- o as default
5
- };