@scalar/api-client 2.10.0 → 2.11.0
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 +25 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +1 -0
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.js +6 -6
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +14 -13
- package/dist/hooks/useClientConfig.d.ts +3 -3
- package/dist/layouts/App/create-api-client-app.d.ts +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +1 -1
- package/dist/libs/create-client.d.ts +1 -1
- package/dist/store/store.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -6
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +24 -27
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +3 -6
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -12
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +11 -10
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -5
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +45 -47
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +11 -9
- 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 +179 -5
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +2 -179
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +201 -198
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +11 -6
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +82 -5
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +2 -85
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +3 -13
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +16 -18
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +133 -142
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -1
- package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts +2 -16
- package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.js +2 -2
- package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue2.js +202 -229
- package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts +3 -5
- package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.js +2 -2
- package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue2.js +81 -85
- package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts +2 -5
- package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.js +32 -34
- package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts +2 -5
- package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.js +2 -2
- package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue2.js +31 -33
- package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts +2 -5
- package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.js +42 -45
- package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-response-block/components/Headers.vue.js +9 -9
- package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.js +2 -2
- package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue2.js +18 -18
- package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.js +14 -14
- package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.js +12 -12
- package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.js +13 -13
- package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTable.vue.js +4 -4
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +5 -7
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
- package/dist/v2/components/data-table/DataTableInput.vue2.js +32 -36
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +25 -0
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -0
- package/dist/v2/components/forms/ConfirmationForm.vue.js +7 -0
- package/dist/v2/components/forms/ConfirmationForm.vue2.js +45 -0
- package/dist/v2/components/forms/index.d.ts +2 -0
- package/dist/v2/components/forms/index.d.ts.map +1 -0
- package/dist/v2/components/forms/index.js +4 -0
- package/dist/v2/components/layout/CollapsibleSection.vue.d.ts +43 -0
- package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -0
- package/dist/v2/components/layout/CollapsibleSection.vue.js +89 -0
- package/dist/v2/components/layout/CollapsibleSection.vue2.js +4 -0
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts +23 -0
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -0
- package/dist/v2/components/layout/ValueEmitter.vue.js +21 -0
- package/dist/v2/components/layout/ValueEmitter.vue2.js +4 -0
- package/dist/v2/components/layout/index.d.ts +2 -0
- package/dist/v2/components/layout/index.d.ts.map +1 -0
- package/dist/v2/components/layout/index.js +4 -0
- package/dist/v2/components/modals/DeleteModal.vue.d.ts +15 -0
- package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -0
- package/dist/v2/components/modals/DeleteModal.vue.js +31 -0
- package/dist/v2/components/modals/DeleteModal.vue2.js +4 -0
- package/dist/v2/components/modals/index.d.ts +2 -0
- package/dist/v2/components/modals/index.d.ts.map +1 -0
- package/dist/v2/components/modals/index.js +4 -0
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +4 -2
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.js +31 -31
- package/dist/v2/components/server/ServerDropdownItem.vue.d.ts +2 -6
- package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue2.js +16 -16
- package/dist/v2/components/server/index.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +6 -2
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +45 -55
- package/dist/v2/features/app/App.vue.d.ts +2 -2
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +89 -74
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -2
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +50 -47
- package/dist/v2/features/app/helpers/routes.d.ts +0 -10
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue2.js +75 -73
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +13 -25
- 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 +47 -35
- package/dist/v2/features/collection/components/Form.vue.d.ts +3 -7
- package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Form.vue.js +28 -33
- package/dist/v2/features/collection/components/Servers.vue.d.ts +13 -31
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue2.js +103 -82
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +3 -3
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +3 -3
- package/dist/v2/features/modal/Modal.vue2.js +40 -32
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +22 -28
- package/dist/v2/hooks/use-sidebar-state.d.ts +47 -0
- package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -0
- package/dist/v2/hooks/use-sidebar-state.js +112 -0
- package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
- package/dist/v2/hooks/use-workspace-client-events.js +75 -107
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +17 -17
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +0 -45
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +0 -29
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts +0 -29
- package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts.map +0 -1
|
@@ -1,240 +1,243 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
import { pkceOptions as
|
|
4
|
-
import { useToasts as
|
|
1
|
+
import { defineComponent as z, computed as C, createElementBlock as k, openBlock as i, Fragment as V, createVNode as o, unref as r, withCtx as l, createTextVNode as u, createElementVNode as x, createBlock as v, createCommentVNode as f } from "vue";
|
|
2
|
+
import { useLoadingState as T, ScalarButton as U } from "@scalar/components";
|
|
3
|
+
import { pkceOptions as b } from "@scalar/oas-utils/entities/spec";
|
|
4
|
+
import { useToasts as B } from "@scalar/use-toasts";
|
|
5
5
|
import L from "./OAuthScopesInput.vue.js";
|
|
6
|
-
import { authorizeOauth2 as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
6
|
+
import { authorizeOauth2 as P } from "../helpers/oauth.js";
|
|
7
|
+
import m from "./RequestAuthDataTableInput.vue.js";
|
|
8
|
+
import d from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
9
|
+
const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { class: "flex h-8 w-full items-center justify-end border-t" }, M = /* @__PURE__ */ z({
|
|
10
10
|
__name: "OAuth2",
|
|
11
11
|
props: {
|
|
12
12
|
environment: {},
|
|
13
|
-
envVariables: {},
|
|
14
13
|
flows: {},
|
|
15
14
|
type: {},
|
|
16
15
|
selectedScopes: {},
|
|
17
16
|
server: {},
|
|
18
17
|
proxyUrl: {}
|
|
19
18
|
},
|
|
20
|
-
emits: ["update:
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
U("No server selected", "error");
|
|
27
|
-
return;
|
|
19
|
+
emits: ["update:securityScheme", "update:selectedScopes"],
|
|
20
|
+
setup(p, { emit: w }) {
|
|
21
|
+
const y = w, c = T(), { toast: g } = B(), t = C(() => p.flows[p.type]), s = (a) => y("update:securityScheme", {
|
|
22
|
+
type: "oauth2",
|
|
23
|
+
flows: {
|
|
24
|
+
[p.type]: a
|
|
28
25
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
return (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
r
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
])]),
|
|
74
|
-
_: 1
|
|
75
|
-
}, 8, ["loading"])
|
|
76
|
-
])
|
|
77
|
-
]),
|
|
78
|
-
_: 1
|
|
79
|
-
})
|
|
80
|
-
], 64)) : (u(), v(x, { key: 1 }, [
|
|
81
|
-
r(o(n), null, {
|
|
82
|
-
default: l(() => [
|
|
83
|
-
"authorizationUrl" in t.value ? (u(), y(c, p({ key: 0 }, m, {
|
|
84
|
-
containerClass: "border-r-0",
|
|
85
|
-
modelValue: t.value.authorizationUrl,
|
|
86
|
-
placeholder: "https://galaxy.scalar.com/authorize",
|
|
87
|
-
"onUpdate:modelValue": e[2] || (e[2] = (a) => s("update:securityScheme", { authUrl: a }))
|
|
88
|
-
}), {
|
|
89
|
-
default: l(() => [...e[13] || (e[13] = [
|
|
90
|
-
d(" Auth URL ", -1)
|
|
91
|
-
])]),
|
|
92
|
-
_: 1
|
|
93
|
-
}, 16, ["modelValue"])) : f("", !0),
|
|
94
|
-
"tokenUrl" in t.value ? (u(), y(c, p({ key: 1 }, m, {
|
|
95
|
-
modelValue: t.value.tokenUrl,
|
|
96
|
-
placeholder: "https://galaxy.scalar.com/token",
|
|
97
|
-
"onUpdate:modelValue": e[3] || (e[3] = (a) => s("update:securityScheme", { tokenUrl: a }))
|
|
98
|
-
}), {
|
|
99
|
-
default: l(() => [...e[14] || (e[14] = [
|
|
100
|
-
d(" Token URL ", -1)
|
|
101
|
-
])]),
|
|
102
|
-
_: 1
|
|
103
|
-
}, 16, ["modelValue"])) : f("", !0)
|
|
104
|
-
]),
|
|
105
|
-
_: 1
|
|
106
|
-
}),
|
|
107
|
-
"x-scalar-secret-redirect-uri" in t.value ? (u(), y(o(n), { key: 0 }, {
|
|
108
|
-
default: l(() => [
|
|
109
|
-
r(c, p(m, {
|
|
110
|
-
modelValue: t.value["x-scalar-secret-redirect-uri"],
|
|
111
|
-
placeholder: "https://galaxy.scalar.com/callback",
|
|
112
|
-
"onUpdate:modelValue": e[4] || (e[4] = (a) => s("update:securityScheme", { redirectUrl: a }))
|
|
113
|
-
}), {
|
|
114
|
-
default: l(() => [...e[15] || (e[15] = [
|
|
115
|
-
d(" Redirect URL ", -1)
|
|
26
|
+
}), S = async () => {
|
|
27
|
+
if (c.isLoading)
|
|
28
|
+
return;
|
|
29
|
+
c.startLoading();
|
|
30
|
+
const [a, e] = await P(
|
|
31
|
+
p.flows,
|
|
32
|
+
p.type,
|
|
33
|
+
p.selectedScopes,
|
|
34
|
+
p.server,
|
|
35
|
+
p.proxyUrl
|
|
36
|
+
).finally(() => c.stopLoading());
|
|
37
|
+
e ? s({ "x-scalar-secret-token": e }) : (console.error(a), g(a?.message ?? "Failed to authorize", "error"));
|
|
38
|
+
};
|
|
39
|
+
return (a, e) => t.value["x-scalar-secret-token"] ? (i(), k(V, { key: 0 }, [
|
|
40
|
+
o(r(d), null, {
|
|
41
|
+
default: l(() => [
|
|
42
|
+
o(m, {
|
|
43
|
+
class: "border-r-transparent",
|
|
44
|
+
environment: a.environment,
|
|
45
|
+
modelValue: t.value["x-scalar-secret-token"],
|
|
46
|
+
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
47
|
+
type: "password",
|
|
48
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => s({ "x-scalar-secret-token": n }))
|
|
49
|
+
}, {
|
|
50
|
+
default: l(() => [...e[11] || (e[11] = [
|
|
51
|
+
u(" Access Token ", -1)
|
|
52
|
+
])]),
|
|
53
|
+
_: 1
|
|
54
|
+
}, 8, ["environment", "modelValue"])
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
}),
|
|
58
|
+
o(r(d), { class: "min-w-full" }, {
|
|
59
|
+
default: l(() => [
|
|
60
|
+
x("div", R, [
|
|
61
|
+
o(r(U), {
|
|
62
|
+
class: "mr-1 p-0 px-2 py-0.5",
|
|
63
|
+
loading: r(c),
|
|
64
|
+
size: "sm",
|
|
65
|
+
variant: "outlined",
|
|
66
|
+
onClick: e[1] || (e[1] = () => s({ "x-scalar-secret-token": "" }))
|
|
67
|
+
}, {
|
|
68
|
+
default: l(() => [...e[12] || (e[12] = [
|
|
69
|
+
u(" Clear ", -1)
|
|
116
70
|
])]),
|
|
117
71
|
_: 1
|
|
118
|
-
},
|
|
119
|
-
])
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
]),
|
|
72
|
+
}, 8, ["loading"])
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
})
|
|
77
|
+
], 64)) : (i(), k(V, { key: 1 }, [
|
|
78
|
+
o(r(d), null, {
|
|
79
|
+
default: l(() => [
|
|
80
|
+
"authorizationUrl" in t.value ? (i(), v(m, {
|
|
81
|
+
key: 0,
|
|
82
|
+
containerClass: "border-r-0",
|
|
83
|
+
environment: a.environment,
|
|
84
|
+
modelValue: t.value.authorizationUrl,
|
|
85
|
+
placeholder: "https://galaxy.scalar.com/authorize",
|
|
86
|
+
"onUpdate:modelValue": e[2] || (e[2] = (n) => s({ authorizationUrl: n }))
|
|
87
|
+
}, {
|
|
88
|
+
default: l(() => [...e[13] || (e[13] = [
|
|
89
|
+
u(" Auth URL ", -1)
|
|
90
|
+
])]),
|
|
137
91
|
_: 1
|
|
138
|
-
}),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
])]),
|
|
150
|
-
_: 1
|
|
151
|
-
}, 16, ["modelValue"])
|
|
152
|
-
]),
|
|
92
|
+
}, 8, ["environment", "modelValue"])) : f("", !0),
|
|
93
|
+
"tokenUrl" in t.value ? (i(), v(m, {
|
|
94
|
+
key: 1,
|
|
95
|
+
environment: a.environment,
|
|
96
|
+
modelValue: t.value.tokenUrl,
|
|
97
|
+
placeholder: "https://galaxy.scalar.com/token",
|
|
98
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => s({ tokenUrl: n }))
|
|
99
|
+
}, {
|
|
100
|
+
default: l(() => [...e[14] || (e[14] = [
|
|
101
|
+
u(" Token URL ", -1)
|
|
102
|
+
])]),
|
|
153
103
|
_: 1
|
|
154
|
-
})
|
|
155
|
-
]
|
|
156
|
-
|
|
104
|
+
}, 8, ["environment", "modelValue"])) : f("", !0)
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
}),
|
|
108
|
+
"x-scalar-secret-redirect-uri" in t.value ? (i(), v(r(d), { key: 0 }, {
|
|
109
|
+
default: l(() => [
|
|
110
|
+
o(m, {
|
|
111
|
+
environment: a.environment,
|
|
112
|
+
modelValue: t.value["x-scalar-secret-redirect-uri"],
|
|
113
|
+
placeholder: "https://galaxy.scalar.com/callback",
|
|
114
|
+
"onUpdate:modelValue": e[4] || (e[4] = (n) => s({ "x-scalar-secret-redirect-uri": n }))
|
|
115
|
+
}, {
|
|
116
|
+
default: l(() => [...e[15] || (e[15] = [
|
|
117
|
+
u(" Redirect URL ", -1)
|
|
118
|
+
])]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["environment", "modelValue"])
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
})) : f("", !0),
|
|
124
|
+
"x-scalar-secret-username" in t.value && "x-scalar-secret-password" in t.value ? (i(), k(V, { key: 1 }, [
|
|
125
|
+
o(r(d), null, {
|
|
157
126
|
default: l(() => [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
127
|
+
o(m, {
|
|
128
|
+
class: "text-c-2",
|
|
129
|
+
environment: a.environment,
|
|
130
|
+
modelValue: t.value["x-scalar-secret-username"],
|
|
131
|
+
placeholder: "janedoe",
|
|
132
|
+
"onUpdate:modelValue": e[5] || (e[5] = (n) => s({ "x-scalar-secret-username": n }))
|
|
133
|
+
}, {
|
|
134
|
+
default: l(() => [...e[16] || (e[16] = [
|
|
135
|
+
u(" Username ", -1)
|
|
165
136
|
])]),
|
|
166
137
|
_: 1
|
|
167
|
-
},
|
|
138
|
+
}, 8, ["environment", "modelValue"])
|
|
168
139
|
]),
|
|
169
140
|
_: 1
|
|
170
141
|
}),
|
|
171
|
-
|
|
142
|
+
o(r(d), null, {
|
|
172
143
|
default: l(() => [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
144
|
+
o(m, {
|
|
145
|
+
environment: a.environment,
|
|
146
|
+
modelValue: t.value["x-scalar-secret-password"],
|
|
147
|
+
placeholder: "********",
|
|
176
148
|
type: "password",
|
|
177
|
-
"onUpdate:modelValue": e[
|
|
178
|
-
}
|
|
179
|
-
default: l(() => [...e[
|
|
180
|
-
|
|
181
|
-
])]),
|
|
182
|
-
_: 1
|
|
183
|
-
}, 16, ["modelValue"])
|
|
184
|
-
]),
|
|
185
|
-
_: 1
|
|
186
|
-
})) : f("", !0),
|
|
187
|
-
"x-usePkce" in t.value ? (u(), y(o(n), { key: 3 }, {
|
|
188
|
-
default: l(() => [
|
|
189
|
-
r(c, p(m, {
|
|
190
|
-
enum: o(P),
|
|
191
|
-
modelValue: t.value["x-usePkce"],
|
|
192
|
-
readOnly: "",
|
|
193
|
-
"onUpdate:modelValue": e[9] || (e[9] = (a) => s("update:securityScheme", {
|
|
194
|
-
usePkce: a
|
|
195
|
-
}))
|
|
196
|
-
}), {
|
|
197
|
-
default: l(() => [...e[20] || (e[20] = [
|
|
198
|
-
d(" Use PKCE ", -1)
|
|
149
|
+
"onUpdate:modelValue": e[6] || (e[6] = (n) => s({ "x-scalar-secret-password": n }))
|
|
150
|
+
}, {
|
|
151
|
+
default: l(() => [...e[17] || (e[17] = [
|
|
152
|
+
u(" Password ", -1)
|
|
199
153
|
])]),
|
|
200
154
|
_: 1
|
|
201
|
-
},
|
|
155
|
+
}, 8, ["environment", "modelValue"])
|
|
202
156
|
]),
|
|
203
157
|
_: 1
|
|
204
|
-
})
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
158
|
+
})
|
|
159
|
+
], 64)) : f("", !0),
|
|
160
|
+
o(r(d), null, {
|
|
161
|
+
default: l(() => [
|
|
162
|
+
o(m, {
|
|
163
|
+
environment: a.environment,
|
|
164
|
+
modelValue: t.value["x-scalar-secret-client-id"],
|
|
165
|
+
placeholder: "12345",
|
|
166
|
+
"onUpdate:modelValue": e[7] || (e[7] = (n) => s({ "x-scalar-secret-client-id": n }))
|
|
167
|
+
}, {
|
|
168
|
+
default: l(() => [...e[18] || (e[18] = [
|
|
169
|
+
u(" Client ID ", -1)
|
|
170
|
+
])]),
|
|
171
|
+
_: 1
|
|
172
|
+
}, 8, ["environment", "modelValue"])
|
|
173
|
+
]),
|
|
174
|
+
_: 1
|
|
175
|
+
}),
|
|
176
|
+
"x-scalar-secret-client-secret" in t.value ? (i(), v(r(d), { key: 2 }, {
|
|
177
|
+
default: l(() => [
|
|
178
|
+
o(m, {
|
|
179
|
+
environment: a.environment,
|
|
180
|
+
modelValue: t.value["x-scalar-secret-client-secret"],
|
|
181
|
+
placeholder: "XYZ123",
|
|
182
|
+
type: "password",
|
|
183
|
+
"onUpdate:modelValue": e[8] || (e[8] = (n) => s({ "x-scalar-secret-client-secret": n }))
|
|
184
|
+
}, {
|
|
185
|
+
default: l(() => [...e[19] || (e[19] = [
|
|
186
|
+
u(" Client Secret ", -1)
|
|
187
|
+
])]),
|
|
188
|
+
_: 1
|
|
189
|
+
}, 8, ["environment", "modelValue"])
|
|
190
|
+
]),
|
|
191
|
+
_: 1
|
|
192
|
+
})) : f("", !0),
|
|
193
|
+
"x-usePkce" in t.value ? (i(), v(r(d), { key: 3 }, {
|
|
194
|
+
default: l(() => [
|
|
195
|
+
o(m, {
|
|
196
|
+
enum: r(b),
|
|
197
|
+
environment: a.environment,
|
|
198
|
+
modelValue: t.value["x-usePkce"],
|
|
199
|
+
readOnly: "",
|
|
200
|
+
"onUpdate:modelValue": e[9] || (e[9] = (n) => s({
|
|
201
|
+
"x-usePkce": n
|
|
202
|
+
}))
|
|
203
|
+
}, {
|
|
204
|
+
default: l(() => [...e[20] || (e[20] = [
|
|
205
|
+
u(" Use PKCE ", -1)
|
|
206
|
+
])]),
|
|
207
|
+
_: 1
|
|
208
|
+
}, 8, ["enum", "environment", "modelValue"])
|
|
209
|
+
]),
|
|
210
|
+
_: 1
|
|
211
|
+
})) : f("", !0),
|
|
212
|
+
Object.keys(t.value.scopes ?? {}).length ? (i(), v(r(d), { key: 4 }, {
|
|
213
|
+
default: l(() => [
|
|
214
|
+
o(L, {
|
|
215
|
+
flow: t.value,
|
|
216
|
+
selectedScopes: a.selectedScopes,
|
|
217
|
+
"onUpdate:selectedScopes": e[10] || (e[10] = (n) => y("update:selectedScopes", n))
|
|
218
|
+
}, null, 8, ["flow", "selectedScopes"])
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
})) : f("", !0),
|
|
222
|
+
o(r(d), { class: "min-w-full" }, {
|
|
220
223
|
default: l(() => [
|
|
221
|
-
|
|
222
|
-
r(
|
|
224
|
+
x("div", F, [
|
|
225
|
+
o(r(U), {
|
|
223
226
|
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
224
|
-
loading:
|
|
227
|
+
loading: r(c),
|
|
225
228
|
size: "sm",
|
|
226
229
|
variant: "outlined",
|
|
227
|
-
onClick:
|
|
230
|
+
onClick: S
|
|
228
231
|
}, {
|
|
229
232
|
default: l(() => [...e[21] || (e[21] = [
|
|
230
|
-
|
|
233
|
+
u(" Authorize ", -1)
|
|
231
234
|
])]),
|
|
232
235
|
_: 1
|
|
233
236
|
}, 8, ["loading"])
|
|
234
237
|
])
|
|
235
238
|
]),
|
|
236
239
|
_: 1
|
|
237
|
-
})
|
|
240
|
+
})
|
|
238
241
|
], 64));
|
|
239
242
|
}
|
|
240
243
|
});
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
2
1
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
2
|
import type { AuthMeta } from '@scalar/workspace-store/mutators';
|
|
3
|
+
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
4
4
|
import type { ComponentsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
5
|
-
import type { EnvVariable } from '../../../../store/index.js';
|
|
6
5
|
import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
|
|
7
6
|
type __VLS_Props = {
|
|
8
|
-
environment
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/** The current environment configuration */
|
|
8
|
+
environment: XScalarEnvironment;
|
|
9
|
+
/** Controls border display for static (non-collapsible) layouts */
|
|
10
|
+
isStatic: boolean;
|
|
11
|
+
/** Available authentication scheme options */
|
|
11
12
|
selectedSchemeOptions: SecuritySchemeOption[];
|
|
13
|
+
/** Index of the currently active authentication tab */
|
|
12
14
|
activeAuthIndex: number;
|
|
15
|
+
/** OpenAPI security scheme definitions */
|
|
13
16
|
securitySchemes: ComponentsObject['securitySchemes'];
|
|
17
|
+
/** Current server configuration */
|
|
14
18
|
server: ServerObject | undefined;
|
|
19
|
+
/** Event bus for authentication updates */
|
|
15
20
|
eventBus: WorkspaceEventBus;
|
|
21
|
+
/** Metadata for authentication context */
|
|
16
22
|
meta: AuthMeta;
|
|
17
23
|
};
|
|
18
24
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
19
|
-
activeAuthIndex: number;
|
|
20
25
|
activeScheme: import("vue").ComputedRef<SecuritySchemeOption | undefined>;
|
|
21
26
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
27
|
export default _default;
|
package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAoJA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAwOF,wBAOG"}
|
|
@@ -1,7 +1,84 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as p, computed as d, createElementBlock as s, openBlock as a, withModifiers as y, createCommentVNode as m, createBlock as x, normalizeClass as r, Fragment as g, renderList as k, createElementVNode as u, toDisplayString as w, unref as B, withCtx as C, createVNode as A } from "vue";
|
|
2
|
+
import z from "./RequestAuthTab.vue.js";
|
|
3
|
+
import N from "../../../components/data-table/DataTable.vue.js";
|
|
4
|
+
const O = ["onClick"], T = { class: "relative z-10 font-medium whitespace-nowrap" }, U = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
|
|
7
|
+
}, E = /* @__PURE__ */ p({
|
|
8
|
+
__name: "RequestAuthDataTable",
|
|
9
|
+
props: {
|
|
10
|
+
environment: {},
|
|
11
|
+
isStatic: { type: Boolean },
|
|
12
|
+
selectedSchemeOptions: {},
|
|
13
|
+
activeAuthIndex: {},
|
|
14
|
+
securitySchemes: { default: () => ({}) },
|
|
15
|
+
server: {},
|
|
16
|
+
eventBus: {},
|
|
17
|
+
meta: {}
|
|
18
|
+
},
|
|
19
|
+
setup(t, { expose: h }) {
|
|
20
|
+
const n = d(
|
|
21
|
+
() => t.selectedSchemeOptions[t.activeAuthIndex]
|
|
22
|
+
), v = d(() => t.selectedSchemeOptions.length > 1), b = (e) => t.eventBus.emit("auth:update:active-index", {
|
|
23
|
+
index: e,
|
|
24
|
+
meta: t.meta
|
|
25
|
+
}), S = (e) => t.eventBus.emit("auth:update:security-scheme", {
|
|
26
|
+
payload: e,
|
|
27
|
+
name: n.value?.id ?? ""
|
|
28
|
+
}), f = (e) => t.eventBus.emit("auth:update:selected-scopes", {
|
|
29
|
+
...e,
|
|
30
|
+
meta: t.meta
|
|
31
|
+
}), c = (e) => t.activeAuthIndex === e;
|
|
32
|
+
return h({
|
|
33
|
+
activeScheme: n
|
|
34
|
+
}), (e, o) => (a(), s("form", {
|
|
35
|
+
onSubmit: o[0] || (o[0] = y(() => {
|
|
36
|
+
}, ["prevent"]))
|
|
37
|
+
}, [
|
|
38
|
+
v.value ? (a(), s("div", {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: r(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", { "border-x-0": !e.isStatic }]),
|
|
41
|
+
"data-testid": "auth-tabs"
|
|
42
|
+
}, [
|
|
43
|
+
(a(!0), s(g, null, k(e.selectedSchemeOptions, (l, i) => (a(), s("div", {
|
|
44
|
+
key: l.id,
|
|
45
|
+
class: "relative z-1 -mb-[var(--scalar-border-width)] flex h-8"
|
|
46
|
+
}, [
|
|
47
|
+
u("button", {
|
|
48
|
+
class: r(["floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors", c(i) ? "text-c-1" : "text-c-3"]),
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: (I) => b(i)
|
|
51
|
+
}, [
|
|
52
|
+
u("span", T, w(l.label), 1)
|
|
53
|
+
], 10, O),
|
|
54
|
+
c(i) ? (a(), s("div", U)) : m("", !0)
|
|
55
|
+
]))), 128))
|
|
56
|
+
], 2)) : m("", !0),
|
|
57
|
+
n.value ? (a(), x(B(N), {
|
|
58
|
+
key: 1,
|
|
59
|
+
class: r(["flex-1", { "bg-b-1 rounded-b-lg border border-t-0": e.isStatic }]),
|
|
60
|
+
columns: [""],
|
|
61
|
+
presentational: ""
|
|
62
|
+
}, {
|
|
63
|
+
default: C(() => [
|
|
64
|
+
A(z, {
|
|
65
|
+
environment: e.environment,
|
|
66
|
+
isStatic: e.isStatic,
|
|
67
|
+
securitySchemes: e.securitySchemes,
|
|
68
|
+
selectedSecuritySchemas: n.value.value,
|
|
69
|
+
server: e.server,
|
|
70
|
+
"onUpdate:securityScheme": S,
|
|
71
|
+
"onUpdate:selectedScopes": f
|
|
72
|
+
}, null, 8, ["environment", "isStatic", "securitySchemes", "selectedSecuritySchemas", "server"])
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
}, 8, ["class"])) : (a(), s("div", {
|
|
76
|
+
key: 2,
|
|
77
|
+
class: r(["bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm", { "min-h-[calc(4rem+0.5px)] rounded-b-lg border": e.isStatic }])
|
|
78
|
+
}, " No authentication selected ", 2))
|
|
79
|
+
], 32));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
5
82
|
export {
|
|
6
|
-
|
|
83
|
+
E as default
|
|
7
84
|
};
|