@scalar/api-client 2.0.33 → 2.0.35
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 +28 -0
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +39 -31
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +65 -55
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +53 -44
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +42 -34
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +126 -70
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +37 -29
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +97 -85
- package/dist/components/CommandPalette/handleKeyDown.d.ts +2 -0
- package/dist/components/CommandPalette/handleKeyDown.d.ts.map +1 -0
- package/dist/components/CommandPalette/handleKeyDown.js +7 -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/Form/Form.vue.js +1 -1
- package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.js +14 -16
- 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 +125 -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/components/Sidebar/SidebarButton.vue.js +1 -1
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +9 -9
- package/dist/constants.d.ts +0 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -2
- 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 +1036 -1218
- package/dist/layouts/Modal/api-client-modal.d.ts.map +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 +3 -5
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +73 -67
- 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.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +101 -102
- 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/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 +9 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA0MA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;UAO1C,OAAO,GAAG,cAAc;;UAAxB,OAAO,GAAG,cAAc;;AAkdhC,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,117 +1,154 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { defineComponent as V, computed as q, ref as I, openBlock as E, createElementBlock as $, Fragment as B, createVNode as a, unref as e, withCtx as l, createBlock as A, createCommentVNode as F, createElementVNode as r, createTextVNode as C } from "vue";
|
|
2
|
+
import P from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
3
|
+
import { commandPaletteBus as T } from "../../libs/eventBusses/command-palette.js";
|
|
4
|
+
import { PathId as b } from "../../router.js";
|
|
5
|
+
import { useWorkspace as U } from "../../store/workspace.js";
|
|
6
|
+
import { useModal as g, ScalarDropdown as W, ScalarDropdownItem as p, ScalarIcon as u, ScalarButton as f, ScalarModal as N, ScalarTextField as j } from "@scalar/components";
|
|
7
|
+
import { useRouter as G } from "vue-router";
|
|
8
|
+
const H = /* @__PURE__ */ r("span", null, "Add Example", -1), J = /* @__PURE__ */ r("span", null, "Rename", -1), K = /* @__PURE__ */ r("span", null, "Delete", -1), L = { class: "flex gap-3" }, ae = /* @__PURE__ */ V({
|
|
8
9
|
__name: "RequestSidebarItemMenu",
|
|
9
10
|
props: {
|
|
10
11
|
item: {}
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
activeWorkspace:
|
|
15
|
-
activeRouterParams:
|
|
16
|
-
findRequestFolders:
|
|
17
|
-
requestMutators:
|
|
18
|
-
requestExampleMutators:
|
|
19
|
-
} =
|
|
13
|
+
setup(y) {
|
|
14
|
+
const t = y, {
|
|
15
|
+
activeWorkspace: v,
|
|
16
|
+
activeRouterParams: x,
|
|
17
|
+
findRequestFolders: D,
|
|
18
|
+
requestMutators: _,
|
|
19
|
+
requestExampleMutators: R
|
|
20
|
+
} = U(), { replace: h } = G(), M = () => T.emit({
|
|
20
21
|
commandName: "Add Example",
|
|
21
|
-
metaData:
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
console.log("duplicate");
|
|
26
|
-
}, D = () => {
|
|
27
|
-
if ("requestUid" in a.item)
|
|
28
|
-
h.delete(a.item), r.value[p.Examples] === a.item.uid && m(`/workspace/${c.value}/request/default`);
|
|
22
|
+
metaData: t.item.uid
|
|
23
|
+
}), S = () => {
|
|
24
|
+
if ("requestUid" in t.item)
|
|
25
|
+
R.delete(t.item), x.value[b.Examples] === t.item.uid && h(`/workspace/${v.value}/request/default`);
|
|
29
26
|
else {
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
32
|
-
|
|
27
|
+
const c = D(t.item.uid);
|
|
28
|
+
if (!c.length) return;
|
|
29
|
+
_.delete(t.item, c[0]), x.value[b.Request] === t.item.uid && h(`/workspace/${v.value.uid}/request/default`);
|
|
33
30
|
}
|
|
34
|
-
}, q =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
}, n = q(() => "summary" in t.item), k = q(() => "summary" in t.item ? t.item.summary || "" : "name" in t.item && t.item.name || ""), i = I(""), w = () => {
|
|
32
|
+
"summary" in t.item ? _.edit(t.item.uid, "summary", i.value) : "summary" in t.item || R.edit(t.item.uid, "name", i.value), i.value = "", o.hide();
|
|
33
|
+
}, o = g(), d = g(), z = () => {
|
|
34
|
+
i.value = k.value, o.show();
|
|
35
|
+
};
|
|
36
|
+
return (c, s) => (E(), $(B, null, [
|
|
37
|
+
a(e(W), { teleport: "#scalar-client" }, {
|
|
38
|
+
items: l(() => [
|
|
39
|
+
n.value ? (E(), A(e(p), {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: "flex !gap-2",
|
|
42
|
+
onClick: M
|
|
43
|
+
}, {
|
|
44
|
+
default: l(() => [
|
|
45
|
+
a(e(u), {
|
|
46
|
+
class: "inline-flex",
|
|
47
|
+
icon: "Add",
|
|
48
|
+
size: "sm"
|
|
49
|
+
}),
|
|
50
|
+
H
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
})) : F("", !0),
|
|
54
|
+
a(e(p), {
|
|
55
|
+
class: "flex !gap-2",
|
|
56
|
+
onClick: z
|
|
57
|
+
}, {
|
|
58
|
+
default: l(() => [
|
|
59
|
+
a(e(u), {
|
|
60
|
+
class: "inline-flex",
|
|
61
|
+
icon: "Edit",
|
|
62
|
+
size: "sm"
|
|
63
|
+
}),
|
|
64
|
+
J
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
}),
|
|
68
|
+
a(e(p), {
|
|
69
|
+
class: "flex !gap-2",
|
|
70
|
+
onClick: s[0] || (s[0] = (m) => e(d).show())
|
|
71
|
+
}, {
|
|
72
|
+
default: l(() => [
|
|
73
|
+
a(e(u), {
|
|
74
|
+
class: "inline-flex",
|
|
75
|
+
icon: "Trash",
|
|
76
|
+
size: "sm"
|
|
77
|
+
}),
|
|
78
|
+
K
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
})
|
|
82
|
+
]),
|
|
83
|
+
default: l(() => [
|
|
84
|
+
a(e(f), {
|
|
85
|
+
class: "z-10 hover:bg-b-3 transition-none p-1 group-hover:flex ui-open:flex absolute left-0 hidden -translate-x-full -ml-1",
|
|
86
|
+
size: "sm",
|
|
87
|
+
variant: "ghost"
|
|
88
|
+
}, {
|
|
89
|
+
default: l(() => [
|
|
90
|
+
a(e(u), {
|
|
91
|
+
icon: "Ellipses",
|
|
92
|
+
size: "sm"
|
|
93
|
+
})
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
})
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
}),
|
|
100
|
+
a(e(N), {
|
|
101
|
+
size: "sm",
|
|
102
|
+
state: e(d),
|
|
103
|
+
title: n.value ? "Delete Request" : "Delete Example"
|
|
104
|
+
}, {
|
|
105
|
+
default: l(() => [
|
|
106
|
+
a(P, {
|
|
107
|
+
variableName: k.value,
|
|
108
|
+
onClose: s[1] || (s[1] = (m) => e(d).hide()),
|
|
109
|
+
onDelete: S
|
|
110
|
+
}, null, 8, ["variableName"])
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 8, ["state", "title"]),
|
|
114
|
+
a(e(N), {
|
|
115
|
+
state: e(o),
|
|
116
|
+
title: n.value ? "Rename Request" : "Rename Example"
|
|
117
|
+
}, {
|
|
118
|
+
default: l(() => [
|
|
119
|
+
a(e(j), {
|
|
120
|
+
modelValue: i.value,
|
|
121
|
+
"onUpdate:modelValue": s[2] || (s[2] = (m) => i.value = m),
|
|
122
|
+
label: n.value ? "Request" : "Example"
|
|
123
|
+
}, null, 8, ["modelValue", "label"]),
|
|
124
|
+
r("div", L, [
|
|
125
|
+
a(e(f), {
|
|
126
|
+
class: "flex-1",
|
|
127
|
+
variant: "outlined",
|
|
128
|
+
onClick: s[3] || (s[3] = (m) => e(o).hide())
|
|
129
|
+
}, {
|
|
130
|
+
default: l(() => [
|
|
131
|
+
C(" Cancel ")
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
47
134
|
}),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
t(e(s), {
|
|
58
|
-
class: "inline-flex",
|
|
59
|
-
icon: "Edit",
|
|
60
|
-
size: "sm"
|
|
61
|
-
}),
|
|
62
|
-
N
|
|
63
|
-
]),
|
|
64
|
-
_: 1
|
|
65
|
-
}),
|
|
66
|
-
t(e(o), {
|
|
67
|
-
class: "flex !gap-2",
|
|
68
|
-
onClick: g
|
|
69
|
-
}, {
|
|
70
|
-
default: l(() => [
|
|
71
|
-
t(e(s), {
|
|
72
|
-
class: "inline-flex",
|
|
73
|
-
icon: "Duplicate",
|
|
74
|
-
size: "sm"
|
|
75
|
-
}),
|
|
76
|
-
M
|
|
77
|
-
]),
|
|
78
|
-
_: 1
|
|
79
|
-
}),
|
|
80
|
-
t(e(S)),
|
|
81
|
-
t(e(o), {
|
|
82
|
-
class: "flex !gap-2",
|
|
83
|
-
onClick: D
|
|
84
|
-
}, {
|
|
85
|
-
default: l(() => [
|
|
86
|
-
t(e(s), {
|
|
87
|
-
class: "inline-flex",
|
|
88
|
-
icon: "Trash",
|
|
89
|
-
size: "sm"
|
|
90
|
-
}),
|
|
91
|
-
P
|
|
92
|
-
]),
|
|
93
|
-
_: 1
|
|
94
|
-
})
|
|
95
|
-
]),
|
|
96
|
-
default: l(() => [
|
|
97
|
-
t(e(b), {
|
|
98
|
-
class: "z-10 hover:bg-b-3 transition-none p-1 group-hover:flex ui-open:flex absolute left-0 hidden -translate-x-full -ml-1",
|
|
99
|
-
size: "sm",
|
|
100
|
-
variant: "ghost"
|
|
101
|
-
}, {
|
|
102
|
-
default: l(() => [
|
|
103
|
-
t(e(s), {
|
|
104
|
-
icon: "Ellipses",
|
|
105
|
-
size: "sm"
|
|
135
|
+
a(e(f), {
|
|
136
|
+
class: "flex-1",
|
|
137
|
+
type: "submit",
|
|
138
|
+
onClick: w
|
|
139
|
+
}, {
|
|
140
|
+
default: l(() => [
|
|
141
|
+
C(" Save ")
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
106
144
|
})
|
|
107
|
-
])
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
])
|
|
111
|
-
|
|
112
|
-
}));
|
|
145
|
+
])
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["state", "title"])
|
|
149
|
+
], 64));
|
|
113
150
|
}
|
|
114
151
|
});
|
|
115
152
|
export {
|
|
116
|
-
|
|
153
|
+
ae as default
|
|
117
154
|
};
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type SecuritySchemeOptionOauth } from '../../../views/Request/libs/index.js';
|
|
3
|
-
import type { SelectedSchemeOauth2 } from '@scalar/oas-utils/entities/workspace/security';
|
|
1
|
+
import type { SecuritySchemeOauth2 } from '@scalar/oas-utils/entities/workspace/security';
|
|
4
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
5
|
-
|
|
6
|
-
schemeModel: SecuritySchemeOptionOauth;
|
|
7
|
-
updateScheme: UpdateScheme;
|
|
3
|
+
scheme: SecuritySchemeOauth2;
|
|
8
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
9
|
-
|
|
10
|
-
schemeModel: SecuritySchemeOptionOauth;
|
|
11
|
-
updateScheme: UpdateScheme;
|
|
5
|
+
scheme: SecuritySchemeOauth2;
|
|
12
6
|
}>>>, {}, {}>;
|
|
13
7
|
export default _default;
|
|
14
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/OAuth2.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/OAuth2.vue"],"names":[],"mappings":"AAwLA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAA;;YAO/E,oBAAoB;;YAApB,oBAAoB;;AA4f9B,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,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"}
|