@scalar/api-client 2.0.13 → 2.0.15

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 (29) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/App.vue.js +44 -32
  4. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  5. package/dist/components/AddressBar/AddressBar.vue2.js +3 -3
  6. package/dist/components/AddressBar/AddressBarServer.vue.js +23 -23
  7. package/dist/components/CodeInput/CodeInput.vue.d.ts +2 -0
  8. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  9. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue2.js +16 -14
  11. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  12. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  13. package/dist/components/DataTable/DataTableInput.vue2.js +63 -61
  14. package/dist/components/DataTable/DataTableInputEnumSelect.vue.d.ts.map +1 -1
  15. package/dist/components/DataTable/DataTableInputEnumSelect.vue.js +1 -1
  16. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  17. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +15 -17
  18. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/SidebarListElementActions.vue.js +12 -12
  20. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  21. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  22. package/dist/components/TopNav/TopNavItem.vue2.js +10 -7
  23. package/dist/style.css +1 -1
  24. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  25. package/dist/views/Request/Request.vue.js +2 -2
  26. package/dist/views/Request/Request.vue2.js +101 -100
  27. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  28. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -0
  29. package/package.json +6 -6
@@ -1,148 +1,149 @@
1
- import { defineComponent as K, ref as P, onMounted as G, onBeforeUnmount as J, computed as Q, openBlock as c, createElementBlock as h, Fragment as q, unref as e, createElementVNode as p, createVNode as r, createCommentVNode as b, withCtx as d, withDirectives as X, normalizeClass as S, createTextVNode as $, toDisplayString as Y, withModifiers as E, renderList as Z, createBlock as C, vShow as ee } from "vue";
2
- import te from "../../components/ActionModal/ActionModal.vue.js";
3
- import oe from "../../components/AddressBar/AddressBar.vue.js";
1
+ import { defineComponent as P, ref as G, onMounted as J, onBeforeUnmount as Q, computed as X, openBlock as p, createElementBlock as _, Fragment as q, createElementVNode as d, createVNode as r, unref as e, createCommentVNode as k, withCtx as m, withDirectives as Y, normalizeClass as S, createTextVNode as $, toDisplayString as Z, withModifiers as E, renderList as ee, createBlock as C, vShow as te } from "vue";
2
+ import oe from "../../components/ActionModal/ActionModal.vue.js";
3
+ import se from "../../components/AddressBar/AddressBar.vue.js";
4
4
  import re from "../../components/Search/SearchButton.vue.js";
5
- import se from "../../components/Search/SearchModal.vue.js";
6
- import ne from "../../components/Sidebar/SidebarButton.vue.js";
7
- import ae from "../../components/ViewLayout/ViewLayout.vue.js";
8
- import le from "../../components/ViewLayout/ViewLayoutContent.vue.js";
9
- import { useWorkspace as ie } from "../../store/workspace.js";
10
- import ue from "./RequestSection/RequestSection.vue.js";
5
+ import ne from "../../components/Search/SearchModal.vue.js";
6
+ import ae from "../../components/Sidebar/SidebarButton.vue.js";
7
+ import le from "../../components/ViewLayout/ViewLayout.vue.js";
8
+ import ie from "../../components/ViewLayout/ViewLayoutContent.vue.js";
9
+ import { useWorkspace as ue } from "../../store/workspace.js";
10
+ import ce from "./RequestSection/RequestSection.vue.js";
11
11
  /* empty css */
12
- import ce from "./ResponseSection/ResponseSection.vue.js";
13
- import { useModal as de, ScalarIcon as y } from "@scalar/components";
12
+ import de from "./ResponseSection/ResponseSection.vue.js";
13
+ import { useModal as me, ScalarIcon as b } from "@scalar/components";
14
14
  import { isMacOS as I } from "@scalar/use-tooltip";
15
- import { useMagicKeys as me, useEventListener as pe } from "@vueuse/core";
16
- import fe from "./RequestSidebarItem.vue.js";
17
- import { useActionModal as ve } from "../../hooks/useActionModal.js";
18
- import ge from "../../components/Sidebar/Sidebar.vue.js";
15
+ import { useMagicKeys as pe, useEventListener as fe } from "@vueuse/core";
16
+ import ve from "./RequestSidebarItem.vue.js";
17
+ import { useActionModal as ge } from "../../hooks/useActionModal.js";
18
+ import xe from "../../components/Sidebar/Sidebar.vue.js";
19
19
  /* empty css */
20
- import { useSidebar as xe } from "../../hooks/useSidebar.js";
21
- import { sendRequest as he } from "../../libs/sendRequest.js";
20
+ import { useSidebar as he } from "../../hooks/useSidebar.js";
21
+ import { sendRequest as be } from "../../libs/sendRequest.js";
22
22
  import { executeRequestBus as V } from "../../libs/eventBusses/executeRequestBus.js";
