@scalar/api-client 2.0.34 → 2.0.36
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 +17 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts +7 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +33 -31
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts +19 -3
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +37 -35
- package/dist/components/DataTable/index.d.ts +1 -0
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/index.js +6 -4
- package/dist/components/SideNav/SideHelp.vue.d.ts +3 -0
- package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -0
- package/dist/components/SideNav/SideHelp.vue.js +127 -0
- package/dist/components/SideNav/SideHelp.vue2.js +4 -0
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +3 -3
- package/dist/components/SideNav/SideNav.vue2.js +28 -24
- package/dist/index.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +512 -603
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/{api-client-modal.d.ts → create-api-client-modal.d.ts} +1037 -1219
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -0
- package/dist/layouts/Modal/index.d.ts +1 -1
- package/dist/layouts/Modal/index.d.ts.map +1 -1
- package/dist/layouts/Modal/index.js +1 -1
- package/dist/libs/create-client.d.ts +513 -603
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +58 -68
- package/dist/libs/local-storage.js +5 -5
- package/dist/libs/sendRequest.d.ts +2 -5
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +60 -63
- package/dist/store/workspace.d.ts +1037 -1219
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +350 -277
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +22 -22
- package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.js +270 -177
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +52 -42
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +141 -104
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +5 -36
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +50 -2
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +20 -20
- package/dist/views/Request/components/OAuth2.vue.d.ts +3 -9
- package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/components/OAuth2.vue.js +141 -112
- package/dist/views/Request/components/OAuthScopesInput.vue.d.ts +2 -6
- package/dist/views/Request/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/components/OAuthScopesInput.vue.js +35 -39
- package/dist/views/Request/consts/index.d.ts +2 -0
- package/dist/views/Request/consts/index.d.ts.map +1 -0
- package/dist/views/Request/consts/index.js +5 -0
- package/dist/views/Request/consts/new-auth-options.d.ts +92 -0
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -0
- package/dist/views/Request/consts/new-auth-options.js +83 -0
- package/dist/views/Request/libs/oauth2.d.ts +3 -16
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +28 -31
- package/package.json +10 -6
- package/dist/layouts/Modal/api-client-modal.d.ts.map +0 -1
- /package/dist/layouts/Modal/{api-client-modal.js → create-api-client-modal.js} +0 -0
|
@@ -1,168 +1,197 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { authorizeOauth2 as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as S, openBlock as u, createElementBlock as c, Fragment as h, createVNode as t, unref as d, withCtx as o, createTextVNode as s, createElementVNode as V, createBlock as f, createCommentVNode as m } from "vue";
|
|
2
|
+
import { useWorkspace as $ } from "../../../store/workspace.js";
|
|
3
|
+
import n from "../RequestSection/RequestAuthDataTableInput.vue.js";
|
|
4
|
+
import { useLoadingState as v, ScalarButton as k } from "@scalar/components";
|
|
5
|
+
import C from "./OAuthScopesInput.vue.js";
|
|
6
|
+
import i from "../../../components/DataTable/DataTableRow.vue.js";
|
|
7
|
+
import { authorizeOauth2 as T } from "../libs/oauth2.js";
|
|
8
|
+
const F = { class: "h-8 flex items-center justify-self-end" }, I = { class: "h-8 flex items-center justify-self-end" }, E = /* @__PURE__ */ S({
|
|
9
9
|
__name: "OAuth2",
|
|
10
10
|
props: {
|
|
11
|
-
|
|
12
|
-
schemeModel: {},
|
|
13
|
-
updateScheme: { type: Function }
|
|
11
|
+
scheme: {}
|
|
14
12
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
const e = await
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
e && u.updateScheme(`flows.${u.schemeModel.flowKey}.token`, e);
|
|
13
|
+
setup(y) {
|
|
14
|
+
const w = y, p = v(), { isReadOnly: U, securitySchemeMutators: g } = $(), r = (e, l) => g.edit(w.scheme.uid, e, l), z = async () => {
|
|
15
|
+
if (p.isLoading) return;
|
|
16
|
+
p.startLoading();
|
|
17
|
+
const e = await T(w.scheme).finally(
|
|
18
|
+
() => p.stopLoading()
|
|
19
|
+
);
|
|
20
|
+
e && r("flow.token", e);
|
|
24
21
|
};
|
|
25
|
-
return (e,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
return (e, l) => e.scheme.flow.token ? (u(), c(h, { key: 0 }, [
|
|
23
|
+
t(d(i), null, {
|
|
24
|
+
default: o(() => [
|
|
25
|
+
t(n, {
|
|
26
|
+
id: "oauth2-access-token",
|
|
27
|
+
class: "border-r-transparent",
|
|
28
|
+
modelValue: e.scheme.flow.token,
|
|
29
|
+
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
30
|
+
type: "password",
|
|
31
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => r("flow.token", a))
|
|
32
|
+
}, {
|
|
33
|
+
default: o(() => [
|
|
34
|
+
s(" Access Token ")
|
|
35
|
+
]),
|
|
36
|
+
_: 1
|
|
37
|
+
}, 8, ["modelValue"])
|
|
38
|
+
]),
|
|
39
|
+
_: 1
|
|
40
|
+
}),
|
|
41
|
+
t(d(i), { class: "min-w-full" }, {
|
|
42
|
+
default: o(() => [
|
|
43
|
+
V("div", F, [
|
|
44
|
+
t(d(k), {
|
|
45
|
+
class: "p-0 py-0.5 px-2 mr-1",
|
|
46
|
+
loading: d(p),
|
|
42
47
|
size: "sm",
|
|
43
|
-
variant: "
|
|
44
|
-
onClick:
|
|
48
|
+
variant: "outlined",
|
|
49
|
+
onClick: l[1] || (l[1] = (a) => r("flow.token", ""))
|
|
45
50
|
}, {
|
|
46
|
-
default:
|
|
51
|
+
default: o(() => [
|
|
47
52
|
s(" Clear ")
|
|
48
53
|
]),
|
|
49
54
|
_: 1
|
|
50
|
-
})
|
|
51
|
-
])
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
id:
|
|
61
|
-
modelValue: e.
|
|
55
|
+
}, 8, ["loading"])
|
|
56
|
+
])
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
})
|
|
60
|
+
], 64)) : (u(), c(h, { key: 1 }, [
|
|
61
|
+
d(U) ? m("", !0) : (u(), f(d(i), { key: 0 }, {
|
|
62
|
+
default: o(() => [
|
|
63
|
+
"authorizationUrl" in e.scheme.flow ? (u(), f(n, {
|
|
64
|
+
key: 0,
|
|
65
|
+
id: `oauth2-authorization-url-${e.scheme.uid}`,
|
|
66
|
+
modelValue: e.scheme.flow.authorizationUrl,
|
|
67
|
+
placeholder: "https://galaxy.scalar.com/authorize",
|
|
68
|
+
"onUpdate:modelValue": l[2] || (l[2] = (a) => r("flow.authorizationUrl", a))
|
|
69
|
+
}, {
|
|
70
|
+
default: o(() => [
|
|
71
|
+
s(" Authorization Url ")
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
}, 8, ["id", "modelValue"])) : m("", !0),
|
|
75
|
+
"tokenUrl" in e.scheme.flow ? (u(), f(n, {
|
|
76
|
+
key: 1,
|
|
77
|
+
id: `oauth2-token-url-${e.scheme.uid}`,
|
|
78
|
+
modelValue: e.scheme.flow.tokenUrl,
|
|
79
|
+
placeholder: "https://galaxy.scalar.com/token",
|
|
80
|
+
"onUpdate:modelValue": l[3] || (l[3] = (a) => r("flow.tokenUrl", a))
|
|
81
|
+
}, {
|
|
82
|
+
default: o(() => [
|
|
83
|
+
s(" Token Url ")
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
}, 8, ["id", "modelValue"])) : m("", !0)
|
|
87
|
+
]),
|
|
88
|
+
_: 1
|
|
89
|
+
})),
|
|
90
|
+
"redirectUri" in e.scheme.flow ? (u(), f(d(i), { key: 1 }, {
|
|
91
|
+
default: o(() => [
|
|
92
|
+
t(n, {
|
|
93
|
+
id: `oauth2-redirect-uri-${e.scheme.uid}`,
|
|
94
|
+
modelValue: e.scheme.flow.redirectUri,
|
|
62
95
|
placeholder: "https://galaxy.scalar.com/callback",
|
|
63
|
-
"onUpdate:modelValue":
|
|
96
|
+
"onUpdate:modelValue": l[4] || (l[4] = (a) => r("flow.redirectUri", a))
|
|
64
97
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
s(" Redirect
|
|
98
|
+
default: o(() => [
|
|
99
|
+
s(" Redirect Url ")
|
|
67
100
|
]),
|
|
68
101
|
_: 1
|
|
69
|
-
}, 8, ["modelValue"])
|
|
102
|
+
}, 8, ["id", "modelValue"])
|
|
70
103
|
]),
|
|
71
104
|
_: 1
|
|
72
|
-
})) :
|
|
73
|
-
e.
|
|
74
|
-
|
|
75
|
-
default:
|
|
76
|
-
|
|
77
|
-
id:
|
|
105
|
+
})) : m("", !0),
|
|
106
|
+
e.scheme.flow.type === "password" ? (u(), c(h, { key: 2 }, [
|
|
107
|
+
t(d(i), null, {
|
|
108
|
+
default: o(() => [
|
|
109
|
+
t(n, {
|
|
110
|
+
id: `oauth2-password-username-${e.scheme.uid}`,
|
|
78
111
|
class: "text-c-2",
|
|
79
|
-
modelValue: e.
|
|
112
|
+
modelValue: e.scheme.flow.value,
|
|
80
113
|
placeholder: "ScalarEnjoyer01",
|
|
81
|
-
"onUpdate:modelValue":
|
|
114
|
+
"onUpdate:modelValue": l[5] || (l[5] = (a) => r("flow.value", a))
|
|
82
115
|
}, {
|
|
83
|
-
default:
|
|
116
|
+
default: o(() => [
|
|
84
117
|
s(" Username ")
|
|
85
118
|
]),
|
|
86
119
|
_: 1
|
|
87
|
-
}, 8, ["modelValue"])
|
|
120
|
+
}, 8, ["id", "modelValue"])
|
|
88
121
|
]),
|
|
89
122
|
_: 1
|
|
90
123
|
}),
|
|
91
|
-
|
|
92
|
-
default:
|
|
93
|
-
|
|
94
|
-
id:
|
|
95
|
-
modelValue: e.
|
|
96
|
-
placeholder: "
|
|
124
|
+
t(d(i), null, {
|
|
125
|
+
default: o(() => [
|
|
126
|
+
t(n, {
|
|
127
|
+
id: `oauth2-password-password-${e.scheme.uid}`,
|
|
128
|
+
modelValue: e.scheme.flow.secondValue,
|
|
129
|
+
placeholder: "xxxxxx",
|
|
97
130
|
type: "password",
|
|
98
|
-
"onUpdate:modelValue":
|
|
131
|
+
"onUpdate:modelValue": l[6] || (l[6] = (a) => r("flow.secondValue", a))
|
|
99
132
|
}, {
|
|
100
|
-
default:
|
|
133
|
+
default: o(() => [
|
|
101
134
|
s(" Password ")
|
|
102
135
|
]),
|
|
103
136
|
_: 1
|
|
104
|
-
}, 8, ["modelValue"])
|
|
137
|
+
}, 8, ["id", "modelValue"])
|
|
105
138
|
]),
|
|
106
139
|
_: 1
|
|
107
140
|
})
|
|
108
|
-
], 64)) :
|
|
109
|
-
|
|
110
|
-
default:
|
|
111
|
-
|
|
112
|
-
id:
|
|
113
|
-
modelValue: e.
|
|
141
|
+
], 64)) : m("", !0),
|
|
142
|
+
t(d(i), null, {
|
|
143
|
+
default: o(() => [
|
|
144
|
+
t(n, {
|
|
145
|
+
id: `oauth2-client-id-${e.scheme.uid}`,
|
|
146
|
+
modelValue: e.scheme.clientId,
|
|
114
147
|
placeholder: "12345",
|
|
115
|
-
"onUpdate:modelValue":
|
|
148
|
+
"onUpdate:modelValue": l[7] || (l[7] = (a) => r("clientId", a))
|
|
116
149
|
}, {
|
|
117
|
-
default:
|
|
150
|
+
default: o(() => [
|
|
118
151
|
s(" Client ID ")
|
|
119
152
|
]),
|
|
120
153
|
_: 1
|
|
121
|
-
}, 8, ["modelValue"])
|
|
154
|
+
}, 8, ["id", "modelValue"])
|
|
122
155
|
]),
|
|
123
156
|
_: 1
|
|
124
157
|
}),
|
|
125
|
-
"clientSecret" in e.
|
|
126
|
-
default:
|
|
127
|
-
|
|
128
|
-
id:
|
|
129
|
-
modelValue: e.
|
|
158
|
+
"clientSecret" in e.scheme.flow ? (u(), f(d(i), { key: 3 }, {
|
|
159
|
+
default: o(() => [
|
|
160
|
+
t(n, {
|
|
161
|
+
id: `oauth2-client-secret-${e.scheme.uid}`,
|
|
162
|
+
modelValue: e.scheme.flow.clientSecret,
|
|
130
163
|
placeholder: "XYZ123",
|
|
131
164
|
type: "password",
|
|
132
|
-
"onUpdate:modelValue":
|
|
133
|
-
// Vue cant figure out the type if we check in the template above so we do it here
|
|
134
|
-
(e.schemeModel.flowKey === "authorizationCode" || e.schemeModel.flowKey === "clientCredentials" || e.schemeModel.flowKey === "password") && e.updateScheme(`flows.${e.schemeModel.flowKey}.clientSecret`, t)
|
|
135
|
-
))
|
|
165
|
+
"onUpdate:modelValue": l[8] || (l[8] = (a) => r("flow.clientSecret", a))
|
|
136
166
|
}, {
|
|
137
|
-
default:
|
|
167
|
+
default: o(() => [
|
|
138
168
|
s(" Client Secret ")
|
|
139
169
|
]),
|
|
140
170
|
_: 1
|
|
141
|
-
}, 8, ["modelValue"])
|
|
171
|
+
}, 8, ["id", "modelValue"])
|
|
142
172
|
]),
|
|
143
173
|
_: 1
|
|
144
|
-
})) :
|
|
145
|
-
e.
|
|
146
|
-
default:
|
|
147
|
-
|
|
148
|
-
activeFlow: e.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, null, 8, ["activeFlow", "schemeModel", "updateScheme"])
|
|
174
|
+
})) : m("", !0),
|
|
175
|
+
e.scheme.flow.scopes ? (u(), f(d(i), { key: 4 }, {
|
|
176
|
+
default: o(() => [
|
|
177
|
+
t(C, {
|
|
178
|
+
activeFlow: e.scheme.flow,
|
|
179
|
+
updateScheme: r
|
|
180
|
+
}, null, 8, ["activeFlow"])
|
|
152
181
|
]),
|
|
153
182
|
_: 1
|
|
154
|
-
})) :
|
|
155
|
-
|
|
156
|
-
default:
|
|
157
|
-
|
|
158
|
-
|
|
183
|
+
})) : m("", !0),
|
|
184
|
+
t(d(i), { class: "min-w-full" }, {
|
|
185
|
+
default: o(() => [
|
|
186
|
+
V("div", I, [
|
|
187
|
+
t(d(k), {
|
|
159
188
|
class: "p-0 py-0.5 px-2 mr-1",
|
|
160
|
-
loading: d(
|
|
189
|
+
loading: d(p),
|
|
161
190
|
size: "sm",
|
|
162
191
|
variant: "outlined",
|
|
163
|
-
onClick:
|
|
192
|
+
onClick: z
|
|
164
193
|
}, {
|
|
165
|
-
default:
|
|
194
|
+
default: o(() => [
|
|
166
195
|
s(" Authorize ")
|
|
167
196
|
]),
|
|
168
197
|
_: 1
|
|
@@ -175,5 +204,5 @@ const U = { class: "h-8 flex items-center justify-self-end" }, L = /* @__PURE__
|
|
|
175
204
|
}
|
|
176
205
|
});
|
|
177
206
|
export {
|
|
178
|
-
|
|
207
|
+
E as default
|
|
179
208
|
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import type { UpdateScheme } from '../../../store/workspace.js';
|
|
2
|
-
import type { SecuritySchemeOptionOauth } from '../../../views/Request/libs/index.js';
|
|
3
2
|
import type { SecuritySchemeOauth2 } from '@scalar/oas-utils/entities/workspace/security';
|
|
4
|
-
import type { ValueOf } from 'type-fest';
|
|
5
3
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
6
|
-
activeFlow:
|
|
7
|
-
schemeModel: SecuritySchemeOptionOauth;
|
|
4
|
+
activeFlow: SecuritySchemeOauth2["flow"];
|
|
8
5
|
updateScheme: UpdateScheme;
|
|
9
6
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
10
|
-
activeFlow:
|
|
11
|
-
schemeModel: SecuritySchemeOptionOauth;
|
|
7
|
+
activeFlow: SecuritySchemeOauth2["flow"];
|
|
12
8
|
updateScheme: UpdateScheme;
|
|
13
9
|
}>>>, {}, {}>;
|
|
14
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/OAuthScopesInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/OAuthScopesInput.vue"],"names":[],"mappings":"AAgGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAA;;gBAM3E,oBAAoB,CAAC,MAAM,CAAC;kBAC1B,YAAY;;gBADd,oBAAoB,CAAC,MAAM,CAAC;kBAC1B,YAAY;;AAoR5B,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,59 +1,55 @@
|
|
|
1
|
-
import { defineComponent as S, computed as f, openBlock as m, createBlock as h, unref as o, withCtx as
|
|
2
|
-
import { Disclosure as
|
|
3
|
-
import { ScalarIcon as
|
|
1
|
+
import { defineComponent as S, computed as f, openBlock as m, createBlock as h, unref as o, withCtx as s, createElementVNode as l, createVNode as c, toDisplayString as p, createElementBlock as g, Fragment as b, renderList as C } from "vue";
|
|
2
|
+
import { Disclosure as F, DisclosureButton as k, DisclosurePanel as D } from "@headlessui/vue";
|
|
3
|
+
import { ScalarIcon as y } from "@scalar/components";
|
|
4
4
|
import _ from "../../../components/DataTable/DataTableCell.vue.js";
|
|
5
5
|
import V from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import B from "../../../components/DataTable/DataTableCheckbox.vue.js";
|
|
7
|
+
const O = { class: "flex h-full w-full" }, $ = /* @__PURE__ */ l("div", { class: "text-c-2 min-w-[120px] items-center pl-2 h-full border-r-1/2" }, [
|
|
8
8
|
/* @__PURE__ */ l("span", { class: "h-8 flex items-center" }, " Scopes ")
|
|
9
|
-
], -1),
|
|
9
|
+
], -1), j = { class: "flex-1 text-c-3" }, E = {
|
|
10
10
|
class: "grid auto-rows-auto border-t-1/2",
|
|
11
11
|
style: { gridTemplateColumns: "1fr auto" }
|
|
12
|
-
},
|
|
12
|
+
}, I = { class: "font-code text-xs" }, P = /* @__PURE__ */ S({
|
|
13
13
|
__name: "OAuthScopesInput",
|
|
14
14
|
props: {
|
|
15
15
|
activeFlow: {},
|
|
16
|
-
schemeModel: {},
|
|
17
16
|
updateScheme: { type: Function }
|
|
18
17
|
},
|
|
19
18
|
setup(v) {
|
|
20
|
-
const
|
|
19
|
+
const n = v, x = f(
|
|
21
20
|
() => {
|
|
22
21
|
var e;
|
|
23
|
-
return Object.entries(((e =
|
|
24
|
-
id:
|
|
25
|
-
label:
|
|
22
|
+
return Object.entries(((e = n.activeFlow) == null ? void 0 : e.scopes) ?? {}).map(([a, t]) => ({
|
|
23
|
+
id: a,
|
|
24
|
+
label: a,
|
|
26
25
|
description: t
|
|
27
26
|
}));
|
|
28
27
|
}
|
|
29
28
|
), r = f(() => {
|
|
30
29
|
var e;
|
|
31
|
-
return ((e =
|
|
30
|
+
return ((e = n.activeFlow) == null ? void 0 : e.selectedScopes) || [];
|
|
32
31
|
});
|
|
33
|
-
function w(e,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
e
|
|
37
|
-
]) : s.updateScheme(
|
|
38
|
-
`flows.${s.schemeModel.flowKey}.selectedScopes`,
|
|
32
|
+
function w(e, a) {
|
|
33
|
+
a ? n.updateScheme("flow.selectedScopes", [...r.value, e]) : n.updateScheme(
|
|
34
|
+
"flow.selectedScopes",
|
|
39
35
|
r.value.filter((t) => t !== e)
|
|
40
36
|
);
|
|
41
37
|
}
|
|
42
|
-
return (e,
|
|
43
|
-
default:
|
|
44
|
-
l("div",
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
return (e, a) => (m(), h(o(_), { class: "items-center min-h-8 h-auto" }, {
|
|
39
|
+
default: s(() => [
|
|
40
|
+
l("div", O, [
|
|
41
|
+
$,
|
|
42
|
+
c(o(F), {
|
|
47
43
|
as: "div",
|
|
48
44
|
class: "flex flex-col w-full"
|
|
49
45
|
}, {
|
|
50
|
-
default:
|
|
51
|
-
|
|
52
|
-
default:
|
|
46
|
+
default: s(() => [
|
|
47
|
+
c(o(k), { class: "group/scopes-accordion flex items-center text-left min-h-8 gap-1.5 h-auto pl-2 hover:bg-b-2 pr-2.5 cursor-pointer" }, {
|
|
48
|
+
default: s(({ open: t }) => {
|
|
53
49
|
var i, u, d;
|
|
54
50
|
return [
|
|
55
|
-
l("div",
|
|
56
|
-
|
|
51
|
+
l("div", j, " Selected " + p(((u = (i = e.activeFlow) == null ? void 0 : i.selectedScopes) == null ? void 0 : u.length) || 0) + " / " + p(Object.keys(((d = e.activeFlow) == null ? void 0 : d.scopes) ?? {}).length || 0), 1),
|
|
52
|
+
c(o(y), {
|
|
57
53
|
class: "text-c-3 group-hover/scopes-accordion:text-c-2",
|
|
58
54
|
icon: t ? "ChevronDown" : "ChevronRight",
|
|
59
55
|
size: "xs"
|
|
@@ -62,25 +58,25 @@ const B = { class: "flex h-full w-full" }, M = /* @__PURE__ */ l("div", { class:
|
|
|
62
58
|
}),
|
|
63
59
|
_: 1
|
|
64
60
|
}),
|
|
65
|
-
|
|
66
|
-
default:
|
|
67
|
-
l("table",
|
|
68
|
-
(m(!0), g(b, null,
|
|
61
|
+
c(o(D), { as: "template" }, {
|
|
62
|
+
default: s(() => [
|
|
63
|
+
l("table", E, [
|
|
64
|
+
(m(!0), g(b, null, C(x.value, ({ id: t, label: i, description: u }) => (m(), h(o(V), {
|
|
69
65
|
key: t,
|
|
70
66
|
class: "text-c-2",
|
|
71
67
|
onClick: (d) => w(t, !r.value.includes(t))
|
|
72
68
|
}, {
|
|
73
|
-
default:
|
|
74
|
-
|
|
75
|
-
default:
|
|
69
|
+
default: s(() => [
|
|
70
|
+
c(o(_), { class: "w-full px-2 py-1.5 hover:bg-b-2 cursor-pointer" }, {
|
|
71
|
+
default: s(() => [
|
|
76
72
|
l("span", null, [
|
|
77
|
-
l("span",
|
|
73
|
+
l("span", I, p(i), 1),
|
|
78
74
|
l("span", null, " – " + p(u), 1)
|
|
79
75
|
])
|
|
80
76
|
]),
|
|
81
77
|
_: 2
|
|
82
78
|
}, 1024),
|
|
83
|
-
|
|
79
|
+
c(o(B), {
|
|
84
80
|
modelValue: r.value.includes(t),
|
|
85
81
|
"onUpdate:modelValue": () => {
|
|
86
82
|
}
|
|
@@ -102,5 +98,5 @@ const B = { class: "flex h-full w-full" }, M = /* @__PURE__ */ l("div", { class:
|
|
|
102
98
|
}
|
|
103
99
|
});
|
|
104
100
|
export {
|
|
105
|
-
|
|
101
|
+
P as default
|
|
106
102
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { SecuritySchemePayload } from '@scalar/oas-utils/entities/workspace/security';
|
|
2
|
+
export type SecuritySchemeOption = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
labelWithoutId: string;
|
|
6
|
+
payload?: SecuritySchemePayload;
|
|
7
|
+
};
|
|
8
|
+
export type SecuritySchemeGroup = {
|
|
9
|
+
label: string;
|
|
10
|
+
options: SecuritySchemeOption[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Add auth options for Request Auth
|
|
14
|
+
*
|
|
15
|
+
* We store it as a dictionary first for quick lookups then convert to an array of options
|
|
16
|
+
*/
|
|
17
|
+
export declare const ADD_AUTH_DICT: {
|
|
18
|
+
readonly apiKeyCookie: {
|
|
19
|
+
readonly label: "API Key in Cookies";
|
|
20
|
+
readonly payload: {
|
|
21
|
+
readonly type: "apiKey";
|
|
22
|
+
readonly in: "cookie";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
readonly apiKeyHeader: {
|
|
26
|
+
readonly label: "API Key in Headers";
|
|
27
|
+
readonly payload: {
|
|
28
|
+
readonly type: "apiKey";
|
|
29
|
+
readonly in: "header";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly apiKeyQuery: {
|
|
33
|
+
readonly label: "API Key in Query Params";
|
|
34
|
+
readonly payload: {
|
|
35
|
+
readonly type: "apiKey";
|
|
36
|
+
readonly in: "query";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly httpBasic: {
|
|
40
|
+
readonly label: "HTTP Basic";
|
|
41
|
+
readonly payload: {
|
|
42
|
+
readonly type: "http";
|
|
43
|
+
readonly scheme: "basic";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
readonly httpBearer: {
|
|
47
|
+
readonly label: "HTTP Bearer";
|
|
48
|
+
readonly payload: {
|
|
49
|
+
readonly type: "http";
|
|
50
|
+
readonly scheme: "bearer";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly oauth2Implicit: {
|
|
54
|
+
readonly label: "Oauth2 Implicit Flow";
|
|
55
|
+
readonly payload: {
|
|
56
|
+
readonly type: "oauth2";
|
|
57
|
+
readonly flow: {
|
|
58
|
+
readonly type: "implicit";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
readonly oauth2Password: {
|
|
63
|
+
readonly label: "Oauth2 Password Flow";
|
|
64
|
+
readonly payload: {
|
|
65
|
+
readonly type: "oauth2";
|
|
66
|
+
readonly flow: {
|
|
67
|
+
readonly type: "password";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
readonly oauth2ClientCredentials: {
|
|
72
|
+
readonly label: "Oauth2 Client Credentials";
|
|
73
|
+
readonly payload: {
|
|
74
|
+
readonly type: "oauth2";
|
|
75
|
+
readonly flow: {
|
|
76
|
+
readonly type: "clientCredentials";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
readonly oauth2AuthorizationFlow: {
|
|
81
|
+
readonly label: "Oauth2 Authorization Code";
|
|
82
|
+
readonly payload: {
|
|
83
|
+
readonly type: "oauth2";
|
|
84
|
+
readonly flow: {
|
|
85
|
+
readonly type: "authorizationCode";
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/** Options for the dropdown to add new auth */
|
|
91
|
+
export declare const ADD_AUTH_OPTIONS: SecuritySchemeOption[];
|
|
92
|
+
//# sourceMappingURL=new-auth-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-auth-options.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/new-auth-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAA;AAG1F,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEhB,CAAA;AAIV,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,EAAE,oBAAoB,EAOlD,CAAA"}
|