@scalar/api-client 2.2.3 → 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 +69 -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/CommandPaletteImport.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 +37 -47
- 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/ImportNowButton.vue.js +3 -3
- 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/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +72 -70
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue2.js +83 -81
- 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 +3 -2
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.js +6 -6
- package/dist/layouts/Modal/create-api-client-modal.d.ts +6 -4
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +3 -2
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.js +4 -4
- package/dist/libs/create-client.d.ts +6 -5
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +38 -37
- package/dist/libs/index.d.ts +1 -2
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +20 -20
- package/dist/libs/send-request/index.d.ts +2 -0
- package/dist/libs/send-request/index.d.ts.map +1 -0
- package/dist/libs/send-request/index.js +9 -0
- package/dist/libs/{send-request.d.ts → send-request/send-request.d.ts} +6 -6
- package/dist/libs/send-request/send-request.d.ts.map +1 -0
- package/dist/libs/{send-request.js → send-request/send-request.js} +29 -29
- package/dist/store/events.d.ts +1 -1
- package/dist/store/import-spec.d.ts +1 -1
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +1 -1
- package/dist/store/store.d.ts +6 -4
- 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 +76 -72
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +30 -30
- 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 +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +245 -191
- 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 +188 -196
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +153 -147
- 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 +50 -58
- 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 +18 -14
- package/dist/libs/send-request.d.ts.map +0 -1
|
@@ -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"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as A, computed as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useActiveEntities as
|
|
5
|
-
import { useModal as C, ScalarDropdown as S, ScalarDropdownItem as u, ScalarIcon as
|
|
1
|
+
import { defineComponent as A, computed as L, ref as M, openBlock as m, createElementBlock as W, createElementVNode as l, createVNode as s, unref as e, withCtx as n, Fragment as O, renderList as I, createBlock as h, withModifiers as r, toDisplayString as z } from "vue";
|
|
2
|
+
import U from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
3
|
+
import V from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
|
|
4
|
+
import { useActiveEntities as q } from "../../../store/active-entities.js";
|
|
5
|
+
import { useModal as C, ScalarDropdown as S, ScalarDropdownItem as u, ScalarListboxCheckbox as F, ScalarIcon as c, ScalarTooltip as P, ScalarButton as $, ScalarDropdownDivider as Y, ScalarModal as E } from "@scalar/components";
|
|
6
6
|
import { useRouter as G } from "vue-router";
|
|
7
7
|
import { useWorkspace as H } from "../../../store/store.js";
|
|
8
8
|
const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font-medium m-0 flex gap-1.5 items-center" }, Q = { class: "line-clamp-1 text-left w-[calc(100%-10px)]" }, X = { class: "text-ellipsis overflow-hidden" }, Z = { class: "flex items-center justify-center h-4 w-4" }, re = /* @__PURE__ */ A({
|
|
9
9
|
__name: "WorkspaceDropdown",
|
|
10
10
|
setup(ee) {
|
|
11
|
-
const { activeWorkspace: f } =
|
|
11
|
+
const { activeWorkspace: f } = q(), { workspaces: d, workspaceMutators: g, events: N } = H(), { push: b } = G(), T = (o) => {
|
|
12
12
|
o !== f.value.uid && b({
|
|
13
13
|
name: "workspace",
|
|
14
14
|
params: {
|
|
15
15
|
workspace: o
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
}, _ =
|
|
19
|
-
v.value = d[o].name,
|
|
18
|
+
}, _ = L(() => Object.keys(d).length === 1), j = () => N.commandPalette.emit({ commandName: "Create Workspace" }), v = M(""), i = M(""), w = C(), k = C(), y = (o) => {
|
|
19
|
+
v.value = d[o].name, i.value = o, w.show();
|
|
20
20
|
}, B = (o) => {
|
|
21
|
-
o.trim() && (g.edit(
|
|
21
|
+
o.trim() && (g.edit(i.value, "name", o.trim()), w.hide());
|
|
22
22
|
}, D = (o) => {
|
|
23
|
-
v.value = d[o].name,
|
|
23
|
+
v.value = d[o].name, i.value = o, k.show();
|
|
24
24
|
}, R = async () => {
|
|
25
25
|
if (!_.value) {
|
|
26
|
-
const o = f.value.uid ===
|
|
27
|
-
if (delete t[
|
|
26
|
+
const o = f.value.uid === i.value, t = { ...d };
|
|
27
|
+
if (delete t[i.value], g.delete(i.value), o) {
|
|
28
28
|
const p = Object.keys(t)[0];
|
|
29
29
|
await b({
|
|
30
30
|
name: "workspace",
|
|
@@ -37,43 +37,37 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
37
37
|
k.hide();
|
|
38
38
|
};
|
|
39
39
|
return (o, t) => (m(), W("div", null, [
|
|
40
|
-
|
|
40
|
+
l("div", J, [
|
|
41
41
|
s(e(S), null, {
|
|
42
42
|
items: n(() => [
|
|
43
|
-
(m(!0), W(
|
|
44
|
-
key:
|
|
43
|
+
(m(!0), W(O, null, I(e(d), (p, a) => (m(), h(e(u), {
|
|
44
|
+
key: a,
|
|
45
45
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
|
|
46
|
-
onClick:
|
|
46
|
+
onClick: r((x) => T(a), ["stop"])
|
|
47
47
|
}, {
|
|
48
48
|
default: n(() => [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
icon: "Checkmark",
|
|
58
|
-
thickness: "3.5"
|
|
59
|
-
})
|
|
60
|
-
], 2),
|
|
61
|
-
a("span", X, z(p.name), 1),
|
|
62
|
-
s(e(S), { teleport: ".scalar-client" }, {
|
|
49
|
+
s(e(F), {
|
|
50
|
+
selected: e(f).uid === a
|
|
51
|
+
}, null, 8, ["selected"]),
|
|
52
|
+
l("span", X, z(p.name), 1),
|
|
53
|
+
s(e(S), {
|
|
54
|
+
placement: "right-start",
|
|
55
|
+
teleport: ".scalar-client"
|
|
56
|
+
}, {
|
|
63
57
|
items: n(() => [
|
|
64
58
|
s(e(u), {
|
|
65
59
|
class: "flex gap-2",
|
|
66
|
-
onMousedown: (x) => y(
|
|
67
|
-
onTouchend:
|
|
60
|
+
onMousedown: (x) => y(a),
|
|
61
|
+
onTouchend: r((x) => y(a), ["prevent"])
|
|
68
62
|
}, {
|
|
69
63
|
default: n(() => [
|
|
70
|
-
s(e(
|
|
64
|
+
s(e(c), {
|
|
71
65
|
class: "inline-flex",
|
|
72
66
|
icon: "Edit",
|
|
73
67
|
size: "md",
|
|
74
68
|
thickness: "1.5"
|
|
75
69
|
}),
|
|
76
|
-
t[4] || (t[4] =
|
|
70
|
+
t[4] || (t[4] = l("span", null, "Rename", -1))
|
|
77
71
|
]),
|
|
78
72
|
_: 2
|
|
79
73
|
}, 1032, ["onMousedown", "onTouchend"]),
|
|
@@ -86,27 +80,27 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
86
80
|
s(e(u), {
|
|
87
81
|
class: "flex gap-2 w-full",
|
|
88
82
|
disabled: "",
|
|
89
|
-
onMousedown: t[0] || (t[0] =
|
|
83
|
+
onMousedown: t[0] || (t[0] = r(() => {
|
|
90
84
|
}, ["prevent"])),
|
|
91
|
-
onTouchend: t[1] || (t[1] =
|
|
85
|
+
onTouchend: t[1] || (t[1] = r(() => {
|
|
92
86
|
}, ["prevent"]))
|
|
93
87
|
}, {
|
|
94
88
|
default: n(() => [
|
|
95
|
-
s(e(
|
|
89
|
+
s(e(c), {
|
|
96
90
|
class: "inline-flex",
|
|
97
91
|
icon: "Delete",
|
|
98
92
|
size: "md",
|
|
99
93
|
thickness: "1.5"
|
|
100
94
|
}),
|
|
101
|
-
t[5] || (t[5] =
|
|
95
|
+
t[5] || (t[5] = l("span", null, "Delete", -1))
|
|
102
96
|
]),
|
|
103
97
|
_: 1
|
|
104
98
|
})
|
|
105
99
|
]),
|
|
106
100
|
content: n(() => t[6] || (t[6] = [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
l("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, [
|
|
102
|
+
l("div", { class: "flex items-center text-c-2" }, [
|
|
103
|
+
l("span", null, "Only workspace cannot be deleted.")
|
|
110
104
|
])
|
|
111
105
|
], -1)
|
|
112
106
|
])),
|
|
@@ -114,17 +108,17 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
114
108
|
})) : (m(), h(e(u), {
|
|
115
109
|
key: 1,
|
|
116
110
|
class: "flex !gap-2",
|
|
117
|
-
onMousedown:
|
|
118
|
-
onTouchend:
|
|
111
|
+
onMousedown: r((x) => D(a), ["prevent"]),
|
|
112
|
+
onTouchend: r((x) => D(a), ["prevent"])
|
|
119
113
|
}, {
|
|
120
114
|
default: n(() => [
|
|
121
|
-
s(e(
|
|
115
|
+
s(e(c), {
|
|
122
116
|
class: "inline-flex",
|
|
123
117
|
icon: "Delete",
|
|
124
118
|
size: "sm",
|
|
125
119
|
thickness: "1.5"
|
|
126
120
|
}),
|
|
127
|
-
t[7] || (t[7] =
|
|
121
|
+
t[7] || (t[7] = l("span", null, "Delete", -1))
|
|
128
122
|
]),
|
|
129
123
|
_: 2
|
|
130
124
|
}, 1032, ["onMousedown", "onTouchend"]))
|
|
@@ -137,7 +131,7 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
137
131
|
variant: "ghost"
|
|
138
132
|
}, {
|
|
139
133
|
default: n(() => [
|
|
140
|
-
s(e(
|
|
134
|
+
s(e(c), {
|
|
141
135
|
icon: "Ellipses",
|
|
142
136
|
size: "sm"
|
|
143
137
|
})
|
|
@@ -156,14 +150,13 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
156
150
|
onClick: j
|
|
157
151
|
}, {
|
|
158
152
|
default: n(() => [
|
|
159
|
-
|
|
160
|
-
s(e(
|
|
161
|
-
class: "h-2.5",
|
|
153
|
+
l("div", Z, [
|
|
154
|
+
s(e(c), {
|
|
162
155
|
icon: "Add",
|
|
163
|
-
|
|
156
|
+
size: "sm"
|
|
164
157
|
})
|
|
165
158
|
]),
|
|
166
|
-
t[8] || (t[8] =
|
|
159
|
+
t[8] || (t[8] = l("span", null, "Create Workspace", -1))
|
|
167
160
|
]),
|
|
168
161
|
_: 1
|
|
169
162
|
})
|
|
@@ -175,12 +168,11 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
175
168
|
variant: "ghost"
|
|
176
169
|
}, {
|
|
177
170
|
default: n(() => [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
s(e(
|
|
181
|
-
class: "size-3",
|
|
171
|
+
l("div", K, [
|
|
172
|
+
l("h2", Q, z(e(f).name), 1),
|
|
173
|
+
s(e(c), {
|
|
182
174
|
icon: "ChevronDown",
|
|
183
|
-
|
|
175
|
+
size: "md"
|
|
184
176
|
})
|
|
185
177
|
])
|
|
186
178
|
]),
|
|
@@ -196,7 +188,7 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
196
188
|
title: "Delete workspace"
|
|
197
189
|
}, {
|
|
198
190
|
default: n(() => [
|
|
199
|
-
s(
|
|
191
|
+
s(U, {
|
|
200
192
|
variableName: v.value,
|
|
201
193
|
warningMessage: "This cannot be undone. You’re about to delete the workspace and everything inside it.",
|
|
202
194
|
onClose: t[2] || (t[2] = (p) => e(k).hide()),
|
|
@@ -211,7 +203,7 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
|
|
|
211
203
|
title: "Rename Workspace"
|
|
212
204
|
}, {
|
|
213
205
|
default: n(() => [
|
|
214
|
-
s(
|
|
206
|
+
s(V, {
|
|
215
207
|
name: v.value,
|
|
216
208
|
onClose: t[3] || (t[3] = (p) => e(w).hide()),
|
|
217
209
|
onEdit: B
|
|
@@ -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
|
};
|