@scalar/api-client 2.0.39 → 2.0.41

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 (74) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
  5. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +1 -1
  6. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +11 -11
  7. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  8. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  9. package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
  10. package/dist/components/Search/SearchButton.vue.js +5 -28
  11. package/dist/components/Search/SearchButton.vue2.js +28 -2
  12. package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
  13. package/dist/components/SideNav/SideHelp.vue.js +26 -28
  14. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  15. package/dist/components/SideNav/SideNav.vue.js +2 -2
  16. package/dist/components/SideNav/SideNav.vue2.js +5 -5
  17. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  18. package/dist/components/SideNav/SideNavLink.vue.js +6 -6
  19. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  20. package/dist/components/Sidebar/Sidebar.vue.js +14 -10
  21. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/SidebarButton.vue.js +4 -4
  23. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  24. package/dist/layouts/App/create-api-client-app.d.ts +20 -20
  25. package/dist/layouts/Modal/create-api-client-modal.d.ts +40 -40
  26. package/dist/libs/create-client.d.ts +20 -20
  27. package/dist/libs/sendRequest.d.ts.map +1 -1
  28. package/dist/libs/sendRequest.js +87 -70
  29. package/dist/store/workspace.d.ts +64 -64
  30. package/dist/store/workspace.d.ts.map +1 -1
  31. package/dist/store/workspace.js +129 -132
  32. package/dist/style.css +1 -1
  33. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  34. package/dist/views/Request/Request.vue.js +2 -2
  35. package/dist/views/Request/Request.vue2.js +206 -146
  36. package/dist/views/Request/RequestSidebarItem.vue.d.ts +4 -4
  37. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  38. package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
  39. package/dist/views/Request/RequestSidebarItem.vue2.js +105 -92
  40. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  41. package/dist/views/Request/RequestSidebarItemMenu.vue.js +2 -2
  42. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +44 -44
  43. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +3 -17
  44. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  45. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +89 -5
  46. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +2 -37
  47. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +18 -0
  48. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -0
  49. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +34 -0
  50. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue2.js +4 -0
  51. package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.d.ts +12 -0
  52. package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.d.ts.map +1 -0
  53. package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.js +14 -0
  54. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts +23 -0
  55. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -0
  56. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +7 -0
  57. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +65 -0
  58. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts +19 -0
  59. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -0
  60. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +7 -0
  61. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +29 -0
  62. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.d.ts +20 -0
  63. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.d.ts.map +1 -0
  64. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.js +25 -0
  65. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue2.js +4 -0
  66. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  67. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +61 -63
  68. package/dist/views/Request/consts/index.d.ts +2 -0
  69. package/dist/views/Request/consts/index.d.ts.map +1 -1
  70. package/dist/views/Request/consts/index.js +6 -3
  71. package/dist/views/Request/consts/mediaTypes.d.ts +16 -0
  72. package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -0
  73. package/dist/views/Request/consts/mediaTypes.js +108 -0
  74. package/package.json +9 -7
