@scalar/api-client 2.2.39 → 2.2.41
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 +27 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +35 -31
- package/dist/components/AddressBar/index.d.ts +1 -2
- package/dist/components/AddressBar/index.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +29 -29
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +7 -7
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +21 -21
- package/dist/components/{AddressBar/AddressBarServer.vue.d.ts → Server/ServerDropdown.vue.d.ts} +6 -1
- package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerDropdown.vue.js +155 -0
- package/dist/components/Server/ServerDropdown.vue2.js +4 -0
- package/dist/components/Server/ServerDropdownItem.vue.d.ts +19 -0
- package/dist/components/Server/ServerDropdownItem.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerDropdownItem.vue.js +7 -0
- package/dist/components/Server/ServerDropdownItem.vue2.js +81 -0
- package/dist/components/Server/ServerVariablesForm.vue.js +20 -20
- package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.js +4 -4
- package/dist/components/Server/index.d.ts +3 -0
- package/dist/components/Server/index.d.ts.map +1 -0
- package/dist/components/Server/index.js +6 -0
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +1 -5
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/hooks/useLayout.d.ts +2 -0
- package/dist/hooks/useLayout.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +30 -40
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +60 -80
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +30 -40
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +30 -40
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/store/active-entities.d.ts +6 -8
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/servers.d.ts +30 -40
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/store.d.ts +30 -40
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +0 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +40 -42
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -1
- 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 +72 -72
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +18 -17
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +12 -11
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +1 -0
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Servers/index.d.ts +2 -0
- package/dist/views/Servers/index.d.ts.map +1 -0
- package/dist/views/Servers/index.js +4 -0
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +196 -160
- package/dist/views/Settings/components/SettingsAppearance.vue.d.ts.map +1 -1
- package/dist/views/Settings/components/SettingsAppearance.vue.js +50 -39
- package/package.json +20 -10
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +0 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +0 -123
- package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts +0 -10
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +0 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +0 -7
- package/dist/components/AddressBar/AddressBarServerItem.vue2.js +0 -77
|
@@ -2,7 +2,6 @@ import { type Oauth2Flow, type SecuritySchemeOauth2 } from '@scalar/oas-utils/en
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
scheme: SecuritySchemeOauth2;
|
|
4
4
|
flow: Oauth2Flow;
|
|
5
|
-
layout?: 'client' | 'reference';
|
|
6
5
|
};
|
|
7
6
|
declare const _default: 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>;
|
|
8
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuth2.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuth2.vue"],"names":[],"mappings":"AAsOA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,oBAAoB,EAE1B,MAAM,iCAAiC,CAAA;AAQxC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAC;;AA8dF,wBAMG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as L, openBlock as
|
|
1
|
+
import { defineComponent as L, openBlock as d, createElementBlock as w, Fragment as k, createVNode as a, unref as r, withCtx as o, createTextVNode as u, createElementVNode as v, createBlock as m, createCommentVNode as i } from "vue";
|
|
2
2
|
import { useActiveEntities as P } from "../../../../store/active-entities.js";
|
|
3
3
|
import { useLoadingState as R, ScalarButton as $ } from "@scalar/components";
|
|
4
4
|
import { pkceOptions as A } from "@scalar/oas-utils/entities/spec";
|
|
@@ -12,11 +12,10 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
12
12
|
__name: "OAuth2",
|
|
13
13
|
props: {
|
|
14
14
|
scheme: {},
|
|
15
|
-
flow: {}
|
|
16
|
-
layout: { default: "client" }
|
|
15
|
+
flow: {}
|
|
17
16
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const p = R(), { toast: V } = B(), { activeCollection: S, activeServer: U, activeWorkspace: z } = P(), { securitySchemeMutators: C } = I(),
|
|
17
|
+
setup(y) {
|
|
18
|
+
const p = R(), { toast: V } = B(), { activeCollection: S, activeServer: U, activeWorkspace: z } = P(), { securitySchemeMutators: C } = I(), s = (l, e) => C.edit(y.scheme.uid, l, e), T = async () => {
|
|
20
19
|
var t, g;
|
|
21
20
|
if (p.isLoading || !((t = S.value) != null && t.uid)) return;
|
|
22
21
|
if (p.startLoading(), !U.value) {
|
|
@@ -24,14 +23,14 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
25
|
const [l, e] = await b(
|
|
27
|
-
|
|
26
|
+
y.flow,
|
|
28
27
|
U.value,
|
|
29
28
|
(g = z.value) == null ? void 0 : g.proxyUrl
|
|
30
29
|
).finally(() => p.stopLoading());
|
|
31
|
-
e ?
|
|
30
|
+
e ? s(`flows.${y.flow.type}.token`, e) : (console.error(l), V((l == null ? void 0 : l.message) ?? "Failed to authorize", "error"));
|
|
32
31
|
};
|
|
33
|
-
return (l, e) => (
|
|
34
|
-
l.flow.token ? (
|
|
32
|
+
return (l, e) => (d(), w(k, null, [
|
|
33
|
+
l.flow.token ? (d(), w(k, { key: 0 }, [
|
|
35
34
|
a(r(n), null, {
|
|
36
35
|
default: o(() => [
|
|
37
36
|
a(f, {
|
|
@@ -39,10 +38,10 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
39
38
|
modelValue: l.flow.token,
|
|
40
39
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
41
40
|
type: "password",
|
|
42
|
-
"onUpdate:modelValue": e[0] || (e[0] = (t) =>
|
|
41
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => s(`flows.${l.flow.type}.token`, t))
|
|
43
42
|
}, {
|
|
44
43
|
default: o(() => e[10] || (e[10] = [
|
|
45
|
-
|
|
44
|
+
u(" Access Token ")
|
|
46
45
|
])),
|
|
47
46
|
_: 1
|
|
48
47
|
}, 8, ["modelValue"])
|
|
@@ -57,10 +56,10 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
57
56
|
loading: r(p),
|
|
58
57
|
size: "sm",
|
|
59
58
|
variant: "outlined",
|
|
60
|
-
onClick: e[1] || (e[1] = (t) =>
|
|
59
|
+
onClick: e[1] || (e[1] = (t) => s(`flows.${l.flow.type}.token`, ""))
|
|
61
60
|
}, {
|
|
62
61
|
default: o(() => e[11] || (e[11] = [
|
|
63
|
-
|
|
62
|
+
u(" Clear ")
|
|
64
63
|
])),
|
|
65
64
|
_: 1
|
|
66
65
|
}, 8, ["loading"])
|
|
@@ -68,60 +67,60 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
68
67
|
]),
|
|
69
68
|
_: 1
|
|
70
69
|
})
|
|
71
|
-
], 64)) : (
|
|
70
|
+
], 64)) : (d(), w(k, { key: 1 }, [
|
|
72
71
|
a(r(n), null, {
|
|
73
72
|
default: o(() => [
|
|
74
|
-
"authorizationUrl" in l.flow ? (
|
|
73
|
+
"authorizationUrl" in l.flow ? (d(), m(f, {
|
|
75
74
|
key: 0,
|
|
76
75
|
modelValue: l.flow.authorizationUrl,
|
|
77
76
|
placeholder: "https://galaxy.scalar.com/authorize",
|
|
78
|
-
"onUpdate:modelValue": e[2] || (e[2] = (t) =>
|
|
77
|
+
"onUpdate:modelValue": e[2] || (e[2] = (t) => s(`flows.${l.flow.type}.authorizationUrl`, t))
|
|
79
78
|
}, {
|
|
80
79
|
default: o(() => e[12] || (e[12] = [
|
|
81
|
-
|
|
80
|
+
u(" Auth URL ")
|
|
82
81
|
])),
|
|
83
82
|
_: 1
|
|
84
83
|
}, 8, ["modelValue"])) : i("", !0),
|
|
85
|
-
"tokenUrl" in l.flow ? (
|
|
84
|
+
"tokenUrl" in l.flow ? (d(), m(f, {
|
|
86
85
|
key: 1,
|
|
87
86
|
modelValue: l.flow.tokenUrl,
|
|
88
87
|
placeholder: "https://galaxy.scalar.com/token",
|
|
89
|
-
"onUpdate:modelValue": e[3] || (e[3] = (t) =>
|
|
88
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => s(`flows.${l.flow.type}.tokenUrl`, t))
|
|
90
89
|
}, {
|
|
91
90
|
default: o(() => e[13] || (e[13] = [
|
|
92
|
-
|
|
91
|
+
u(" Token URL ")
|
|
93
92
|
])),
|
|
94
93
|
_: 1
|
|
95
94
|
}, 8, ["modelValue"])) : i("", !0)
|
|
96
95
|
]),
|
|
97
96
|
_: 1
|
|
98
97
|
}),
|
|
99
|
-
"x-scalar-redirect-uri" in l.flow ? (
|
|
98
|
+
"x-scalar-redirect-uri" in l.flow ? (d(), m(r(n), { key: 0 }, {
|
|
100
99
|
default: o(() => [
|
|
101
100
|
a(f, {
|
|
102
101
|
modelValue: l.flow["x-scalar-redirect-uri"],
|
|
103
102
|
placeholder: "https://galaxy.scalar.com/callback",
|
|
104
|
-
"onUpdate:modelValue": e[4] || (e[4] = (t) =>
|
|
103
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => s(`flows.${l.flow.type}.x-scalar-redirect-uri`, t))
|
|
105
104
|
}, {
|
|
106
105
|
default: o(() => e[14] || (e[14] = [
|
|
107
|
-
|
|
106
|
+
u(" Redirect URL ")
|
|
108
107
|
])),
|
|
109
108
|
_: 1
|
|
110
109
|
}, 8, ["modelValue"])
|
|
111
110
|
]),
|
|
112
111
|
_: 1
|
|
113
112
|
})) : i("", !0),
|
|
114
|
-
l.flow.type === "password" ? (
|
|
113
|
+
l.flow.type === "password" ? (d(), w(k, { key: 1 }, [
|
|
115
114
|
a(r(n), null, {
|
|
116
115
|
default: o(() => [
|
|
117
116
|
a(f, {
|
|
118
117
|
class: "text-c-2",
|
|
119
118
|
modelValue: l.flow.username,
|
|
120
119
|
placeholder: "janedoe",
|
|
121
|
-
"onUpdate:modelValue": e[5] || (e[5] = (t) =>
|
|
120
|
+
"onUpdate:modelValue": e[5] || (e[5] = (t) => s(`flows.${l.flow.type}.username`, t))
|
|
122
121
|
}, {
|
|
123
122
|
default: o(() => e[15] || (e[15] = [
|
|
124
|
-
|
|
123
|
+
u(" Username ")
|
|
125
124
|
])),
|
|
126
125
|
_: 1
|
|
127
126
|
}, 8, ["modelValue"])
|
|
@@ -134,10 +133,10 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
134
133
|
modelValue: l.flow.password,
|
|
135
134
|
placeholder: "********",
|
|
136
135
|
type: "password",
|
|
137
|
-
"onUpdate:modelValue": e[6] || (e[6] = (t) =>
|
|
136
|
+
"onUpdate:modelValue": e[6] || (e[6] = (t) => s(`flows.${l.flow.type}.password`, t))
|
|
138
137
|
}, {
|
|
139
138
|
default: o(() => e[16] || (e[16] = [
|
|
140
|
-
|
|
139
|
+
u(" Password ")
|
|
141
140
|
])),
|
|
142
141
|
_: 1
|
|
143
142
|
}, 8, ["modelValue"])
|
|
@@ -150,63 +149,62 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
150
149
|
a(f, {
|
|
151
150
|
modelValue: l.flow["x-scalar-client-id"],
|
|
152
151
|
placeholder: "12345",
|
|
153
|
-
"onUpdate:modelValue": e[7] || (e[7] = (t) =>
|
|
152
|
+
"onUpdate:modelValue": e[7] || (e[7] = (t) => s(`flows.${l.flow.type}.x-scalar-client-id`, t))
|
|
154
153
|
}, {
|
|
155
154
|
default: o(() => e[17] || (e[17] = [
|
|
156
|
-
|
|
155
|
+
u(" Client ID ")
|
|
157
156
|
])),
|
|
158
157
|
_: 1
|
|
159
158
|
}, 8, ["modelValue"])
|
|
160
159
|
]),
|
|
161
160
|
_: 1
|
|
162
161
|
}),
|
|
163
|
-
"clientSecret" in l.flow ? (
|
|
162
|
+
"clientSecret" in l.flow ? (d(), m(r(n), { key: 2 }, {
|
|
164
163
|
default: o(() => [
|
|
165
164
|
a(f, {
|
|
166
165
|
modelValue: l.flow.clientSecret,
|
|
167
166
|
placeholder: "XYZ123",
|
|
168
167
|
type: "password",
|
|
169
|
-
"onUpdate:modelValue": e[8] || (e[8] = (t) =>
|
|
168
|
+
"onUpdate:modelValue": e[8] || (e[8] = (t) => s(`flows.${l.flow.type}.clientSecret`, t))
|
|
170
169
|
}, {
|
|
171
170
|
default: o(() => e[18] || (e[18] = [
|
|
172
|
-
|
|
171
|
+
u(" Client Secret ")
|
|
173
172
|
])),
|
|
174
173
|
_: 1
|
|
175
174
|
}, 8, ["modelValue"])
|
|
176
175
|
]),
|
|
177
176
|
_: 1
|
|
178
177
|
})) : i("", !0),
|
|
179
|
-
"x-usePkce" in l.flow ? (
|
|
178
|
+
"x-usePkce" in l.flow ? (d(), m(r(n), { key: 3 }, {
|
|
180
179
|
default: o(() => [
|
|
181
180
|
a(f, {
|
|
182
181
|
enum: r(A),
|
|
183
182
|
modelValue: l.flow["x-usePkce"],
|
|
184
183
|
readOnly: "",
|
|
185
|
-
"onUpdate:modelValue": e[9] || (e[9] = (t) =>
|
|
184
|
+
"onUpdate:modelValue": e[9] || (e[9] = (t) => s(
|
|
186
185
|
`flows.${l.flow.type}.x-usePkce`,
|
|
187
186
|
t
|
|
188
187
|
))
|
|
189
188
|
}, {
|
|
190
189
|
default: o(() => e[19] || (e[19] = [
|
|
191
|
-
|
|
190
|
+
u(" Use PKCE ")
|
|
192
191
|
])),
|
|
193
192
|
_: 1
|
|
194
193
|
}, 8, ["enum", "modelValue"])
|
|
195
194
|
]),
|
|
196
195
|
_: 1
|
|
197
196
|
})) : i("", !0),
|
|
198
|
-
Object.keys(l.flow.scopes ?? {}).length ? (
|
|
197
|
+
Object.keys(l.flow.scopes ?? {}).length ? (d(), m(r(n), { key: 4 }, {
|
|
199
198
|
default: o(() => [
|
|
200
199
|
a(F, {
|
|
201
200
|
flow: l.flow,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}, null, 8, ["flow", "layout"])
|
|
201
|
+
updateScheme: s
|
|
202
|
+
}, null, 8, ["flow"])
|
|
205
203
|
]),
|
|
206
204
|
_: 1
|
|
207
205
|
})) : i("", !0)
|
|
208
206
|
], 64)),
|
|
209
|
-
l.flow.token ? i("", !0) : (
|
|
207
|
+
l.flow.token ? i("", !0) : (d(), m(r(n), {
|
|
210
208
|
key: 2,
|
|
211
209
|
class: "min-w-full"
|
|
212
210
|
}, {
|
|
@@ -220,7 +218,7 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
220
218
|
onClick: T
|
|
221
219
|
}, {
|
|
222
220
|
default: o(() => e[20] || (e[20] = [
|
|
223
|
-
|
|
221
|
+
u(" Authorize ")
|
|
224
222
|
])),
|
|
225
223
|
_: 1
|
|
226
224
|
}, 8, ["loading"])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
selectedSecuritySchemeUids: string[];
|
|
3
3
|
title: string;
|
|
4
|
-
layout
|
|
4
|
+
layout: 'client' | 'reference';
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
7
|
"update:selectedSecuritySchemeUids": (args_0: string[]) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuth.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuth.vue"],"names":[],"mappings":"AAkVA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;CAC/B,CAAC;;;;;;AAuYF,wBAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./RequestAuth.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-01b699f6"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as F, ref as _, computed as r, openBlock as M, createBlock as K, withCtx as m, createElementVNode as y, toDisplayString as q, createElementBlock as L, normalizeClass as N, createCommentVNode as z, createVNode as d, unref as n } from "vue";
|
|
2
|
+
import W from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useLayout as H } from "../../../../hooks/useLayout.js";
|
|
3
4
|
import { useActiveEntities as P } from "../../../../store/active-entities.js";
|
|
4
5
|
import { useModal as G, ScalarComboboxMultiselect as J, ScalarButton as Q, ScalarIcon as X } from "@scalar/components";
|
|
5
6
|
import { isDefined as U } from "@scalar/oas-utils/helpers";
|
|
6
7
|
import Y from "./DeleteRequestAuthModal.vue.js";
|
|
7
8
|
import Z from "./RequestAuthDataTable.vue.js";
|
|
8
9
|
import { ADD_AUTH_OPTIONS as ee } from "../../consts/new-auth-options.js";
|
|
9
|
-
import {
|
|
10
|
-
import { useWorkspace as le } from "../../../../store/store.js";
|
|
10
|
+
import { useWorkspace as te } from "../../../../store/store.js";
|
|
11
11
|
import { displaySchemeFormatter as g } from "../../libs/auth.js";
|
|
12
|
-
const
|
|
12
|
+
const le = { class: "inline-flex gap-1 items-center" }, oe = { class: "flex flex-1 -mx-1" }, ie = { class: "text-c-1" }, ye = /* @__PURE__ */ F({
|
|
13
13
|
__name: "RequestAuth",
|
|
14
14
|
props: {
|
|
15
15
|
selectedSecuritySchemeUids: {},
|
|
@@ -17,123 +17,123 @@ const oe = { class: "inline-flex gap-1 items-center" }, ie = { class: "flex flex
|
|
|
17
17
|
layout: {}
|
|
18
18
|
},
|
|
19
19
|
emits: ["update:selectedSecuritySchemeUids"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
securitySchemes:
|
|
23
|
-
securitySchemeMutators:
|
|
24
|
-
requestMutators:
|
|
25
|
-
collectionMutators:
|
|
26
|
-
} =
|
|
20
|
+
setup(h, { emit: O }) {
|
|
21
|
+
const R = O, { layout: v } = H(), { activeCollection: a, activeRequest: f } = P(), {
|
|
22
|
+
securitySchemes: k,
|
|
23
|
+
securitySchemeMutators: $,
|
|
24
|
+
requestMutators: B,
|
|
25
|
+
collectionMutators: V
|
|
26
|
+
} = te(), A = _(null), p = G(), S = _(null), D = r(() => {
|
|
27
27
|
var l, i;
|
|
28
|
-
const e = ((l =
|
|
28
|
+
const e = ((l = f.value) == null ? void 0 : l.security) ?? ((i = a.value) == null ? void 0 : i.security) ?? [];
|
|
29
29
|
return { filteredRequirements: e.filter(
|
|
30
30
|
(s) => Object.keys(s).length
|
|
31
31
|
), requirements: e };
|
|
32
|
-
}), b =
|
|
33
|
-
const { filteredRequirements: e, requirements: t } =
|
|
32
|
+
}), b = r(() => {
|
|
33
|
+
const { filteredRequirements: e, requirements: t } = D.value;
|
|
34
34
|
if (!t.length) return null;
|
|
35
|
-
const l = e.length < t.length, i = l ? "Unlock" : "Lock", s = l ? "Optional" : "Required",
|
|
36
|
-
return { icon: i, text:
|
|
37
|
-
}),
|
|
38
|
-
() =>
|
|
39
|
-
const t =
|
|
35
|
+
const l = e.length < t.length, i = l ? "Unlock" : "Lock", s = l ? "Optional" : "Required", u = `${e.length === 1 ? Object.keys(e[0] || {})[0] : ""} ${s}`;
|
|
36
|
+
return { icon: i, text: u };
|
|
37
|
+
}), c = r(
|
|
38
|
+
() => h.selectedSecuritySchemeUids.map((e) => {
|
|
39
|
+
const t = k[e ?? ""];
|
|
40
40
|
if (t)
|
|
41
41
|
return g(t);
|
|
42
42
|
}).filter(U)
|
|
43
43
|
);
|
|
44
|
-
function
|
|
44
|
+
function w(e) {
|
|
45
45
|
var i, s;
|
|
46
|
-
if (!((i =
|
|
46
|
+
if (!((i = a.value) != null && i.uid) || !((s = f.value) != null && s.uid)) return;
|
|
47
47
|
const t = e.find((o) => o.payload), l = e.filter((o) => !o.payload).map(({ id: o }) => o);
|
|
48
48
|
if (t != null && t.payload) {
|
|
49
|
-
const o =
|
|
49
|
+
const o = $.add(
|
|
50
50
|
t.payload,
|
|
51
|
-
|
|
51
|
+
a.value.uid
|
|
52
52
|
);
|
|
53
53
|
o && l.push(o.uid);
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
C(l), R("update:selectedSecuritySchemeUids", l);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
!
|
|
59
|
-
|
|
57
|
+
const C = (e) => {
|
|
58
|
+
!a.value || !f.value || (v === "modal" || h.layout === "reference" ? V.edit(
|
|
59
|
+
a.value.uid,
|
|
60
60
|
"selectedSecuritySchemeUids",
|
|
61
61
|
e
|
|
62
|
-
) :
|
|
63
|
-
|
|
62
|
+
) : B.edit(
|
|
63
|
+
f.value.uid,
|
|
64
64
|
"selectedSecuritySchemeUids",
|
|
65
65
|
e
|
|
66
66
|
));
|
|
67
67
|
};
|
|
68
|
-
function
|
|
69
|
-
S.value = e,
|
|
68
|
+
function T(e) {
|
|
69
|
+
S.value = e, p.show();
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const E = (e) => {
|
|
72
72
|
var l;
|
|
73
|
-
const t =
|
|
73
|
+
const t = h.selectedSecuritySchemeUids.filter(
|
|
74
74
|
(i) => i !== e
|
|
75
75
|
);
|
|
76
|
-
|
|
77
|
-
},
|
|
76
|
+
C(t), R("update:selectedSecuritySchemeUids", t), (l = A.value) == null || l.$el.focus(), p.hide();
|
|
77
|
+
}, I = r(() => {
|
|
78
78
|
var t;
|
|
79
|
-
return (((t =
|
|
80
|
-
}),
|
|
79
|
+
return (((t = a.value) == null ? void 0 : t.securitySchemes) ?? []).map((l) => k[l]).filter((l) => l);
|
|
80
|
+
}), j = r(
|
|
81
81
|
() => {
|
|
82
|
-
const e = [...
|
|
83
|
-
|
|
84
|
-
const
|
|
82
|
+
const e = [...I.value], t = [];
|
|
83
|
+
D.value.filteredRequirements.forEach((o) => {
|
|
84
|
+
const u = e.findIndex(
|
|
85
85
|
(x) => (x == null ? void 0 : x.nameKey) === Object.keys(o)[0]
|
|
86
86
|
);
|
|
87
|
-
|
|
87
|
+
u > -1 && (t.push(e[u]), e.splice(u, 1));
|
|
88
88
|
});
|
|
89
89
|
const l = e.map((o) => o ? g(o) : void 0).filter(U), i = t.map((o) => o ? g(o) : void 0).filter(U), s = [
|
|
90
90
|
{ label: "Required authentication", options: i },
|
|
91
91
|
{ label: "Available authentication", options: l }
|
|
92
92
|
];
|
|
93
|
-
return
|
|
93
|
+
return v === "modal" || h.layout === "reference" ? i.length ? s : l : (s.push({
|
|
94
94
|
label: "Add new authentication",
|
|
95
95
|
options: ee
|
|
96
96
|
}), s);
|
|
97
97
|
}
|
|
98
98
|
);
|
|
99
|
-
return (e, t) => (M(),
|
|
99
|
+
return (e, t) => (M(), K(W, {
|
|
100
100
|
class: "group/params",
|
|
101
|
-
itemCount:
|
|
102
|
-
layout:
|
|
101
|
+
itemCount: c.value.length,
|
|
102
|
+
layout: e.layout
|
|
103
103
|
}, {
|
|
104
|
-
title:
|
|
105
|
-
y("div",
|
|
104
|
+
title: m(() => [
|
|
105
|
+
y("div", le, [
|
|
106
106
|
y("span", null, q(e.title), 1),
|
|
107
|
-
b.value ? (M(),
|
|
107
|
+
b.value ? (M(), L("span", {
|
|
108
108
|
key: 0,
|
|
109
|
-
class:
|
|
110
|
-
}, q(b.value.text), 3)) :
|
|
109
|
+
class: N(["text-c-3 text-xs leading-[normal]", { "text-c-1": b.value.text === "Required" }])
|
|
110
|
+
}, q(b.value.text), 3)) : z("", !0)
|
|
111
111
|
])
|
|
112
112
|
]),
|
|
113
|
-
actions:
|
|
114
|
-
y("div",
|
|
115
|
-
|
|
113
|
+
actions: m(() => [
|
|
114
|
+
y("div", oe, [
|
|
115
|
+
d(n(J), {
|
|
116
116
|
class: "text-xs w-72",
|
|
117
|
-
isDeletable:
|
|
118
|
-
modelValue:
|
|
117
|
+
isDeletable: n(v) !== "modal" && e.layout !== "reference",
|
|
118
|
+
modelValue: c.value,
|
|
119
119
|
multiple: "",
|
|
120
|
-
options:
|
|
121
|
-
onDelete:
|
|
122
|
-
"onUpdate:modelValue":
|
|
120
|
+
options: j.value,
|
|
121
|
+
onDelete: T,
|
|
122
|
+
"onUpdate:modelValue": w
|
|
123
123
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
|
|
124
|
+
default: m(() => [
|
|
125
|
+
d(n(Q), {
|
|
126
126
|
ref_key: "comboboxButtonRef",
|
|
127
|
-
ref:
|
|
127
|
+
ref: A,
|
|
128
128
|
class: "h-auto px-1.5 py-0.75 hover:bg-b-3 text-c-1 hover:text-c-1 font-normal",
|
|
129
129
|
fullWidth: "",
|
|
130
130
|
variant: "ghost"
|
|
131
131
|
}, {
|
|
132
|
-
default:
|
|
132
|
+
default: m(() => {
|
|
133
133
|
var l;
|
|
134
134
|
return [
|
|
135
|
-
y("div",
|
|
136
|
-
|
|
135
|
+
y("div", ie, q(c.value.length === 0 ? "Auth Type" : c.value.length === 1 ? (l = c.value[0]) == null ? void 0 : l.label : "Multiple"), 1),
|
|
136
|
+
d(n(X), {
|
|
137
137
|
class: "ml-1 shrink-0",
|
|
138
138
|
icon: "ChevronDown",
|
|
139
139
|
size: "sm"
|
|
@@ -147,18 +147,18 @@ const oe = { class: "inline-flex gap-1 items-center" }, ie = { class: "flex flex
|
|
|
147
147
|
}, 8, ["isDeletable", "modelValue", "options"])
|
|
148
148
|
])
|
|
149
149
|
]),
|
|
150
|
-
default:
|
|
151
|
-
|
|
152
|
-
layout:
|
|
150
|
+
default: m(() => [
|
|
151
|
+
d(Z, {
|
|
152
|
+
layout: e.layout,
|
|
153
153
|
selectedSecuritySchemeUids: e.selectedSecuritySchemeUids
|
|
154
154
|
}, null, 8, ["layout", "selectedSecuritySchemeUids"]),
|
|
155
|
-
|
|
155
|
+
d(Y, {
|
|
156
156
|
scheme: S.value,
|
|
157
|
-
state:
|
|
158
|
-
onClose: t[0] || (t[0] = (l) =>
|
|
157
|
+
state: n(p),
|
|
158
|
+
onClose: t[0] || (t[0] = (l) => n(p).hide()),
|
|
159
159
|
onDelete: t[1] || (t[1] = (l) => {
|
|
160
160
|
var i;
|
|
161
|
-
return
|
|
161
|
+
return E((i = S.value) == null ? void 0 : i.id);
|
|
162
162
|
})
|
|
163
163
|
}, null, 8, ["scheme", "state"])
|
|
164
164
|
]),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ClientLayout } from '../../../../hooks/index.js';
|
|
2
1
|
type __VLS_Props = {
|
|
3
2
|
selectedSecuritySchemeUids: string[];
|
|
4
|
-
layout
|
|
3
|
+
layout: 'client' | 'reference';
|
|
5
4
|
};
|
|
6
5
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLFormElement>;
|
|
7
6
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue"],"names":[],"mappings":"AA8LA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;IACpC,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;CAC/B,CAAC;;AA2MF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./RequestAuthDataTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f417cbbe"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, ref as f, computed as S, watch as x, openBlock as r, createElementBlock as o, withModifiers as k, Fragment as w, renderList as g, normalizeClass as p, createElementVNode as n, toDisplayString as _, unref as l, createCommentVNode as c, createBlock as C, withCtx as U, createVNode as v } from "vue";
|
|
2
2
|
import { useModal as z } from "@scalar/components";
|
|
3
3
|
import A from "./DeleteRequestAuthModal.vue.js";
|
|
4
4
|
import M from "./RequestExampleAuth.vue.js";
|
|
@@ -14,25 +14,25 @@ const E = {
|
|
|
14
14
|
}, F = {
|
|
15
15
|
key: 2,
|
|
16
16
|
class: "text-c-3 px-4 text-sm border-t min-h-16 justify-center flex items-center bg-b-1"
|
|
17
|
-
}, J = /* @__PURE__ */
|
|
17
|
+
}, J = /* @__PURE__ */ y({
|
|
18
18
|
__name: "RequestAuthDataTable",
|
|
19
19
|
props: {
|
|
20
20
|
selectedSecuritySchemeUids: {},
|
|
21
|
-
layout: {
|
|
21
|
+
layout: {}
|
|
22
22
|
},
|
|
23
23
|
setup(u) {
|
|
24
|
-
const { securitySchemes: d } = B(), m = z(), b = f(null), e = f(0), h =
|
|
24
|
+
const { securitySchemes: d } = B(), m = z(), b = f(null), e = f(0), h = S(() => u.selectedSecuritySchemeUids[e.value] || null);
|
|
25
25
|
return x(
|
|
26
26
|
() => u.selectedSecuritySchemeUids,
|
|
27
|
-
(
|
|
28
|
-
|
|
27
|
+
(t) => {
|
|
28
|
+
t[e.value] || (e.value = Math.max(0, e.value - 1));
|
|
29
29
|
}
|
|
30
|
-
), (
|
|
30
|
+
), (t, s) => (r(), o("form", {
|
|
31
31
|
onSubmit: s[1] || (s[1] = k(() => {
|
|
32
32
|
}, ["prevent"]))
|
|
33
33
|
}, [
|
|
34
|
-
|
|
35
|
-
(
|
|
34
|
+
t.selectedSecuritySchemeUids.length > 1 ? (r(), o("div", E, [
|
|
35
|
+
(r(!0), o(w, null, g(t.selectedSecuritySchemeUids, (a, i) => (r(), o("div", {
|
|
36
36
|
key: a,
|
|
37
37
|
class: p(["flex relative h-8 z-1 cursor-pointer -mb-[var(--scalar-border-width)]", [e.value === i ? "text-c-1" : "text-c-3"]])
|
|
38
38
|
}, [
|
|
@@ -41,29 +41,30 @@ const E = {
|
|
|
41
41
|
type: "button",
|
|
42
42
|
onClick: (R) => e.value = i
|
|
43
43
|
}, [
|
|
44
|
-
n("span", q, _(
|
|
44
|
+
n("span", q, _(l(d)[a] ? l(N)(l(d)[a]).label : ""), 1)
|
|
45
45
|
], 8, V),
|
|
46
46
|
s[2] || (s[2] = n("div", { class: "absolute bottom-0 z-0 -inset-x-96 h-[var(--scalar-border-width)] bg-border" }, null, -1)),
|
|
47
|
-
e.value === i ? (
|
|
47
|
+
e.value === i ? (r(), o("div", D)) : c("", !0)
|
|
48
48
|
], 2))), 128))
|
|
49
49
|
])) : c("", !0),
|
|
50
|
-
h.value ? (
|
|
50
|
+
h.value ? (r(), C(l($), {
|
|
51
51
|
key: 1,
|
|
52
|
-
class: p(["flex-1",
|
|
52
|
+
class: p(["flex-1", t.layout === "reference" && "border-0"]),
|
|
53
53
|
columns: [""]
|
|
54
54
|
}, {
|
|
55
55
|
default: U(() => [
|
|
56
56
|
v(M, {
|
|
57
|
+
layout: t.layout,
|
|
57
58
|
selectedSecuritySchemeUids: [h.value]
|
|
58
|
-
}, null, 8, ["selectedSecuritySchemeUids"])
|
|
59
|
+
}, null, 8, ["layout", "selectedSecuritySchemeUids"])
|
|
59
60
|
]),
|
|
60
61
|
_: 1
|
|
61
62
|
}, 8, ["class"])) : c("", !0),
|
|
62
|
-
|
|
63
|
+
t.selectedSecuritySchemeUids.length ? c("", !0) : (r(), o("div", F, " No authentication selected ")),
|
|
63
64
|
v(A, {
|
|
64
65
|
scheme: b.value,
|
|
65
|
-
state:
|
|
66
|
-
onClose: s[0] || (s[0] = (a) =>
|
|
66
|
+
state: l(m),
|
|
67
|
+
onClose: s[0] || (s[0] = (a) => l(m).hide())
|
|
67
68
|
}, null, 8, ["scheme", "state"])
|
|
68
69
|
], 32));
|
|
69
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
selectedSecuritySchemeUids: string[];
|
|
3
|
-
layout
|
|
3
|
+
layout: 'client' | 'reference';
|
|
4
4
|
};
|
|
5
5
|
declare const _default: 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>;
|
|
6
6
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestExampleAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestExampleAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue"],"names":[],"mappings":"AAmNA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;IACpC,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;CAC/B,CAAC;;AA+XF,wBAMG"}
|