@scalar/api-client 2.26.1 → 2.27.1
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 +102 -0
- package/dist/components/Server/ServerSelector.vue.js +6 -6
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +48 -43
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -10
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +101 -100
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +62 -69
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +6 -6
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +36 -2
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +38 -3
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +68 -69
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +35 -41
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +37 -41
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +107 -87
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -93
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +29 -37
- package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.d.ts +2 -2
- package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue2.js +45 -42
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +25 -24
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
- package/dist/v2/features/app/App.vue.d.ts +6 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +48 -46
- package/dist/v2/features/app/app-events.d.ts +1 -1
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +95 -56
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue2.js +111 -105
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +12 -2
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +12 -10
- package/dist/v2/features/app/helpers/routes.d.ts +3 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
- package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-theme.js +34 -0
- package/dist/v2/features/app/index.d.ts +0 -1
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +13 -12
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
- package/dist/v2/features/collection/components/Authentication.vue2.js +49 -40
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +27 -15
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +2 -2
- package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +93 -88
- package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.js +19 -17
- package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
- package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
- package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +15 -15
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +31 -34
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
- package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
- package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
- package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/components/Section.vue.js +26 -15
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
- package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +2 -2
- package/dist/v2/helpers/index.d.ts +0 -1
- package/dist/v2/helpers/index.d.ts.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
- package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.js +8 -6
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +10 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +139 -155
- 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 +104 -101
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +20 -18
- package/dist/v2/helpers/plugins.d.ts +0 -65
- package/dist/v2/helpers/plugins.d.ts.map +0 -1
- package/dist/v2/helpers/plugins.js +0 -11
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
import { pkceOptions as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as P, computed as C, ref as R, watch as I, createElementBlock as p, openBlock as m, Fragment as V, createVNode as r, unref as o, withCtx as l, createTextVNode as d, createElementVNode as S, createBlock as f, createCommentVNode as v } from "vue";
|
|
2
|
+
import { useLoadingState as L, ScalarButton as k } from "@scalar/components";
|
|
3
|
+
import { pkceOptions as F } from "@scalar/oas-utils/entities/spec";
|
|
4
|
+
import { useToasts as A } from "@scalar/use-toasts";
|
|
5
|
+
import N from "./OAuthScopesInput.vue.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { authorizeOauth2 as
|
|
8
|
-
import
|
|
7
|
+
import { authorizeOauth2 as h } from "../helpers/oauth.js";
|
|
8
|
+
import c from "./RequestAuthDataTableInput.vue.js";
|
|
9
9
|
import u from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
10
|
-
const
|
|
10
|
+
const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, E = { class: "flex h-8 w-full items-center justify-end border-t" }, q = /* @__PURE__ */ P({
|
|
11
11
|
__name: "OAuth2",
|
|
12
12
|
props: {
|
|
13
13
|
environment: {},
|
|
14
14
|
flows: {},
|
|
15
15
|
type: {},
|
|
16
16
|
selectedScopes: {},
|
|
17
|
+
scheme: {},
|
|
17
18
|
server: {},
|
|
18
19
|
proxyUrl: {},
|
|
19
20
|
name: {},
|
|
@@ -21,60 +22,66 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
21
22
|
},
|
|
22
23
|
emits: ["update:selectedScopes"],
|
|
23
24
|
setup(t, { emit: g }) {
|
|
24
|
-
const
|
|
25
|
-
() => t.selectedScopes.filter((
|
|
26
|
-
),
|
|
25
|
+
const z = g, y = L(), { toast: B } = A(), a = C(() => t.flows[t.type]), U = C(
|
|
26
|
+
() => t.selectedScopes.filter((s) => s in (a.value.scopes ?? {}))
|
|
27
|
+
), x = (s) => {
|
|
28
|
+
if (t.scheme.type === "openIdConnect")
|
|
29
|
+
return i(s);
|
|
30
|
+
t.eventBus.emit("auth:update:security-scheme", {
|
|
31
|
+
payload: {
|
|
32
|
+
type: t.scheme.type,
|
|
33
|
+
flows: {
|
|
34
|
+
[t.type]: s
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
name: t.name
|
|
38
|
+
});
|
|
39
|
+
}, i = (s) => t.eventBus.emit("auth:update:security-scheme-secrets", {
|
|
27
40
|
payload: {
|
|
28
|
-
type:
|
|
29
|
-
|
|
30
|
-
[t.type]: d
|
|
31
|
-
}
|
|
41
|
+
type: t.scheme.type,
|
|
42
|
+
[t.type]: s
|
|
32
43
|
},
|
|
33
44
|
name: t.name
|
|
34
|
-
}),
|
|
35
|
-
payload: {
|
|
36
|
-
type: "oauth2",
|
|
37
|
-
[t.type]: d
|
|
38
|
-
},
|
|
45
|
+
}), T = () => t.eventBus.emit("auth:clear:security-scheme-secrets", {
|
|
39
46
|
name: t.name
|
|
40
|
-
});
|
|
41
|
-
|
|
47
|
+
}), w = R(!1);
|
|
48
|
+
I(
|
|
42
49
|
() => a.value["x-scalar-secret-redirect-uri"],
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
"x-scalar-secret-redirect-uri": window.location.origin
|
|
46
|
-
});
|
|
50
|
+
(s) => {
|
|
51
|
+
w.value || s || typeof window > "u" || !("x-scalar-secret-redirect-uri" in a.value) || (w.value = !0, i({
|
|
52
|
+
"x-scalar-secret-redirect-uri": window.location.origin
|
|
53
|
+
}));
|
|
47
54
|
},
|
|
48
55
|
{ immediate: !0 }
|
|
49
56
|
);
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
57
|
+
const b = async () => {
|
|
58
|
+
if (y.isLoading)
|
|
52
59
|
return;
|
|
53
|
-
|
|
54
|
-
const [
|
|
60
|
+
y.start();
|
|
61
|
+
const [s, e] = await h(
|
|
55
62
|
t.flows,
|
|
56
63
|
t.type,
|
|
57
|
-
|
|
64
|
+
U.value,
|
|
58
65
|
t.server,
|
|
59
66
|
t.proxyUrl
|
|
60
67
|
);
|
|
61
|
-
await
|
|
62
|
-
},
|
|
63
|
-
"x-scalar-credentials-location":
|
|
68
|
+
await y.clear(), e ? i({ "x-scalar-secret-token": e }) : (console.error(s), B(s?.message ?? "Failed to authorize", "error"));
|
|
69
|
+
}, O = (s) => x({
|
|
70
|
+
"x-scalar-credentials-location": s === "body" ? "body" : "header"
|
|
64
71
|
});
|
|
65
|
-
return (
|
|
72
|
+
return (s, e) => a.value["x-scalar-secret-token"] ? (m(), p(V, { key: 0 }, [
|
|
66
73
|
r(o(u), null, {
|
|
67
74
|
default: l(() => [
|
|
68
|
-
r(
|
|
75
|
+
r(c, {
|
|
69
76
|
class: "border-r-transparent",
|
|
70
77
|
environment: t.environment,
|
|
71
78
|
modelValue: a.value["x-scalar-secret-token"],
|
|
72
79
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
73
80
|
type: "password",
|
|
74
|
-
"onUpdate:modelValue": e[0] || (e[0] = (n) =>
|
|
81
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => i({ "x-scalar-secret-token": n }))
|
|
75
82
|
}, {
|
|
76
83
|
default: l(() => [...e[12] || (e[12] = [
|
|
77
|
-
|
|
84
|
+
d(" Access Token ", -1)
|
|
78
85
|
])]),
|
|
79
86
|
_: 1
|
|
80
87
|
}, 8, ["environment", "modelValue"])
|
|
@@ -83,16 +90,16 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
83
90
|
}),
|
|
84
91
|
r(o(u), { class: "min-w-full" }, {
|
|
85
92
|
default: l(() => [
|
|
86
|
-
|
|
87
|
-
r(o(
|
|
93
|
+
S("div", j, [
|
|
94
|
+
r(o(k), {
|
|
88
95
|
class: "mr-1 p-0 px-2 py-0.5",
|
|
89
|
-
loader: o(
|
|
96
|
+
loader: o(y),
|
|
90
97
|
size: "sm",
|
|
91
98
|
variant: "outlined",
|
|
92
|
-
onClick: e[1] || (e[1] = () =>
|
|
99
|
+
onClick: e[1] || (e[1] = () => i({ "x-scalar-secret-token": "" }))
|
|
93
100
|
}, {
|
|
94
101
|
default: l(() => [...e[13] || (e[13] = [
|
|
95
|
-
|
|
102
|
+
d(" Clear ", -1)
|
|
96
103
|
])]),
|
|
97
104
|
_: 1
|
|
98
105
|
}, 8, ["loader"])
|
|
@@ -100,65 +107,65 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
100
107
|
]),
|
|
101
108
|
_: 1
|
|
102
109
|
})
|
|
103
|
-
], 64)) : (
|
|
110
|
+
], 64)) : (m(), p(V, { key: 1 }, [
|
|
104
111
|
r(o(u), null, {
|
|
105
112
|
default: l(() => [
|
|
106
|
-
"authorizationUrl" in a.value ? (
|
|
113
|
+
"authorizationUrl" in a.value ? (m(), f(c, {
|
|
107
114
|
key: 0,
|
|
108
115
|
containerClass: "border-r-0",
|
|
109
116
|
environment: t.environment,
|
|
110
117
|
modelValue: a.value.authorizationUrl,
|
|
111
118
|
placeholder: "https://galaxy.scalar.com/authorize",
|
|
112
|
-
"onUpdate:modelValue": e[2] || (e[2] = (n) =>
|
|
119
|
+
"onUpdate:modelValue": e[2] || (e[2] = (n) => x({ authorizationUrl: n }))
|
|
113
120
|
}, {
|
|
114
121
|
default: l(() => [...e[14] || (e[14] = [
|
|
115
|
-
|
|
122
|
+
d(" Auth URL ", -1)
|
|
116
123
|
])]),
|
|
117
124
|
_: 1
|
|
118
125
|
}, 8, ["environment", "modelValue"])) : v("", !0),
|
|
119
|
-
"tokenUrl" in a.value ? (
|
|
126
|
+
"tokenUrl" in a.value ? (m(), f(c, {
|
|
120
127
|
key: 1,
|
|
121
128
|
environment: t.environment,
|
|
122
129
|
modelValue: a.value.tokenUrl,
|
|
123
130
|
placeholder: "https://galaxy.scalar.com/token",
|
|
124
|
-
"onUpdate:modelValue": e[3] || (e[3] = (n) =>
|
|
131
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => x({ tokenUrl: n }))
|
|
125
132
|
}, {
|
|
126
133
|
default: l(() => [...e[15] || (e[15] = [
|
|
127
|
-
|
|
134
|
+
d(" Token URL ", -1)
|
|
128
135
|
])]),
|
|
129
136
|
_: 1
|
|
130
137
|
}, 8, ["environment", "modelValue"])) : v("", !0)
|
|
131
138
|
]),
|
|
132
139
|
_: 1
|
|
133
140
|
}),
|
|
134
|
-
"x-scalar-secret-redirect-uri" in a.value ? (
|
|
141
|
+
"x-scalar-secret-redirect-uri" in a.value ? (m(), f(o(u), { key: 0 }, {
|
|
135
142
|
default: l(() => [
|
|
136
|
-
r(
|
|
143
|
+
r(c, {
|
|
137
144
|
environment: t.environment,
|
|
138
145
|
modelValue: a.value["x-scalar-secret-redirect-uri"],
|
|
139
146
|
placeholder: "https://galaxy.scalar.com/callback",
|
|
140
|
-
"onUpdate:modelValue": e[4] || (e[4] = (n) =>
|
|
147
|
+
"onUpdate:modelValue": e[4] || (e[4] = (n) => i({ "x-scalar-secret-redirect-uri": n }))
|
|
141
148
|
}, {
|
|
142
149
|
default: l(() => [...e[16] || (e[16] = [
|
|
143
|
-
|
|
150
|
+
d(" Redirect URL ", -1)
|
|
144
151
|
])]),
|
|
145
152
|
_: 1
|
|
146
153
|
}, 8, ["environment", "modelValue"])
|
|
147
154
|
]),
|
|
148
155
|
_: 1
|
|
149
156
|
})) : v("", !0),
|
|
150
|
-
"x-scalar-secret-username" in a.value && "x-scalar-secret-password" in a.value ? (
|
|
157
|
+
"x-scalar-secret-username" in a.value && "x-scalar-secret-password" in a.value ? (m(), p(V, { key: 1 }, [
|
|
151
158
|
r(o(u), null, {
|
|
152
159
|
default: l(() => [
|
|
153
|
-
r(
|
|
160
|
+
r(c, {
|
|
154
161
|
class: "text-c-2",
|
|
155
162
|
environment: t.environment,
|
|
156
163
|
modelValue: a.value["x-scalar-secret-username"],
|
|
157
164
|
placeholder: "janedoe",
|
|
158
|
-
"onUpdate:modelValue": e[5] || (e[5] = (n) =>
|
|
165
|
+
"onUpdate:modelValue": e[5] || (e[5] = (n) => i({ "x-scalar-secret-username": n }))
|
|
159
166
|
}, {
|
|
160
167
|
default: l(() => [...e[17] || (e[17] = [
|
|
161
|
-
|
|
168
|
+
d(" Username ", -1)
|
|
162
169
|
])]),
|
|
163
170
|
_: 1
|
|
164
171
|
}, 8, ["environment", "modelValue"])
|
|
@@ -167,15 +174,15 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
167
174
|
}),
|
|
168
175
|
r(o(u), null, {
|
|
169
176
|
default: l(() => [
|
|
170
|
-
r(
|
|
177
|
+
r(c, {
|
|
171
178
|
environment: t.environment,
|
|
172
179
|
modelValue: a.value["x-scalar-secret-password"],
|
|
173
180
|
placeholder: "********",
|
|
174
181
|
type: "password",
|
|
175
|
-
"onUpdate:modelValue": e[6] || (e[6] = (n) =>
|
|
182
|
+
"onUpdate:modelValue": e[6] || (e[6] = (n) => i({ "x-scalar-secret-password": n }))
|
|
176
183
|
}, {
|
|
177
184
|
default: l(() => [...e[18] || (e[18] = [
|
|
178
|
-
|
|
185
|
+
d(" Password ", -1)
|
|
179
186
|
])]),
|
|
180
187
|
_: 1
|
|
181
188
|
}, 8, ["environment", "modelValue"])
|
|
@@ -185,68 +192,68 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
185
192
|
], 64)) : v("", !0),
|
|
186
193
|
r(o(u), null, {
|
|
187
194
|
default: l(() => [
|
|
188
|
-
r(
|
|
195
|
+
r(c, {
|
|
189
196
|
environment: t.environment,
|
|
190
197
|
modelValue: a.value["x-scalar-secret-client-id"],
|
|
191
198
|
placeholder: "12345",
|
|
192
|
-
"onUpdate:modelValue": e[7] || (e[7] = (n) =>
|
|
199
|
+
"onUpdate:modelValue": e[7] || (e[7] = (n) => i({ "x-scalar-secret-client-id": n }))
|
|
193
200
|
}, {
|
|
194
201
|
default: l(() => [...e[19] || (e[19] = [
|
|
195
|
-
|
|
202
|
+
d(" Client ID ", -1)
|
|
196
203
|
])]),
|
|
197
204
|
_: 1
|
|
198
205
|
}, 8, ["environment", "modelValue"])
|
|
199
206
|
]),
|
|
200
207
|
_: 1
|
|
201
208
|
}),
|
|
202
|
-
"x-scalar-secret-client-secret" in a.value ? (
|
|
209
|
+
"x-scalar-secret-client-secret" in a.value ? (m(), f(o(u), { key: 2 }, {
|
|
203
210
|
default: l(() => [
|
|
204
|
-
r(
|
|
211
|
+
r(c, {
|
|
205
212
|
environment: t.environment,
|
|
206
213
|
modelValue: a.value["x-scalar-secret-client-secret"],
|
|
207
214
|
placeholder: "XYZ123",
|
|
208
215
|
type: "password",
|
|
209
|
-
"onUpdate:modelValue": e[8] || (e[8] = (n) =>
|
|
216
|
+
"onUpdate:modelValue": e[8] || (e[8] = (n) => i({ "x-scalar-secret-client-secret": n }))
|
|
210
217
|
}, {
|
|
211
218
|
default: l(() => [...e[20] || (e[20] = [
|
|
212
|
-
|
|
219
|
+
d(" Client Secret ", -1)
|
|
213
220
|
])]),
|
|
214
221
|
_: 1
|
|
215
222
|
}, 8, ["environment", "modelValue"])
|
|
216
223
|
]),
|
|
217
224
|
_: 1
|
|
218
225
|
})) : v("", !0),
|
|
219
|
-
"x-usePkce" in a.value ? (
|
|
226
|
+
"x-usePkce" in a.value ? (m(), f(o(u), { key: 3 }, {
|
|
220
227
|
default: l(() => [
|
|
221
|
-
r(
|
|
222
|
-
enum: o(
|
|
228
|
+
r(c, {
|
|
229
|
+
enum: o(F),
|
|
223
230
|
environment: t.environment,
|
|
224
231
|
modelValue: a.value["x-usePkce"],
|
|
225
232
|
readOnly: "",
|
|
226
|
-
"onUpdate:modelValue": e[9] || (e[9] = (n) =>
|
|
233
|
+
"onUpdate:modelValue": e[9] || (e[9] = (n) => x({
|
|
227
234
|
"x-usePkce": n
|
|
228
235
|
}))
|
|
229
236
|
}, {
|
|
230
237
|
default: l(() => [...e[21] || (e[21] = [
|
|
231
|
-
|
|
238
|
+
d(" Use PKCE ", -1)
|
|
232
239
|
])]),
|
|
233
240
|
_: 1
|
|
234
241
|
}, 8, ["enum", "environment", "modelValue"])
|
|
235
242
|
]),
|
|
236
243
|
_: 1
|
|
237
244
|
})) : v("", !0),
|
|
238
|
-
t.type !== "implicit" ? (
|
|
245
|
+
t.type !== "implicit" ? (m(), f(o(u), { key: 4 }, {
|
|
239
246
|
default: l(() => [
|
|
240
|
-
r(
|
|
247
|
+
r(c, {
|
|
241
248
|
enum: ["header", "body"],
|
|
242
249
|
environment: t.environment,
|
|
243
250
|
modelValue: a.value["x-scalar-credentials-location"] || "header",
|
|
244
251
|
placeholder: "header",
|
|
245
252
|
readOnly: "",
|
|
246
|
-
"onUpdate:modelValue": e[10] || (e[10] = (n) =>
|
|
253
|
+
"onUpdate:modelValue": e[10] || (e[10] = (n) => O(n))
|
|
247
254
|
}, {
|
|
248
255
|
default: l(() => [...e[22] || (e[22] = [
|
|
249
|
-
|
|
256
|
+
d(" Credentials Location ", -1)
|
|
250
257
|
])]),
|
|
251
258
|
_: 1
|
|
252
259
|
}, 8, ["environment", "modelValue"])
|
|
@@ -255,27 +262,40 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
255
262
|
})) : v("", !0),
|
|
256
263
|
r(o(u), null, {
|
|
257
264
|
default: l(() => [
|
|
258
|
-
r(
|
|
265
|
+
r(N, {
|
|
259
266
|
flow: a.value,
|
|
260
267
|
flowType: t.type,
|
|
261
|
-
selectedScopes:
|
|
262
|
-
"onUpdate:selectedScopes": e[11] || (e[11] = (n) =>
|
|
268
|
+
selectedScopes: U.value,
|
|
269
|
+
"onUpdate:selectedScopes": e[11] || (e[11] = (n) => z("update:selectedScopes", n))
|
|
263
270
|
}, null, 8, ["flow", "flowType", "selectedScopes"])
|
|
264
271
|
]),
|
|
265
272
|
_: 1
|
|
266
273
|
}),
|
|
267
274
|
r(o(u), { class: "min-w-full" }, {
|
|
268
275
|
default: l(() => [
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
S("div", E, [
|
|
277
|
+
t.scheme.type === "openIdConnect" ? (m(), f(o(k), {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: "mr-1 p-0 px-2 py-0.5",
|
|
280
|
+
loader: o(y),
|
|
273
281
|
size: "sm",
|
|
274
282
|
variant: "outlined",
|
|
275
|
-
onClick:
|
|
283
|
+
onClick: T
|
|
276
284
|
}, {
|
|
277
285
|
default: l(() => [...e[23] || (e[23] = [
|
|
278
|
-
|
|
286
|
+
d(" Clear ", -1)
|
|
287
|
+
])]),
|
|
288
|
+
_: 1
|
|
289
|
+
}, 8, ["loader"])) : v("", !0),
|
|
290
|
+
r(o(k), {
|
|
291
|
+
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
292
|
+
loader: o(y),
|
|
293
|
+
size: "sm",
|
|
294
|
+
variant: "outlined",
|
|
295
|
+
onClick: b
|
|
296
|
+
}, {
|
|
297
|
+
default: l(() => [...e[24] || (e[24] = [
|
|
298
|
+
d(" Authorize ", -1)
|
|
279
299
|
])]),
|
|
280
300
|
_: 1
|
|
281
301
|
}, 8, ["loader"])
|
|
@@ -287,5 +307,5 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
287
307
|
}
|
|
288
308
|
});
|
|
289
309
|
export {
|
|
290
|
-
|
|
310
|
+
q as default
|
|
291
311
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
|
+
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
3
|
+
import { type OpenIdConnectObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** Current environment configuration */
|
|
6
|
+
environment: XScalarEnvironment;
|
|
7
|
+
/** Event bus for authentication updates */
|
|
8
|
+
eventBus: WorkspaceEventBus;
|
|
9
|
+
/** Get the static border class */
|
|
10
|
+
getStaticBorderClass: () => string | false;
|
|
11
|
+
/** Name of the security scheme */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Proxy URL */
|
|
14
|
+
proxyUrl: string;
|
|
15
|
+
/** OpenID Connect scheme */
|
|
16
|
+
scheme: OpenIdConnectObject;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=OpenIDConnect.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenIDConnect.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue"],"names":[],"mappings":"AA4GA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAQvG,KAAK,WAAW,GAAG;IACf,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kCAAkC;IAClC,oBAAoB,EAAE,MAAM,MAAM,GAAG,KAAK,CAAA;IAC1C,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,MAAM,EAAE,mBAAmB,CAAA;CAC5B,CAAC;AA0KJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent as f, createElementBlock as p, openBlock as C, Fragment as h, createVNode as r, unref as a, withCtx as l, createTextVNode as c, createElementVNode as y } from "vue";
|
|
2
|
+
import { useLoadingState as v, ScalarButton as I } from "@scalar/components";
|
|
3
|
+
import { useToasts as U } from "@scalar/use-toasts";
|
|
4
|
+
import { fetchOpenIDConnectDiscovery as w } from "../helpers/fetch-openid-connect-discovery.js";
|
|
5
|
+
import { openIDDiscoveryToFlows as g } from "../helpers/openid-discovery-to-flows.js";
|
|
6
|
+
import x from "./RequestAuthDataTableInput.vue.js";
|
|
7
|
+
import i from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
8
|
+
const B = { class: "flex h-8 w-full items-center justify-end border-t" }, T = /* @__PURE__ */ f({
|
|
9
|
+
__name: "OpenIDConnect",
|
|
10
|
+
props: {
|
|
11
|
+
environment: {},
|
|
12
|
+
eventBus: {},
|
|
13
|
+
getStaticBorderClass: { type: Function },
|
|
14
|
+
name: {},
|
|
15
|
+
proxyUrl: {},
|
|
16
|
+
scheme: {}
|
|
17
|
+
},
|
|
18
|
+
setup(e) {
|
|
19
|
+
const o = v(), { toast: s } = U(), d = async () => {
|
|
20
|
+
if (o.isLoading || !e.scheme.openIdConnectUrl)
|
|
21
|
+
return;
|
|
22
|
+
o.start();
|
|
23
|
+
const [n, t] = await w(
|
|
24
|
+
e.scheme.openIdConnectUrl,
|
|
25
|
+
e.proxyUrl
|
|
26
|
+
);
|
|
27
|
+
if (await o.clear(), n) {
|
|
28
|
+
console.error(n), s(
|
|
29
|
+
n?.message ?? "Failed to fetch OpenID Connect configuration",
|
|
30
|
+
"error"
|
|
31
|
+
);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const u = g(t);
|
|
35
|
+
e.eventBus.emit("auth:update:security-scheme-secrets", {
|
|
36
|
+
payload: u,
|
|
37
|
+
name: e.name,
|
|
38
|
+
overwrite: !0
|
|
39
|
+
});
|
|
40
|
+
}, m = (n) => e.eventBus.emit("auth:update:security-scheme", {
|
|
41
|
+
payload: {
|
|
42
|
+
type: "openIdConnect",
|
|
43
|
+
openIdConnectUrl: n
|
|
44
|
+
},
|
|
45
|
+
name: e.name
|
|
46
|
+
});
|
|
47
|
+
return (n, t) => (C(), p(h, null, [
|
|
48
|
+
r(a(i), null, {
|
|
49
|
+
default: l(() => [
|
|
50
|
+
r(x, {
|
|
51
|
+
containerClass: e.getStaticBorderClass(),
|
|
52
|
+
environment: e.environment,
|
|
53
|
+
modelValue: e.scheme.openIdConnectUrl,
|
|
54
|
+
placeholder: "https://example.com/.well-known/openid-configuration",
|
|
55
|
+
required: "",
|
|
56
|
+
"onUpdate:modelValue": m
|
|
57
|
+
}, {
|
|
58
|
+
default: l(() => [...t[0] || (t[0] = [
|
|
59
|
+
c(" Discovery URL ", -1)
|
|
60
|
+
])]),
|
|
61
|
+
_: 1
|
|
62
|
+
}, 8, ["containerClass", "environment", "modelValue"])
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
}),
|
|
66
|
+
r(a(i), { class: "min-w-full" }, {
|
|
67
|
+
default: l(() => [
|
|
68
|
+
y("div", B, [
|
|
69
|
+
r(a(I), {
|
|
70
|
+
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
71
|
+
disabled: !e.scheme.openIdConnectUrl,
|
|
72
|
+
loader: a(o),
|
|
73
|
+
size: "sm",
|
|
74
|
+
variant: "outlined",
|
|
75
|
+
onClick: d
|
|
76
|
+
}, {
|
|
77
|
+
default: l(() => [...t[1] || (t[1] = [
|
|
78
|
+
c(" Fetch Configuration ", -1)
|
|
79
|
+
])]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["disabled", "loader"])
|
|
82
|
+
])
|
|
83
|
+
]),
|
|
84
|
+
_: 1
|
|
85
|
+
})
|
|
86
|
+
], 64));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
T as default
|
|
91
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"AAgXA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAEV,yBAAyB,EACzB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAcnF,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,uBAAuB,EAAE,yBAAyB,CAAA;IAClD,oGAAoG;IACpG,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AAkoBF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|