@scalar/api-client 2.3.10 → 2.3.12
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 +49 -0
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +45 -51
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +3 -3
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +25 -26
- package/dist/layouts/App/create-api-client-app.d.ts +18 -160
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +36 -320
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +18 -160
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +18 -160
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +40 -37
- package/dist/libs/send-request/create-request-operation.d.ts +1 -0
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +41 -41
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/store/import-spec.d.ts +2 -154
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +12 -12
- package/dist/store/security-schemes.d.ts +16 -6
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts +18 -160
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue.js +2 -2
- package/dist/views/Request/Request.vue.d.ts +2 -0
- 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 +35 -33
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +80 -69
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +32 -32
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestCodeExample.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 +1 -1
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.d.ts +11 -0
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +81 -0
- package/dist/views/Request/ResponseSection/RequestHeaders.vue2.js +4 -0
- 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 +6 -6
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +2 -0
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +73 -60
- package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
- package/dist/views/Request/consts/mediaTypes.js +1 -0
- package/dist/views/Request/hooks/useOpenApiWatcher.js +25 -25
- package/package.json +12 -12
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent as p, openBlock as e, createBlock as n, withCtx as r, createTextVNode as l, createElementBlock as s, createVNode as m, Fragment as i, renderList as _, toDisplayString as c } from "vue";
|
|
2
|
+
import h from "../../../components/DataTable/DataTable.vue.js";
|
|
3
|
+
import x from "../../../components/DataTable/DataTableRow.vue.js";
|
|
4
|
+
import u from "../../../components/DataTable/DataTableText.vue.js";
|
|
5
|
+
import g from "../../../components/HelpfulLink.vue.js";
|
|
6
|
+
import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
|
+
import { httpHeaders as y } from "../../../data/httpHeaders.js";
|
|
8
|
+
const b = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "max-h-[calc(100%-32px)] overflow-y-auto border-t"
|
|
11
|
+
}, k = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-sm"
|
|
14
|
+
}, q = /* @__PURE__ */ p({
|
|
15
|
+
__name: "RequestHeaders",
|
|
16
|
+
props: {
|
|
17
|
+
headers: {}
|
|
18
|
+
},
|
|
19
|
+
setup(C) {
|
|
20
|
+
const f = (o) => y.find(
|
|
21
|
+
(a) => a.name.toLowerCase() === o.toLowerCase()
|
|
22
|
+
);
|
|
23
|
+
return (o, a) => (e(), n(w, {
|
|
24
|
+
class: "overflow-auto",
|
|
25
|
+
defaultOpen: !1,
|
|
26
|
+
itemCount: o.headers.length
|
|
27
|
+
}, {
|
|
28
|
+
title: r(() => a[0] || (a[0] = [
|
|
29
|
+
l("Request Headers")
|
|
30
|
+
])),
|
|
31
|
+
default: r(() => [
|
|
32
|
+
o.headers.length ? (e(), s("div", b, [
|
|
33
|
+
m(h, {
|
|
34
|
+
columns: ["minmax(auto, min-content)", "minmax(50%, 1fr)"],
|
|
35
|
+
scroll: ""
|
|
36
|
+
}, {
|
|
37
|
+
default: r(() => [
|
|
38
|
+
(e(!0), s(i, null, _(o.headers, (t) => (e(), n(x, {
|
|
39
|
+
key: t.name,
|
|
40
|
+
class: "group/row text-c-1"
|
|
41
|
+
}, {
|
|
42
|
+
default: r(() => [
|
|
43
|
+
m(u, { class: "z-1 bg-b-1 sticky left-0 max-w-48 group-first/row:border-t-0" }, {
|
|
44
|
+
default: r(() => {
|
|
45
|
+
var d;
|
|
46
|
+
return [
|
|
47
|
+
typeof ((d = f(t.name)) == null ? void 0 : d.url) == "string" ? (e(), n(g, {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "decoration-c-3",
|
|
50
|
+
href: f(t.name).url
|
|
51
|
+
}, {
|
|
52
|
+
default: r(() => [
|
|
53
|
+
l(c(t.name), 1)
|
|
54
|
+
]),
|
|
55
|
+
_: 2
|
|
56
|
+
}, 1032, ["href"])) : (e(), s(i, { key: 1 }, [
|
|
57
|
+
l(c(t.name), 1)
|
|
58
|
+
], 64))
|
|
59
|
+
];
|
|
60
|
+
}),
|
|
61
|
+
_: 2
|
|
62
|
+
}, 1024),
|
|
63
|
+
m(u, {
|
|
64
|
+
class: "z-0 group-first/row:border-t-0",
|
|
65
|
+
text: t.value
|
|
66
|
+
}, null, 8, ["text"])
|
|
67
|
+
]),
|
|
68
|
+
_: 2
|
|
69
|
+
}, 1024))), 128))
|
|
70
|
+
]),
|
|
71
|
+
_: 1
|
|
72
|
+
})
|
|
73
|
+
])) : (e(), s("div", k, " No Headers "))
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
}, 8, ["itemCount"]));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
q as default
|
|
81
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":"AAkGA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC9D,CAAC;;AAyKF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-51934a33"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as b, ref as C, computed as d, openBlock as o, createBlock as n, createSlots as N, withCtx as u, createTextVNode as
|
|
1
|
+
import { defineComponent as b, ref as C, computed as d, openBlock as o, createBlock as n, createSlots as N, withCtx as u, createTextVNode as w, toDisplayString as g, createElementBlock as T, createElementVNode as _, unref as a, createCommentVNode as s, createVNode as $ } from "vue";
|
|
2
2
|
import E from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
3
|
import { useResponseBody as P } from "../../../hooks/useResponseBody.js";
|
|
4
4
|
import S from "./ResponseBodyDownload.vue.js";
|
|
@@ -10,7 +10,7 @@ import { mediaTypes as I } from "../consts/mediaTypes.js";
|
|
|
10
10
|
const q = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "bg-b-1 flex max-h-[calc(100%-32px)] flex-col overflow-hidden"
|
|
13
|
-
}, z = { class: "flex items-center justify-between border-
|
|
13
|
+
}, z = { class: "flex min-h-8 items-center justify-between border-y px-3 py-1.5" }, A = { class: "text-xxs font-code leading-3" }, X = /* @__PURE__ */ b({
|
|
14
14
|
__name: "ResponseBody",
|
|
15
15
|
props: {
|
|
16
16
|
title: {},
|
|
@@ -29,10 +29,10 @@ const q = {
|
|
|
29
29
|
}), e = d(() => I[i.value.essence]);
|
|
30
30
|
return (t, m) => (o(), n(E, { class: "max-h-content overflow-y-hidden" }, N({
|
|
31
31
|
title: u(() => [
|
|
32
|
-
|
|
32
|
+
w(g(t.title), 1)
|
|
33
33
|
]),
|
|
34
34
|
default: u(() => {
|
|
35
|
-
var f, v, y,
|
|
35
|
+
var f, v, y, h;
|
|
36
36
|
return [
|
|
37
37
|
t.data ? (o(), T("div", q, [
|
|
38
38
|
_("div", z, [
|
|
@@ -55,9 +55,9 @@ const q = {
|
|
|
55
55
|
src: a(l),
|
|
56
56
|
type: a(i).essence
|
|
57
57
|
}, null, 8, ["alpha", "mode", "src", "type"])) : s("", !0),
|
|
58
|
-
!((y = e.value) != null && y.raw) && !((
|
|
58
|
+
!((y = e.value) != null && y.raw) && !((h = e.value) != null && h.preview) ? (o(), n(U, { key: 2 }, {
|
|
59
59
|
default: u(() => m[1] || (m[1] = [
|
|
60
|
-
|
|
60
|
+
w(" Binary file ")
|
|
61
61
|
])),
|
|
62
62
|
_: 1
|
|
63
63
|
})) : s("", !0)
|
|
@@ -37,7 +37,7 @@ const P = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, T = {
|
|
|
37
37
|
}));
|
|
38
38
|
}, y = (s) => {
|
|
39
39
|
s != null && s.createNew && w.name === "request" && k();
|
|
40
|
-
}, N = "2.3.
|
|
40
|
+
}, N = "2.3.12";
|
|
41
41
|
return B(() => r.hotKeys.on(y)), E(() => r.hotKeys.off(y)), (s, e) => (u(), i("div", P, [
|
|
42
42
|
o("div", {
|
|
43
43
|
class: q(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
|
@@ -11,7 +11,7 @@ const b = {
|
|
|
11
11
|
}, k = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-sm"
|
|
14
|
-
},
|
|
14
|
+
}, z = /* @__PURE__ */ p({
|
|
15
15
|
__name: "ResponseHeaders",
|
|
16
16
|
props: {
|
|
17
17
|
headers: {}
|
|
@@ -26,7 +26,7 @@ const b = {
|
|
|
26
26
|
itemCount: o.headers.length
|
|
27
27
|
}, {
|
|
28
28
|
title: r(() => a[0] || (a[0] = [
|
|
29
|
-
l("Headers")
|
|
29
|
+
l("Response Headers")
|
|
30
30
|
])),
|
|
31
31
|
default: r(() => [
|
|
32
32
|
o.headers.length ? (e(), s("div", b, [
|
|
@@ -77,5 +77,5 @@ const b = {
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
export {
|
|
80
|
-
|
|
80
|
+
z as default
|
|
81
81
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { SendRequestResult } from '../../../libs/send-request/create-request-operation';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
numWorkspaceRequests: number;
|
|
4
5
|
response: ResponseInstance | undefined;
|
|
6
|
+
requestResult: SendRequestResult | null | undefined;
|
|
5
7
|
};
|
|
6
8
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLElement>;
|
|
7
9
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"AAmPA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAKvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAarF,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACtC,aAAa,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAA;CACpD,CAAC;;AA0SF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-fc4ef6e9"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import { defineComponent as j, computed as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import E from "./
|
|
7
|
-
import O from "./ResponseMetaInformation.vue.js";
|
|
8
|
-
import $ from "./ResponseBodyVirtual.vue.js";
|
|
1
|
+
import { defineComponent as j, computed as u, ref as C, useId as T, openBlock as l, createBlock as i, withCtx as f, createElementVNode as c, normalizeClass as y, createCommentVNode as d, createVNode as h, createElementBlock as k, Fragment as b } from "vue";
|
|
2
|
+
import V from "../../../components/SectionFilter.vue.js";
|
|
3
|
+
import I from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
|
+
import g from "./RequestHeaders.vue.js";
|
|
5
|
+
import $ from "./ResponseBody.vue.js";
|
|
6
|
+
import E from "./ResponseBodyVirtual.vue.js";
|
|
9
7
|
/* empty css */
|
|
10
|
-
import
|
|
8
|
+
import O from "./ResponseCookies.vue.js";
|
|
9
|
+
import w from "./ResponseEmpty.vue.js";
|
|
11
10
|
import z from "./ResponseHeaders.vue.js";
|
|
12
|
-
|
|
11
|
+
import N from "./ResponseLoadingOverlay.vue.js";
|
|
12
|
+
import S from "./ResponseMetaInformation.vue.js";
|
|
13
|
+
const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5, _ = /* @__PURE__ */ j({
|
|
13
14
|
__name: "ResponseSection",
|
|
14
15
|
props: {
|
|
15
16
|
numWorkspaceRequests: {},
|
|
16
|
-
response: {}
|
|
17
|
+
response: {},
|
|
18
|
+
requestResult: {}
|
|
17
19
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const m =
|
|
20
|
+
setup(n) {
|
|
21
|
+
const m = u(() => {
|
|
20
22
|
var a;
|
|
21
|
-
const e = (a =
|
|
23
|
+
const e = (a = n.response) == null ? void 0 : a.headers;
|
|
22
24
|
return e ? Object.keys(e).map((o) => ({
|
|
23
25
|
name: o,
|
|
24
26
|
value: e[o] ?? "",
|
|
25
27
|
required: !1
|
|
26
|
-
}))
|
|
27
|
-
|
|
28
|
-
"rest-api-client-content-length",
|
|
29
|
-
"X-API-Client-Content-Length"
|
|
30
|
-
].includes(o.name)
|
|
31
|
-
) : [];
|
|
32
|
-
}), x = c(
|
|
28
|
+
})) : [];
|
|
29
|
+
}), R = u(
|
|
33
30
|
() => {
|
|
34
31
|
var e;
|
|
35
|
-
return ((e =
|
|
36
|
-
var
|
|
37
|
-
const o = (r = (
|
|
32
|
+
return ((e = n.response) == null ? void 0 : e.cookieHeaderKeys.flatMap((a) => {
|
|
33
|
+
var t, r;
|
|
34
|
+
const o = (r = (t = n.response) == null ? void 0 : t.headers) == null ? void 0 : r[a];
|
|
38
35
|
return o ? {
|
|
39
36
|
name: a,
|
|
40
37
|
value: o,
|
|
@@ -42,16 +39,16 @@ const L = { class: "flex h-8 flex-1 items-center" }, N = ["id", "role"], b = 2e5
|
|
|
42
39
|
} : [];
|
|
43
40
|
})) ?? [];
|
|
44
41
|
}
|
|
45
|
-
),
|
|
42
|
+
), x = ["Cookies", "Headers", "Body"], s = C("All"), v = u(() => ["All", ...x]), p = u(
|
|
46
43
|
() => Object.fromEntries(
|
|
47
|
-
|
|
44
|
+
v.value.map((e) => [e, T()])
|
|
48
45
|
)
|
|
49
|
-
),
|
|
50
|
-
var
|
|
51
|
-
if (!
|
|
46
|
+
), B = u(() => {
|
|
47
|
+
var t, r;
|
|
48
|
+
if (!n.response)
|
|
52
49
|
return !1;
|
|
53
|
-
const e = ((
|
|
54
|
-
return !e || (
|
|
50
|
+
const e = ((t = n.response.headers) == null ? void 0 : t["content-type"]) || ((r = n.response.headers) == null ? void 0 : r["Content-Type"]);
|
|
51
|
+
return !e || (n.response.size ?? 0) <= A || e.includes("text/html") ? !1 : [
|
|
55
52
|
// Text types
|
|
56
53
|
"text/",
|
|
57
54
|
// JSON types
|
|
@@ -78,64 +75,80 @@ const L = { class: "flex h-8 flex-1 items-center" }, N = ["id", "role"], b = 2e5
|
|
|
78
75
|
"application/x-java-source",
|
|
79
76
|
// Form data
|
|
80
77
|
"application/x-www-form-urlencoded"
|
|
81
|
-
].some((
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
].some((H) => e.includes(H)) && (n.response.size ?? 0) > A;
|
|
79
|
+
}), q = u(
|
|
80
|
+
() => {
|
|
81
|
+
var e;
|
|
82
|
+
return ((e = n.requestResult) == null ? void 0 : e.request.parameters.headers.filter((a) => a.enabled).map((a) => ({
|
|
83
|
+
name: a.key,
|
|
84
|
+
value: a.value,
|
|
85
|
+
required: !0
|
|
86
|
+
}))) ?? [];
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
return (e, a) => (l(), i(I, { "aria-label": "Response" }, {
|
|
90
|
+
title: f(() => [
|
|
91
|
+
c("div", W, [
|
|
92
|
+
c("div", {
|
|
87
93
|
"aria-live": "polite",
|
|
88
94
|
class: y(["flex items-center", { "animate-response-heading": e.response }])
|
|
89
95
|
}, [
|
|
90
|
-
a[1] || (a[1] =
|
|
91
|
-
e.response ? (
|
|
96
|
+
a[1] || (a[1] = c("span", { class: "response-heading pointer-events-none absolute" }, " Response ", -1)),
|
|
97
|
+
e.response ? (l(), i(S, {
|
|
92
98
|
key: 0,
|
|
93
99
|
class: "animate-response-children",
|
|
94
100
|
response: e.response
|
|
95
|
-
}, null, 8, ["response"])) :
|
|
101
|
+
}, null, 8, ["response"])) : d("", !0)
|
|
96
102
|
], 2),
|
|
97
|
-
h(
|
|
103
|
+
h(V, {
|
|
98
104
|
modelValue: s.value,
|
|
99
105
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => s.value = o),
|
|
100
106
|
filterIds: p.value,
|
|
101
|
-
filters:
|
|
107
|
+
filters: v.value
|
|
102
108
|
}, null, 8, ["modelValue", "filterIds", "filters"])
|
|
103
109
|
])
|
|
104
110
|
]),
|
|
105
|
-
default:
|
|
106
|
-
var o,
|
|
111
|
+
default: f(() => {
|
|
112
|
+
var o, t, r;
|
|
107
113
|
return [
|
|
108
|
-
|
|
114
|
+
c("div", {
|
|
109
115
|
id: p.value.All,
|
|
110
116
|
class: y(["custom-scroll response-section-content relative grid h-full justify-stretch", {
|
|
111
117
|
"content-start": e.response
|
|
112
118
|
}]),
|
|
113
119
|
role: s.value === "All" && e.response ? "tabpanel" : "none"
|
|
114
120
|
}, [
|
|
115
|
-
e.response ? (
|
|
116
|
-
s.value === "All" || s.value === "Cookies" ? (
|
|
121
|
+
e.response ? (l(), k(b, { key: 1 }, [
|
|
122
|
+
s.value === "All" || s.value === "Cookies" ? (l(), i(O, {
|
|
117
123
|
key: 0,
|
|
118
124
|
class: "response-section-content-cookies",
|
|
119
125
|
id: p.value.Cookies,
|
|
120
|
-
cookies:
|
|
126
|
+
cookies: R.value,
|
|
121
127
|
role: s.value === "All" ? "none" : "tabpanel"
|
|
122
|
-
}, null, 8, ["id", "cookies", "role"])) :
|
|
123
|
-
s.value === "All" || s.value === "Headers" ? (
|
|
128
|
+
}, null, 8, ["id", "cookies", "role"])) : d("", !0),
|
|
129
|
+
s.value === "All" || s.value === "Headers" ? (l(), i(g, {
|
|
124
130
|
key: 1,
|
|
125
131
|
class: "response-section-content-headers",
|
|
126
132
|
id: p.value.Headers,
|
|
133
|
+
headers: q.value,
|
|
134
|
+
role: s.value === "All" ? "none" : "tabpanel"
|
|
135
|
+
}, null, 8, ["id", "headers", "role"])) : d("", !0),
|
|
136
|
+
s.value === "All" || s.value === "Headers" ? (l(), i(z, {
|
|
137
|
+
key: 2,
|
|
138
|
+
class: "response-section-content-headers",
|
|
139
|
+
id: p.value.Headers,
|
|
127
140
|
headers: m.value,
|
|
128
141
|
role: s.value === "All" ? "none" : "tabpanel"
|
|
129
|
-
}, null, 8, ["id", "headers", "role"])) :
|
|
130
|
-
s.value === "All" || s.value === "Body" ? (
|
|
131
|
-
|
|
142
|
+
}, null, 8, ["id", "headers", "role"])) : d("", !0),
|
|
143
|
+
s.value === "All" || s.value === "Body" ? (l(), k(b, { key: 3 }, [
|
|
144
|
+
B.value && typeof ((o = e.response) == null ? void 0 : o.data) == "string" ? (l(), i(E, {
|
|
132
145
|
key: 0,
|
|
133
146
|
id: p.value.Body,
|
|
134
147
|
content: e.response.data,
|
|
135
|
-
data: (
|
|
148
|
+
data: (t = e.response) == null ? void 0 : t.data,
|
|
136
149
|
headers: m.value,
|
|
137
150
|
role: s.value === "All" ? "none" : "tabpanel"
|
|
138
|
-
}, null, 8, ["id", "content", "data", "headers", "role"])) : (
|
|
151
|
+
}, null, 8, ["id", "content", "data", "headers", "role"])) : (l(), i($, {
|
|
139
152
|
key: 1,
|
|
140
153
|
class: "response-section-content-body",
|
|
141
154
|
id: p.value.Body,
|
|
@@ -145,13 +158,13 @@ const L = { class: "flex h-8 flex-1 items-center" }, N = ["id", "role"], b = 2e5
|
|
|
145
158
|
role: s.value === "All" ? "none" : "tabpanel",
|
|
146
159
|
title: "Body"
|
|
147
160
|
}, null, 8, ["id", "data", "headers", "role"]))
|
|
148
|
-
], 64)) :
|
|
149
|
-
], 64)) : (
|
|
161
|
+
], 64)) : d("", !0)
|
|
162
|
+
], 64)) : (l(), i(w, {
|
|
150
163
|
key: 0,
|
|
151
164
|
numWorkspaceRequests: e.numWorkspaceRequests
|
|
152
165
|
}, null, 8, ["numWorkspaceRequests"])),
|
|
153
|
-
h(
|
|
154
|
-
], 10,
|
|
166
|
+
h(N)
|
|
167
|
+
], 10, F)
|
|
155
168
|
];
|
|
156
169
|
}),
|
|
157
170
|
_: 1
|
|
@@ -159,5 +172,5 @@ const L = { class: "flex h-8 flex-1 items-center" }, N = ["id", "role"], b = 2e5
|
|
|
159
172
|
}
|
|
160
173
|
});
|
|
161
174
|
export {
|
|
162
|
-
|
|
175
|
+
_ as default
|
|
163
176
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaTypes.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/mediaTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,yCAAyC;AACzC,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"mediaTypes.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/mediaTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,yCAAyC;AACzC,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;CA6GjE,CAAA;AAED,iEAAiE;AACjE,eAAO,MAAM,cAAc,EAAE,MAAM,EAEX,CAAA"}
|
|
@@ -10,6 +10,7 @@ const n = {
|
|
|
10
10
|
raw: !0,
|
|
11
11
|
language: "json"
|
|
12
12
|
},
|
|
13
|
+
"application/vnd.api+json": { extension: ".json", raw: !0, language: "json" },
|
|
13
14
|
"application/msword": { extension: ".doc" },
|
|
14
15
|
"application/octet-stream": { extension: ".bin" },
|
|
15
16
|
"application/ogg": { extension: ".ogx" },
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useActiveEntities as
|
|
1
|
+
import { useActiveEntities as D } from "../../../store/active-entities.js";
|
|
2
2
|
import { specDictionary as f } from "../../../store/import-spec.js";
|
|
3
|
-
import { combineRenameDiffs as
|
|
4
|
-
import {
|
|
3
|
+
import { combineRenameDiffs as R, mutateCollectionDiff as d, mutateSecuritySchemeDiff as g, mutateServerDiff as S, mutateTagDiff as T, mutateRequestDiff as M } from "../libs/watch-mode.js";
|
|
4
|
+
import { fetchDocument as I, createHash as C } from "@scalar/oas-utils/helpers";
|
|
5
5
|
import { parseSchema as O } from "@scalar/oas-utils/transforms";
|
|
6
|
-
import { useToasts as
|
|
7
|
-
import { useTimeoutPoll as
|
|
8
|
-
import
|
|
6
|
+
import { useToasts as L } from "@scalar/use-toasts";
|
|
7
|
+
import { useTimeoutPoll as N } from "@vueuse/core";
|
|
8
|
+
import U from "microdiff";
|
|
9
9
|
import { watch as b } from "vue";
|
|
10
10
|
import { useWorkspace as P } from "../../../store/store.js";
|
|
11
11
|
const k = 5 * 1e3, q = 60 * 1e3, J = () => {
|
|
12
|
-
const { toast: h } =
|
|
13
|
-
e.path[0] === "info" || e.path[0] === "security" ? d(e, c, o) ||
|
|
14
|
-
}, { pause: p, resume: m } =
|
|
12
|
+
const { toast: h } = L(), c = D(), o = P(), { activeCollection: s, activeWorkspace: W } = c, { collectionMutators: n } = o, a = (e) => h(`[useOpenApiWatcher] Changes to the ${e} were not applied`, "error"), w = (e) => {
|
|
13
|
+
e.path[0] === "info" || e.path[0] === "security" ? d(e, c, o) || a("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? g(e, c, o) || a("securitySchemes") : e.path[0] === "servers" ? S(e, c, o) || a("servers") : e.path[0] === "tags" ? T(e, c, o) || a("tags") : e.path[0] === "paths" && (M(e, c, o) || a("requests"));
|
|
14
|
+
}, { pause: p, resume: m } = N(async () => {
|
|
15
15
|
var l, v;
|
|
16
|
-
const e = (l =
|
|
16
|
+
const e = (l = s.value) == null ? void 0 : l.documentUrl;
|
|
17
17
|
if (!e)
|
|
18
18
|
return;
|
|
19
|
-
const
|
|
19
|
+
const t = f[e];
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
22
|
-
if (n.edit(
|
|
23
|
-
if (
|
|
24
|
-
const { schema:
|
|
21
|
+
const i = await I(e, (v = W.value) == null ? void 0 : v.proxyUrl, !1), u = C(i);
|
|
22
|
+
if (n.edit(s.value.uid, "watchModeStatus", "WATCHING"), t != null && t.hash)
|
|
23
|
+
if (t.hash && t.hash !== u) {
|
|
24
|
+
const { schema: r } = await O(i), A = U(t.schema, r), y = R(A);
|
|
25
25
|
try {
|
|
26
26
|
y.forEach(w), f[e] = {
|
|
27
27
|
hash: u,
|
|
28
|
-
schema:
|
|
28
|
+
schema: r
|
|
29
29
|
};
|
|
30
30
|
} catch (E) {
|
|
31
31
|
console.error("[useOpenApiWatcher] Error:", E);
|
|
@@ -33,14 +33,14 @@ const k = 5 * 1e3, q = 60 * 1e3, J = () => {
|
|
|
33
33
|
} else
|
|
34
34
|
console.log("[useOpenApiWatcher] No changes detected yet…");
|
|
35
35
|
else {
|
|
36
|
-
const { schema:
|
|
37
|
-
|
|
36
|
+
const { schema: r } = await O(i);
|
|
37
|
+
r && (f[e] = {
|
|
38
38
|
hash: u,
|
|
39
|
-
schema:
|
|
39
|
+
schema: r
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
} catch (
|
|
43
|
-
console.error("[useOpenApiWatcher] Error:",
|
|
42
|
+
} catch (i) {
|
|
43
|
+
console.error("[useOpenApiWatcher] Error:", i), console.info("[useOpenApiWatcher] Pausing watcher for 60 seconds"), p(), n.edit(s.value.uid, "watchModeStatus", "ERROR"), h("[useOpenApiWatcher] Unable to fetch the spec file, paused the watcher for 60 seconds", "error"), setTimeout(() => {
|
|
44
44
|
console.info("[useOpenApiWatcher] Resuming watcher"), m();
|
|
45
45
|
}, q);
|
|
46
46
|
}
|
|
@@ -48,13 +48,13 @@ const k = 5 * 1e3, q = 60 * 1e3, J = () => {
|
|
|
48
48
|
b(
|
|
49
49
|
[() => {
|
|
50
50
|
var e;
|
|
51
|
-
return (e =
|
|
51
|
+
return (e = s.value) == null ? void 0 : e.documentUrl;
|
|
52
52
|
}, () => {
|
|
53
53
|
var e;
|
|
54
|
-
return (e =
|
|
54
|
+
return (e = s.value) == null ? void 0 : e.watchMode;
|
|
55
55
|
}],
|
|
56
|
-
([e,
|
|
57
|
-
e &&
|
|
56
|
+
([e, t]) => {
|
|
57
|
+
e && t ? (console.info(`[useOpenApiWatcher] Watching ${e} …`), m()) : s.value && (p(), n.edit(s.value.uid, "watchModeStatus", "IDLE"));
|
|
58
58
|
},
|
|
59
59
|
{ immediate: !0 }
|
|
60
60
|
);
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.3.
|
|
21
|
+
"version": "2.3.12",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -189,21 +189,21 @@
|
|
|
189
189
|
"whatwg-mimetype": "^4.0.0",
|
|
190
190
|
"yaml": "^2.4.5",
|
|
191
191
|
"zod": "^3.23.8",
|
|
192
|
-
"@scalar/components": "0.13.
|
|
192
|
+
"@scalar/components": "0.13.43",
|
|
193
193
|
"@scalar/draggable": "0.1.11",
|
|
194
|
+
"@scalar/import": "0.3.9",
|
|
194
195
|
"@scalar/icons": "0.1.3",
|
|
195
|
-
"@scalar/import": "0.3.7",
|
|
196
|
-
"@scalar/openapi-parser": "0.10.12",
|
|
197
|
-
"@scalar/oas-utils": "0.2.124",
|
|
198
|
-
"@scalar/openapi-types": "0.1.9",
|
|
199
|
-
"@scalar/postman-to-openapi": "0.1.47",
|
|
200
196
|
"@scalar/object-utils": "1.1.13",
|
|
201
|
-
"@scalar/
|
|
202
|
-
"@scalar/types": "0.
|
|
203
|
-
"@scalar/
|
|
204
|
-
"@scalar/
|
|
197
|
+
"@scalar/openapi-parser": "0.10.14",
|
|
198
|
+
"@scalar/openapi-types": "0.2.0",
|
|
199
|
+
"@scalar/postman-to-openapi": "0.1.49",
|
|
200
|
+
"@scalar/oas-utils": "0.2.126",
|
|
201
|
+
"@scalar/snippetz": "0.2.19",
|
|
202
|
+
"@scalar/themes": "0.9.84",
|
|
203
|
+
"@scalar/types": "0.1.6",
|
|
204
|
+
"@scalar/use-codemirror": "0.11.88",
|
|
205
205
|
"@scalar/use-toasts": "0.7.9",
|
|
206
|
-
"@scalar/use-
|
|
206
|
+
"@scalar/use-hooks": "0.1.38",
|
|
207
207
|
"@scalar/use-tooltip": "1.0.6"
|
|
208
208
|
},
|
|
209
209
|
"devDependencies": {
|