@scalar/api-client 2.2.49 → 2.2.50
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 +31 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts +15 -3
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +102 -94
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts +2 -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 +54 -58
- package/dist/components/CodeInput/CodeInput.vue.d.ts +9 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +95 -93
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +1 -3
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -22
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +13 -13
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +12 -12
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +54 -49
- package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +9 -9
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.js +11 -8
- package/dist/components/DataTable/DataTableInput.vue.d.ts +6 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +4 -4
- package/dist/components/DataTable/DataTableInput.vue2.js +36 -30
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +15 -15
- package/dist/components/Form/Form.vue.d.ts +3 -1
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.js +30 -25
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +41 -41
- package/dist/components/ImportCollection/ImportNowButton.vue.js +24 -24
- package/dist/components/ScreenReader.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdown.vue.js +13 -13
- package/dist/components/Server/ServerDropdownItem.vue.d.ts +1 -1
- package/dist/components/Server/ServerDropdownItem.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +19 -19
- package/dist/layouts/App/create-api-client-app.d.ts +387 -477
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +774 -954
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +387 -477
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +390 -479
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +3 -15
- package/dist/libs/env-helpers.d.ts.map +1 -1
- package/dist/libs/find-request.d.ts +7 -7
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/hot-keys.d.ts +3 -1
- package/dist/libs/hot-keys.d.ts.map +1 -1
- package/dist/libs/hot-keys.js +11 -15
- package/dist/libs/hot-keys.test.d.ts +2 -0
- package/dist/libs/hot-keys.test.d.ts.map +1 -0
- package/dist/libs/index.js +27 -26
- package/dist/libs/send-request/build-request-security.d.ts +1 -1
- package/dist/libs/send-request/build-request-security.js +19 -16
- package/dist/libs/send-request/create-request-operation.test.d.ts +10 -10
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.d.ts +1 -1
- package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +37 -34
- package/dist/store/active-entities.d.ts +58 -67
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +61 -74
- package/dist/store/collections.d.ts +90 -90
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +4 -17
- package/dist/store/cookies.d.ts +14 -14
- package/dist/store/environment.d.ts +19 -18
- package/dist/store/environment.d.ts.map +1 -1
- package/dist/store/environment.js +2 -8
- package/dist/store/import-spec.d.ts +16 -106
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +9 -14
- package/dist/store/request-example.d.ts +25 -25
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +15 -20
- package/dist/store/requests.d.ts +84 -84
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +17 -40
- package/dist/store/router-params.d.ts +13 -11
- package/dist/store/router-params.d.ts.map +1 -1
- package/dist/store/router-params.js +5 -5
- package/dist/store/security-schemes.d.ts +58 -58
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +1 -3
- package/dist/store/servers.d.ts +17 -17
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +2 -9
- package/dist/store/store.d.ts +387 -477
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +2 -4
- package/dist/store/tags.d.ts +28 -28
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +19 -34
- package/dist/store/workspace.d.ts +36 -36
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +1 -5
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +18 -18
- package/dist/views/Cookies/CookieRaw.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +24 -24
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +140 -132
- package/dist/views/Environment/EnvironmentModal.vue.d.ts +2 -2
- package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentModal.vue.js +15 -15
- 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 +160 -141
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.d.ts +2 -1
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +7 -7
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +6 -2
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +99 -95
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +4 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +70 -64
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +4 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +40 -34
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +6 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +32 -26
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +4 -0
- 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 +93 -85
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts +9 -0
- 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 +214 -244
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +10 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +77 -80
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +7 -0
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +89 -96
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +10 -2
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +59 -66
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +11 -0
- 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 +176 -155
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +6 -0
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +97 -100
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +31 -22
- package/dist/views/Request/RequestSection/helpers/getting-started.d.ts +2 -2
- package/dist/views/Request/RequestSection/helpers/getting-started.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/helpers/getting-started.js +11 -13
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +50 -48
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +38 -44
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +10 -0
- 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 +77 -69
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts +4 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +41 -39
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -0
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +56 -52
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +68 -68
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.d.ts +1 -1
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +38 -55
- package/dist/views/Request/libs/auth.d.ts +2 -2
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/auth.js +28 -29
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +42 -65
- package/dist/views/Request/libs/request.d.ts +5 -0
- package/dist/views/Request/libs/request.d.ts.map +1 -1
- package/dist/views/Request/libs/request.js +37 -2
- package/dist/views/Request/libs/watch-mode.d.ts.map +1 -1
- package/dist/views/Request/libs/watch-mode.js +10 -34
- package/dist/views/Servers/ServerForm.vue.d.ts +1 -8
- package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +21 -22
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +73 -81
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +118 -134
- package/package.json +15 -15
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { defineComponent as L, computed as O, ref as D, openBlock as
|
|
2
|
-
import V from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { defineComponent as L, computed as O, ref as D, openBlock as c, createElementBlock as z, createElementVNode as a, createVNode as n, unref as t, withCtx as o, Fragment as I, renderList as U, createBlock as g, withModifiers as r, toDisplayString as C } from "vue";
|
|
2
|
+
import { useModal as S, ScalarDropdown as $, ScalarDropdownItem as u, ScalarListboxCheckbox as V, ScalarIcon as p, ScalarTooltip as q, ScalarButton as E, ScalarDropdownDivider as F, ScalarModal as N } from "@scalar/components";
|
|
3
|
+
import { useRouter as P } from "vue-router";
|
|
4
|
+
import Y from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
5
|
+
import G from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
|
|
6
|
+
import { useActiveEntities as H } from "../../../store/active-entities.js";
|
|
7
7
|
import { useWorkspace as J } from "../../../store/store.js";
|
|
8
|
-
const K = { class: "flex items-center text-sm
|
|
8
|
+
const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0 flex items-center gap-1.5 font-bold" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "overflow-hidden text-ellipsis" }, ee = { class: "flex h-4 w-4 items-center justify-center" }, de = /* @__PURE__ */ L({
|
|
9
9
|
__name: "WorkspaceDropdown",
|
|
10
10
|
setup(te) {
|
|
11
|
-
const { activeWorkspace:
|
|
11
|
+
const { activeWorkspace: m } = H(), { workspaces: d, workspaceMutators: b, events: T } = J(), { push: _ } = P(), j = (s) => {
|
|
12
12
|
var e;
|
|
13
|
-
|
|
13
|
+
s !== ((e = m.value) == null ? void 0 : e.uid) && _({
|
|
14
14
|
name: "workspace",
|
|
15
15
|
params: {
|
|
16
|
-
workspace:
|
|
16
|
+
workspace: s
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
}, y = O(() => Object.keys(d).length === 1), B = () => T.commandPalette.emit({ commandName: "Create Workspace" }),
|
|
20
|
-
const e = d[
|
|
21
|
-
e && (
|
|
22
|
-
}, R = (
|
|
23
|
-
|
|
24
|
-
}, W = (
|
|
25
|
-
const e = d[
|
|
26
|
-
e && (
|
|
19
|
+
}, y = O(() => Object.keys(d).length === 1), B = () => T.commandPalette.emit({ commandName: "Create Workspace" }), f = D(""), i = D(""), v = S(), w = S(), M = (s) => {
|
|
20
|
+
const e = d[s];
|
|
21
|
+
e && (f.value = e.name, i.value = s, v.show());
|
|
22
|
+
}, R = (s) => {
|
|
23
|
+
s.trim() && (b.edit(i.value, "name", s.trim()), v.hide());
|
|
24
|
+
}, W = (s) => {
|
|
25
|
+
const e = d[s];
|
|
26
|
+
e && (f.value = e.name, i.value = s, w.show());
|
|
27
27
|
}, A = async () => {
|
|
28
|
-
var
|
|
28
|
+
var s;
|
|
29
29
|
if (!y.value) {
|
|
30
|
-
const e = ((
|
|
30
|
+
const e = ((s = m.value) == null ? void 0 : s.uid) === i.value, l = { ...d };
|
|
31
31
|
if (delete l[i.value], b.delete(i.value), e) {
|
|
32
|
-
const
|
|
32
|
+
const k = Object.keys(l)[0];
|
|
33
33
|
await _({
|
|
34
34
|
name: "workspace",
|
|
35
35
|
params: {
|
|
36
|
-
workspace:
|
|
36
|
+
workspace: k
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
w.hide();
|
|
42
42
|
};
|
|
43
|
-
return (
|
|
43
|
+
return (s, e) => (c(), z("div", null, [
|
|
44
44
|
a("div", K, [
|
|
45
|
-
|
|
45
|
+
n(t($), null, {
|
|
46
46
|
items: o(() => [
|
|
47
|
-
(
|
|
48
|
-
key:
|
|
49
|
-
class: "flex gap-1.5
|
|
50
|
-
onClick:
|
|
47
|
+
(c(!0), z(I, null, U(t(d), (l, k) => (c(), g(t(u), {
|
|
48
|
+
key: k,
|
|
49
|
+
class: "group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
50
|
+
onClick: r((x) => j(l.uid), ["stop"])
|
|
51
51
|
}, {
|
|
52
52
|
default: o(() => {
|
|
53
53
|
var x;
|
|
54
54
|
return [
|
|
55
|
-
|
|
56
|
-
selected: ((x = t(
|
|
55
|
+
n(t(V), {
|
|
56
|
+
selected: ((x = t(m)) == null ? void 0 : x.uid) === k
|
|
57
57
|
}, null, 8, ["selected"]),
|
|
58
58
|
a("span", Z, C(l.name), 1),
|
|
59
|
-
|
|
59
|
+
n(t($), {
|
|
60
60
|
placement: "right-start",
|
|
61
61
|
teleport: ""
|
|
62
62
|
}, {
|
|
63
63
|
items: o(() => [
|
|
64
|
-
|
|
64
|
+
n(t(u), {
|
|
65
65
|
class: "flex gap-2",
|
|
66
|
-
onMousedown: (h) => M(
|
|
67
|
-
onTouchend:
|
|
66
|
+
onMousedown: (h) => M(l.uid),
|
|
67
|
+
onTouchend: r((h) => M(l.uid), ["prevent"])
|
|
68
68
|
}, {
|
|
69
69
|
default: o(() => [
|
|
70
|
-
|
|
70
|
+
n(t(p), {
|
|
71
71
|
class: "inline-flex",
|
|
72
72
|
icon: "Edit",
|
|
73
73
|
size: "md",
|
|
@@ -77,22 +77,22 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
77
77
|
]),
|
|
78
78
|
_: 2
|
|
79
79
|
}, 1032, ["onMousedown", "onTouchend"]),
|
|
80
|
-
y.value ? (
|
|
80
|
+
y.value ? (c(), g(t(q), {
|
|
81
81
|
key: 0,
|
|
82
82
|
class: "z-overlay",
|
|
83
83
|
side: "bottom"
|
|
84
84
|
}, {
|
|
85
85
|
trigger: o(() => [
|
|
86
|
-
|
|
87
|
-
class: "flex gap-2
|
|
86
|
+
n(t(u), {
|
|
87
|
+
class: "flex w-full gap-2",
|
|
88
88
|
disabled: "",
|
|
89
|
-
onMousedown: e[0] || (e[0] =
|
|
89
|
+
onMousedown: e[0] || (e[0] = r(() => {
|
|
90
90
|
}, ["prevent"])),
|
|
91
|
-
onTouchend: e[1] || (e[1] =
|
|
91
|
+
onTouchend: e[1] || (e[1] = r(() => {
|
|
92
92
|
}, ["prevent"]))
|
|
93
93
|
}, {
|
|
94
94
|
default: o(() => [
|
|
95
|
-
|
|
95
|
+
n(t(p), {
|
|
96
96
|
class: "inline-flex",
|
|
97
97
|
icon: "Delete",
|
|
98
98
|
size: "md",
|
|
@@ -104,21 +104,21 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
104
104
|
})
|
|
105
105
|
]),
|
|
106
106
|
content: o(() => e[6] || (e[6] = [
|
|
107
|
-
a("div", { class: "
|
|
108
|
-
a("div", { class: "flex items-center
|
|
107
|
+
a("div", { class: "w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
|
|
108
|
+
a("div", { class: "text-c-2 flex items-center" }, [
|
|
109
109
|
a("span", null, "Only workspace cannot be deleted.")
|
|
110
110
|
])
|
|
111
111
|
], -1)
|
|
112
112
|
])),
|
|
113
113
|
_: 1
|
|
114
|
-
})) : (
|
|
114
|
+
})) : (c(), g(t(u), {
|
|
115
115
|
key: 1,
|
|
116
116
|
class: "flex !gap-2",
|
|
117
|
-
onMousedown:
|
|
118
|
-
onTouchend:
|
|
117
|
+
onMousedown: r((h) => W(l.uid), ["prevent"]),
|
|
118
|
+
onTouchend: r((h) => W(l.uid), ["prevent"])
|
|
119
119
|
}, {
|
|
120
120
|
default: o(() => [
|
|
121
|
-
|
|
121
|
+
n(t(p), {
|
|
122
122
|
class: "inline-flex",
|
|
123
123
|
icon: "Delete",
|
|
124
124
|
size: "sm",
|
|
@@ -130,14 +130,14 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
130
130
|
}, 1032, ["onMousedown", "onTouchend"]))
|
|
131
131
|
]),
|
|
132
132
|
default: o(() => [
|
|
133
|
-
|
|
134
|
-
class: "
|
|
133
|
+
n(t(E), {
|
|
134
|
+
class: "hover:bg-b-3 -mr-1 ml-auto aspect-square h-fit px-0.5 py-0 group-hover/item:flex",
|
|
135
135
|
size: "sm",
|
|
136
136
|
type: "button",
|
|
137
137
|
variant: "ghost"
|
|
138
138
|
}, {
|
|
139
139
|
default: o(() => [
|
|
140
|
-
|
|
140
|
+
n(t(p), {
|
|
141
141
|
icon: "Ellipses",
|
|
142
142
|
size: "sm"
|
|
143
143
|
})
|
|
@@ -151,14 +151,14 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
151
151
|
}),
|
|
152
152
|
_: 2
|
|
153
153
|
}, 1032, ["onClick"]))), 128)),
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
n(t(F)),
|
|
155
|
+
n(t(u), {
|
|
156
156
|
class: "flex items-center gap-1.5",
|
|
157
157
|
onClick: B
|
|
158
158
|
}, {
|
|
159
159
|
default: o(() => [
|
|
160
160
|
a("div", ee, [
|
|
161
|
-
|
|
161
|
+
n(t(p), {
|
|
162
162
|
icon: "Add",
|
|
163
163
|
size: "sm"
|
|
164
164
|
})
|
|
@@ -169,8 +169,8 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
169
169
|
})
|
|
170
170
|
]),
|
|
171
171
|
default: o(() => [
|
|
172
|
-
|
|
173
|
-
class: "
|
|
172
|
+
n(t(E), {
|
|
173
|
+
class: "text-c-1 hover:bg-b-2 line-clamp-1 h-full w-fit justify-start px-1.5 py-1.5 font-normal",
|
|
174
174
|
fullWidth: "",
|
|
175
175
|
variant: "ghost"
|
|
176
176
|
}, {
|
|
@@ -178,7 +178,7 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
178
178
|
var l;
|
|
179
179
|
return [
|
|
180
180
|
a("div", Q, [
|
|
181
|
-
a("h2", X, C((l = t(
|
|
181
|
+
a("h2", X, C((l = t(m)) == null ? void 0 : l.name), 1)
|
|
182
182
|
])
|
|
183
183
|
];
|
|
184
184
|
}),
|
|
@@ -188,30 +188,30 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
188
188
|
_: 1
|
|
189
189
|
})
|
|
190
190
|
]),
|
|
191
|
-
|
|
191
|
+
n(t(N), {
|
|
192
192
|
size: "xxs",
|
|
193
|
-
state: t(
|
|
193
|
+
state: t(w),
|
|
194
194
|
title: "Delete workspace"
|
|
195
195
|
}, {
|
|
196
196
|
default: o(() => [
|
|
197
|
-
|
|
198
|
-
variableName:
|
|
197
|
+
n(Y, {
|
|
198
|
+
variableName: f.value,
|
|
199
199
|
warningMessage: "This cannot be undone. You’re about to delete the workspace and everything inside it.",
|
|
200
|
-
onClose: e[2] || (e[2] = (l) => t(
|
|
200
|
+
onClose: e[2] || (e[2] = (l) => t(w).hide()),
|
|
201
201
|
onDelete: A
|
|
202
202
|
}, null, 8, ["variableName"])
|
|
203
203
|
]),
|
|
204
204
|
_: 1
|
|
205
205
|
}, 8, ["state"]),
|
|
206
|
-
|
|
206
|
+
n(t(N), {
|
|
207
207
|
size: "xxs",
|
|
208
|
-
state: t(
|
|
208
|
+
state: t(v),
|
|
209
209
|
title: "Rename Workspace"
|
|
210
210
|
}, {
|
|
211
211
|
default: o(() => [
|
|
212
|
-
|
|
213
|
-
name:
|
|
214
|
-
onClose: e[3] || (e[3] = (l) => t(
|
|
212
|
+
n(G, {
|
|
213
|
+
name: f.value,
|
|
214
|
+
onClose: e[3] || (e[3] = (l) => t(v).hide()),
|
|
215
215
|
onEdit: R
|
|
216
216
|
}, null, 8, ["name"])
|
|
217
217
|
]),
|
|
@@ -221,5 +221,5 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
|
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
export {
|
|
224
|
-
|
|
224
|
+
de as default
|
|
225
225
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-auth-options.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/new-auth-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"new-auth-options.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/new-auth-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAG5F,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFhB,CAAA;AAIV,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,EAAE,oBAAoB,EAOlD,CAAA"}
|
|
@@ -2,7 +2,7 @@ import type { WorkspaceStore } from '../../store';
|
|
|
2
2
|
import type { ActiveEntitiesStore } from '../../store/active-entities';
|
|
3
3
|
import type { DraggingItem, HoveredItem } from '@scalar/draggable';
|
|
4
4
|
/** Create DnD handlers */
|
|
5
|
-
export declare function dragHandlerFactory(activeWorkspace: ActiveEntitiesStore['activeWorkspace'], { collections, collectionMutators, tags, tagMutators, workspaceMutators
|
|
5
|
+
export declare function dragHandlerFactory(activeWorkspace: ActiveEntitiesStore['activeWorkspace'], { collections, collectionMutators, tags, tagMutators, workspaceMutators }: WorkspaceStore): {
|
|
6
6
|
handleDragEnd: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => void;
|
|
7
7
|
isDroppable: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Request/handle-drag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Request/handle-drag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAGlE,0BAA0B;AAC1B,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,EACvD,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAE,cAAc;kCAcpD,YAAY,eAAe,WAAW;gCA2DxC,YAAY,eAAe,WAAW;EAe1E"}
|
|
@@ -1,61 +1,44 @@
|
|
|
1
|
-
import { useLayout as
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
tagMutators: x,
|
|
7
|
-
workspaceMutators: U
|
|
8
|
-
}) {
|
|
9
|
-
const { layout: b } = w();
|
|
10
|
-
function p(i, f) {
|
|
11
|
-
r[i] ? a.edit(i, "children", f) : l[i] && x.edit(i, "children", f);
|
|
12
|
-
}
|
|
13
|
-
function I(i, f) {
|
|
14
|
-
var D, v, y, C;
|
|
15
|
-
if (!i || !f) return;
|
|
16
|
-
const { id: d, parentId: n } = i, { id: t, parentId: s, offset: h } = f;
|
|
17
|
-
if (n ? r[n] ? a.edit(
|
|
18
|
-
n,
|
|
19
|
-
"children",
|
|
20
|
-
r[n].children.filter(
|
|
21
|
-
(e) => e !== d
|
|
22
|
-
)
|
|
23
|
-
) : l[n] && x.edit(
|
|
24
|
-
n,
|
|
25
|
-
"children",
|
|
26
|
-
l[n].children.filter((e) => e !== d)
|
|
27
|
-
) : U.edit(
|
|
28
|
-
((D = u.value) == null ? void 0 : D.uid) ?? "",
|
|
29
|
-
"collections",
|
|
30
|
-
((v = u.value) == null ? void 0 : v.collections.filter(
|
|
31
|
-
(e) => e !== d
|
|
32
|
-
)) ?? []
|
|
33
|
-
), h === 2) {
|
|
34
|
-
const e = r[t] || l[t];
|
|
35
|
-
p(t, [
|
|
36
|
-
...(e == null ? void 0 : e.children) ?? [],
|
|
37
|
-
d
|
|
38
|
-
]);
|
|
39
|
-
} else if (s) {
|
|
40
|
-
const e = r[s] || l[s], o = [...(e == null ? void 0 : e.children) ?? []], c = o.findIndex((P) => t === P) ?? 0;
|
|
41
|
-
o.splice(c + h, 0, d), p(s, o);
|
|
42
|
-
} else {
|
|
43
|
-
const e = [...((y = u.value) == null ? void 0 : y.collections) ?? []], o = e.findIndex((c) => t === c) ?? 0;
|
|
44
|
-
e.splice(o + h, 0, d), U.edit(
|
|
45
|
-
((C = u.value) == null ? void 0 : C.uid) ?? "",
|
|
46
|
-
"collections",
|
|
47
|
-
e
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
import { useLayout as I } from "../../hooks/useLayout.js";
|
|
2
|
+
function F(f, { collections: l, collectionMutators: a, tags: o, tagMutators: p, workspaceMutators: x }) {
|
|
3
|
+
const { layout: b } = I(), y = (i, r) => {
|
|
4
|
+
i.type === "collection" ? a.edit(i.uid, "children", r) : i.type === "tag" && p.edit(i.uid, "children", r);
|
|
5
|
+
};
|
|
51
6
|
return {
|
|
52
|
-
handleDragEnd:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
7
|
+
handleDragEnd: (i, r) => {
|
|
8
|
+
var D, U, v, C;
|
|
9
|
+
if (!i || !r) return;
|
|
10
|
+
const { id: n, parentId: d } = i, { id: u, parentId: s, offset: c } = r;
|
|
11
|
+
if (d ? l[d] ? a.edit(
|
|
12
|
+
d,
|
|
13
|
+
"children",
|
|
14
|
+
l[d].children.filter((e) => e !== n)
|
|
15
|
+
) : o[d] && p.edit(
|
|
16
|
+
d,
|
|
17
|
+
"children",
|
|
18
|
+
o[d].children.filter((e) => e !== n)
|
|
19
|
+
) : x.edit(
|
|
20
|
+
(D = f.value) == null ? void 0 : D.uid,
|
|
21
|
+
"collections",
|
|
22
|
+
((U = f.value) == null ? void 0 : U.collections.filter((e) => e !== n)) ?? []
|
|
23
|
+
), c === 2) {
|
|
24
|
+
const e = l[u] || o[u];
|
|
25
|
+
e && y(e, [...e.children ?? [], n]);
|
|
26
|
+
} else if (s) {
|
|
27
|
+
const e = l[s] || o[s];
|
|
28
|
+
if (!e) return;
|
|
29
|
+
const t = [...e.children ?? []], h = t.findIndex((E) => u === E) ?? 0;
|
|
30
|
+
t.splice(h + c, 0, n), y(e, t);
|
|
31
|
+
} else {
|
|
32
|
+
const e = [...((v = f.value) == null ? void 0 : v.collections) ?? []], t = e.findIndex((h) => u === h) ?? 0;
|
|
33
|
+
e.splice(t + c, 0, n), x.edit((C = f.value) == null ? void 0 : C.uid, "collections", e);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
isDroppable: (i, r) => {
|
|
37
|
+
var n, d;
|
|
38
|
+
return !(b === "modal" || !l[i.id] && r.offset !== 2 || l[i.id] && ((d = (n = l[r.id]) == null ? void 0 : n.info) == null ? void 0 : d.title) === "Drafts");
|
|
56
39
|
}
|
|
57
40
|
};
|
|
58
41
|
}
|
|
59
42
|
export {
|
|
60
|
-
|
|
43
|
+
F as dragHandlerFactory
|
|
61
44
|
};
|
|
@@ -7,12 +7,12 @@ type DisplayScheme = {
|
|
|
7
7
|
};
|
|
8
8
|
/** Format a scheme object into a display object */
|
|
9
9
|
export declare const formatScheme: (s: DisplayScheme) => {
|
|
10
|
-
id: string
|
|
10
|
+
id: string & import("zod").BRAND<"securityScheme">;
|
|
11
11
|
label: string;
|
|
12
12
|
};
|
|
13
13
|
/** Formats complex security schemes */
|
|
14
14
|
export declare const formatComplexScheme: (uids: string[], securitySchemes: Record<string, DisplayScheme>) => {
|
|
15
|
-
id: string
|
|
15
|
+
id: string & import("zod").BRAND<"securityScheme">;
|
|
16
16
|
label: string;
|
|
17
17
|
};
|
|
18
18
|
/** Compute what the security requirements should be for a request */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/auth.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAG5F,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACxC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;IAClC,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,CAAA;CAC3B,CAAA;AAED,mDAAmD;AACnD,eAAO,MAAM,YAAY,MAAO,aAAa;;;CAG3C,CAAA;AAEF,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,SAAU,MAAM,EAAE,mBAAmB,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;;;CAa/F,CAAA;AAEH,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,eAAgB,SAAS,eAAe,UAAU,+BASrF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,yBACL,UAAU,CAAC,UAAU,CAAC,wBACtB,UAAU,CAAC,iBAAiB,CAAC,mBAClC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,eAClC,OAAO,KAClB,oBAAoB,EAAE,GAAG,mBAAmB,EAsD9C,CAAA"}
|
|
@@ -1,50 +1,49 @@
|
|
|
1
1
|
import { isDefined as p } from "@scalar/oas-utils/helpers";
|
|
2
2
|
import { ADD_AUTH_OPTIONS as O } from "../consts/new-auth-options.js";
|
|
3
|
-
const
|
|
3
|
+
const d = (t) => ({
|
|
4
4
|
id: t.uid,
|
|
5
5
|
label: t.type === "openIdConnect" ? `${t.nameKey} (coming soon)` : t.nameKey
|
|
6
|
-
}), b = (t, e) =>
|
|
6
|
+
}), b = (t, e) => d(
|
|
7
7
|
t.reduce(
|
|
8
|
-
(
|
|
8
|
+
(r, a, i) => {
|
|
9
9
|
const m = e[a];
|
|
10
|
-
return m && (
|
|
10
|
+
return m && (r.nameKey += `${i > 0 ? " & " : ""}${m.nameKey}`, r.uid = `${r.uid}${i > 0 ? "," : ""}${m.uid}`), r;
|
|
11
11
|
},
|
|
12
12
|
{ type: "complex", nameKey: "", uid: "" }
|
|
13
13
|
)
|
|
14
14
|
), A = (t, e) => {
|
|
15
|
-
var
|
|
16
|
-
return JSON.stringify(t == null ? void 0 : t.security) === "[{}]" && ((
|
|
17
|
-
}, D = (t, e,
|
|
15
|
+
var r;
|
|
16
|
+
return JSON.stringify(t == null ? void 0 : t.security) === "[{}]" && ((r = e == null ? void 0 : e.security) != null && r.length) ? !!(e != null && e.security.find((i) => JSON.stringify(i) === "{}")) ? e.security : [...e.security, {}] : (t == null ? void 0 : t.security) ?? (e == null ? void 0 : e.security) ?? [];
|
|
17
|
+
}, D = (t, e, r, a = !1) => {
|
|
18
18
|
{
|
|
19
19
|
const i = e.reduce(
|
|
20
|
-
(n,
|
|
21
|
-
const u = s
|
|
20
|
+
(n, s) => {
|
|
21
|
+
const u = r[s];
|
|
22
22
|
return u && (n[u.nameKey] = u), n;
|
|
23
23
|
},
|
|
24
24
|
{}
|
|
25
|
-
), m = t.flatMap(
|
|
26
|
-
(n)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return b(u, s);
|
|
34
|
-
} else if (r[0]) {
|
|
35
|
-
const u = i[r[0]];
|
|
36
|
-
if (u) return y(u);
|
|
37
|
-
}
|
|
38
|
-
return [];
|
|
25
|
+
), m = t.flatMap((n) => {
|
|
26
|
+
const s = Object.keys(n);
|
|
27
|
+
if (s.length > 1) {
|
|
28
|
+
const u = s.map((g) => {
|
|
29
|
+
var h;
|
|
30
|
+
return (h = i[g]) == null ? void 0 : h.uid;
|
|
31
|
+
}).filter(p);
|
|
32
|
+
return b(u, r);
|
|
39
33
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
if (s[0]) {
|
|
35
|
+
const u = i[s[0]];
|
|
36
|
+
if (u) return d(u);
|
|
37
|
+
}
|
|
38
|
+
return [];
|
|
39
|
+
}), y = e.filter((n) => !m.some((s) => s.id === n)).map((n) => {
|
|
40
|
+
const s = r[n];
|
|
41
|
+
return s ? d(s) : null;
|
|
43
42
|
}).filter(p), f = [
|
|
44
43
|
{ label: "Required authentication", options: m },
|
|
45
|
-
{ label: "Available authentication", options:
|
|
44
|
+
{ label: "Available authentication", options: y }
|
|
46
45
|
];
|
|
47
|
-
return a ? m.length ? f :
|
|
46
|
+
return a ? m.length ? f : y : (f.push({
|
|
48
47
|
label: "Add new authentication",
|
|
49
48
|
options: O
|
|
50
49
|
}), f);
|
|
@@ -52,7 +51,7 @@ const y = (t) => ({
|
|
|
52
51
|
};
|
|
53
52
|
export {
|
|
54
53
|
b as formatComplexScheme,
|
|
55
|
-
|
|
54
|
+
d as formatScheme,
|
|
56
55
|
D as getSchemeOptions,
|
|
57
56
|
A as getSecurityRequirements
|
|
58
57
|
};
|
|
@@ -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,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAGzE,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,
|
|
1
|
+
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAGzE,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,aAAoB,MAAM,YAAY,SAAS,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAa3G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,SACpB,UAAU,gBAEF,MAAM,aAET,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAoI/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,GAAG,SAAS,CAAA;CAC9B,KACA,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA4D/B,CAAA"}
|
|
@@ -14,65 +14,47 @@ const y = () => {
|
|
|
14
14
|
return _(e, a, {
|
|
15
15
|
proxyUrl: o
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
codeVerifier: r,
|
|
29
|
-
codeChallenge: c,
|
|
30
|
-
codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
|
|
31
|
-
}, t.searchParams.set("code_challenge", c), t.searchParams.set(
|
|
32
|
-
"code_challenge_method",
|
|
33
|
-
l.codeChallengeMethod
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
if (e["x-scalar-redirect-uri"].startsWith("/")) {
|
|
37
|
-
const r = i.url || window.location.origin + window.location.pathname, c = new URL(
|
|
38
|
-
e["x-scalar-redirect-uri"],
|
|
39
|
-
r
|
|
40
|
-
).toString();
|
|
41
|
-
t.searchParams.set("redirect_uri", c);
|
|
42
|
-
} else
|
|
43
|
-
t.searchParams.set("redirect_uri", e["x-scalar-redirect-uri"]);
|
|
44
|
-
t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", s), a && t.searchParams.set("scope", a);
|
|
45
|
-
const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
46
|
-
return n ? new Promise((r) => {
|
|
47
|
-
const c = setInterval(() => {
|
|
48
|
-
var m;
|
|
49
|
-
let u = null, h = null;
|
|
50
|
-
try {
|
|
51
|
-
const d = new URL(n.location.href).searchParams;
|
|
52
|
-
u = d.get("access_token"), h = d.get("code");
|
|
53
|
-
const g = new URLSearchParams(
|
|
54
|
-
n.location.href.split("#")[1]
|
|
55
|
-
);
|
|
56
|
-
u || (u = g.get("access_token")), h || (h = g.get("code"));
|
|
57
|
-
} catch {
|
|
58
|
-
}
|
|
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(
|
|
64
|
-
n.location.href
|
|
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([
|
|
70
|
-
new Error("Window was closed without granting authorization"),
|
|
71
|
-
null
|
|
72
|
-
]));
|
|
73
|
-
}, 200);
|
|
74
|
-
}) : [new Error("Failed to open auth window"), null];
|
|
17
|
+
const s = (Math.random() + 1).toString(36).substring(2, 10), t = new URL(e.authorizationUrl);
|
|
18
|
+
let l = null;
|
|
19
|
+
if (e.type === "implicit")
|
|
20
|
+
t.searchParams.set("response_type", "token");
|
|
21
|
+
else if (e.type === "authorizationCode" && (t.searchParams.set("response_type", "code"), e["x-usePkce"] !== "no")) {
|
|
22
|
+
const r = y(), c = await P(r, e["x-usePkce"]);
|
|
23
|
+
l = {
|
|
24
|
+
codeVerifier: r,
|
|
25
|
+
codeChallenge: c,
|
|
26
|
+
codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
|
|
27
|
+
}, t.searchParams.set("code_challenge", c), t.searchParams.set("code_challenge_method", l.codeChallengeMethod);
|
|
75
28
|
}
|
|
29
|
+
if (e["x-scalar-redirect-uri"].startsWith("/")) {
|
|
30
|
+
const r = i.url || window.location.origin + window.location.pathname, c = new URL(e["x-scalar-redirect-uri"], r).toString();
|
|
31
|
+
t.searchParams.set("redirect_uri", c);
|
|
32
|
+
} else
|
|
33
|
+
t.searchParams.set("redirect_uri", e["x-scalar-redirect-uri"]);
|
|
34
|
+
t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", s), a && t.searchParams.set("scope", a);
|
|
35
|
+
const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
36
|
+
return n ? new Promise((r) => {
|
|
37
|
+
const c = setInterval(() => {
|
|
38
|
+
var m;
|
|
39
|
+
let u = null, h = null;
|
|
40
|
+
try {
|
|
41
|
+
const d = new URL(n.location.href).searchParams;
|
|
42
|
+
u = d.get("access_token"), h = d.get("code");
|
|
43
|
+
const g = new URLSearchParams(n.location.href.split("#")[1]);
|
|
44
|
+
u || (u = g.get("access_token")), h || (h = g.get("code"));
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
if (n.closed || u || h)
|
|
48
|
+
if (clearInterval(c), n.close(), u) {
|
|
49
|
+
const d = (m = n.location.href.match(/state=([^&]*)/)) == null ? void 0 : m[1];
|
|
50
|
+
r(d === s ? [null, u] : [new Error("State mismatch"), null]);
|
|
51
|
+
} else h ? new URL(n.location.href).searchParams.get("state") === s ? _(e, a, {
|
|
52
|
+
code: h,
|
|
53
|
+
pkce: l,
|
|
54
|
+
proxyUrl: o
|
|
55
|
+
}).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(c), r([new Error("Window was closed without granting authorization"), null]));
|
|
56
|
+
}, 200);
|
|
57
|
+
}) : [new Error("Failed to open auth window"), null];
|
|
76
58
|
} catch {
|
|
77
59
|
return [new Error("Failed to authorize oauth2 flow"), null];
|
|
78
60
|
}
|
|
@@ -83,7 +65,7 @@ const y = () => {
|
|
|
83
65
|
} = {}) => {
|
|
84
66
|
if (!e) return [new Error("OAuth2 flow was not defined"), null];
|
|
85
67
|
const t = new URLSearchParams();
|
|
86
|
-
t.set("client_id", e["x-scalar-client-id"]), i && (e.type
|
|
68
|
+
t.set("client_id", e["x-scalar-client-id"]), i && (e.type === "clientCredentials" || e.type === "password") && 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");
|
|
87
69
|
try {
|
|
88
70
|
const l = {
|
|
89
71
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -96,12 +78,7 @@ const y = () => {
|
|
|
96
78
|
}), { access_token: r } = await n.json();
|
|
97
79
|
return [null, r];
|
|
98
80
|
} catch {
|
|
99
|
-
return [
|
|
100
|
-
new Error(
|
|
101
|
-
"Failed to get an access token. Please check your credentials."
|
|
102
|
-
),
|
|
103
|
-
null
|
|
104
|
-
];
|
|
81
|
+
return [new Error("Failed to get an access token. Please check your credentials."), null];
|
|
105
82
|
}
|
|
106
83
|
};
|
|
107
84
|
export {
|