@@ -1,114 +1,124 @@
1
- import { defineComponent as P, useCssVars as T, computed as o, resolveComponent as W, openBlock as a, createElementBlock as p, normalizeClass as d, unref as i, createVNode as b, withCtx as k, createBlock as m, createElementVNode as l, toDisplayString as y, createCommentVNode as f, createTextVNode as q, renderSlot as A, withDirectives as M, Fragment as G, renderList as H, vShow as J } from "vue";
2
- import { PathId as K } from "../../router.js";
3
- import { useWorkspace as Q } from "../../store/workspace.js";
4
- import { ScalarIcon as X } from "@scalar/components";
5
- import { Draggable as Y } from "@scalar/draggable";
6
- import { RouterLink as Z } from "vue-router";
7
- import x from "./RequestSidebarItemMenu.vue.js";
8
- import _ from "../../components/HttpMethod/HttpMethod.vue.js";
9
- import { useSidebar as ee } from "../../hooks/useSidebar.js";
10
- const te = { class: "flex flex-row gap-1" }, ie = { class: "flex" }, re = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, se = { class: "flex flex-1 flex-row justify-between sidebar-folderitem editable-sidebar-hover" }, ae = { key: 2 }, $ = "hover:bg-sidebar-active-b indent-padding-left", ge = /* @__PURE__ */ P({
1
+ import { defineComponent as G, useCssVars as H, computed as l, ref as J, resolveComponent as K, openBlock as o, createElementBlock as m, normalizeClass as d, unref as i, createVNode as U, withCtx as C, createBlock as c, createElementVNode as s, toDisplayString as I, createCommentVNode as b, createTextVNode as E, renderSlot as Q, withDirectives as X, Fragment as Y, renderList as Z, vShow as ee, pushScopeId as te, popScopeId as ie } from "vue";
2
+ import { PathId as re } from "../../router.js";
3
+ import { useWorkspace as se } from "../../store/workspace.js";
4
+ import { ScalarIcon as ae } from "@scalar/components";
5
+ import { Draggable as le } from "@scalar/draggable";
6
+ import { RouterLink as ne } from "vue-router";
7
+ import z from "./RequestSidebarItemMenu.vue.js";
8
+ import oe from "../../components/HttpMethod/HttpMethod.vue.js";
9
+ import { useSidebar as de } from "../../hooks/useSidebar.js";
10
+ const ue = (u) => (te("data-v-0285aba2"), u = u(), ie(), u), pe = { class: "flex flex-row gap-1 items-center" }, fe = { class: "relative" }, me = { class: "flex" }, ce = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, be = { class: "flex flex-1 flex-row justify-between editable-sidebar-hover" }, ge = { class: "relative flex h-fit" }, ve = /* @__PURE__ */ ue(() => /* @__PURE__ */ s("span", null, " ", -1)), he = { key: 2 }, O = "hover:bg-sidebar-active-b indent-padding-left", $e = /* @__PURE__ */ G({
11
11
  __name: "RequestSidebarItem",
12
12
  props: {
13
13
  isDraggable: { type: Boolean, default: !1 },
14
- isDroppable: { type: Boolean, default: !1 },
14
+ isDroppable: { type: [Boolean, Function], default: !1 },
15
15
  parentUids: {},
16
16
  item: {}
17
17
  },
18
18
  emits: ["onDragEnd"],
19
- setup(C) {
20
- T((e) => ({
21
- "2b445812": z.value,
22
- "78a7cc6c": B.value
19
+ setup(u) {
20
+ H((e) => ({
21
+ "6aa00981": F.value,
22
+ efd61ec6: N.value
23
23
  }));
24
- const t = C, {
25
- activeRequest: g,
26
- activeRouterParams: S,
27
- activeWorkspace: c,
28
- folders: R,
29
- isReadOnly: r,
30
- requests: h,
31
- requestExamples: I
32
- } = Q(), { collapsedSidebarFolders: v, toggleSidebarFolder: E } = ee(), U = o(() => "childUids" in t.item), z = o(() => t.parentUids.length ? r.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), B = o(() => t.parentUids.length ? r.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), D = (e) => {
33
- var s;
34
- return "spec" in e ? (s = e.spec.info) == null ? void 0 : s.title : "summary" in e ? e.summary || e.path : "name" in e ? e.name : "";
35
- }, O = o(() => ("requestUid" in t.item ? h[t.item.requestUid] : t.item).method), V = o(
24
+ const t = u, {
25
+ activeRequest: w,
26
+ activeRouterParams: _,
27
+ activeWorkspace: g,
28
+ collections: D,
29
+ folders: B,
30
+ isReadOnly: a,
31
+ requests: k,
32
+ requestExamples: v
33
+ } = se(), { collapsedSidebarFolders: y, toggleSidebarFolder: V } = de(), j = l(() => "childUids" in t.item), q = l(() => "spec" in t.item), x = l(() => "summary" in t.item), F = l(() => t.parentUids.length ? a.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), N = l(() => t.parentUids.length ? a.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), R = (e) => {
34
+ var r;
35
+ return "spec" in e ? (r = e.spec.info) == null ? void 0 : r.title : "summary" in e ? e.summary || e.path : "name" in e ? e.name : "";
36
+ }, L = l(() => ("requestUid" in t.item ? k[t.item.requestUid] : t.item).method), P = l(
36
37
  () => {
37
38
  var e;
38
- return v[t.item.uid] || ((e = g.value) == null ? void 0 : e.uid) === t.item.uid && t.item.childUids.length > 1;
39
+ return y[t.item.uid] || ((e = w.value) == null ? void 0 : e.uid) === t.item.uid && t.item.childUids.length > 1;
39
40
  }
40
- ), j = () => "requestUid" in t.item ? `/workspace/${c.value.uid}/request/${t.item.requestUid}/examples/${t.item.uid}` : `/workspace/${c.value.uid}/request/${t.item.uid}`, N = o(
41
- () => S.value[K.Request] === "default" && g.value.uid === t.item.uid
42
- );
43
- return (e, s) => {
44
- const F = W("RequestSidebarItem", !0);
45
- return a(), p("div", {
41
+ ), T = () => "requestUid" in t.item ? `/workspace/${g.value.uid}/request/${t.item.requestUid}/examples/${t.item.uid}` : `/workspace/${g.value.uid}/request/${t.item.uid}`, W = l(
42
+ () => _.value[re.Request] === "default" && w.value.uid === t.item.uid
43
+ ), h = J(null), S = l(() => {
44
+ let e = 0.5, r = 0.5;
45
+ if (!h.value) return { ceiling: e, floor: r };
46
+ const { draggingItem: p } = h.value;
47
+ return !D[p == null ? void 0 : p.id] && q.value ? (e = 1, r = 0) : j.value && !x.value && !q.value && (e = 0.8, r = 0.2), { ceiling: e, floor: r };
48
+ }), A = (e, r) => !(g.value.isReadOnly || v[r.id] || D[e.id]);
49
+ return (e, r) => {
50
+ const p = K("RequestSidebarItem", !0);
51
+ return o(), m("div", {
46
52
  class: d(["relative flex flex-row", [
47
- i(r) && e.parentUids.length > 1 || !i(r) && e.parentUids.length ? "before:bg-b-3 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:z-10 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-px mb-[.5px] last:mb-0 indent-border-line-offset" : ""
53
+ i(a) && e.parentUids.length > 1 || !i(a) && e.parentUids.length ? "before:bg-b-3 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:z-10 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-px mb-[.5px] last:mb-0 indent-border-line-offset" : ""
48
54
  ]])
49
55
  }, [
50
- b(i(Y), {
56
+ U(i(le), {
51
57
  id: e.item.uid,
52
- ceiling: U.value ? 0.8 : 0.5,
53
- class: "flex flex-1 flex-col gap-[.5px] text-sm max-w-full",
54
- floor: U.value ? 0.2 : 0.5,
55
- isDraggable: e.parentUids.length > 0 && e.isDraggable,
58
+ ref_key: "draggableRef",
59
+ ref: h,
60
+ ceiling: S.value.ceiling,
61
+ class: "flex flex-1 flex-col gap-[.5px] text-sm",
62
+ floor: S.value.floor,
63
+ isDraggable: e.isDraggable,
56
64
  isDroppable: e.isDroppable,
57
65
  parentIds: e.parentUids,
58
- onOnDragEnd: s[2] || (s[2] = (...u) => e.$emit("onDragEnd", ...u))
66
+ onOnDragEnd: r[2] || (r[2] = (...f) => e.$emit("onDragEnd", ...f))
59
67
  }, {
60
- default: k(() => {
61
- var u, w;
68
+ default: C(() => {
69
+ var f, $;
62
70
  return [
63
- "summary" in e.item || "requestUid" in e.item ? (a(), m(i(Z), {
71
+ "summary" in e.item || "requestUid" in e.item ? (o(), c(i(ne), {
64
72
  key: 0,
65
73
  class: "no-underline",
66
- to: j()
74
+ to: T()
67
75
  }, {
68
- default: k(({ isExactActive: n }) => [
69
- l("div", {
76
+ default: C(({ isExactActive: n }) => [
77
+ s("div", {
70
78
  class: d(["group relative flex min-h-8 cursor-pointer flex-row items-start justify-between gap-2 py-1.5 pr-2 rounded editable-sidebar-hover", [
71
- $,
72
- n || N.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
79
+ O,
80
+ n || W.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
73
81
  ]]),
74
82
  tabindex: "0"
75
83
  }, [
76
- l("span", {
84
+ s("span", {
77
85
  class: d(["z-10 font-medium w-full pl-2 word-break-break-word", {
78
- "editable-sidebar-hover-item": !i(r)
86
+ "editable-sidebar-hover-item": !i(a)
79
87
  }])
80
- }, y(D(e.item)), 3),
81
- l("div", te, [
82
- i(r) ? f("", !0) : (a(), m(x, {
83
- key: 0,
84
- item: e.item,
85
- parentUids: e.parentUids
86
- }, null, 8, ["item", "parentUids"])),
87
- l("span", ie, [
88
- q("   "),
89
- b(i(_), {
88
+ }, I(R(e.item)), 3),
89
+ s("div", pe, [
90
+ s("div", fe, [
91
+ i(a) ? b("", !0) : (o(), c(z, {
92
+ key: 0,
93
+ item: e.item,
94
+ parentUids: e.parentUids
95
+ }, null, 8, ["item", "parentUids"]))
96
+ ]),
97
+ s("span", me, [
98
+ E("   "),
99
+ U(i(oe), {
90
100
  class: "font-bold",
91
- method: O.value
101
+ method: L.value
92
102
  }, null, 8, ["method"])
93
103
  ])
94
104
  ])
95
105
  ], 2)
96
106
  ]),
97
107
  _: 1
98
- }, 8, ["to"])) : !i(r) || e.parentUids.length ? (a(), p("button", {
108
+ }, 8, ["to"])) : !i(a) || e.parentUids.length ? (o(), m("button", {
99
109
  key: 1,
100
- class: d(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", $]),
110
+ class: d(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", O]),
101
111
  type: "button",
102
- onClick: s[0] || (s[0] = (n) => i(E)(e.item.uid))
112
+ onClick: r[0] || (r[0] = (n) => i(V)(e.item.uid))
103
113
  }, [
104
- l("span", re, [
105
- A(e.$slots, "leftIcon", {}, () => [
106
- l("div", {
114
+ s("span", ce, [
115
+ Q(e.$slots, "leftIcon", {}, () => [
116
+ s("div", {
107
117
  class: d({
108
- "rotate-90": i(v)[e.item.uid]
118
+ "rotate-90": i(y)[e.item.uid]
109
119
  })
110
120
  }, [
111
- b(i(X), {
121
+ U(i(ae), {
112
122
  class: "text-c-3 text-sm",
113
123
  icon: "ChevronRight",
114
124
  size: "sm",
@@ -116,33 +126,36 @@ const te = { class: "flex flex-row gap-1" }, ie = { class: "flex" }, re = { clas
116
126
  })
117
127
  ], 2)
118
128
  ], !0),
119
- q("   ")
129
+ E("   ")
120
130
  ]),
121
- l("div", se, [
122
- l("span", {
123
- class: d(["z-10 font-medium w-full word-break-break-word text-left", {
124
- "editable-sidebar-hover-item": !i(r)
131
+ s("div", be, [
132
+ s("span", {
133
+ class: d(["z-10 font-medium text-left w-full word-break-break-word", {
134
+ "editable-sidebar-hover-item": !i(a)
125
135
  }])
126
- }, y(D(e.item)), 3),
127
- !i(r) && ((w = (u = e.item.spec) == null ? void 0 : u.info) == null ? void 0 : w.title) !== "Drafts" ? (a(), m(x, {
128
- key: 0,
129
- item: e.item,
130
- parentUids: e.parentUids
131
- }, null, 8, ["item", "parentUids"])) : f("", !0)
136
+ }, I(R(e.item)), 3),
137
+ s("div", ge, [
138
+ !i(a) && (($ = (f = e.item.spec) == null ? void 0 : f.info) == null ? void 0 : $.title) !== "Drafts" ? (o(), c(z, {
139
+ key: 0,
140
+ item: e.item,
141
+ parentUids: e.parentUids
142
+ }, null, 8, ["item", "parentUids"])) : b("", !0),
143
+ ve
144
+ ])
132
145
  ])
133
- ])) : f("", !0),
134
- "childUids" in e.item ? M((a(), p("div", ae, [
135
- (a(!0), p(G, null, H("summary" in e.item ? e.item.childUids.slice(1) : e.item.childUids, (n) => (a(), m(F, {
146
+ ])) : b("", !0),
147
+ "childUids" in e.item ? X((o(), m("div", he, [
148
+ (o(!0), m(Y, null, Z(x.value ? e.item.childUids.slice(1) : e.item.childUids, (n) => (o(), c(p, {
136
149
  key: n,
137
- isDraggable: e.isDraggable,
138
- isDroppable: e.isDroppable,
139
- item: i(R)[n] || i(h)[n] || i(I)[n],
150
+ isDraggable: !i(v)[n],
151
+ isDroppable: A,
152
+ item: i(B)[n] || i(k)[n] || i(v)[n],
140
153
  parentUids: [...e.parentUids, e.item.uid],
141
- onOnDragEnd: s[1] || (s[1] = (...L) => e.$emit("onDragEnd", ...L))
142
- }, null, 8, ["isDraggable", "isDroppable", "item", "parentUids"]))), 128))
154
+ onOnDragEnd: r[1] || (r[1] = (...M) => e.$emit("onDragEnd", ...M))
155
+ }, null, 8, ["isDraggable", "item", "parentUids"]))), 128))
143
156
  ], 512)), [
144
- [J, V.value]
145
- ]) : f("", !0)
157
+ [ee, P.value]
158
+ ]) : b("", !0)
146
159
  ];
147
160
  }),
148
161
  _: 3
@@ -152,5 +165,5 @@ const te = { class: "flex flex-row gap-1" }, ie = { class: "flex" }, re = { clas
152
165
  }
153
166
  });
154
167
  export {
155
- ge as default
168
+ $e as default
156
169
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA4PA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;IAOhD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;IAFpD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;AAshBtD,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":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA4PA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;IAOhD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;IAFpD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;AAyhBtD,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,7 +1,7 @@
1
1
  import t from "./RequestSidebarItemMenu.vue2.js";
2
2
  /* empty css */
3
3
  import e from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b4744bc5"]]);
4
+ const m = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b4adf477"]]);
5
5
  export {
6
- a as default
6
+ m as default
7
7
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as V, computed as f, ref as B, openBlock as q, createElementBlock as A, Fragment as F, createVNode as i, unref as t, withCtx as a, createBlock as P, createCommentVNode as T, withKeys as K, withModifiers as W, createElementVNode as d, createTextVNode as E, pushScopeId as j, popScopeId as G } from "vue";
1
+ import { defineComponent as V, computed as f, ref as B, openBlock as S, createElementBlock as A, Fragment as F, createVNode as i, unref as t, withCtx as l, createBlock as P, createCommentVNode as T, withKeys as K, withModifiers as W, createElementVNode as d, createTextVNode as E, pushScopeId as j, popScopeId as G } from "vue";
2
2
  import H from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
3
  import { commandPaletteBus as J } from "../../libs/eventBusses/command-palette.js";
4
4
  import { PathId as R } from "../../router.js";
5
5
  import { useWorkspace as L } from "../../store/workspace.js";
6
- import { useModal as I, ScalarDropdown as O, ScalarDropdownItem as v, ScalarIcon as u, ScalarButton as x, ScalarModal as N, ScalarTextField as Q } from "@scalar/components";
6
+ import { useModal as I, ScalarDropdown as O, ScalarDropdownItem as v, ScalarIcon as u, ScalarButton as h, ScalarModal as N, ScalarTextField as Q } from "@scalar/components";
7
7
  import { useRouter as X } from "vue-router";
8
- const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Add Example", -1)), Z = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Rename", -1)), ee = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Delete", -1)), te = { class: "flex gap-3" }, re = /* @__PURE__ */ V({
8
+ const x = (o) => (j("data-v-b4adf477"), o = o(), G(), o), Y = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Add Example", -1)), Z = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Rename", -1)), ee = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Delete", -1)), te = { class: "flex gap-3" }, me = /* @__PURE__ */ V({
9
9
  __name: "RequestSidebarItemMenu",
10
10
  props: {
11
11
  parentUids: {},
@@ -17,36 +17,36 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
17
17
  activeRouterParams: g,
18
18
  collectionMutators: _,
19
19
  folderMutators: w,
20
- requestMutators: C,
21
- requestExampleMutators: b
22
- } = L(), { replace: y } = X(), U = () => J.emit({
20
+ requestMutators: y,
21
+ requestExampleMutators: C
22
+ } = L(), { replace: b } = X(), U = () => J.emit({
23
23
  commandName: "Add Example",
24
24
  metaData: e.item.uid
25
25
  }), D = () => {
26
- "requestUid" in e.item ? (b.delete(e.item), g.value[R.Examples] === e.item.uid && y(`/workspace/${k.value}/request/default`)) : "summary" in e.item ? (C.delete(
26
+ "requestUid" in e.item ? (C.delete(e.item), g.value[R.Examples] === e.item.uid && b(`/workspace/${k.value}/request/default`)) : "summary" in e.item ? (y.delete(
27
27
  e.item,
28
28
  e.parentUids[e.parentUids.length - 1]
29
- ), g.value[R.Request] === e.item.uid && y(`/workspace/${k.value.uid}/request/default`)) : "spec" in e.item ? _.delete(e.item) : "name" in e.item && w.delete(
29
+ ), g.value[R.Request] === e.item.uid && b(`/workspace/${k.value.uid}/request/default`)) : "spec" in e.item ? _.delete(e.item) : "name" in e.item && w.delete(
30
30
  e.item,
31
31
  e.parentUids[e.parentUids.length - 1]
32
32
  );
33
- }, $ = f(() => "summary" in e.item), M = f(() => {
33
+ }, $ = f(() => "summary" in e.item), q = f(() => {
34
34
  var p;
35
35
  return "summary" in e.item ? e.item.summary || "" : "name" in e.item ? e.item.name || "" : "spec" in e.item && ((p = e.item.spec.info) == null ? void 0 : p.title) || "";
36
- }), s = B(""), S = () => {
37
- "summary" in e.item ? C.edit(e.item.uid, "summary", s.value) : "requestUid" in e.item ? b.edit(e.item.uid, "name", s.value) : "spec" in e.item ? _.edit(e.item.uid, "spec.info.title", s.value) : w.edit(e.item.uid, "name", s.value), r.hide();
38
- }, r = I(), c = I(), z = () => {
39
- s.value = M.value, r.show();
40
- }, m = f(() => "requestUid" in e.item ? "Example" : "summary" in e.item ? "Request" : "spec" in e.item ? "Collection" : "Folder");
41
- return (p, l) => (q(), A(F, null, [
36
+ }), s = B(""), M = () => {
37
+ "summary" in e.item ? y.edit(e.item.uid, "summary", s.value) : "requestUid" in e.item ? C.edit(e.item.uid, "name", s.value) : "spec" in e.item ? _.edit(e.item.uid, "spec.info.title", s.value) : w.edit(e.item.uid, "name", s.value), m.hide();
38
+ }, m = I(), c = I(), z = () => {
39
+ s.value = q.value, m.show();
40
+ }, r = f(() => "requestUid" in e.item ? "Example" : "summary" in e.item ? "Request" : "spec" in e.item ? "Collection" : "Folder");
41
+ return (p, a) => (S(), A(F, null, [
42
42
  i(t(O), { teleport: "#scalar-client" }, {
43
- items: a(() => [
44
- $.value ? (q(), P(t(v), {
43
+ items: l(() => [
44
+ $.value ? (S(), P(t(v), {
45
45
  key: 0,
46
46
  class: "flex !gap-2",
47
47
  onClick: U
48
48
  }, {
49
- default: a(() => [
49
+ default: l(() => [
50
50
  i(t(u), {
51
51
  class: "inline-flex",
52
52
  icon: "Add",
@@ -61,7 +61,7 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
61
61
  class: "flex !gap-2",
62
62
  onClick: z
63
63
  }, {
64
- default: a(() => [
64
+ default: l(() => [
65
65
  i(t(u), {
66
66
  class: "inline-flex",
67
67
  icon: "Edit",
@@ -74,9 +74,9 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
74
74
  }),
75
75
  i(t(v), {
76
76
  class: "flex !gap-2",
77
- onClick: l[1] || (l[1] = (n) => t(c).show())
77
+ onClick: a[1] || (a[1] = (n) => t(c).show())
78
78
  }, {
79
- default: a(() => [
79
+ default: l(() => [
80
80
  i(t(u), {
81
81
  class: "inline-flex",
82
82
  icon: "Trash",
@@ -88,16 +88,16 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
88
88
  _: 1
89
89
  })
90
90
  ]),
91
- default: a(() => [
92
- i(t(x), {
93
- class: "px-1 py-0 z-10 hover:bg-b-3 hidden group-hover:flex ui-open:flex absolute h-[20px] ellipsis-position",
91
+ default: l(() => [
92
+ i(t(h), {
93
+ class: "px-0.5 py-0 z-10 hover:bg-b-3 hidden group-hover:flex ui-open:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit",
94
94
  size: "sm",
95
95
  variant: "ghost",
96
- onClick: l[0] || (l[0] = (n) => {
97
- (m.value === "Collection" || m.value === "Folder") && n.stopPropagation();
96
+ onClick: a[0] || (a[0] = (n) => {
97
+ (r.value === "Collection" || r.value === "Folder") && n.stopPropagation();
98
98
  })
99
99
  }, {
100
- default: a(() => [
100
+ default: l(() => [
101
101
  i(t(u), {
102
102
  icon: "Ellipses",
103
103
  size: "sm"
@@ -111,47 +111,47 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
111
111
  i(t(N), {
112
112
  size: "sm",
113
113
  state: t(c),
114
- title: `Delete ${m.value}`
114
+ title: `Delete ${r.value}`
115
115
  }, {
116
- default: a(() => [
116
+ default: l(() => [
117
117
  i(H, {
118
- variableName: M.value,
118
+ variableName: q.value,
119
119
  warningMessage: "Warning: Deleting this will delete all items inside of this",
120
- onClose: l[2] || (l[2] = (n) => t(c).hide()),
120
+ onClose: a[2] || (a[2] = (n) => t(c).hide()),
121
121
  onDelete: D
122
122
  }, null, 8, ["variableName"])
123
123
  ]),
124
124
  _: 1
125
125
  }, 8, ["state", "title"]),
126
126
  i(t(N), {
127
- state: t(r),
128
- title: `Rename ${m.value}`
127
+ state: t(m),
128
+ title: `Rename ${r.value}`
129
129
  }, {
130
- default: a(() => [
130
+ default: l(() => [
131
131
  i(t(Q), {
132
132
  modelValue: s.value,
133
- "onUpdate:modelValue": l[3] || (l[3] = (n) => s.value = n),
134
- label: m.value,
133
+ "onUpdate:modelValue": a[3] || (a[3] = (n) => s.value = n),
134
+ label: r.value,
135
135
  labelShadowColor: "var(--scalar-background-1)",
136
- onKeydown: K(W(S, ["prevent"]), ["enter"])
136
+ onKeydown: K(W(M, ["prevent"]), ["enter"])
137
137
  }, null, 8, ["modelValue", "label", "onKeydown"]),
138
138
  d("div", te, [
139
- i(t(x), {
139
+ i(t(h), {
140
140
  class: "flex-1",
141
141
  variant: "outlined",
142
- onClick: l[4] || (l[4] = (n) => t(r).hide())
142
+ onClick: a[4] || (a[4] = (n) => t(m).hide())
143
143
  }, {
144
- default: a(() => [
144
+ default: l(() => [
145
145
  E(" Cancel ")
146
146
  ]),
147
147
  _: 1
148
148
  }),
149
- i(t(x), {
149
+ i(t(h), {
150
150
  class: "flex-1",
151
151
  type: "submit",
152
- onClick: S
152
+ onClick: M
153
153
  }, {
154
- default: a(() => [
154
+ default: l(() => [
155
155
  E(" Save ")
156
156
  ]),
157
157
  _: 1
@@ -164,5 +164,5 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
164
164
  }
165
165
  });
166
166
  export {
167
- re as default
167
+ me as default
168
168
  };
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
2
  title: string;
3
3
  data: any;
4
4
  headers: {
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
6
6
  value: string;
7
7
  required: boolean;
8
8
  }[];
9
- }>, {
10
- data: null;
11
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
9
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
12
10
  title: string;
13
11
  data: any;
14
12
  headers: {
@@ -16,20 +14,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
16
14
  value: string;
17
15
  required: boolean;
18
16
  }[];
19
- }>, {
20
- data: null;
21
- }>>>, {
22
- data: any;
23
- }, {}>;
17
+ }>>>, {}, {}>;
24
18
  export default _default;
25
- type __VLS_WithDefaults<P, D> = {
26
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
27
- default: D[K];
28
- }> : P[K];
29
- };
30
- type __VLS_Prettify<T> = {
31
- [K in keyof T]: T[K];
32
- } & {};
33
19
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
34
20
  type __VLS_TypePropsToOption<T> = {
35
21
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":";WAuEW,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;;;WAFtD,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;;;UADvD,GAAG;;AA0Fb,wBAMG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,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":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":";WA8GS,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;WAFtD,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;AAuL/D,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,7 +1,91 @@
1
- import o from "./ResponseBody.vue2.js";
2
- /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-223b333c"]]);
1
+ import { defineComponent as U, ref as x, computed as l, openBlock as r, createBlock as u, createSlots as L, withCtx as p, createTextVNode as w, toDisplayString as g, createElementBlock as V, createElementVNode as b, createCommentVNode as i, createVNode as j } from "vue";
2
+ import T from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import C from "whatwg-mimetype";
4
+ import N from "./ResponseBodyDownload.vue.js";
5
+ import O from "./ResponseBodyInfo.vue.js";
6
+ import S from "./ResponseBodyPreview.vue.js";
7
+ import E from "./ResponseBodyRaw.vue.js";
8
+ import $ from "./ResponseBodyToggle.vue.js";
9
+ import { mediaTypes as I } from "../consts/mediaTypes.js";
10
+ const M = {
11
+ key: 0,
12
+ class: "mx-1 border-1/2 flex flex-col rounded bg-b-1"
13
+ }, P = { class: "flex justify-between items-center border-b-1/2 p-1.5" }, D = { class: "text-xxs leading-3 font-code" }, W = /* @__PURE__ */ U({
14
+ __name: "ResponseBody",
15
+ props: {
16
+ title: {},
17
+ data: {},
18
+ headers: {}
19
+ },
20
+ setup(h) {
21
+ const a = h, _ = (e) => e instanceof Blob, d = x(!0), m = l(
22
+ () => {
23
+ var e;
24
+ return !!((e = t.value) != null && e.raw && t.value.preview);
25
+ }
26
+ ), B = l(() => d.value || !m.value), R = l(() => !d.value || !m.value), o = l(() => {
27
+ var s;
28
+ const e = ((s = a.headers.find((c) => c.name.toLowerCase() === "content-type")) == null ? void 0 : s.value) ?? "";
29
+ return new C(e);
30
+ }), t = l(() => I[o.value.essence]), n = l(() => _(a.data) ? URL.createObjectURL(a.data) : typeof a.data == "string" ? URL.createObjectURL(
31
+ new Blob([a.data], { type: o.value.toString() })
32
+ ) : typeof a.data == "object" && Object.keys(a.data).length ? URL.createObjectURL(
33
+ new Blob([JSON.stringify(a.data)], {
34
+ type: o.value.toString()
35
+ })
36
+ ) : "");
37
+ return (e, s) => (r(), u(T, null, L({
38
+ title: p(() => [
39
+ w(g(e.title), 1)
40
+ ]),
41
+ default: p(() => {
42
+ var c, v, f, y;
43
+ return [
44
+ e.data ? (r(), V("div", M, [
45
+ b("div", P, [
46
+ b("span", D, g(o.value.essence), 1),
47
+ m.value ? (r(), u($, {
48
+ key: 0,
49
+ modelValue: d.value,
50
+ "onUpdate:modelValue": s[0] || (s[0] = (k) => d.value = k)
51
+ }, null, 8, ["modelValue"])) : i("", !0)
52
+ ]),
53
+ (c = t.value) != null && c.raw && R.value ? (r(), u(E, {
54
+ key: n.value,
55
+ data: e.data,
56
+ language: t.value.language
57
+ }, null, 8, ["data", "language"])) : i("", !0),
58
+ (v = t.value) != null && v.preview && B.value ? (r(), u(S, {
59
+ key: n.value,
60
+ alpha: t.value.alpha,
61
+ mode: t.value.preview,
62
+ src: n.value,
63
+ type: o.value.essence
64
+ }, null, 8, ["alpha", "mode", "src", "type"])) : i("", !0),
65
+ !((f = t.value) != null && f.raw) && !((y = t.value) != null && y.preview) ? (r(), u(O, { key: 2 }, {
66
+ default: p(() => [
67
+ w(" Binary file ")
68
+ ]),
69
+ _: 1
70
+ })) : i("", !0)
71
+ ])) : i("", !0)
72
+ ];
73
+ }),
74
+ _: 2
75
+ }, [
76
+ e.data && n.value ? {
77
+ name: "actions",
78
+ fn: p(() => [
79
+ j(N, {
80
+ href: n.value,
81
+ type: o.value.essence
82
+ }, null, 8, ["href", "type"])
83
+ ]),
84
+ key: "0"
85
+ } : void 0
86
+ ]), 1024));
87
+ }
88
+ });
5
89
  export {
6
- e as default
90
+ W as default
7
91
  };