@scalar/api-client 2.2.8 → 2.2.9
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 +21 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +65 -65
- package/dist/components/CodeInput/codeVariableWidget.d.ts +6 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +72 -68
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.vue.js +20 -15
- package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.js +16 -11
- package/dist/components/DataTable/DataTableHeader.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableHeader.vue.js +11 -12
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -1
- 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 +9 -9
- package/dist/components/DataTable/index.js +14 -14
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +87 -67
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +2 -2
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +4 -4
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +8 -4
- 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 +52 -32
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +3 -0
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +43 -31
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +32 -31
- package/dist/layouts/App/create-api-client-app.d.ts +49 -42
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +103 -89
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +31 -19
- package/dist/layouts/Web/create-api-client-web.d.ts +49 -42
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +50 -44
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/env-helpers.d.ts +9 -0
- package/dist/libs/env-helpers.d.ts.map +1 -0
- package/dist/libs/env-helpers.js +4 -0
- package/dist/libs/environment-parser.d.ts +3 -4
- package/dist/libs/environment-parser.d.ts.map +1 -1
- package/dist/libs/environment-parser.js +5 -4
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +24 -22
- package/dist/libs/send-request/send-request.d.ts +5 -2
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +106 -104
- package/dist/routes.d.ts +11 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +13 -7
- package/dist/store/active-entities.d.ts +18 -11
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +108 -69
- package/dist/store/collections.d.ts +17 -15
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +62 -41
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +7 -3
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/router-params.d.ts +1 -1
- package/dist/store/router-params.d.ts.map +1 -1
- package/dist/store/router-params.js +7 -7
- package/dist/store/store.d.ts +49 -42
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +76 -72
- package/dist/store/workspace.d.ts +12 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/vue.d.ts +10 -0
- package/dist/types/vue.d.ts.map +1 -0
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +75 -70
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +308 -152
- package/dist/views/Environment/EnvironmentColorModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColorModal.vue.js +20 -18
- package/dist/views/Environment/EnvironmentColors.vue.d.ts +4 -1
- package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColors.vue.js +83 -58
- package/dist/views/Environment/EnvironmentModal.vue.d.ts +7 -0
- package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentModal.vue.js +119 -37
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +4 -5
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +73 -63
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +60 -61
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +185 -187
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +27 -24
- 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 +35 -187
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +207 -0
- package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue.d.ts → RequestAuth/RequestAuthDataTableInput.vue.d.ts} +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +43 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +5 -134
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +176 -2
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +2 -0
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/index.js +4 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +129 -109
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +32 -38
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/auth.js +3 -3
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +9 -8
- package/package.json +19 -9
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +0 -1
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.js +0 -46
- /package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue2.js → RequestAuth/RequestAuthDataTableInput.vue2.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as K, ref as
|
|
1
|
+
import { defineComponent as K, ref as y, computed as N, watch as P, onMounted as X, onBeforeUnmount as Y, openBlock as h, createElementBlock as Z, Fragment as _, createElementVNode as ee, normalizeClass as O, unref as s, createVNode as d, withCtx as g, createBlock as I, createCommentVNode as T } from "vue";
|
|
2
2
|
import te from "../../components/ImportCurl/ImportCurlModal.vue.js";
|
|
3
3
|
import oe from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
4
4
|
import re from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
@@ -20,48 +20,47 @@ const He = /* @__PURE__ */ K({
|
|
|
20
20
|
__name: "Request",
|
|
21
21
|
emits: ["newTab"],
|
|
22
22
|
setup(Re) {
|
|
23
|
-
const
|
|
23
|
+
const M = ye(), { toast: w } = de(), {
|
|
24
24
|
activeCollection: x,
|
|
25
25
|
activeExample: v,
|
|
26
|
-
activeEnvironment:
|
|
27
|
-
activeRequest:
|
|
26
|
+
activeEnvironment: U,
|
|
27
|
+
activeRequest: R,
|
|
28
28
|
activeWorkspace: a,
|
|
29
29
|
activeServer: A
|
|
30
30
|
} = ue(), {
|
|
31
31
|
cookies: H,
|
|
32
32
|
isReadOnly: l,
|
|
33
33
|
modalState: n,
|
|
34
|
-
requestHistory:
|
|
34
|
+
requestHistory: k,
|
|
35
35
|
securitySchemes: L,
|
|
36
36
|
requestMutators: $,
|
|
37
|
-
serverMutators:
|
|
38
|
-
servers:
|
|
37
|
+
serverMutators: j,
|
|
38
|
+
servers: W,
|
|
39
39
|
events: p
|
|
40
|
-
} =
|
|
41
|
-
() =>
|
|
42
|
-
var
|
|
43
|
-
return o.request.uid === ((
|
|
40
|
+
} = M, u = y(!l), E = y(), t = y(), q = y(""), z = ve(), D = N(
|
|
41
|
+
() => k.findLast((o) => {
|
|
42
|
+
var e;
|
|
43
|
+
return o.request.uid === ((e = v.value) == null ? void 0 : e.uid);
|
|
44
44
|
})
|
|
45
45
|
), { mediaQueries: F } = ce();
|
|
46
46
|
P(F.md, (o) => u.value = o);
|
|
47
|
-
const
|
|
47
|
+
const V = N(
|
|
48
48
|
() => {
|
|
49
|
-
var o,
|
|
50
|
-
return (l ? (o = x.value) == null ? void 0 : o.selectedSecuritySchemeUids : (
|
|
49
|
+
var o, e;
|
|
50
|
+
return (l ? (o = x.value) == null ? void 0 : o.selectedSecuritySchemeUids : (e = R.value) == null ? void 0 : e.selectedSecuritySchemeUids) ?? [];
|
|
51
51
|
}
|
|
52
52
|
), C = async () => {
|
|
53
|
-
|
|
54
|
-
if (!q.value || !v.value || !x.value)
|
|
53
|
+
if (!R.value || !v.value || !x.value)
|
|
55
54
|
return;
|
|
56
|
-
const o =
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
request:
|
|
55
|
+
const o = typeof U.value == "object" ? U.value.value : "{}", e = me.parse(o);
|
|
56
|
+
e.error && console.error("INVALID ENVIRONMENT!");
|
|
57
|
+
const r = e.error || typeof e.data != "object" ? {} : e.data ?? {}, f = a.value.cookies.map((S) => H[S]), [i, m] = fe({
|
|
58
|
+
request: R.value,
|
|
60
59
|
example: v.value,
|
|
61
|
-
selectedSecuritySchemeUids:
|
|
60
|
+
selectedSecuritySchemeUids: V.value,
|
|
62
61
|
proxyUrl: a.value.proxyUrl ?? "",
|
|
63
|
-
environment:
|
|
64
|
-
globalCookies:
|
|
62
|
+
environment: r,
|
|
63
|
+
globalCookies: f,
|
|
65
64
|
status: p.requestStatus,
|
|
66
65
|
securitySchemes: L,
|
|
67
66
|
server: A.value
|
|
@@ -70,96 +69,96 @@ const He = /* @__PURE__ */ K({
|
|
|
70
69
|
w(i.message, "error");
|
|
71
70
|
return;
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
const [c,
|
|
75
|
-
c ? w(c.message, "error") :
|
|
72
|
+
E.value = m.controller;
|
|
73
|
+
const [c, b] = await m.sendRequest();
|
|
74
|
+
c ? w(c.message, "error") : k.push(b);
|
|
76
75
|
}, Q = async () => {
|
|
77
76
|
var o;
|
|
78
|
-
return (o =
|
|
77
|
+
return (o = E.value) == null ? void 0 : o.abort(Se.REQUEST_ABORTED);
|
|
79
78
|
};
|
|
80
79
|
X(() => {
|
|
81
80
|
p.executeRequest.on(C), p.cancelRequest.on(Q);
|
|
82
81
|
}), ie(), Y(() => p.executeRequest.off(C));
|
|
83
82
|
function J({ requestName: o }) {
|
|
84
|
-
var r, i, m
|
|
85
|
-
if (!
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
(
|
|
89
|
-
var
|
|
90
|
-
return
|
|
83
|
+
var r, f, i, m;
|
|
84
|
+
if (!t.value) return;
|
|
85
|
+
if (t.value.servers) {
|
|
86
|
+
const c = Object.values(W).find(
|
|
87
|
+
(b) => {
|
|
88
|
+
var S, B;
|
|
89
|
+
return b.url === ((B = (S = t == null ? void 0 : t.value) == null ? void 0 : S.servers) == null ? void 0 : B[0]);
|
|
91
90
|
}
|
|
92
91
|
);
|
|
93
|
-
|
|
94
|
-
{ url:
|
|
92
|
+
c ? q.value = c.uid : q.value = j.add(
|
|
93
|
+
{ url: t.value.servers[0] },
|
|
95
94
|
a.value.collections[0]
|
|
96
95
|
).uid;
|
|
97
96
|
}
|
|
98
|
-
const
|
|
97
|
+
const e = $.add(
|
|
99
98
|
{
|
|
100
99
|
summary: o,
|
|
101
|
-
path: (r =
|
|
102
|
-
method: (
|
|
103
|
-
parameters: (
|
|
104
|
-
selectedServerUid:
|
|
105
|
-
requestBody: (
|
|
100
|
+
path: (r = t == null ? void 0 : t.value) == null ? void 0 : r.path,
|
|
101
|
+
method: (f = t == null ? void 0 : t.value) == null ? void 0 : f.method,
|
|
102
|
+
parameters: (i = t == null ? void 0 : t.value) == null ? void 0 : i.parameters,
|
|
103
|
+
selectedServerUid: q.value,
|
|
104
|
+
requestBody: (m = t == null ? void 0 : t.value) == null ? void 0 : m.requestBody
|
|
106
105
|
},
|
|
107
106
|
a.value.collections[0]
|
|
108
107
|
);
|
|
109
|
-
|
|
110
|
-
`/workspace/${a.value.uid}/request/${
|
|
108
|
+
e && z.push(
|
|
109
|
+
`/workspace/${a.value.uid}/request/${e.uid}`
|
|
111
110
|
), n.hide();
|
|
112
111
|
}
|
|
113
112
|
function G(o) {
|
|
114
|
-
|
|
113
|
+
t.value = se(o), n.show();
|
|
115
114
|
}
|
|
116
|
-
return (o,
|
|
115
|
+
return (o, e) => (h(), Z(_, null, [
|
|
117
116
|
ee("div", {
|
|
118
|
-
class:
|
|
117
|
+
class: O(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative z-0 overflow-hidden", {
|
|
119
118
|
"!mr-0 !mb-0 !border-0": s(l)
|
|
120
119
|
}])
|
|
121
120
|
}, [
|
|
122
121
|
d(le, {
|
|
123
122
|
modelValue: u.value,
|
|
124
|
-
"onUpdate:modelValue":
|
|
123
|
+
"onUpdate:modelValue": e[0] || (e[0] = (r) => u.value = r),
|
|
125
124
|
isReadonly: s(l),
|
|
126
|
-
onHideModal:
|
|
125
|
+
onHideModal: e[1] || (e[1] = () => s(n).hide()),
|
|
127
126
|
onImportCurl: G
|
|
128
127
|
}, null, 8, ["modelValue", "isReadonly"]),
|
|
129
128
|
d(oe, null, {
|
|
130
|
-
default:
|
|
129
|
+
default: g(() => [
|
|
131
130
|
d(pe, {
|
|
132
131
|
isReadonly: s(l),
|
|
133
132
|
showSidebar: u.value,
|
|
134
|
-
onNewTab:
|
|
135
|
-
"onUpdate:showSidebar":
|
|
133
|
+
onNewTab: e[2] || (e[2] = (r) => o.$emit("newTab", r)),
|
|
134
|
+
"onUpdate:showSidebar": e[3] || (e[3] = (r) => u.value = r)
|
|
136
135
|
}, null, 8, ["isReadonly", "showSidebar"]),
|
|
137
|
-
s(v) ? (
|
|
136
|
+
s(v) ? (h(), I(re, {
|
|
138
137
|
key: 0,
|
|
139
|
-
class:
|
|
138
|
+
class: O(["flex-1", [u.value ? "sidebar-active-hide-layout" : ""]])
|
|
140
139
|
}, {
|
|
141
|
-
default:
|
|
140
|
+
default: g(() => {
|
|
142
141
|
var r;
|
|
143
142
|
return [
|
|
144
|
-
d(ae, { selectedSecuritySchemeUids:
|
|
143
|
+
d(ae, { selectedSecuritySchemeUids: V.value }, null, 8, ["selectedSecuritySchemeUids"]),
|
|
145
144
|
d(ne, {
|
|
146
145
|
response: (r = D.value) == null ? void 0 : r.response
|
|
147
146
|
}, null, 8, ["response"])
|
|
148
147
|
];
|
|
149
148
|
}),
|
|
150
149
|
_: 1
|
|
151
|
-
}, 8, ["class"])) :
|
|
150
|
+
}, 8, ["class"])) : T("", !0)
|
|
152
151
|
]),
|
|
153
152
|
_: 1
|
|
154
153
|
})
|
|
155
154
|
], 2),
|
|
156
|
-
|
|
155
|
+
t.value ? (h(), I(te, {
|
|
157
156
|
key: 0,
|
|
158
|
-
parsedCurl:
|
|
157
|
+
parsedCurl: t.value,
|
|
159
158
|
state: s(n),
|
|
160
|
-
onClose:
|
|
159
|
+
onClose: e[4] || (e[4] = (r) => s(n).hide()),
|
|
161
160
|
onImportCurl: J
|
|
162
|
-
}, null, 8, ["parsedCurl", "state"])) :
|
|
161
|
+
}, null, 8, ["parsedCurl", "state"])) : T("", !0)
|
|
163
162
|
], 64));
|
|
164
163
|
}
|
|
165
164
|
});
|
|
@@ -2,6 +2,7 @@ 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';
|
|
5
6
|
};
|
|
6
7
|
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
8
|
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":"AAuOA,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;IAChB,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CAChC,CAAC;;AA6dF,wBAMG"}
|
|
@@ -1,232 +1,230 @@
|
|
|
1
|
-
import { defineComponent as T, openBlock as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { authorizeOauth2 as
|
|
10
|
-
import { useWorkspace as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as T, openBlock as s, createElementBlock as w, Fragment as y, createVNode as a, unref as r, withCtx as o, createTextVNode as d, createElementVNode as V, createBlock as m, createCommentVNode as i } from "vue";
|
|
2
|
+
import { useActiveEntities as L } from "../../../../store/active-entities.js";
|
|
3
|
+
import { useLoadingState as P, ScalarButton as U } from "@scalar/components";
|
|
4
|
+
import { pkceOptions as R } from "@scalar/oas-utils/entities/spec";
|
|
5
|
+
import { useToasts as A } from "@scalar/use-toasts";
|
|
6
|
+
import B from "./OAuthScopesInput.vue.js";
|
|
7
|
+
import f from "./RequestAuthDataTableInput.vue.js";
|
|
8
|
+
import n from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
9
|
+
import { authorizeOauth2 as F } from "../../libs/oauth2.js";
|
|
10
|
+
import { useWorkspace as b } from "../../../../store/store.js";
|
|
11
|
+
const I = { class: "h-8 flex items-center justify-self-end" }, O = { class: "h-8 flex items-center justify-end border-t-1/2 w-full" }, Y = /* @__PURE__ */ T({
|
|
12
12
|
__name: "OAuth2",
|
|
13
13
|
props: {
|
|
14
14
|
scheme: {},
|
|
15
|
-
flow: {}
|
|
15
|
+
flow: {},
|
|
16
|
+
layout: { default: "client" }
|
|
16
17
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const p =
|
|
18
|
+
setup(k) {
|
|
19
|
+
const p = P(), { toast: g } = A(), { activeCollection: $, activeServer: v, activeWorkspace: S } = L(), { securitySchemeMutators: z } = b(), u = (l, e) => z.edit(k.scheme.uid, l, e), C = async () => {
|
|
19
20
|
var t;
|
|
20
|
-
if (p.isLoading || !((t =
|
|
21
|
+
if (p.isLoading || !((t = $.value) != null && t.uid)) return;
|
|
21
22
|
p.startLoading();
|
|
22
|
-
const [l, e] = await
|
|
23
|
-
|
|
23
|
+
const [l, e] = await F(
|
|
24
|
+
k.flow,
|
|
24
25
|
v.value,
|
|
25
26
|
S.value.proxyUrl
|
|
26
27
|
).finally(() => p.stopLoading());
|
|
27
|
-
e ?
|
|
28
|
+
e ? u(`flows.${k.flow.type}.token`, e) : (console.error(l), g((l == null ? void 0 : l.message) ?? "Failed to authorize", "error"));
|
|
28
29
|
};
|
|
29
|
-
return (l, e) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, {
|
|
40
|
-
default: o(() => e[10] || (e[10] = [
|
|
41
|
-
s(" Access Token ")
|
|
42
|
-
])),
|
|
43
|
-
_: 1
|
|
44
|
-
}, 8, ["modelValue"])
|
|
45
|
-
]),
|
|
46
|
-
_: 1
|
|
47
|
-
}),
|
|
48
|
-
d(a(u), { class: "min-w-full" }, {
|
|
49
|
-
default: o(() => [
|
|
50
|
-
V("div", R, [
|
|
51
|
-
d(a(U), {
|
|
52
|
-
class: "p-0 py-0.5 px-2 mr-1",
|
|
53
|
-
loading: a(p),
|
|
54
|
-
size: "sm",
|
|
55
|
-
variant: "outlined",
|
|
56
|
-
onClick: e[1] || (e[1] = (t) => r(`flows.${l.flow.type}.token`, ""))
|
|
30
|
+
return (l, e) => (s(), w(y, null, [
|
|
31
|
+
l.flow.token ? (s(), w(y, { key: 0 }, [
|
|
32
|
+
a(r(n), null, {
|
|
33
|
+
default: o(() => [
|
|
34
|
+
a(f, {
|
|
35
|
+
class: "border-r-transparent",
|
|
36
|
+
modelValue: l.flow.token,
|
|
37
|
+
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
38
|
+
type: "password",
|
|
39
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => u(`flows.${l.flow.type}.token`, t))
|
|
57
40
|
}, {
|
|
58
|
-
default: o(() => e[
|
|
59
|
-
|
|
41
|
+
default: o(() => e[10] || (e[10] = [
|
|
42
|
+
d(" Access Token ")
|
|
60
43
|
])),
|
|
61
44
|
_: 1
|
|
62
|
-
}, 8, ["
|
|
63
|
-
])
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
45
|
+
}, 8, ["modelValue"])
|
|
46
|
+
]),
|
|
47
|
+
_: 1
|
|
48
|
+
}),
|
|
49
|
+
a(r(n), { class: "min-w-full" }, {
|
|
50
|
+
default: o(() => [
|
|
51
|
+
V("div", I, [
|
|
52
|
+
a(r(U), {
|
|
53
|
+
class: "p-0 py-0.5 px-2 mr-1",
|
|
54
|
+
loading: r(p),
|
|
55
|
+
size: "sm",
|
|
56
|
+
variant: "outlined",
|
|
57
|
+
onClick: e[1] || (e[1] = (t) => u(`flows.${l.flow.type}.token`, ""))
|
|
58
|
+
}, {
|
|
59
|
+
default: o(() => e[11] || (e[11] = [
|
|
60
|
+
d(" Clear ")
|
|
61
|
+
])),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["loading"])
|
|
64
|
+
])
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
})
|
|
68
|
+
], 64)) : (s(), w(y, { key: 1 }, [
|
|
69
|
+
a(r(n), null, {
|
|
70
|
+
default: o(() => [
|
|
71
|
+
"authorizationUrl" in l.flow ? (s(), m(f, {
|
|
72
|
+
key: 0,
|
|
73
|
+
modelValue: l.flow.authorizationUrl,
|
|
74
|
+
placeholder: "https://galaxy.scalar.com/authorize",
|
|
75
|
+
"onUpdate:modelValue": e[2] || (e[2] = (t) => u(`flows.${l.flow.type}.authorizationUrl`, t))
|
|
76
|
+
}, {
|
|
77
|
+
default: o(() => e[12] || (e[12] = [
|
|
78
|
+
d(" Auth URL ")
|
|
79
|
+
])),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["modelValue"])) : i("", !0),
|
|
82
|
+
"tokenUrl" in l.flow ? (s(), m(f, {
|
|
83
|
+
key: 1,
|
|
84
|
+
modelValue: l.flow.tokenUrl,
|
|
85
|
+
placeholder: "https://galaxy.scalar.com/token",
|
|
86
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => u(`flows.${l.flow.type}.tokenUrl`, t))
|
|
87
|
+
}, {
|
|
88
|
+
default: o(() => e[13] || (e[13] = [
|
|
89
|
+
d(" Token URL ")
|
|
90
|
+
])),
|
|
91
|
+
_: 1
|
|
92
|
+
}, 8, ["modelValue"])) : i("", !0)
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
}),
|
|
96
|
+
"x-scalar-redirect-uri" in l.flow ? (s(), m(r(n), { key: 0 }, {
|
|
97
|
+
default: o(() => [
|
|
98
|
+
a(f, {
|
|
99
|
+
modelValue: l.flow["x-scalar-redirect-uri"],
|
|
100
|
+
placeholder: "https://galaxy.scalar.com/callback",
|
|
101
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => u(`flows.${l.flow.type}.x-scalar-redirect-uri`, t))
|
|
102
|
+
}, {
|
|
103
|
+
default: o(() => e[14] || (e[14] = [
|
|
104
|
+
d(" Redirect URL ")
|
|
105
|
+
])),
|
|
106
|
+
_: 1
|
|
107
|
+
}, 8, ["modelValue"])
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
})) : i("", !0),
|
|
111
|
+
l.flow.type === "password" ? (s(), w(y, { key: 1 }, [
|
|
112
|
+
a(r(n), null, {
|
|
113
|
+
default: o(() => [
|
|
114
|
+
a(f, {
|
|
115
|
+
class: "text-c-2",
|
|
116
|
+
modelValue: l.flow.username,
|
|
117
|
+
placeholder: "janedoe",
|
|
118
|
+
"onUpdate:modelValue": e[5] || (e[5] = (t) => u(`flows.${l.flow.type}.username`, t))
|
|
119
|
+
}, {
|
|
120
|
+
default: o(() => e[15] || (e[15] = [
|
|
121
|
+
d(" Username ")
|
|
122
|
+
])),
|
|
123
|
+
_: 1
|
|
124
|
+
}, 8, ["modelValue"])
|
|
125
|
+
]),
|
|
92
126
|
_: 1
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
])
|
|
127
|
+
}),
|
|
128
|
+
a(r(n), null, {
|
|
129
|
+
default: o(() => [
|
|
130
|
+
a(f, {
|
|
131
|
+
modelValue: l.flow.password,
|
|
132
|
+
placeholder: "********",
|
|
133
|
+
type: "password",
|
|
134
|
+
"onUpdate:modelValue": e[6] || (e[6] = (t) => u(`flows.${l.flow.type}.password`, t))
|
|
135
|
+
}, {
|
|
136
|
+
default: o(() => e[16] || (e[16] = [
|
|
137
|
+
d(" Password ")
|
|
138
|
+
])),
|
|
139
|
+
_: 1
|
|
140
|
+
}, 8, ["modelValue"])
|
|
141
|
+
]),
|
|
108
142
|
_: 1
|
|
109
|
-
}
|
|
110
|
-
]),
|
|
111
|
-
|
|
112
|
-
})) : f("", !0),
|
|
113
|
-
l.flow.type === "password" ? (i(), k(y, { key: 2 }, [
|
|
114
|
-
d(a(u), null, {
|
|
143
|
+
})
|
|
144
|
+
], 64)) : i("", !0),
|
|
145
|
+
a(r(n), null, {
|
|
115
146
|
default: o(() => [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
modelValue: l.flow.
|
|
120
|
-
placeholder: "ScalarEnjoyer01",
|
|
121
|
-
"onUpdate:modelValue": e[5] || (e[5] = (t) => r(`flows.${l.flow.type}.username`, t))
|
|
147
|
+
a(f, {
|
|
148
|
+
modelValue: l.flow["x-scalar-client-id"],
|
|
149
|
+
placeholder: "12345",
|
|
150
|
+
"onUpdate:modelValue": e[7] || (e[7] = (t) => u(`flows.${l.flow.type}.x-scalar-client-id`, t))
|
|
122
151
|
}, {
|
|
123
|
-
default: o(() => e[
|
|
124
|
-
|
|
152
|
+
default: o(() => e[17] || (e[17] = [
|
|
153
|
+
d(" Client ID ")
|
|
125
154
|
])),
|
|
126
155
|
_: 1
|
|
127
|
-
}, 8, ["
|
|
156
|
+
}, 8, ["modelValue"])
|
|
128
157
|
]),
|
|
129
158
|
_: 1
|
|
130
159
|
}),
|
|
131
|
-
|
|
160
|
+
"clientSecret" in l.flow ? (s(), m(r(n), { key: 2 }, {
|
|
132
161
|
default: o(() => [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
placeholder: "xxxxxx",
|
|
162
|
+
a(f, {
|
|
163
|
+
modelValue: l.flow.clientSecret,
|
|
164
|
+
placeholder: "XYZ123",
|
|
137
165
|
type: "password",
|
|
138
|
-
"onUpdate:modelValue": e[
|
|
166
|
+
"onUpdate:modelValue": e[8] || (e[8] = (t) => u(`flows.${l.flow.type}.clientSecret`, t))
|
|
139
167
|
}, {
|
|
140
|
-
default: o(() => e[
|
|
141
|
-
|
|
168
|
+
default: o(() => e[18] || (e[18] = [
|
|
169
|
+
d(" Client Secret ")
|
|
142
170
|
])),
|
|
143
171
|
_: 1
|
|
144
|
-
}, 8, ["
|
|
172
|
+
}, 8, ["modelValue"])
|
|
145
173
|
]),
|
|
146
174
|
_: 1
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
"x-usePkce" in l.flow ? (i(), m(a(u), { key: 4 }, {
|
|
183
|
-
default: o(() => [
|
|
184
|
-
d(n, {
|
|
185
|
-
id: `oauth2-use-pkce-${l.scheme.uid}`,
|
|
186
|
-
enum: a(B),
|
|
187
|
-
modelValue: l.flow["x-usePkce"],
|
|
188
|
-
readOnly: "",
|
|
189
|
-
"onUpdate:modelValue": e[9] || (e[9] = (t) => r(
|
|
190
|
-
`flows.${l.flow.type}.x-usePkce`,
|
|
191
|
-
t
|
|
192
|
-
))
|
|
193
|
-
}, {
|
|
194
|
-
default: o(() => e[19] || (e[19] = [
|
|
195
|
-
s(" Use PKCE ")
|
|
196
|
-
])),
|
|
197
|
-
_: 1
|
|
198
|
-
}, 8, ["id", "enum", "modelValue"])
|
|
199
|
-
]),
|
|
200
|
-
_: 1
|
|
201
|
-
})) : f("", !0),
|
|
202
|
-
Object.keys(l.flow.scopes ?? {}).length ? (i(), m(a(u), { key: 5 }, {
|
|
203
|
-
default: o(() => [
|
|
204
|
-
d(O, {
|
|
205
|
-
flow: l.flow,
|
|
206
|
-
updateScheme: r
|
|
207
|
-
}, null, 8, ["flow"])
|
|
208
|
-
]),
|
|
209
|
-
_: 1
|
|
210
|
-
})) : f("", !0),
|
|
211
|
-
d(a(u), { class: "min-w-full" }, {
|
|
175
|
+
})) : i("", !0),
|
|
176
|
+
"x-usePkce" in l.flow ? (s(), m(r(n), { key: 3 }, {
|
|
177
|
+
default: o(() => [
|
|
178
|
+
a(f, {
|
|
179
|
+
enum: r(R),
|
|
180
|
+
modelValue: l.flow["x-usePkce"],
|
|
181
|
+
readOnly: "",
|
|
182
|
+
"onUpdate:modelValue": e[9] || (e[9] = (t) => u(
|
|
183
|
+
`flows.${l.flow.type}.x-usePkce`,
|
|
184
|
+
t
|
|
185
|
+
))
|
|
186
|
+
}, {
|
|
187
|
+
default: o(() => e[19] || (e[19] = [
|
|
188
|
+
d(" Use PKCE ")
|
|
189
|
+
])),
|
|
190
|
+
_: 1
|
|
191
|
+
}, 8, ["enum", "modelValue"])
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
})) : i("", !0),
|
|
195
|
+
Object.keys(l.flow.scopes ?? {}).length ? (s(), m(r(n), { key: 4 }, {
|
|
196
|
+
default: o(() => [
|
|
197
|
+
a(B, {
|
|
198
|
+
flow: l.flow,
|
|
199
|
+
layout: l.layout,
|
|
200
|
+
updateScheme: u
|
|
201
|
+
}, null, 8, ["flow", "layout"])
|
|
202
|
+
]),
|
|
203
|
+
_: 1
|
|
204
|
+
})) : i("", !0)
|
|
205
|
+
], 64)),
|
|
206
|
+
l.flow.token ? i("", !0) : (s(), m(r(n), {
|
|
207
|
+
key: 2,
|
|
208
|
+
class: "min-w-full"
|
|
209
|
+
}, {
|
|
212
210
|
default: o(() => [
|
|
213
|
-
V("div",
|
|
214
|
-
|
|
211
|
+
V("div", O, [
|
|
212
|
+
a(r(U), {
|
|
215
213
|
class: "p-0 py-0.5 px-2 mr-1",
|
|
216
|
-
loading:
|
|
214
|
+
loading: r(p),
|
|
217
215
|
size: "sm",
|
|
218
216
|
variant: "outlined",
|
|
219
217
|
onClick: C
|
|
220
218
|
}, {
|
|
221
219
|
default: o(() => e[20] || (e[20] = [
|
|
222
|
-
|
|
220
|
+
d(" Authorize ")
|
|
223
221
|
])),
|
|
224
222
|
_: 1
|
|
225
223
|
}, 8, ["loading"])
|
|
226
224
|
])
|
|
227
225
|
]),
|
|
228
226
|
_: 1
|
|
229
|
-
})
|
|
227
|
+
}))
|
|
230
228
|
], 64));
|
|
231
229
|
}
|
|
232
230
|
});
|