@scalar/api-client 2.2.17 → 2.2.19
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 +21 -0
- package/dist/components/DataTable/DataTable.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +27 -33
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +9 -6
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +18 -18
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.js +2 -2
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +19 -19
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +7 -7
- package/dist/layouts/App/create-api-client-app.d.ts +3 -3
- package/dist/layouts/Modal/create-api-client-modal.d.ts +6 -6
- package/dist/layouts/Web/create-api-client-web.d.ts +3 -3
- package/dist/libs/create-client.d.ts +3 -3
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +51 -64
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/store.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +118 -108
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +40 -40
- package/dist/views/Request/RequestSidebar.vue.d.ts +2 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +200 -163
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +48 -46
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +20 -20
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +11 -11
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +7 -7
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +22 -22
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +36 -40
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";AA80CA,wBAMG"}
|
|
@@ -212,7 +212,7 @@ const Re = { class: "flex-1" }, je = ["onClick"], nn = /* @__PURE__ */ re({
|
|
|
212
212
|
class: "flex flex-col gap-0.25"
|
|
213
213
|
}, [
|
|
214
214
|
y("button", {
|
|
215
|
-
class: "flex font-medium gap-1.5 group items-center
|
|
215
|
+
class: "flex font-medium gap-1.5 group items-center p-1.5 text-left text-sm w-full break-words rounded hover:bg-b-2",
|
|
216
216
|
type: "button",
|
|
217
217
|
onClick: (a) => r(k)(n.uid)
|
|
218
218
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAkR8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA4YjD,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Request.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fa0c6bf7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,167 +1,177 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { importCurlCommand as
|
|
1
|
+
import { defineComponent as X, ref as S, computed as O, watch as Y, onMounted as Z, onBeforeUnmount as ee, openBlock as x, createElementBlock as te, Fragment as oe, createElementVNode as b, normalizeClass as g, unref as s, createVNode as d, withCtx as I, createBlock as T, createCommentVNode as M } from "vue";
|
|
2
|
+
import re from "../../components/ImportCurl/ImportCurlModal.vue.js";
|
|
3
|
+
import se from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
4
|
+
import le from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
5
|
+
import { importCurlCommand as ae } from "../../libs/importers/curl.js";
|
|
6
6
|
import { useActiveEntities as ue } from "../../store/active-entities.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useOpenApiWatcher as
|
|
11
|
-
import { safeJSON as
|
|
12
|
-
import { useBreakpoints as
|
|
13
|
-
import { useToasts as
|
|
14
|
-
import { useRouter as
|
|
15
|
-
import
|
|
16
|
-
import { createRequestOperation as
|
|
17
|
-
import { ERRORS as
|
|
18
|
-
import { useWorkspace as
|
|
19
|
-
|
|
7
|
+
import ne from "./RequestSection/RequestSection.vue.js";
|
|
8
|
+
import ie from "./RequestSubpageHeader.vue.js";
|
|
9
|
+
import ce from "./ResponseSection/ResponseSection.vue.js";
|
|
10
|
+
import { useOpenApiWatcher as me } from "./hooks/useOpenApiWatcher.js";
|
|
11
|
+
import { safeJSON as de } from "@scalar/object-utils/parse";
|
|
12
|
+
import { useBreakpoints as ve } from "@scalar/use-hooks/useBreakpoints";
|
|
13
|
+
import { useToasts as fe } from "@scalar/use-toasts";
|
|
14
|
+
import { useRouter as pe } from "vue-router";
|
|
15
|
+
import ye from "./RequestSidebar.vue.js";
|
|
16
|
+
import { createRequestOperation as Se } from "../../libs/send-request/send-request.js";
|
|
17
|
+
import { ERRORS as Re } from "../../libs/errors.js";
|
|
18
|
+
import { useWorkspace as he } from "../../store/store.js";
|
|
19
|
+
import { useLayout as qe } from "../../hooks/useLayout.js";
|
|
20
|
+
const xe = { class: "flex h-full" }, be = { class: "flex flex-1 flex-col h-full" }, ze = /* @__PURE__ */ X({
|
|
20
21
|
__name: "Request",
|
|
21
22
|
emits: ["newTab"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
activeCollection:
|
|
23
|
+
setup(we) {
|
|
24
|
+
const _ = he(), { toast: w } = fe(), { layout: A } = qe(), {
|
|
25
|
+
activeCollection: U,
|
|
25
26
|
activeExample: v,
|
|
26
|
-
activeEnvironment:
|
|
27
|
+
activeEnvironment: k,
|
|
27
28
|
activeRequest: R,
|
|
28
29
|
activeWorkspace: a,
|
|
29
|
-
activeServer:
|
|
30
|
+
activeServer: L
|
|
30
31
|
} = ue(), {
|
|
31
32
|
cookies: H,
|
|
32
|
-
isReadOnly:
|
|
33
|
+
isReadOnly: u,
|
|
33
34
|
modalState: n,
|
|
34
|
-
requestHistory:
|
|
35
|
-
securitySchemes:
|
|
36
|
-
requestMutators:
|
|
37
|
-
serverMutators:
|
|
38
|
-
servers:
|
|
39
|
-
events:
|
|
40
|
-
} =
|
|
41
|
-
() =>
|
|
35
|
+
requestHistory: E,
|
|
36
|
+
securitySchemes: $,
|
|
37
|
+
requestMutators: j,
|
|
38
|
+
serverMutators: W,
|
|
39
|
+
servers: z,
|
|
40
|
+
events: f
|
|
41
|
+
} = _, l = S(!u), V = S(), t = S(), h = S(""), D = pe(), F = O(
|
|
42
|
+
() => E.findLast((o) => {
|
|
42
43
|
var e;
|
|
43
44
|
return o.request.uid === ((e = v.value) == null ? void 0 : e.uid);
|
|
44
45
|
})
|
|
45
|
-
), { mediaQueries:
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
), { mediaQueries: Q } = ve();
|
|
47
|
+
Y(Q.xl, (o) => l.value = o, {
|
|
48
|
+
immediate: A !== "modal"
|
|
49
|
+
});
|
|
50
|
+
const C = O(
|
|
48
51
|
() => {
|
|
49
52
|
var o, e;
|
|
50
|
-
return (
|
|
53
|
+
return (u ? (o = U.value) == null ? void 0 : o.selectedSecuritySchemeUids : (e = R.value) == null ? void 0 : e.selectedSecuritySchemeUids) ?? [];
|
|
51
54
|
}
|
|
52
|
-
),
|
|
53
|
-
if (!R.value || !v.value || !
|
|
55
|
+
), B = async () => {
|
|
56
|
+
if (!R.value || !v.value || !U.value)
|
|
54
57
|
return;
|
|
55
|
-
const o = typeof
|
|
58
|
+
const o = typeof k.value == "object" ? k.value.value : "{}", e = de.parse(o);
|
|
56
59
|
e.error && console.error("INVALID ENVIRONMENT!");
|
|
57
|
-
const r = e.error || typeof e.data != "object" ? {} : e.data ?? {},
|
|
60
|
+
const r = e.error || typeof e.data != "object" ? {} : e.data ?? {}, p = a.value.cookies.map((y) => H[y]), [i, c] = Se({
|
|
58
61
|
request: R.value,
|
|
59
62
|
example: v.value,
|
|
60
|
-
selectedSecuritySchemeUids:
|
|
63
|
+
selectedSecuritySchemeUids: C.value,
|
|
61
64
|
proxyUrl: a.value.proxyUrl ?? "",
|
|
62
65
|
environment: r,
|
|
63
|
-
globalCookies:
|
|
64
|
-
status:
|
|
65
|
-
securitySchemes:
|
|
66
|
-
server:
|
|
66
|
+
globalCookies: p,
|
|
67
|
+
status: f.requestStatus,
|
|
68
|
+
securitySchemes: $,
|
|
69
|
+
server: L.value
|
|
67
70
|
});
|
|
68
71
|
if (i) {
|
|
69
72
|
w(i.message, "error");
|
|
70
73
|
return;
|
|
71
74
|
}
|
|
72
|
-
|
|
73
|
-
const [
|
|
74
|
-
|
|
75
|
-
},
|
|
75
|
+
V.value = c.controller;
|
|
76
|
+
const [m, q] = await c.sendRequest();
|
|
77
|
+
m ? w(m.message, "error") : E.push(q);
|
|
78
|
+
}, J = async () => {
|
|
76
79
|
var o;
|
|
77
|
-
return (o =
|
|
80
|
+
return (o = V.value) == null ? void 0 : o.abort(Re.REQUEST_ABORTED);
|
|
78
81
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}),
|
|
82
|
-
function
|
|
83
|
-
var r,
|
|
82
|
+
Z(() => {
|
|
83
|
+
f.executeRequest.on(B), f.cancelRequest.on(J);
|
|
84
|
+
}), me(), ee(() => f.executeRequest.off(B));
|
|
85
|
+
function G({ requestName: o }) {
|
|
86
|
+
var r, p, i, c;
|
|
84
87
|
if (!t.value) return;
|
|
85
88
|
if (t.value.servers) {
|
|
86
|
-
const
|
|
87
|
-
(
|
|
88
|
-
var
|
|
89
|
-
return
|
|
89
|
+
const m = Object.values(z).find(
|
|
90
|
+
(q) => {
|
|
91
|
+
var y, N;
|
|
92
|
+
return q.url === ((N = (y = t == null ? void 0 : t.value) == null ? void 0 : y.servers) == null ? void 0 : N[0]);
|
|
90
93
|
}
|
|
91
94
|
);
|
|
92
|
-
|
|
95
|
+
m ? h.value = m.uid : h.value = W.add(
|
|
93
96
|
{ url: t.value.servers[0] },
|
|
94
97
|
a.value.collections[0]
|
|
95
98
|
).uid;
|
|
96
99
|
}
|
|
97
|
-
const e =
|
|
100
|
+
const e = j.add(
|
|
98
101
|
{
|
|
99
102
|
summary: o,
|
|
100
103
|
path: (r = t == null ? void 0 : t.value) == null ? void 0 : r.path,
|
|
101
|
-
method: (
|
|
104
|
+
method: (p = t == null ? void 0 : t.value) == null ? void 0 : p.method,
|
|
102
105
|
parameters: (i = t == null ? void 0 : t.value) == null ? void 0 : i.parameters,
|
|
103
|
-
selectedServerUid:
|
|
104
|
-
requestBody: (
|
|
106
|
+
selectedServerUid: h.value,
|
|
107
|
+
requestBody: (c = t == null ? void 0 : t.value) == null ? void 0 : c.requestBody
|
|
105
108
|
},
|
|
106
109
|
a.value.collections[0]
|
|
107
110
|
);
|
|
108
|
-
e &&
|
|
111
|
+
e && D.push(
|
|
109
112
|
`/workspace/${a.value.uid}/request/${e.uid}`
|
|
110
113
|
), n.hide();
|
|
111
114
|
}
|
|
112
|
-
function
|
|
113
|
-
t.value =
|
|
115
|
+
function K(o) {
|
|
116
|
+
t.value = ae(o), n.show();
|
|
114
117
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
function P(o) {
|
|
119
|
+
console.log("hello", o), l.value = o;
|
|
120
|
+
}
|
|
121
|
+
return (o, e) => (x(), te(oe, null, [
|
|
122
|
+
b("div", {
|
|
123
|
+
class: g(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative z-0 overflow-hidden", {
|
|
124
|
+
"!mr-0 !mb-0 !border-0": s(u)
|
|
119
125
|
}])
|
|
120
126
|
}, [
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}, null, 8, ["
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
127
|
+
b("div", xe, [
|
|
128
|
+
d(ye, {
|
|
129
|
+
isReadonly: s(u),
|
|
130
|
+
showSidebar: l.value,
|
|
131
|
+
onNewTab: e[0] || (e[0] = (r) => o.$emit("newTab", r)),
|
|
132
|
+
"onUpdate:showSidebar": P
|
|
133
|
+
}, null, 8, ["isReadonly", "showSidebar"]),
|
|
134
|
+
b("div", be, [
|
|
135
|
+
d(ie, {
|
|
136
|
+
modelValue: l.value,
|
|
137
|
+
"onUpdate:modelValue": e[1] || (e[1] = (r) => l.value = r),
|
|
138
|
+
isReadonly: s(u),
|
|
139
|
+
onHideModal: e[2] || (e[2] = () => s(n).hide()),
|
|
140
|
+
onImportCurl: K
|
|
141
|
+
}, null, 8, ["modelValue", "isReadonly"]),
|
|
142
|
+
d(se, null, {
|
|
143
|
+
default: I(() => [
|
|
144
|
+
s(v) ? (x(), T(le, {
|
|
145
|
+
key: 0,
|
|
146
|
+
class: g(["flex-1", [l.value ? "sidebar-active-hide-layout" : ""]])
|
|
147
|
+
}, {
|
|
148
|
+
default: I(() => {
|
|
149
|
+
var r;
|
|
150
|
+
return [
|
|
151
|
+
d(ne, { selectedSecuritySchemeUids: C.value }, null, 8, ["selectedSecuritySchemeUids"]),
|
|
152
|
+
d(ce, {
|
|
153
|
+
response: (r = F.value) == null ? void 0 : r.response
|
|
154
|
+
}, null, 8, ["response"])
|
|
155
|
+
];
|
|
156
|
+
}),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["class"])) : M("", !0)
|
|
159
|
+
]),
|
|
149
160
|
_: 1
|
|
150
|
-
}
|
|
151
|
-
])
|
|
152
|
-
|
|
153
|
-
})
|
|
161
|
+
})
|
|
162
|
+
])
|
|
163
|
+
])
|
|
154
164
|
], 2),
|
|
155
|
-
t.value ? (
|
|
165
|
+
t.value ? (x(), T(re, {
|
|
156
166
|
key: 0,
|
|
157
167
|
parsedCurl: t.value,
|
|
158
168
|
state: s(n),
|
|
159
|
-
onClose: e[
|
|
160
|
-
onImportCurl:
|
|
161
|
-
}, null, 8, ["parsedCurl", "state"])) :
|
|
169
|
+
onClose: e[3] || (e[3] = (r) => s(n).hide()),
|
|
170
|
+
onImportCurl: G
|
|
171
|
+
}, null, 8, ["parsedCurl", "state"])) : M("", !0)
|
|
162
172
|
], 64));
|
|
163
173
|
}
|
|
164
174
|
});
|
|
165
175
|
export {
|
|
166
|
-
|
|
176
|
+
ze as default
|
|
167
177
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAolBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;
|
|
1
|
+
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAolBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AAu4BF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a3031462"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -13,7 +13,7 @@ import { useWorkspace as de } from "../../../store/store.js";
|
|
|
13
13
|
import { useFileDialog as H } from "../../../hooks/useFileDialog.js";
|
|
14
14
|
const se = {
|
|
15
15
|
key: 0,
|
|
16
|
-
class: "text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
|
|
16
|
+
class: "border-t-1/2 text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
|
|
17
17
|
}, ce = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "flex items-center justify-center p-1.5 overflow-hidden"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4KA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAC;;AAmQF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0fb9317f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useActiveEntities as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { canMethodHaveBody as
|
|
9
|
-
import
|
|
10
|
-
import { useWorkspace as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as b, computed as A, ref as V, watch as w, openBlock as d, createBlock as C, unref as o, withCtx as x, createElementVNode as g, createElementBlock as v, createCommentVNode as R, toDisplayString as H, createVNode as s, withDirectives as i, vShow as r } from "vue";
|
|
2
|
+
import N from "../../../components/ContextBar.vue.js";
|
|
3
|
+
import E from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
|
+
import { useActiveEntities as K } from "../../../store/active-entities.js";
|
|
5
|
+
import U from "./RequestBody.vue.js";
|
|
6
|
+
import h from "./RequestParams.vue.js";
|
|
7
|
+
import Q from "./RequestPathParams.vue.js";
|
|
8
|
+
import { canMethodHaveBody as f } from "@scalar/oas-utils/helpers";
|
|
9
|
+
import $ from "./RequestAuth/RequestAuth.vue.js";
|
|
10
|
+
import { useWorkspace as D } from "../../../store/store.js";
|
|
11
|
+
const M = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none group" }, z = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
|
|
14
14
|
for: "requestname"
|
|
15
|
-
},
|
|
15
|
+
}, I = ["value"], L = {
|
|
16
16
|
key: 2,
|
|
17
17
|
class: "flex items-center text-c-1 h-8"
|
|
18
|
-
},
|
|
18
|
+
}, O = { class: "request-section-content custom-scroll flex flex-1 flex-col" }, te = /* @__PURE__ */ b({
|
|
19
19
|
__name: "RequestSection",
|
|
20
20
|
props: {
|
|
21
21
|
selectedSecuritySchemeUids: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const { activeRequest: l, activeExample: y } =
|
|
23
|
+
setup(P) {
|
|
24
|
+
const { activeRequest: l, activeExample: y } = K(), { isReadOnly: p, requestMutators: k } = D(), q = A(() => {
|
|
25
25
|
var a, u;
|
|
26
26
|
const t = /* @__PURE__ */ new Set([
|
|
27
27
|
"All",
|
|
@@ -32,52 +32,52 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
32
32
|
"Headers",
|
|
33
33
|
"Body"
|
|
34
34
|
]);
|
|
35
|
-
return (a = y.value) != null && a.parameters.path.length || t.delete("Variables"),
|
|
36
|
-
}), _ =
|
|
35
|
+
return (a = y.value) != null && a.parameters.path.length || t.delete("Variables"), f(((u = l.value) == null ? void 0 : u.method) ?? "get") || t.delete("Body"), _.value && t.delete("Auth"), [...t];
|
|
36
|
+
}), _ = A(
|
|
37
37
|
() => {
|
|
38
38
|
var t, a;
|
|
39
39
|
return p && ((a = (t = l.value) == null ? void 0 : t.security) == null ? void 0 : a.length) === 0;
|
|
40
40
|
}
|
|
41
|
-
), e =
|
|
42
|
-
|
|
43
|
-
e.value === "Body" && t && !
|
|
41
|
+
), e = V("All");
|
|
42
|
+
w(l, (t) => {
|
|
43
|
+
e.value === "Body" && t && !f(t.method) && (e.value = "All");
|
|
44
44
|
});
|
|
45
|
-
const
|
|
45
|
+
const B = (t) => {
|
|
46
46
|
if (!l.value) return;
|
|
47
47
|
const a = t.target;
|
|
48
|
-
|
|
48
|
+
k.edit(l.value.uid, "summary", a.value);
|
|
49
49
|
};
|
|
50
50
|
return (t, a) => {
|
|
51
51
|
var u;
|
|
52
|
-
return d(),
|
|
52
|
+
return d(), C(E, {
|
|
53
53
|
"aria-label": `Request: ${(u = o(l)) == null ? void 0 : u.summary}`
|
|
54
54
|
}, {
|
|
55
55
|
title: x(() => {
|
|
56
56
|
var n, c;
|
|
57
57
|
return [
|
|
58
|
-
|
|
59
|
-
o(p) ?
|
|
60
|
-
o(p) ? (d(), v("span",
|
|
58
|
+
g("div", M, [
|
|
59
|
+
o(p) ? R("", !0) : (d(), v("label", z)),
|
|
60
|
+
o(p) ? (d(), v("span", L, H((c = o(l)) == null ? void 0 : c.summary), 1)) : (d(), v("input", {
|
|
61
61
|
key: 1,
|
|
62
62
|
id: "requestname",
|
|
63
63
|
class: "text-c-1 rounded pointer-events-auto relative w-full pl-2 -ml-0.5 md:-ml-1 xl:-ml-2 has-[:focus-visible]:outline h-8 group-hover-input has-[:focus-visible]:outline z-10",
|
|
64
64
|
placeholder: "Request Name",
|
|
65
65
|
value: (n = o(l)) == null ? void 0 : n.summary,
|
|
66
|
-
onInput:
|
|
67
|
-
}, null, 40,
|
|
66
|
+
onInput: B
|
|
67
|
+
}, null, 40, I))
|
|
68
68
|
]),
|
|
69
|
-
s(
|
|
69
|
+
s(N, {
|
|
70
70
|
activeSection: e.value,
|
|
71
|
-
sections:
|
|
71
|
+
sections: q.value,
|
|
72
72
|
onSetActiveSection: a[0] || (a[0] = (m) => e.value = m)
|
|
73
73
|
}, null, 8, ["activeSection", "sections"])
|
|
74
74
|
];
|
|
75
75
|
}),
|
|
76
76
|
default: x(() => {
|
|
77
|
-
var n, c, m;
|
|
77
|
+
var n, c, m, S;
|
|
78
78
|
return [
|
|
79
|
-
|
|
80
|
-
i(s(
|
|
79
|
+
g("div", O, [
|
|
80
|
+
i(s($, {
|
|
81
81
|
selectedSecuritySchemeUids: t.selectedSecuritySchemeUids,
|
|
82
82
|
title: "Authentication"
|
|
83
83
|
}, null, 8, ["selectedSecuritySchemeUids"]), [
|
|
@@ -86,7 +86,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
86
86
|
!_.value && (e.value === "All" || e.value === "Auth")
|
|
87
87
|
]
|
|
88
88
|
]),
|
|
89
|
-
i(s(
|
|
89
|
+
i(s(Q, {
|
|
90
90
|
paramKey: "path",
|
|
91
91
|
title: "Variables"
|
|
92
92
|
}, null, 512), [
|
|
@@ -95,28 +95,28 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
95
95
|
(e.value === "All" || e.value === "Variables") && ((m = (c = (n = o(y)) == null ? void 0 : n.parameters) == null ? void 0 : c.path) == null ? void 0 : m.length)
|
|
96
96
|
]
|
|
97
97
|
]),
|
|
98
|
-
i(s(
|
|
98
|
+
i(s(h, {
|
|
99
99
|
paramKey: "cookies",
|
|
100
100
|
title: "Cookies"
|
|
101
101
|
}, null, 512), [
|
|
102
102
|
[r, e.value === "All" || e.value === "Cookies"]
|
|
103
103
|
]),
|
|
104
|
-
i(s(
|
|
104
|
+
i(s(h, {
|
|
105
105
|
paramKey: "headers",
|
|
106
106
|
title: "Headers"
|
|
107
107
|
}, null, 512), [
|
|
108
108
|
[r, e.value === "All" || e.value === "Headers"]
|
|
109
109
|
]),
|
|
110
|
-
i(s(
|
|
110
|
+
i(s(h, {
|
|
111
111
|
paramKey: "query",
|
|
112
112
|
title: "Query Parameters"
|
|
113
113
|
}, null, 512), [
|
|
114
114
|
[r, e.value === "All" || e.value === "Query"]
|
|
115
115
|
]),
|
|
116
|
-
i(s(
|
|
116
|
+
i(s(U, { title: "Body" }, null, 512), [
|
|
117
117
|
[
|
|
118
118
|
r,
|
|
119
|
-
o(l) && (e.value === "All" || e.value === "Body") && o(
|
|
119
|
+
((S = o(l)) == null ? void 0 : S.method) && (e.value === "All" || e.value === "Body") && o(f)(o(l).method)
|
|
120
120
|
]
|
|
121
121
|
])
|
|
122
122
|
])
|
|
@@ -128,5 +128,5 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
export {
|
|
131
|
-
|
|
131
|
+
te as default
|
|
132
132
|
};
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
isReadonly: boolean;
|
|
4
4
|
};
|
|
5
5
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
6
|
+
"update:modelValue": (v: boolean) => any;
|
|
6
7
|
clearDrafts: () => any;
|
|
7
8
|
newTab: (args_0: {
|
|
8
9
|
name: string;
|
|
@@ -10,6 +11,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
10
11
|
}) => any;
|
|
11
12
|
"update:showSidebar": (v: boolean) => any;
|
|
12
13
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
|
|
13
15
|
onClearDrafts?: (() => any) | undefined;
|
|
14
16
|
onNewTab?: ((args_0: {
|
|
15
17
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AA+eA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;;;;cAMqC,MAAM;aAAO,MAAM;;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAqwB1D,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-17d11c53"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|