@scalar/api-client 2.2.4 → 2.2.6
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 +43 -0
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +15 -15
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +24 -24
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -5
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +5 -6
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +8 -8
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +9 -10
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue2.js +16 -17
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +85 -84
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +24 -26
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +6 -0
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +28 -23
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +1 -1
- package/dist/components/OpenApiClientButton.vue2.js +16 -16
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -6
- package/dist/layouts/App/create-api-client-app.d.ts +1 -0
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -0
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +1 -0
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +2 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +36 -35
- package/dist/store/store.d.ts +3 -1
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +47 -45
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +18 -20
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +13 -13
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +20 -19
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +2 -2
- 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 +12 -14
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +60 -61
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +187 -195
- 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 +24 -28
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +5 -5
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -25
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +41 -30
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -4
- package/dist/views/Request/libs/oauth2.d.ts +6 -2
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +43 -37
- package/package.json +13 -14
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useActiveEntities as
|
|
1
|
+
import { defineComponent as C, openBlock as l, createElementBlock as a, createElementVNode as r, createVNode as s, normalizeClass as k, unref as t, createBlock as d, createCommentVNode as i } from "vue";
|
|
2
|
+
import V from "../../components/AddressBar/AddressBar.vue.js";
|
|
3
|
+
import x from "../../components/EnvironmentSelector/EnvironmentSelector.vue.js";
|
|
4
|
+
import v from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
5
|
+
import { useActiveEntities as w } from "../../store/active-entities.js";
|
|
6
6
|
import { ScalarIcon as g } from "@scalar/components";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import $ from "./components/WorkspaceDropdown.vue.js";
|
|
8
|
+
import B from "../../components/OpenApiClientButton.vue.js";
|
|
9
|
+
import { useWorkspace as R } from "../../store/store.js";
|
|
9
10
|
import { useLayout as h } from "../../hooks/useLayout.js";
|
|
10
|
-
const
|
|
11
|
+
const z = { class: "lg:min-h-header flex items-center w-full justify-center p-2 pt-2 lg:pt-1 lg:p-1 flex-wrap t-app__top-container border-b-1/2" }, A = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 lg:mb-0 mb-2 lg:flex-1 w-6/12" }, E = { class: "flex flex-row items-center gap-1 lg:px-2.5 lg:mb-0 mb-2 lg:flex-1 justify-end w-6/12" }, D = /* @__PURE__ */ C({
|
|
11
12
|
__name: "RequestSubpageHeader",
|
|
12
13
|
props: {
|
|
13
14
|
modelValue: { type: Boolean },
|
|
14
15
|
isReadonly: { type: Boolean }
|
|
15
16
|
},
|
|
16
17
|
emits: ["update:modelValue", "hideModal", "importCurl"],
|
|
17
|
-
setup(
|
|
18
|
-
const { activeCollection: m } =
|
|
18
|
+
setup(M) {
|
|
19
|
+
const { activeCollection: m } = w(), c = R(), { hideClientButton: y } = c, { layout: b } = h();
|
|
19
20
|
return (o, e) => {
|
|
20
21
|
var p, u, f;
|
|
21
|
-
return l(), a("div",
|
|
22
|
-
r("div",
|
|
23
|
-
s(
|
|
24
|
-
class:
|
|
22
|
+
return l(), a("div", z, [
|
|
23
|
+
r("div", A, [
|
|
24
|
+
s(v, {
|
|
25
|
+
class: k(["gitbook-hidden", [
|
|
25
26
|
"xl:hidden",
|
|
26
27
|
{ "xl:!flex": !o.modelValue },
|
|
27
28
|
{ "!flex": t(b) === "modal" }
|
|
@@ -29,22 +30,17 @@ const $ = { class: "lg:min-h-header flex items-center w-full justify-center p-2
|
|
|
29
30
|
modelValue: o.modelValue,
|
|
30
31
|
"onUpdate:modelValue": e[0] || (e[0] = (n) => o.$emit("update:modelValue", n))
|
|
31
32
|
}, null, 8, ["class", "modelValue"]),
|
|
32
|
-
o.isReadonly ? i("", !0) : (l(), d(t(
|
|
33
|
-
e[4] || (e[4] = r("a", {
|
|
34
|
-
class: "text-c-2 text-sm font-medium gitbook-show ml-.5 hover:text-c-1 border p-1 rounded hover:bg-b-3",
|
|
35
|
-
href: "https://scalar.com/",
|
|
36
|
-
target: "_blank"
|
|
37
|
-
}, " Powered by Scalar.com ", -1))
|
|
33
|
+
o.isReadonly ? i("", !0) : (l(), d(t($), { key: 0 }))
|
|
38
34
|
]),
|
|
39
|
-
s(
|
|
35
|
+
s(V, {
|
|
40
36
|
onImportCurl: e[1] || (e[1] = (n) => o.$emit("importCurl", n))
|
|
41
37
|
}),
|
|
42
|
-
r("div",
|
|
43
|
-
o.isReadonly ? i("", !0) : (l(), d(
|
|
44
|
-
o.isReadonly && ((p = t(m)) != null && p.documentUrl) ? (l(), d(t(
|
|
38
|
+
r("div", E, [
|
|
39
|
+
o.isReadonly ? i("", !0) : (l(), d(x, { key: 0 })),
|
|
40
|
+
o.isReadonly && ((p = t(m)) != null && p.documentUrl) && !t(y) ? (l(), d(t(B), {
|
|
45
41
|
key: 1,
|
|
46
42
|
buttonSource: "modal",
|
|
47
|
-
class: "
|
|
43
|
+
class: "!w-fit lg:-mr-1",
|
|
48
44
|
integration: (u = t(m)) == null ? void 0 : u.integration,
|
|
49
45
|
url: (f = t(m)) == null ? void 0 : f.documentUrl
|
|
50
46
|
}, null, 8, ["integration", "url"])) : i("", !0),
|
|
@@ -59,7 +55,7 @@ const $ = { class: "lg:min-h-header flex items-center w-full justify-center p-2
|
|
|
59
55
|
size: "lg",
|
|
60
56
|
thickness: "2"
|
|
61
57
|
}),
|
|
62
|
-
e[
|
|
58
|
+
e[4] || (e[4] = r("span", { class: "sr-only" }, "Close Client", -1))
|
|
63
59
|
])) : i("", !0),
|
|
64
60
|
o.isReadonly ? (l(), a("button", {
|
|
65
61
|
key: 3,
|
|
@@ -72,7 +68,7 @@ const $ = { class: "lg:min-h-header flex items-center w-full justify-center p-2
|
|
|
72
68
|
size: "md",
|
|
73
69
|
thickness: "1.75"
|
|
74
70
|
}),
|
|
75
|
-
e[
|
|
71
|
+
e[5] || (e[5] = r("span", { class: "sr-only" }, "Close Client", -1))
|
|
76
72
|
])) : i("", !0)
|
|
77
73
|
])
|
|
78
74
|
]);
|
|
@@ -80,5 +76,5 @@ const $ = { class: "lg:min-h-header flex items-center w-full justify-center p-2
|
|
|
80
76
|
}
|
|
81
77
|
});
|
|
82
78
|
export {
|
|
83
|
-
|
|
79
|
+
D as default
|
|
84
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyPreview.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBodyPreview.vue"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAC;;
|
|
1
|
+
{"version":3,"file":"ResponseBodyPreview.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBodyPreview.vue"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAC;;AA+HF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseBodyPreview.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
4
|
+
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-c821a9de"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -8,18 +8,18 @@ const k = ["src"], w = ["src", "type"], B = ["src", "type"], E = ["data", "type"
|
|
|
8
8
|
mode: {},
|
|
9
9
|
alpha: { type: Boolean }
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
11
|
+
setup(u) {
|
|
12
|
+
const p = u, r = i(!1);
|
|
13
13
|
return y(
|
|
14
|
-
() =>
|
|
14
|
+
() => p.src,
|
|
15
15
|
() => r.value = !1
|
|
16
16
|
), (e, o) => !r.value && e.src ? (s(), t("div", {
|
|
17
17
|
key: 0,
|
|
18
|
-
class: n(["flex justify-center overflow-
|
|
18
|
+
class: n(["flex justify-center overflow-auto rounded-b", { "p-2 bg-preview": e.alpha }])
|
|
19
19
|
}, [
|
|
20
20
|
e.mode === "image" ? (s(), t("img", {
|
|
21
21
|
key: 0,
|
|
22
|
-
class: n(["max-w-full", { rounded: e.alpha }]),
|
|
22
|
+
class: n(["h-full max-w-full", { rounded: e.alpha }]),
|
|
23
23
|
src: e.src,
|
|
24
24
|
onError: o[0] || (o[0] = (l) => r.value = !0)
|
|
25
25
|
}, null, 42, k)) : e.mode === "video" ? (s(), t("video", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseEmpty.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseEmpty.vue"],"names":[],"mappings":";AA4YA,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseEmpty.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bc56cd7e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as _, onMounted as R, onBeforeUnmount as C, openBlock as r, createElementBlock as l, createElementVNode as o, normalizeClass as k, unref as t, createTextVNode as c, toDisplayString as w, createCommentVNode as m, createVNode as s } from "vue";
|
|
2
|
+
import N from "../../../assets/computer.ascii.js";
|
|
3
3
|
import x from "../../../assets/keycap.ascii.js";
|
|
4
4
|
import u from "../../../components/ScalarAsciiArt.vue.js";
|
|
5
5
|
import p from "../../../components/ScalarHotkey.vue.js";
|
|
6
|
-
import { useActiveEntities as
|
|
7
|
-
import { useRoute as
|
|
8
|
-
import { useWorkspace as
|
|
9
|
-
import { useLayout as
|
|
10
|
-
const
|
|
6
|
+
import { useActiveEntities as q } from "../../../store/active-entities.js";
|
|
7
|
+
import { useRoute as S } from "vue-router";
|
|
8
|
+
import { useWorkspace as V } from "../../../store/store.js";
|
|
9
|
+
import { useLayout as B } from "../../../hooks/useLayout.js";
|
|
10
|
+
const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "scalar-version-number"
|
|
13
|
-
},
|
|
13
|
+
}, E = { class: "scale-75 flex" }, P = { class: "relative" }, $ = { class: "relative -ml-12" }, j = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, F = /* @__PURE__ */ _({
|
|
14
14
|
__name: "ResponseEmpty",
|
|
15
15
|
setup(z) {
|
|
16
|
-
const { activeWorkspaceRequests: d } =
|
|
16
|
+
const { activeWorkspaceRequests: d } = q(), { isReadOnly: g, events: a } = V(), v = S(), { layout: n } = B(), f = () => {
|
|
17
17
|
a.commandPalette.emit({ commandName: "Create Request" });
|
|
18
18
|
}, y = (i) => {
|
|
19
19
|
i != null && i.createNew && v.name === "request" && f();
|
|
20
|
-
}, h = "2.2.
|
|
21
|
-
return R(() => a.hotKeys.on(y)), C(() => a.hotKeys.off(y)), (i, e) => (
|
|
20
|
+
}, h = "2.2.6";
|
|
21
|
+
return R(() => a.hotKeys.on(y)), C(() => a.hotKeys.off(y)), (i, e) => (r(), l("div", K, [
|
|
22
22
|
o("div", {
|
|
23
23
|
class: k(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
|
24
|
-
"hidden opacity-0": t(d).length <= 1 && t(
|
|
24
|
+
"hidden opacity-0": t(d).length <= 1 && t(n) !== "modal"
|
|
25
25
|
}])
|
|
26
26
|
}, [
|
|
27
|
-
t(g) ? m("", !0) : (
|
|
28
|
-
c(" Scalar App V" +
|
|
27
|
+
t(g) ? m("", !0) : (r(), l("div", A, [
|
|
28
|
+
c(" Scalar App V" + w(t(h)) + " Beta ", 1),
|
|
29
29
|
e[2] || (e[2] = o("div", { class: "mt-2" }, [
|
|
30
30
|
o("a", {
|
|
31
31
|
href: "https://github.com/scalar/scalar/issues/2669",
|
|
@@ -33,18 +33,23 @@ const B = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, E = {
|
|
|
33
33
|
}, " Roadmap ")
|
|
34
34
|
], -1))
|
|
35
35
|
])),
|
|
36
|
+
e[3] || (e[3] = o("a", {
|
|
37
|
+
class: "gitbook-show scalar-version-number",
|
|
38
|
+
href: "https://www.scalar.com",
|
|
39
|
+
target: "_blank"
|
|
40
|
+
}, " Powered By Scalar.com ", -1)),
|
|
36
41
|
s(u, {
|
|
37
|
-
art: t(
|
|
42
|
+
art: t(N),
|
|
38
43
|
class: "text-c-3"
|
|
39
44
|
}, null, 8, ["art"])
|
|
40
45
|
], 2),
|
|
41
|
-
t(
|
|
46
|
+
t(n) !== "modal" ? (r(), l("div", {
|
|
42
47
|
key: 0,
|
|
43
48
|
class: k(["h-[calc(100%_-_50px)] items-center justify-center hidden pb-5", {
|
|
44
49
|
"!flex opacity-100": t(d).length == 1
|
|
45
50
|
}])
|
|
46
51
|
}, [
|
|
47
|
-
o("div",
|
|
52
|
+
o("div", E, [
|
|
48
53
|
o("div", P, [
|
|
49
54
|
s(p, {
|
|
50
55
|
class: "keycap-hotkey",
|
|
@@ -56,7 +61,7 @@ const B = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, E = {
|
|
|
56
61
|
}, null, 8, ["art"])
|
|
57
62
|
]),
|
|
58
63
|
o("div", $, [
|
|
59
|
-
e[
|
|
64
|
+
e[4] || (e[4] = o("div", { class: "keycap-hotkey !right-[60px]" }, "K", -1)),
|
|
60
65
|
s(u, {
|
|
61
66
|
art: t(x),
|
|
62
67
|
class: "!leading-[6px] keycap-n"
|
|
@@ -65,30 +70,30 @@ const B = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, E = {
|
|
|
65
70
|
])
|
|
66
71
|
], 2)) : m("", !0),
|
|
67
72
|
o("div", j, [
|
|
68
|
-
t(
|
|
73
|
+
t(n) !== "modal" ? (r(), l("button", {
|
|
69
74
|
key: 0,
|
|
70
75
|
class: "flex items-center gap-1.5",
|
|
71
76
|
type: "button",
|
|
72
|
-
onClick: e[0] || (e[0] = (
|
|
77
|
+
onClick: e[0] || (e[0] = (b) => t(a).commandPalette.emit())
|
|
73
78
|
}, [
|
|
74
|
-
e[
|
|
79
|
+
e[5] || (e[5] = c(" Get Started ")),
|
|
75
80
|
s(p, { hotkey: "k" })
|
|
76
81
|
])) : m("", !0),
|
|
77
82
|
o("button", {
|
|
78
83
|
class: "flex items-center gap-1.5",
|
|
79
84
|
type: "button",
|
|
80
|
-
onClick: e[1] || (e[1] = (
|
|
85
|
+
onClick: e[1] || (e[1] = (b) => t(a).executeRequest.emit())
|
|
81
86
|
}, [
|
|
82
|
-
e[
|
|
87
|
+
e[6] || (e[6] = c(" Send Request ")),
|
|
83
88
|
s(p, { hotkey: "↵" })
|
|
84
89
|
]),
|
|
85
|
-
t(
|
|
90
|
+
t(n) === "desktop" ? (r(), l("button", {
|
|
86
91
|
key: 1,
|
|
87
92
|
class: "flex items-center gap-1.5",
|
|
88
93
|
type: "button",
|
|
89
94
|
onClick: f
|
|
90
95
|
}, [
|
|
91
|
-
e[
|
|
96
|
+
e[7] || (e[7] = c(" New Request ")),
|
|
92
97
|
s(p, { hotkey: "N" })
|
|
93
98
|
])) : m("", !0)
|
|
94
99
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseMetaInformation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseMetaInformation.vue"],"names":[],"mappings":"AAsFA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAQvE,KAAK,WAAW,GAAG;IAAE,QAAQ,EAAE,gBAAgB,CAAA;CAAE,CAAC;;AAsJlD,wBAOG"}
|
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
import { defineComponent as I, ref as
|
|
2
|
-
import
|
|
3
|
-
import { httpStatusCodes as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as I, ref as m, computed as _, openBlock as o, createElementBlock as r, toDisplayString as n, unref as f, Fragment as v, createElementVNode as a, createTextVNode as p, createCommentVNode as y, createBlock as b, withCtx as w, normalizeStyle as k } from "vue";
|
|
2
|
+
import B from "../../../components/HelpfulLink.vue.js";
|
|
3
|
+
import { httpStatusCodes as L } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import N from "pretty-bytes";
|
|
5
5
|
import h from "pretty-ms";
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
const
|
|
6
|
+
import { useWorkspace as V } from "../../../store/store.js";
|
|
7
|
+
const x = { class: "flex gap-1.5 text-c-1" }, z = { key: 0 }, D = { key: 0 }, E = { key: 1 }, $ = /* @__PURE__ */ I({
|
|
8
8
|
__name: "ResponseMetaInformation",
|
|
9
9
|
props: {
|
|
10
10
|
response: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
e === "start" ?
|
|
12
|
+
setup(g) {
|
|
13
|
+
const C = g, { events: S } = V(), l = m(), u = m(0);
|
|
14
|
+
S.requestStatus.on((e) => {
|
|
15
|
+
e === "start" ? l.value = setInterval(() => u.value += 1e3, 1e3) : (clearInterval(l.value), l.value = void 0, u.value = 0);
|
|
16
16
|
});
|
|
17
17
|
const i = (e) => {
|
|
18
|
-
var
|
|
18
|
+
var c, d;
|
|
19
19
|
const t = parseInt(
|
|
20
|
-
((
|
|
20
|
+
((c = e.headers) == null ? void 0 : c["Content-Length"]) || ((d = e.headers) == null ? void 0 : d["content-length"]) || "0",
|
|
21
21
|
10
|
|
22
22
|
);
|
|
23
|
-
return t ?
|
|
24
|
-
},
|
|
25
|
-
const e =
|
|
23
|
+
return t ? N(t) : void 0;
|
|
24
|
+
}, s = _(() => {
|
|
25
|
+
const e = C.response.status;
|
|
26
26
|
if (e)
|
|
27
|
-
return
|
|
27
|
+
return L[e] ?? void 0;
|
|
28
28
|
});
|
|
29
|
-
return (e, t) => (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
t[0] || (t[0] =
|
|
33
|
-
p(" " + n(
|
|
29
|
+
return (e, t) => (o(), r("div", x, [
|
|
30
|
+
l.value && u.value ? (o(), r("span", z, n(f(h)(u.value)), 1)) : (o(), r(v, { key: 1 }, [
|
|
31
|
+
a("span", null, [
|
|
32
|
+
t[0] || (t[0] = a("span", { class: "sr-only" }, "Response Information, Duration:", -1)),
|
|
33
|
+
p(" " + n(f(h)(e.response.duration)), 1)
|
|
34
34
|
]),
|
|
35
|
-
i(e.response) ? (
|
|
36
|
-
t[1] || (t[1] =
|
|
35
|
+
i(e.response) ? (o(), r("span", D, [
|
|
36
|
+
t[1] || (t[1] = a("span", { class: "sr-only" }, ", Size:", -1)),
|
|
37
37
|
p(" " + n(i(e.response)), 1)
|
|
38
38
|
])) : y("", !0),
|
|
39
|
-
|
|
40
|
-
t[2] || (t[2] =
|
|
41
|
-
|
|
39
|
+
s.value ? (o(), r(v, { key: 1 }, [
|
|
40
|
+
t[2] || (t[2] = a("span", { class: "sr-only" }, ", Status:", -1)),
|
|
41
|
+
s.value.url ? (o(), b(B, {
|
|
42
42
|
key: 0,
|
|
43
|
-
|
|
43
|
+
class: "flex items-center gap-1.5",
|
|
44
|
+
href: s.value.url
|
|
44
45
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
p(n(e.response.status) + " " + n(
|
|
46
|
+
default: w(() => [
|
|
47
|
+
p(n(e.response.status) + " " + n(s.value.name) + " ", 1),
|
|
48
|
+
a("span", {
|
|
49
|
+
class: "block h-1.5 w-1.5 rounded-full",
|
|
50
|
+
style: k({ backgroundColor: s.value.color })
|
|
51
|
+
}, null, 4)
|
|
47
52
|
]),
|
|
48
53
|
_: 1
|
|
49
|
-
}, 8, ["href"])) : (
|
|
54
|
+
}, 8, ["href"])) : (o(), r("span", E, [
|
|
55
|
+
p(n(e.response.status) + " " + n(s.value.name) + " ", 1),
|
|
56
|
+
a("span", {
|
|
57
|
+
class: "block h-1.5 w-1.5 rounded-full",
|
|
58
|
+
style: k({ backgroundColor: s.value.color })
|
|
59
|
+
}, null, 4)
|
|
60
|
+
]))
|
|
50
61
|
], 64)) : y("", !0)
|
|
51
62
|
], 64))
|
|
52
63
|
]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";AA0yBA,wBAMG"}
|
|
@@ -152,9 +152,8 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
152
152
|
default: n(() => [
|
|
153
153
|
l("div", Z, [
|
|
154
154
|
s(e(c), {
|
|
155
|
-
class: "h-2.5",
|
|
156
155
|
icon: "Add",
|
|
157
|
-
|
|
156
|
+
size: "sm"
|
|
158
157
|
})
|
|
159
158
|
]),
|
|
160
159
|
t[8] || (t[8] = l("span", null, "Create Workspace", -1))
|
|
@@ -172,9 +171,8 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
172
171
|
l("div", K, [
|
|
173
172
|
l("h2", Q, z(e(f).name), 1),
|
|
174
173
|
s(e(c), {
|
|
175
|
-
class: "size-3",
|
|
176
174
|
icon: "ChevronDown",
|
|
177
|
-
|
|
175
|
+
size: "md"
|
|
178
176
|
})
|
|
179
177
|
])
|
|
180
178
|
]),
|
|
@@ -18,11 +18,15 @@ export declare const generateCodeChallenge: (verifier: string, encoding: "SHA-25
|
|
|
18
18
|
*
|
|
19
19
|
* @returns the accessToken
|
|
20
20
|
*/
|
|
21
|
-
export declare const authorizeOauth2: (flow: Oauth2Flow, activeServer: Server) => Promise<ErrorResponse<string>>;
|
|
21
|
+
export declare const authorizeOauth2: (flow: Oauth2Flow, activeServer: Server, proxyUrl?: string) => Promise<ErrorResponse<string>>;
|
|
22
22
|
/**
|
|
23
23
|
* Makes the BE authorization call to grab the token server to server
|
|
24
24
|
* Used for clientCredentials and authorizationCode
|
|
25
25
|
*/
|
|
26
|
-
export declare const authorizeServers: (flow: NonImplicitFlow, scopes: string, code
|
|
26
|
+
export declare const authorizeServers: (flow: NonImplicitFlow, scopes: string, { code, pkce, proxyUrl, }?: {
|
|
27
|
+
code?: string;
|
|
28
|
+
pkce?: PKCEState | null;
|
|
29
|
+
proxyUrl?: string;
|
|
30
|
+
}) => Promise<ErrorResponse<string>>;
|
|
27
31
|
export {};
|
|
28
32
|
//# sourceMappingURL=oauth2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AAGxC,qDAAqD;AACrD,KAAK,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAEhE,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAmBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,aACtB,MAAM,YACN,SAAS,GAAG,OAAO,KAC5B,OAAO,CAAC,MAAM,CAahB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,SACpB,UAAU,gBAEF,MAAM,aAET,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAsJ/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SACrB,eAAe,UACb,MAAM,8BAKX;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,KACA,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA6D/B,CAAA"}
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
import { shouldUseProxy as w } from "@scalar/oas-utils/helpers";
|
|
2
|
+
const P = () => {
|
|
2
3
|
const e = new Uint8Array(32);
|
|
3
4
|
return crypto.getRandomValues(e), btoa(String.fromCharCode(...e)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
4
|
-
}, _ = async (e, i) => {
|
|
5
|
-
if (i === "plain") return e;
|
|
6
|
-
const s = new TextEncoder().encode(e), t = await crypto.subtle.digest("SHA-256", s);
|
|
7
|
-
return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
8
5
|
}, y = async (e, i) => {
|
|
6
|
+
if (i === "plain") return e;
|
|
7
|
+
const a = new TextEncoder().encode(e), s = await crypto.subtle.digest("SHA-256", a);
|
|
8
|
+
return btoa(String.fromCharCode(...new Uint8Array(s))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
9
|
+
}, k = async (e, i, o) => {
|
|
9
10
|
try {
|
|
10
11
|
if (!e) return [new Error("Flow not found"), null];
|
|
11
12
|
const a = e.selectedScopes.join(" ");
|
|
12
13
|
if (e.type === "clientCredentials" || e.type === "password")
|
|
13
|
-
return
|
|
14
|
+
return _(e, a, {
|
|
15
|
+
proxyUrl: o
|
|
16
|
+
});
|
|
14
17
|
{
|
|
15
18
|
const s = (Math.random() + 1).toString(36).substring(7), t = new URL(e.authorizationUrl);
|
|
16
|
-
let
|
|
19
|
+
let l = null;
|
|
17
20
|
if (e.type === "implicit")
|
|
18
21
|
t.searchParams.set("response_type", "token");
|
|
19
22
|
else if (e.type === "authorizationCode" && (t.searchParams.set("response_type", "code"), e["x-usePkce"] !== "no")) {
|
|
20
|
-
const r =
|
|
23
|
+
const r = P(), c = await y(
|
|
21
24
|
r,
|
|
22
25
|
e["x-usePkce"]
|
|
23
26
|
);
|
|
24
|
-
|
|
27
|
+
l = {
|
|
25
28
|
codeVerifier: r,
|
|
26
29
|
codeChallenge: c,
|
|
27
30
|
codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
|
|
28
31
|
}, t.searchParams.set("code_challenge", c), t.searchParams.set(
|
|
29
32
|
"code_challenge_method",
|
|
30
|
-
|
|
33
|
+
l.codeChallengeMethod
|
|
31
34
|
);
|
|
32
35
|
}
|
|
33
36
|
if (e["x-scalar-redirect-uri"].startsWith("/")) {
|
|
@@ -42,29 +45,28 @@ const w = () => {
|
|
|
42
45
|
const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
43
46
|
return n ? new Promise((r) => {
|
|
44
47
|
const c = setInterval(() => {
|
|
45
|
-
var
|
|
46
|
-
let
|
|
48
|
+
var m;
|
|
49
|
+
let u = null, h = null;
|
|
47
50
|
try {
|
|
48
|
-
const
|
|
49
|
-
|
|
51
|
+
const d = new URL(n.location.href).searchParams;
|
|
52
|
+
u = d.get("access_token"), h = d.get("code");
|
|
50
53
|
const g = new URLSearchParams(
|
|
51
54
|
n.location.href.split("#")[1]
|
|
52
55
|
);
|
|
53
|
-
|
|
56
|
+
u || (u = g.get("access_token")), h || (h = g.get("code"));
|
|
54
57
|
} catch {
|
|
55
58
|
}
|
|
56
|
-
if (n.closed ||
|
|
57
|
-
if (clearInterval(c), n.close(),
|
|
58
|
-
const
|
|
59
|
-
r(
|
|
60
|
-
} else
|
|
59
|
+
if (n.closed || u || h)
|
|
60
|
+
if (clearInterval(c), n.close(), u) {
|
|
61
|
+
const d = (m = n.location.href.match(/state=([^&]*)/)) == null ? void 0 : m[1];
|
|
62
|
+
r(d === s ? [null, u] : [new Error("State mismatch"), null]);
|
|
63
|
+
} else h ? new URL(
|
|
61
64
|
n.location.href
|
|
62
|
-
).searchParams.get("state") === s ?
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(c), r([
|
|
65
|
+
).searchParams.get("state") === s ? _(e, a, {
|
|
66
|
+
code: h,
|
|
67
|
+
pkce: l,
|
|
68
|
+
proxyUrl: o
|
|
69
|
+
}).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(c), r([
|
|
68
70
|
new Error("Window was closed without granting authorization"),
|
|
69
71
|
null
|
|
70
72
|
]));
|
|
@@ -74,21 +76,25 @@ const w = () => {
|
|
|
74
76
|
} catch {
|
|
75
77
|
return [new Error("Failed to authorize oauth2 flow"), null];
|
|
76
78
|
}
|
|
77
|
-
},
|
|
79
|
+
}, _ = async (e, i, {
|
|
80
|
+
code: o,
|
|
81
|
+
pkce: a,
|
|
82
|
+
proxyUrl: s
|
|
83
|
+
} = {}) => {
|
|
78
84
|
if (!e) return [new Error("OAuth2 flow was not defined"), null];
|
|
79
85
|
const t = new URLSearchParams();
|
|
80
|
-
t.set("client_id", e["x-scalar-client-id"]), i && t.set("scope", i), e.clientSecret && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]),
|
|
86
|
+
t.set("client_id", e["x-scalar-client-id"]), i && t.set("scope", i), e.clientSecret && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]), o ? (t.set("code", o), t.set("grant_type", "authorization_code"), a && t.set("code_verifier", a.codeVerifier)) : e.type === "password" ? (t.set("grant_type", "password"), t.set("username", e.username), t.set("password", e.password)) : t.set("grant_type", "client_credentials");
|
|
81
87
|
try {
|
|
82
|
-
const
|
|
88
|
+
const l = {
|
|
83
89
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
84
90
|
};
|
|
85
|
-
|
|
86
|
-
const
|
|
91
|
+
l.Authorization = `Basic ${btoa(`${e["x-scalar-client-id"]}:${e.clientSecret}`)}`;
|
|
92
|
+
const p = w(s, e.tokenUrl) ? `${s}?${new URLSearchParams([["scalar_url", e.tokenUrl]]).toString()}` : e.tokenUrl, n = await fetch(p, {
|
|
87
93
|
method: "POST",
|
|
88
|
-
headers:
|
|
94
|
+
headers: l,
|
|
89
95
|
body: t
|
|
90
|
-
}), { access_token:
|
|
91
|
-
return [null,
|
|
96
|
+
}), { access_token: r } = await n.json();
|
|
97
|
+
return [null, r];
|
|
92
98
|
} catch {
|
|
93
99
|
return [
|
|
94
100
|
new Error(
|
|
@@ -99,7 +105,7 @@ const w = () => {
|
|
|
99
105
|
}
|
|
100
106
|
};
|
|
101
107
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
k as authorizeOauth2,
|
|
109
|
+
_ as authorizeServers,
|
|
110
|
+
y as generateCodeChallenge
|
|
105
111
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.2.
|
|
21
|
+
"version": "2.2.6",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -146,7 +146,6 @@
|
|
|
146
146
|
"@headlessui/vue": "^1.7.20",
|
|
147
147
|
"@vueuse/core": "^10.10.0",
|
|
148
148
|
"@vueuse/integrations": "^11.2.0",
|
|
149
|
-
"cva": "1.0.0-beta.1",
|
|
150
149
|
"focus-trap": "^7",
|
|
151
150
|
"fuse.js": "^7.0.0",
|
|
152
151
|
"js-cookie": "^3.0.5",
|
|
@@ -160,20 +159,20 @@
|
|
|
160
159
|
"whatwg-mimetype": "^4.0.0",
|
|
161
160
|
"yaml": "^2.4.5",
|
|
162
161
|
"zod": "^3.23.8",
|
|
163
|
-
"@scalar/components": "0.13.
|
|
162
|
+
"@scalar/components": "0.13.1",
|
|
164
163
|
"@scalar/draggable": "0.1.7",
|
|
165
164
|
"@scalar/icons": "0.1.2",
|
|
166
|
-
"@scalar/import": "0.2.
|
|
165
|
+
"@scalar/import": "0.2.2",
|
|
167
166
|
"@scalar/object-utils": "1.1.12",
|
|
168
|
-
"@scalar/oas-utils": "0.2.
|
|
169
|
-
"@scalar/openapi-types": "0.1.5",
|
|
170
|
-
"@scalar/themes": "0.9.53",
|
|
167
|
+
"@scalar/oas-utils": "0.2.84",
|
|
171
168
|
"@scalar/openapi-parser": "0.8.10",
|
|
172
|
-
"@scalar/types": "0.
|
|
173
|
-
"@scalar/
|
|
174
|
-
"@scalar/
|
|
175
|
-
"@scalar/use-
|
|
176
|
-
"@scalar/use-
|
|
169
|
+
"@scalar/openapi-types": "0.1.5",
|
|
170
|
+
"@scalar/themes": "0.9.54",
|
|
171
|
+
"@scalar/types": "0.0.23",
|
|
172
|
+
"@scalar/use-codemirror": "0.11.45",
|
|
173
|
+
"@scalar/use-hooks": "0.1.7",
|
|
174
|
+
"@scalar/use-tooltip": "1.0.4",
|
|
175
|
+
"@scalar/use-toasts": "0.7.7"
|
|
177
176
|
},
|
|
178
177
|
"devDependencies": {
|
|
179
178
|
"@types/js-cookie": "^3.0.6",
|
|
@@ -190,8 +189,8 @@
|
|
|
190
189
|
"vite": "^5.4.10",
|
|
191
190
|
"vite-svg-loader": "^5.1.0",
|
|
192
191
|
"vitest": "^1.6.0",
|
|
193
|
-
"@scalar/
|
|
194
|
-
"@scalar/
|
|
192
|
+
"@scalar/galaxy": "0.2.16",
|
|
193
|
+
"@scalar/build-tooling": "0.1.12"
|
|
195
194
|
},
|
|
196
195
|
"scripts": {
|
|
197
196
|
"build": "vite build && pnpm types:build && tsc-alias -p tsconfig.build.json",
|