23
- const be = {
24
- key: 0,
25
- class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full"
26
- }, ye = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container" }, we = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, _e = { 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" }, Ke = /* @__PURE__ */ K({
23
+ const ye = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full" }, we = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container" }, _e = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, ke = { 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" }, Pe = /* @__PURE__ */ P({
27
24
  __name: "Request",
28
- setup(ke) {
29
- var R;
25
+ setup(Se) {
26
+ var O;
30
27
  const {
31
- activeExample: w,
32
- activeRequest: m,
33
- activeServer: _,
28
+ activeExample: y,
29
+ activeRequest: i,
30
+ activeServer: x,
34
31
  activeSecurityScheme: z,
35
- activeWorkspace: l,
32
+ activeWorkspace: u,
36
33
  collections: N,
37
- modalState: A
38
- } = ie(), { collapsedSidebarFolders: L } = xe(), k = ve(), f = de(), i = P(!((R = l.value) != null && R.isReadOnly)), U = (s) => {
39
- k.tab = s;
34
+ modalState: j
35
+ } = ue(), { collapsedSidebarFolders: A } = he(), w = ge(), f = me(), l = G(!((O = u.value) != null && O.isReadOnly)), L = (s) => {
36
+ w.tab = s;
40
37
  }, D = async () => {
41
- var n, u, v;
42
- if (!m.value || !w.value) {
38
+ var n, c, v, g;
39
+ if (!i.value || !y.value) {
43
40
  console.warn(
44
41
  "There is no request active at the moment. Please select one then try again."
45
42
  );
46
43
  return;
47
44
  }
48
- let s = ((n = _.value) == null ? void 0 : n.url) + m.value.path;
49
- if ((u = _.value) != null && u.variables) {
50
- const x = /{\s*([\w.-]+)\s*}/g;
51
- s = s.replace(x, (W, H) => {
52
- var M, O, B;
53
- const a = (O = (M = _.value) == null ? void 0 : M.variables) == null ? void 0 : O[H];
54
- return (a == null ? void 0 : a.value) || (a == null ? void 0 : a.default) || ((B = a == null ? void 0 : a.enum) == null ? void 0 : B[0]) || W;
45
+ let s = (n = x.value) != null && n.url ? ((c = x.value) == null ? void 0 : c.url) + i.value.path : i.value.path;
46
+ if ((v = x.value) != null && v.variables) {
47
+ const W = /{\s*([\w.-]+)\s*}/g;
48
+ s = s.replace(W, (H, K) => {
49
+ var R, M, B;
50
+ const a = (M = (R = x.value) == null ? void 0 : R.variables) == null ? void 0 : M[K];
51
+ return (a == null ? void 0 : a.value) || (a == null ? void 0 : a.default) || ((B = a == null ? void 0 : a.enum) == null ? void 0 : B[0]) || H;
55
52
  });
56
53
  }
57
- const { request: o, response: t } = await he(
58
- m.value,
59
- w.value,
54
+ const { request: o, response: t } = await be(
55
+ i.value,
56
+ y.value,
60
57
  s,
61
58
  z.value,
62
- (v = l.value) == null ? void 0 : v.proxyUrl
59
+ (g = u.value) == null ? void 0 : g.proxyUrl
63
60
  );
64
- o && t ? m.value.history.push({
61
+ o && t ? i.value.history.push({
65
62
  request: o,
66
63
  response: t,
67
64
  timestamp: Date.now()
68
65
  }) : console.warn("No response or request was returned");
69
66
  };
70
- G(() => V.on(D)), J(() => V.off(D));
71
- const j = Q(() => Object.values(N)), F = (s, o, t, n) => {
67
+ J(() => V.on(D)), Q(() => V.off(D));
68
+ const U = X(() => {
69
+ const s = Object.values(N), o = s.findIndex((n) => n.uid === "drafts"), [t] = s.splice(o, 1);
70
+ return s.push(t), s;
71
+ }), F = (s, o, t, n) => {
72
72
  }, T = () => {
73
- k.show();
74
- }, g = me();
75
- return pe(document, "keydown", (s) => {
76
- (I() ? g.meta.value : g.ctrl.value) && s.key === "b" && (i.value = !i.value), (I() ? g.meta.value : g.ctrl.value) && s.key === "k" && (f.open ? f.hide() : f.show());
77
- }), (s, o) => (c(), h(q, null, [
78
- e(l) ? (c(), h("div", be, [
79
- p("div", ye, [
80
- p("div", we, [
81
- p("button", {
73
+ w.show();
74
+ }, h = pe();
75
+ return fe(document, "keydown", (s) => {
76
+ (I() ? h.meta.value : h.ctrl.value) && s.key === "b" && (l.value = !l.value), (I() ? h.meta.value : h.ctrl.value) && s.key === "k" && (f.open ? f.hide() : f.show());
77
+ }), (s, o) => (p(), _(q, null, [
78
+ d("div", ye, [
79
+ d("div", we, [
80
+ d("div", _e, [
81
+ d("button", {
82
82
  class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
83
83
  type: "button",
84
- onClick: o[0] || (o[0] = (t) => i.value = !i.value)
84
+ onClick: o[0] || (o[0] = (t) => l.value = !l.value)
85
85
  }, [
86
- r(e(y), {
87
- icon: i.value ? "SideBarOpen" : "SideBarClosed",
86
+ r(e(b), {
87
+ icon: l.value ? "SideBarOpen" : "SideBarClosed",
88
88
  size: "sm"
89
89
  }, null, 8, ["icon"])
90
90
  ])
91
91
  ]),
92
- r(oe),
93
- p("div", _e, [
94
- e(l).isReadOnly ? (c(), h("button", {
92
+ r(se),
93
+ d("div", ke, [
94
+ e(u).isReadOnly ? (p(), _("button", {
95
95
  key: 0,
96
96
  class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
97
97
  type: "button",
98
- onClick: o[1] || (o[1] = (t) => e(A).hide())
98
+ onClick: o[1] || (o[1] = (t) => e(j).hide())
99
99
  }, [
100
- r(e(y), {
100
+ r(e(b), {
101
+ class: "stroke-[1.75]",
101
102
  icon: "Close",
102
- size: "xs"
103
+ size: "lg"
103
104
  })
104
- ])) : b("", !0)
105
+ ])) : k("", !0)
105
106
  ])
106
107
  ]),
107
- r(ae, null, {
108
- default: d(() => [
109
- X(r(e(ge), {
110
- class: S([i.value ? "sidebar-active-width" : ""])
108
+ r(le, null, {
109
+ default: m(() => [
110
+ Y(r(e(xe), {
111
+ class: S([l.value ? "sidebar-active-width" : ""])
111
112
  }, {
112
- title: d(() => [
113
- $(Y(e(l).name), 1)
113
+ title: m(() => [
114
+ $(Z(e(u).name), 1)
114
115
  ]),
115
- content: d(() => [
116
+ content: m(() => [
116
117
  r(re, {
117
118
  onOpenSearchModal: o[2] || (o[2] = (t) => e(f).show())
118
119
  }),
119
- p("div", {
120
+ d("div", {
120
121
  class: "custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-12 pt-2.5",
121
122
  onDragenter: o[3] || (o[3] = E(() => {
122
123
  }, ["prevent"])),
123
124
  onDragover: o[4] || (o[4] = E(() => {
124
125
  }, ["prevent"]))
125
126
  }, [
126
- (c(!0), h(q, null, Z(j.value, (t, n) => (c(), C(fe, {
127
+ (p(!0), _(q, null, ee(U.value, (t, n) => (p(), C(ve, {
127
128
  key: t.uid,
128
- isDraggable: !e(l).isReadOnly,
129
- isDroppable: !e(l).isReadOnly,
129
+ isDraggable: !e(u).isReadOnly,
130
+ isDroppable: !e(u).isReadOnly,
130
131
  item: t,
131
132
  parentUids: [],
132
- onOnDragEnd: (...u) => F(t, n, ...u)
133
+ onOnDragEnd: (...c) => F(t, n, ...c)
133
134
  }, {
134
- leftIcon: d(() => [
135
- r(e(y), {
135
+ leftIcon: m(() => [
136
+ r(e(b), {
136
137
  class: "text-sidebar-c-2 stroke-[1] text-sm group-hover:hidden",
137
138
  icon: "CodeFolder",
138
139
  size: "sm"
139
140
  }),
140
- p("div", {
141
+ d("div", {
141
142
  class: S({
142
- "rotate-90": e(L)[t.uid]
143
+ "rotate-90": e(A)[t.uid]
143
144
  })
144
145
  }, [
145
- r(e(y), {
146
+ r(e(b), {
146
147
  class: "text-c-3 hidden text-sm group-hover:block",
147
148
  icon: "ChevronRight",
148
149
  size: "sm"
@@ -153,12 +154,12 @@ const be = {
153
154
  }, 1032, ["isDraggable", "isDroppable", "item", "onOnDragEnd"]))), 128))
154
155
  ], 32)
155
156
  ]),
156
- button: d(() => [
157
- e(l).isReadOnly ? b("", !0) : (c(), C(ne, {
157
+ button: m(() => [
158
+ e(u).isReadOnly ? k("", !0) : (p(), C(ae, {
158
159
  key: 0,
159
160
  click: T
160
161
  }, {
161
- title: d(() => [
162
+ title: m(() => [
162
163
  $("Add Item")
163
164
  ]),
164
165
  _: 1
@@ -166,35 +167,35 @@ const be = {
166
167
  ]),
167
168
  _: 1
168
169
  }, 8, ["class"]), [
169
- [ee, i.value]
170
+ [te, l.value]
170
171
  ]),
171
- e(w) ? (c(), C(le, {
172
+ e(y) ? (p(), C(ie, {
172
173
  key: 0,
173
- class: S(["flex-1", [i.value ? "sidebar-active-hide-layout" : ""]])
174
+ class: S(["flex-1", [l.value ? "sidebar-active-hide-layout" : ""]])
174
175
  }, {
175
- default: d(() => {
176
- var t, n, u, v, x;
176
+ default: m(() => {
177
+ var t, n, c, v, g;
177
178
  return [
178
- r(ue),
179
- r(ce, {
180
- response: (x = (v = (t = e(m)) == null ? void 0 : t.history) == null ? void 0 : v[((u = (n = e(m)) == null ? void 0 : n.history) == null ? void 0 : u.length) - 1]) == null ? void 0 : x.response
179
+ r(ce),
180
+ r(de, {
181
+ response: (g = (v = (t = e(i)) == null ? void 0 : t.history) == null ? void 0 : v[((c = (n = e(i)) == null ? void 0 : n.history) == null ? void 0 : c.length) - 1]) == null ? void 0 : g.response
181
182
  }, null, 8, ["response"])
182
183
  ];
183
184
  }),
184
185
  _: 1
185
- }, 8, ["class"])) : b("", !0),
186
- r(te, {
187
- state: e(k),
188
- "onUpdate:tab": U
186
+ }, 8, ["class"])) : k("", !0),
187
+ r(oe, {
188
+ state: e(w),
189
+ "onUpdate:tab": L
189
190
  }, null, 8, ["state"])
190
191
  ]),
191
192
  _: 1
192
193
  })
193
- ])) : b("", !0),
194
- r(se, { modalState: e(f) }, null, 8, ["modalState"])
194
+ ]),
195
+ r(ne, { modalState: e(f) }, null, 8, ["modalState"])
195
196
  ], 64));
196
197
  }
197
198
  });
198
199
  export {
199
- Ke as default
200
+ Pe as default
200
201
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":";WAmbS,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;WAFT,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;AAkwBlB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":";WAobS,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;WAFT,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;AAkwBlB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -291,6 +291,7 @@ const te = {
291
291
  content: "",
292
292
  language: z.value,
293
293
  lineNumbers: "",
294
+ lint: "",
294
295
  modelValue: ((l = s(t)) == null ? void 0 : l.body.raw.value) ?? "",
295
296
  "onUpdate:modelValue": $
296
297
  }, null, 8, ["language", "modelValue"]))
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.0.13",
21
+ "version": "2.0.15",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -98,7 +98,7 @@
98
98
  "dependencies": {
99
99
  "@headlessui/tailwindcss": "^0.2.0",
100
100
  "@headlessui/vue": "^1.7.20",
101
- "@scalar/openapi-parser": "^0.7.1",
101
+ "@scalar/openapi-parser": "^0.7.2",
102
102
  "@vueuse/core": "^10.10.0",
103
103
  "axios": "^1.6.8",
104
104
  "cva": "1.0.0-beta.1",
@@ -110,14 +110,14 @@
110
110
  "vue": "^3.4.22",
111
111
  "vue-router": "^4.3.0",
112
112
  "zod": "^3.22.4",
113
- "@scalar/components": "0.12.10",
113
+ "@scalar/components": "0.12.12",
114
114
  "@scalar/draggable": "0.1.3",
115
- "@scalar/oas-utils": "0.2.12",
115
+ "@scalar/oas-utils": "0.2.13",
116
116
  "@scalar/object-utils": "1.1.4",
117
117
  "@scalar/themes": "0.9.13",
118
- "@scalar/use-codemirror": "0.11.4",
119
118
  "@scalar/use-toasts": "0.7.4",
120
- "@scalar/use-tooltip": "1.0.2"
119
+ "@scalar/use-tooltip": "1.0.2",
120
+ "@scalar/use-codemirror": "0.11.5"
121
121
  },
122
122
  "devDependencies": {
123
123
  "@types/content-type": "^1.1.8",