@scalar/api-client 2.2.42 → 2.2.44
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 +32 -0
- package/dist/layouts/App/create-api-client-app.d.ts +29 -29
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +58 -58
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +29 -29
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +29 -29
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/find-request.d.ts +1 -1
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.d.ts +8 -10
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +100 -100
- package/dist/store/active-entities.d.ts +5 -3
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/collections.d.ts +12 -12
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/requests.d.ts +13 -13
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +25 -25
- package/dist/store/store.d.ts +29 -29
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +4 -4
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +5 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +60 -58
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +10 -7
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +103 -115
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +9 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +52 -44
- package/dist/views/Request/RequestSection/RequestAuth/{RequestExampleAuth.vue.d.ts → RequestAuthTab.vue.d.ts} +7 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/{RequestExampleAuth.vue2.js → RequestAuthTab.vue2.js} +68 -62
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +107 -97
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +2 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +78 -67
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/auth.d.ts +22 -2
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/auth.js +56 -5
- package/dist/views/Request/libs/index.js +9 -6
- package/package.json +12 -12
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +0 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as b, openBlock as y, createBlock as S, unref as s, withCtx as n, createElementVNode as r, toDisplayString as i, createVNode as m, createTextVNode as u } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useWorkspace as _ } from "../../../../store/store.js";
|
|
3
|
+
import { ScalarModal as g, ScalarButton as d } from "@scalar/components";
|
|
4
4
|
const k = { class: "mb-4 leading-normal text-c-2 text-sm" }, C = { class: "flex justify-between gap-2" }, B = /* @__PURE__ */ b({
|
|
5
5
|
__name: "DeleteRequestAuthModal",
|
|
6
6
|
props: {
|
|
@@ -9,11 +9,11 @@ const k = { class: "mb-4 leading-normal text-c-2 text-sm" }, C = { class: "flex
|
|
|
9
9
|
},
|
|
10
10
|
emits: ["close", "delete"],
|
|
11
11
|
setup(p, { emit: f }) {
|
|
12
|
-
const l = p, c = f, { securitySchemeMutators: h } =
|
|
12
|
+
const l = p, c = f, { securitySchemeMutators: h } = _(), x = () => {
|
|
13
13
|
var e;
|
|
14
14
|
(e = l.scheme) != null && e.id && h.delete(l.scheme.id), c("delete");
|
|
15
15
|
};
|
|
16
|
-
return (e, t) => (y(), S(s(
|
|
16
|
+
return (e, t) => (y(), S(s(g), {
|
|
17
17
|
size: "xxs",
|
|
18
18
|
state: e.state,
|
|
19
19
|
title: "Delete Security Scheme"
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { type Oauth2Flow, type SecuritySchemeOauth2 } from '@scalar/oas-utils/entities/spec';
|
|
1
|
+
import { type Collection, type Oauth2Flow, type SecuritySchemeOauth2, type Server } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { Workspace } from '@scalar/oas-utils/entities/workspace';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
scheme: SecuritySchemeOauth2;
|
|
4
5
|
flow: Oauth2Flow;
|
|
6
|
+
collection: Collection;
|
|
7
|
+
server: Server | undefined;
|
|
8
|
+
workspace: Workspace;
|
|
5
9
|
};
|
|
6
10
|
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>;
|
|
7
11
|
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":"AAwOA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,MAAM,EAEZ,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAQrE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA4dF,wBAMG"}
|
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { useLoadingState as
|
|
4
|
-
import { pkceOptions as
|
|
5
|
-
import { useToasts as
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as v, openBlock as d, createElementBlock as k, Fragment as y, createVNode as a, unref as r, withCtx as o, createTextVNode as n, createElementVNode as g, createBlock as p, createCommentVNode as i } from "vue";
|
|
2
|
+
import { useWorkspace as C } from "../../../../store/store.js";
|
|
3
|
+
import { useLoadingState as T, ScalarButton as $ } from "@scalar/components";
|
|
4
|
+
import { pkceOptions as L } from "@scalar/oas-utils/entities/spec";
|
|
5
|
+
import { useToasts as P } from "@scalar/use-toasts";
|
|
6
|
+
import R from "./OAuthScopesInput.vue.js";
|
|
7
7
|
import f from "./RequestAuthDataTableInput.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import { authorizeOauth2 as
|
|
10
|
-
|
|
11
|
-
const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8 flex items-center justify-end border-t-1/2 w-full" }, Z = /* @__PURE__ */ L({
|
|
8
|
+
import u from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
9
|
+
import { authorizeOauth2 as B } from "../../libs/oauth2.js";
|
|
10
|
+
const F = { class: "h-8 flex items-center justify-self-end" }, b = { class: "h-8 flex items-center justify-end border-t-1/2 w-full" }, H = /* @__PURE__ */ v({
|
|
12
11
|
__name: "OAuth2",
|
|
13
12
|
props: {
|
|
14
13
|
scheme: {},
|
|
15
|
-
flow: {}
|
|
14
|
+
flow: {},
|
|
15
|
+
collection: {},
|
|
16
|
+
server: {},
|
|
17
|
+
workspace: {}
|
|
16
18
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
var t,
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
19
|
+
setup(m) {
|
|
20
|
+
const w = T(), { toast: V } = P(), { securitySchemeMutators: z } = C(), s = (l, e) => z.edit(m.scheme.uid, l, e), S = async () => {
|
|
21
|
+
var t, U;
|
|
22
|
+
if (w.isLoading || !((t = m.collection) != null && t.uid)) return;
|
|
23
|
+
if (w.startLoading(), !m.server) {
|
|
22
24
|
V("No server selected", "error");
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
25
|
-
const [l, e] = await
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
).finally(() =>
|
|
30
|
-
e ? s(`flows.${
|
|
27
|
+
const [l, e] = await B(
|
|
28
|
+
m.flow,
|
|
29
|
+
m.server,
|
|
30
|
+
(U = m.workspace) == null ? void 0 : U.proxyUrl
|
|
31
|
+
).finally(() => w.stopLoading());
|
|
32
|
+
e ? s(`flows.${m.flow.type}.token`, e) : (console.error(l), V((l == null ? void 0 : l.message) ?? "Failed to authorize", "error"));
|
|
31
33
|
};
|
|
32
|
-
return (l, e) => (d(),
|
|
33
|
-
l.flow.token ? (d(),
|
|
34
|
-
a(r(
|
|
34
|
+
return (l, e) => (d(), k(y, null, [
|
|
35
|
+
l.flow.token ? (d(), k(y, { key: 0 }, [
|
|
36
|
+
a(r(u), null, {
|
|
35
37
|
default: o(() => [
|
|
36
38
|
a(f, {
|
|
37
39
|
class: "border-r-transparent",
|
|
@@ -41,25 +43,25 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
41
43
|
"onUpdate:modelValue": e[0] || (e[0] = (t) => s(`flows.${l.flow.type}.token`, t))
|
|
42
44
|
}, {
|
|
43
45
|
default: o(() => e[10] || (e[10] = [
|
|
44
|
-
|
|
46
|
+
n(" Access Token ")
|
|
45
47
|
])),
|
|
46
48
|
_: 1
|
|
47
49
|
}, 8, ["modelValue"])
|
|
48
50
|
]),
|
|
49
51
|
_: 1
|
|
50
52
|
}),
|
|
51
|
-
a(r(
|
|
53
|
+
a(r(u), { class: "min-w-full" }, {
|
|
52
54
|
default: o(() => [
|
|
53
|
-
|
|
55
|
+
g("div", F, [
|
|
54
56
|
a(r($), {
|
|
55
57
|
class: "p-0 py-0.5 px-2 mr-1",
|
|
56
|
-
loading: r(
|
|
58
|
+
loading: r(w),
|
|
57
59
|
size: "sm",
|
|
58
60
|
variant: "outlined",
|
|
59
61
|
onClick: e[1] || (e[1] = (t) => s(`flows.${l.flow.type}.token`, ""))
|
|
60
62
|
}, {
|
|
61
63
|
default: o(() => e[11] || (e[11] = [
|
|
62
|
-
|
|
64
|
+
n(" Clear ")
|
|
63
65
|
])),
|
|
64
66
|
_: 1
|
|
65
67
|
}, 8, ["loading"])
|
|
@@ -67,35 +69,35 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
67
69
|
]),
|
|
68
70
|
_: 1
|
|
69
71
|
})
|
|
70
|
-
], 64)) : (d(),
|
|
71
|
-
a(r(
|
|
72
|
+
], 64)) : (d(), k(y, { key: 1 }, [
|
|
73
|
+
a(r(u), null, {
|
|
72
74
|
default: o(() => [
|
|
73
|
-
"authorizationUrl" in l.flow ? (d(),
|
|
75
|
+
"authorizationUrl" in l.flow ? (d(), p(f, {
|
|
74
76
|
key: 0,
|
|
75
77
|
modelValue: l.flow.authorizationUrl,
|
|
76
78
|
placeholder: "https://galaxy.scalar.com/authorize",
|
|
77
79
|
"onUpdate:modelValue": e[2] || (e[2] = (t) => s(`flows.${l.flow.type}.authorizationUrl`, t))
|
|
78
80
|
}, {
|
|
79
81
|
default: o(() => e[12] || (e[12] = [
|
|
80
|
-
|
|
82
|
+
n(" Auth URL ")
|
|
81
83
|
])),
|
|
82
84
|
_: 1
|
|
83
85
|
}, 8, ["modelValue"])) : i("", !0),
|
|
84
|
-
"tokenUrl" in l.flow ? (d(),
|
|
86
|
+
"tokenUrl" in l.flow ? (d(), p(f, {
|
|
85
87
|
key: 1,
|
|
86
88
|
modelValue: l.flow.tokenUrl,
|
|
87
89
|
placeholder: "https://galaxy.scalar.com/token",
|
|
88
90
|
"onUpdate:modelValue": e[3] || (e[3] = (t) => s(`flows.${l.flow.type}.tokenUrl`, t))
|
|
89
91
|
}, {
|
|
90
92
|
default: o(() => e[13] || (e[13] = [
|
|
91
|
-
|
|
93
|
+
n(" Token URL ")
|
|
92
94
|
])),
|
|
93
95
|
_: 1
|
|
94
96
|
}, 8, ["modelValue"])) : i("", !0)
|
|
95
97
|
]),
|
|
96
98
|
_: 1
|
|
97
99
|
}),
|
|
98
|
-
"x-scalar-redirect-uri" in l.flow ? (d(),
|
|
100
|
+
"x-scalar-redirect-uri" in l.flow ? (d(), p(r(u), { key: 0 }, {
|
|
99
101
|
default: o(() => [
|
|
100
102
|
a(f, {
|
|
101
103
|
modelValue: l.flow["x-scalar-redirect-uri"],
|
|
@@ -103,15 +105,15 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
103
105
|
"onUpdate:modelValue": e[4] || (e[4] = (t) => s(`flows.${l.flow.type}.x-scalar-redirect-uri`, t))
|
|
104
106
|
}, {
|
|
105
107
|
default: o(() => e[14] || (e[14] = [
|
|
106
|
-
|
|
108
|
+
n(" Redirect URL ")
|
|
107
109
|
])),
|
|
108
110
|
_: 1
|
|
109
111
|
}, 8, ["modelValue"])
|
|
110
112
|
]),
|
|
111
113
|
_: 1
|
|
112
114
|
})) : i("", !0),
|
|
113
|
-
l.flow.type === "password" ? (d(),
|
|
114
|
-
a(r(
|
|
115
|
+
l.flow.type === "password" ? (d(), k(y, { key: 1 }, [
|
|
116
|
+
a(r(u), null, {
|
|
115
117
|
default: o(() => [
|
|
116
118
|
a(f, {
|
|
117
119
|
class: "text-c-2",
|
|
@@ -120,14 +122,14 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
120
122
|
"onUpdate:modelValue": e[5] || (e[5] = (t) => s(`flows.${l.flow.type}.username`, t))
|
|
121
123
|
}, {
|
|
122
124
|
default: o(() => e[15] || (e[15] = [
|
|
123
|
-
|
|
125
|
+
n(" Username ")
|
|
124
126
|
])),
|
|
125
127
|
_: 1
|
|
126
128
|
}, 8, ["modelValue"])
|
|
127
129
|
]),
|
|
128
130
|
_: 1
|
|
129
131
|
}),
|
|
130
|
-
a(r(
|
|
132
|
+
a(r(u), null, {
|
|
131
133
|
default: o(() => [
|
|
132
134
|
a(f, {
|
|
133
135
|
modelValue: l.flow.password,
|
|
@@ -136,7 +138,7 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
136
138
|
"onUpdate:modelValue": e[6] || (e[6] = (t) => s(`flows.${l.flow.type}.password`, t))
|
|
137
139
|
}, {
|
|
138
140
|
default: o(() => e[16] || (e[16] = [
|
|
139
|
-
|
|
141
|
+
n(" Password ")
|
|
140
142
|
])),
|
|
141
143
|
_: 1
|
|
142
144
|
}, 8, ["modelValue"])
|
|
@@ -144,7 +146,7 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
144
146
|
_: 1
|
|
145
147
|
})
|
|
146
148
|
], 64)) : i("", !0),
|
|
147
|
-
a(r(
|
|
149
|
+
a(r(u), null, {
|
|
148
150
|
default: o(() => [
|
|
149
151
|
a(f, {
|
|
150
152
|
modelValue: l.flow["x-scalar-client-id"],
|
|
@@ -152,14 +154,14 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
152
154
|
"onUpdate:modelValue": e[7] || (e[7] = (t) => s(`flows.${l.flow.type}.x-scalar-client-id`, t))
|
|
153
155
|
}, {
|
|
154
156
|
default: o(() => e[17] || (e[17] = [
|
|
155
|
-
|
|
157
|
+
n(" Client ID ")
|
|
156
158
|
])),
|
|
157
159
|
_: 1
|
|
158
160
|
}, 8, ["modelValue"])
|
|
159
161
|
]),
|
|
160
162
|
_: 1
|
|
161
163
|
}),
|
|
162
|
-
"clientSecret" in l.flow ? (d(),
|
|
164
|
+
"clientSecret" in l.flow ? (d(), p(r(u), { key: 2 }, {
|
|
163
165
|
default: o(() => [
|
|
164
166
|
a(f, {
|
|
165
167
|
modelValue: l.flow.clientSecret,
|
|
@@ -168,17 +170,17 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
168
170
|
"onUpdate:modelValue": e[8] || (e[8] = (t) => s(`flows.${l.flow.type}.clientSecret`, t))
|
|
169
171
|
}, {
|
|
170
172
|
default: o(() => e[18] || (e[18] = [
|
|
171
|
-
|
|
173
|
+
n(" Client Secret ")
|
|
172
174
|
])),
|
|
173
175
|
_: 1
|
|
174
176
|
}, 8, ["modelValue"])
|
|
175
177
|
]),
|
|
176
178
|
_: 1
|
|
177
179
|
})) : i("", !0),
|
|
178
|
-
"x-usePkce" in l.flow ? (d(),
|
|
180
|
+
"x-usePkce" in l.flow ? (d(), p(r(u), { key: 3 }, {
|
|
179
181
|
default: o(() => [
|
|
180
182
|
a(f, {
|
|
181
|
-
enum: r(
|
|
183
|
+
enum: r(L),
|
|
182
184
|
modelValue: l.flow["x-usePkce"],
|
|
183
185
|
readOnly: "",
|
|
184
186
|
"onUpdate:modelValue": e[9] || (e[9] = (t) => s(
|
|
@@ -187,16 +189,16 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
187
189
|
))
|
|
188
190
|
}, {
|
|
189
191
|
default: o(() => e[19] || (e[19] = [
|
|
190
|
-
|
|
192
|
+
n(" Use PKCE ")
|
|
191
193
|
])),
|
|
192
194
|
_: 1
|
|
193
195
|
}, 8, ["enum", "modelValue"])
|
|
194
196
|
]),
|
|
195
197
|
_: 1
|
|
196
198
|
})) : i("", !0),
|
|
197
|
-
Object.keys(l.flow.scopes ?? {}).length ? (d(),
|
|
199
|
+
Object.keys(l.flow.scopes ?? {}).length ? (d(), p(r(u), { key: 4 }, {
|
|
198
200
|
default: o(() => [
|
|
199
|
-
a(
|
|
201
|
+
a(R, {
|
|
200
202
|
flow: l.flow,
|
|
201
203
|
updateScheme: s
|
|
202
204
|
}, null, 8, ["flow"])
|
|
@@ -204,21 +206,21 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
204
206
|
_: 1
|
|
205
207
|
})) : i("", !0)
|
|
206
208
|
], 64)),
|
|
207
|
-
l.flow.token ? i("", !0) : (d(),
|
|
209
|
+
l.flow.token ? i("", !0) : (d(), p(r(u), {
|
|
208
210
|
key: 2,
|
|
209
211
|
class: "min-w-full"
|
|
210
212
|
}, {
|
|
211
213
|
default: o(() => [
|
|
212
|
-
|
|
214
|
+
g("div", b, [
|
|
213
215
|
a(r($), {
|
|
214
216
|
class: "p-0 py-0.5 px-2 mr-1",
|
|
215
|
-
loading: r(
|
|
217
|
+
loading: r(w),
|
|
216
218
|
size: "sm",
|
|
217
219
|
variant: "outlined",
|
|
218
|
-
onClick:
|
|
220
|
+
onClick: S
|
|
219
221
|
}, {
|
|
220
222
|
default: o(() => e[20] || (e[20] = [
|
|
221
|
-
|
|
223
|
+
n(" Authorize ")
|
|
222
224
|
])),
|
|
223
225
|
_: 1
|
|
224
226
|
}, 8, ["loading"])
|
|
@@ -230,5 +232,5 @@ const N = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8
|
|
|
230
232
|
}
|
|
231
233
|
});
|
|
232
234
|
export {
|
|
233
|
-
|
|
235
|
+
H as default
|
|
234
236
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import type { SelectedSecuritySchemeUids } from '@scalar/oas-utils/entities/shared';
|
|
2
|
+
import type { Collection, Operation, Server } from '@scalar/oas-utils/entities/spec';
|
|
3
|
+
import type { Workspace } from '@scalar/oas-utils/entities/workspace';
|
|
1
4
|
type __VLS_Props = {
|
|
2
|
-
|
|
3
|
-
title: string;
|
|
5
|
+
collection: Collection;
|
|
4
6
|
layout: 'client' | 'reference';
|
|
7
|
+
operation?: Operation;
|
|
8
|
+
selectedSecuritySchemeUids: SelectedSecuritySchemeUids;
|
|
9
|
+
server: Server | undefined;
|
|
10
|
+
title: string;
|
|
11
|
+
workspace: Workspace;
|
|
5
12
|
};
|
|
6
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
"update:selectedSecuritySchemeUids": (args_0: string[]) => any;
|
|
8
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
-
"onUpdate:selectedSecuritySchemeUids"?: ((args_0: string[]) => any) | undefined;
|
|
10
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
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>;
|
|
11
14
|
export default _default;
|
|
12
15
|
//# sourceMappingURL=RequestAuth.vue.d.ts.map
|
|
@@ -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":"AAuTA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAmWF,wBAOG"}
|
|
@@ -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 m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-c68c4902"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,139 +1,124 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useLayout as
|
|
4
|
-
import {
|
|
5
|
-
import { useModal as
|
|
6
|
-
import { isDefined as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { displaySchemeFormatter as g } from "../../libs/auth.js";
|
|
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({
|
|
1
|
+
import { defineComponent as $, ref as b, computed as d, openBlock as q, createBlock as B, withCtx as a, createElementVNode as f, toDisplayString as S, createElementBlock as V, normalizeClass as L, createCommentVNode as T, createVNode as u, unref as c } from "vue";
|
|
2
|
+
import j from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useLayout as z } from "../../../../hooks/useLayout.js";
|
|
4
|
+
import { useWorkspace as E } from "../../../../store/store.js";
|
|
5
|
+
import { useModal as I, ScalarComboboxMultiselect as K, ScalarButton as N, ScalarIcon as W } from "@scalar/components";
|
|
6
|
+
import { isDefined as F } from "@scalar/oas-utils/helpers";
|
|
7
|
+
import G from "./DeleteRequestAuthModal.vue.js";
|
|
8
|
+
import H from "./RequestAuthDataTable.vue.js";
|
|
9
|
+
import { getSecurityRequirements as J, formatComplexScheme as P, formatScheme as Q, getSchemeOptions as X } from "../../libs/auth.js";
|
|
10
|
+
const Y = { class: "inline-flex gap-1 items-center" }, Z = { class: "flex flex-1 -mx-1" }, _ = { class: "text-c-1" }, ae = /* @__PURE__ */ $({
|
|
13
11
|
__name: "RequestAuth",
|
|
14
12
|
props: {
|
|
13
|
+
collection: {},
|
|
14
|
+
layout: {},
|
|
15
|
+
operation: {},
|
|
15
16
|
selectedSecuritySchemeUids: {},
|
|
17
|
+
server: {},
|
|
16
18
|
title: {},
|
|
17
|
-
|
|
19
|
+
workspace: {}
|
|
18
20
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(s) => Object.keys(s).length
|
|
31
|
-
), requirements: e };
|
|
32
|
-
}), b = r(() => {
|
|
33
|
-
const { filteredRequirements: e, requirements: t } = D.value;
|
|
21
|
+
setup(s) {
|
|
22
|
+
const { layout: h } = z(), {
|
|
23
|
+
securitySchemes: y,
|
|
24
|
+
securitySchemeMutators: R,
|
|
25
|
+
requestMutators: C,
|
|
26
|
+
collectionMutators: A
|
|
27
|
+
} = E(), g = b(null), m = I(), p = b(null), x = d(() => {
|
|
28
|
+
const e = J(s.operation, s.collection);
|
|
29
|
+
return { filteredRequirements: e.filter((o) => Object.keys(o).length), requirements: e };
|
|
30
|
+
}), v = d(() => {
|
|
31
|
+
const { filteredRequirements: e, requirements: t } = x.value;
|
|
34
32
|
if (!t.length) return null;
|
|
35
|
-
const
|
|
36
|
-
return { icon:
|
|
37
|
-
}),
|
|
38
|
-
() =>
|
|
39
|
-
|
|
33
|
+
const o = e.length < t.length, n = o ? "Unlock" : "Lock", l = o ? "Optional" : "Required", U = `${e.length === 1 ? Object.keys(e[0] || {})[0] : ""} ${l}`;
|
|
34
|
+
return { icon: n, text: U };
|
|
35
|
+
}), r = d(
|
|
36
|
+
() => s.selectedSecuritySchemeUids.map((e) => {
|
|
37
|
+
if (Array.isArray(e)) return P(e, y);
|
|
38
|
+
const t = y[e ?? ""];
|
|
40
39
|
if (t)
|
|
41
|
-
return
|
|
42
|
-
}).filter(
|
|
40
|
+
return Q(t);
|
|
41
|
+
}).filter(F)
|
|
43
42
|
);
|
|
44
|
-
function
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
function D(e) {
|
|
44
|
+
var n;
|
|
45
|
+
const t = e.find((l) => l.payload), o = e.filter((l) => !l.payload).map(({ id: l }) => {
|
|
46
|
+
const i = l.split(",");
|
|
47
|
+
return i.length > 1 ? i : l;
|
|
48
|
+
});
|
|
48
49
|
if (t != null && t.payload) {
|
|
49
|
-
const
|
|
50
|
+
const l = R.add(
|
|
50
51
|
t.payload,
|
|
51
|
-
|
|
52
|
+
(n = s.collection) == null ? void 0 : n.uid
|
|
52
53
|
);
|
|
53
|
-
|
|
54
|
+
l && o.push(l.uid);
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
k(o);
|
|
56
57
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"selectedSecuritySchemeUids",
|
|
61
|
-
e
|
|
62
|
-
) : B.edit(
|
|
63
|
-
f.value.uid,
|
|
64
|
-
"selectedSecuritySchemeUids",
|
|
65
|
-
e
|
|
66
|
-
));
|
|
58
|
+
const k = (e) => {
|
|
59
|
+
var t;
|
|
60
|
+
h === "modal" || s.layout === "reference" ? A.edit(s.collection.uid, "selectedSecuritySchemeUids", e) : (t = s.operation) != null && t.uid && C.edit(s.operation.uid, "selectedSecuritySchemeUids", e);
|
|
67
61
|
};
|
|
68
|
-
function
|
|
69
|
-
|
|
62
|
+
function w(e) {
|
|
63
|
+
p.value = e, m.show();
|
|
70
64
|
}
|
|
71
|
-
const
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}), j = r(
|
|
65
|
+
const O = (e) => {
|
|
66
|
+
var o;
|
|
67
|
+
if (!e) return;
|
|
68
|
+
const t = s.selectedSecuritySchemeUids.filter((n) => {
|
|
69
|
+
const l = e.split(",");
|
|
70
|
+
return l.length > 1 && Array.isArray(n) && l.length === n.length ? n.every((i) => !l.includes(i)) : n !== e;
|
|
71
|
+
});
|
|
72
|
+
k(t), (o = g.value) == null || o.$el.focus(), m.hide();
|
|
73
|
+
}, M = d(
|
|
81
74
|
() => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
{ label: "Required authentication", options: i },
|
|
91
|
-
{ label: "Available authentication", options: l }
|
|
92
|
-
];
|
|
93
|
-
return v === "modal" || h.layout === "reference" ? i.length ? s : l : (s.push({
|
|
94
|
-
label: "Add new authentication",
|
|
95
|
-
options: ee
|
|
96
|
-
}), s);
|
|
75
|
+
var e;
|
|
76
|
+
return X(
|
|
77
|
+
x.value.filteredRequirements,
|
|
78
|
+
((e = s.collection) == null ? void 0 : e.securitySchemes) ?? [],
|
|
79
|
+
y,
|
|
80
|
+
h === "modal" || s.layout === "reference"
|
|
81
|
+
);
|
|
97
82
|
}
|
|
98
83
|
);
|
|
99
|
-
return (e, t) => (
|
|
84
|
+
return (e, t) => (q(), B(j, {
|
|
100
85
|
class: "group/params",
|
|
101
|
-
itemCount:
|
|
86
|
+
itemCount: r.value.length,
|
|
102
87
|
layout: e.layout
|
|
103
88
|
}, {
|
|
104
|
-
title:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
89
|
+
title: a(() => [
|
|
90
|
+
f("div", Y, [
|
|
91
|
+
f("span", null, S(e.title), 1),
|
|
92
|
+
v.value ? (q(), V("span", {
|
|
108
93
|
key: 0,
|
|
109
|
-
class:
|
|
110
|
-
},
|
|
94
|
+
class: L(["text-c-3 text-xs leading-[normal]", { "text-c-1": v.value.text === "Required" }])
|
|
95
|
+
}, S(v.value.text), 3)) : T("", !0)
|
|
111
96
|
])
|
|
112
97
|
]),
|
|
113
|
-
actions:
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
actions: a(() => [
|
|
99
|
+
f("div", Z, [
|
|
100
|
+
u(c(K), {
|
|
116
101
|
class: "text-xs w-72",
|
|
117
|
-
isDeletable:
|
|
118
|
-
modelValue:
|
|
102
|
+
isDeletable: c(h) !== "modal" && e.layout !== "reference",
|
|
103
|
+
modelValue: r.value,
|
|
119
104
|
multiple: "",
|
|
120
|
-
options:
|
|
121
|
-
onDelete:
|
|
122
|
-
"onUpdate:modelValue":
|
|
105
|
+
options: M.value,
|
|
106
|
+
onDelete: w,
|
|
107
|
+
"onUpdate:modelValue": D
|
|
123
108
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
|
|
109
|
+
default: a(() => [
|
|
110
|
+
u(c(N), {
|
|
126
111
|
ref_key: "comboboxButtonRef",
|
|
127
|
-
ref:
|
|
112
|
+
ref: g,
|
|
128
113
|
class: "h-auto px-1.5 py-0.75 hover:bg-b-3 text-c-1 hover:text-c-1 font-normal",
|
|
129
114
|
fullWidth: "",
|
|
130
115
|
variant: "ghost"
|
|
131
116
|
}, {
|
|
132
|
-
default:
|
|
133
|
-
var
|
|
117
|
+
default: a(() => {
|
|
118
|
+
var o;
|
|
134
119
|
return [
|
|
135
|
-
|
|
136
|
-
|
|
120
|
+
f("div", _, S(r.value.length === 0 ? "Auth Type" : r.value.length === 1 ? (o = r.value[0]) == null ? void 0 : o.label : "Multiple"), 1),
|
|
121
|
+
u(c(W), {
|
|
137
122
|
class: "ml-1 shrink-0",
|
|
138
123
|
icon: "ChevronDown",
|
|
139
124
|
size: "sm"
|
|
@@ -147,18 +132,21 @@ const le = { class: "inline-flex gap-1 items-center" }, oe = { class: "flex flex
|
|
|
147
132
|
}, 8, ["isDeletable", "modelValue", "options"])
|
|
148
133
|
])
|
|
149
134
|
]),
|
|
150
|
-
default:
|
|
151
|
-
|
|
135
|
+
default: a(() => [
|
|
136
|
+
u(H, {
|
|
137
|
+
collection: e.collection,
|
|
152
138
|
layout: e.layout,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
139
|
+
selectedSchemeOptions: r.value,
|
|
140
|
+
server: e.server,
|
|
141
|
+
workspace: e.workspace
|
|
142
|
+
}, null, 8, ["collection", "layout", "selectedSchemeOptions", "server", "workspace"]),
|
|
143
|
+
u(G, {
|
|
144
|
+
scheme: p.value,
|
|
145
|
+
state: c(m),
|
|
146
|
+
onClose: t[0] || (t[0] = (o) => c(m).hide()),
|
|
147
|
+
onDelete: t[1] || (t[1] = (o) => {
|
|
148
|
+
var n;
|
|
149
|
+
return O((n = p.value) == null ? void 0 : n.id);
|
|
162
150
|
})
|
|
163
151
|
}, null, 8, ["scheme", "state"])
|
|
164
152
|
]),
|
|
@@ -167,5 +155,5 @@ const le = { class: "inline-flex gap-1 items-center" }, oe = { class: "flex flex
|
|
|
167
155
|
}
|
|
168
156
|
});
|
|
169
157
|
export {
|
|
170
|
-
|
|
158
|
+
ae as default
|
|
171
159
|
};
|