@scalar/api-client 2.5.2 → 2.5.4
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 +46 -0
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue2.js +18 -18
- package/dist/components/ImportCollection/OperationBadge.vue.d.ts +1 -1
- package/dist/components/ImportCollection/OperationBadge.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +2 -2
- package/dist/components/TopNav/TopNavItem.vue2.js +4 -4
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +6 -5
- package/dist/libs/hot-keys.js +1 -1
- package/dist/libs/index.js +23 -24
- package/dist/libs/local-storage.d.ts +0 -8
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/local-storage.js +24 -28
- package/dist/routes.d.ts +6 -6
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +1 -1
- package/dist/store/cookies.js +1 -1
- package/dist/store/environment.js +1 -1
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +13 -12
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +42 -40
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +1 -1
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +1 -1
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +14 -13
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +1 -1
- package/dist/style.css +1 -1
- 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 +28 -28
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +38 -38
- 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 +28 -26
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +8 -8
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +14 -13
|
@@ -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":"AA6XA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAMrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAe1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,WAAW,CAAC,EAAE,OAAO,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;;AAgaF,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 p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-653ceb53"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as $, useId as K, ref as E, computed as p, createBlock as N, openBlock as d, withCtx as f, createVNode as y, unref as i, createElementVNode as a, createElementBlock as S, Fragment as k, createTextVNode as x, toDisplayString as A, createCommentVNode as j, normalizeClass as z } from "vue";
|
|
2
2
|
import { useModal as W, ScalarComboboxMultiselect as Y, ScalarButton as F, ScalarIcon as H } from "@scalar/components";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { getSecurityRequirements as
|
|
11
|
-
const
|
|
3
|
+
import { safeLocalStorage as J, CLIENT_LS_KEYS as G } from "@scalar/helpers/object/local-storage";
|
|
4
|
+
import { isDefined as P } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import Q from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
6
|
+
import { useLayout as X } from "../../../../hooks/useLayout.js";
|
|
7
|
+
import { useWorkspace as Z } from "../../../../store/store.js";
|
|
8
|
+
import _ from "./DeleteRequestAuthModal.vue.js";
|
|
9
|
+
import ee from "./RequestAuthDataTable.vue.js";
|
|
10
|
+
import { getSecurityRequirements as te, formatComplexScheme as le, formatScheme as oe, getSchemeOptions as ne } from "../../libs/auth.js";
|
|
11
|
+
const se = ["id"], re = { class: "-mx-1 flex flex-1" }, ie = { class: "text-c-1" }, ve = /* @__PURE__ */ $({
|
|
12
12
|
__name: "RequestAuth",
|
|
13
13
|
props: {
|
|
14
14
|
collection: {},
|
|
@@ -23,15 +23,15 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
23
23
|
workspace: {}
|
|
24
24
|
},
|
|
25
25
|
setup(s) {
|
|
26
|
-
const { layout: C } =
|
|
26
|
+
const { layout: C } = X(), {
|
|
27
27
|
securitySchemes: u,
|
|
28
28
|
securitySchemeMutators: O,
|
|
29
29
|
requestMutators: T,
|
|
30
30
|
collectionMutators: w
|
|
31
|
-
} =
|
|
31
|
+
} = Z(), q = K(), R = E(null), h = W(), v = E(
|
|
32
32
|
null
|
|
33
33
|
), V = p(() => {
|
|
34
|
-
const e =
|
|
34
|
+
const e = te(s.operation, s.collection);
|
|
35
35
|
return { filteredRequirements: e.filter((n) => Object.keys(n).length), requirements: e };
|
|
36
36
|
}), g = p(() => {
|
|
37
37
|
const { filteredRequirements: e, requirements: t } = V.value;
|
|
@@ -39,19 +39,19 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
39
39
|
return null;
|
|
40
40
|
const o = !t.some(
|
|
41
41
|
(m) => Object.keys(m).length > 1
|
|
42
|
-
) && e.length < t.length, l = o ? "Unlock" : "Lock", r = o ? "Optional" : "Required",
|
|
42
|
+
) && e.length < t.length, l = o ? "Unlock" : "Lock", r = o ? "Optional" : "Required", L = `${e.length === 1 ? (() => {
|
|
43
43
|
const m = Object.keys(e[0] || {});
|
|
44
44
|
return m.length > 1 ? m.join(" & ") : m[0] || "";
|
|
45
45
|
})() : ""} ${r}`;
|
|
46
|
-
return { icon: l, text:
|
|
46
|
+
return { icon: l, text: L };
|
|
47
47
|
}), c = p(
|
|
48
48
|
() => s.selectedSecuritySchemeUids.map((e) => {
|
|
49
49
|
if (Array.isArray(e))
|
|
50
|
-
return
|
|
50
|
+
return le(e, u);
|
|
51
51
|
const t = u[e ?? ""];
|
|
52
52
|
if (t)
|
|
53
|
-
return
|
|
54
|
-
}).filter(
|
|
53
|
+
return oe(t);
|
|
54
|
+
}).filter(P)
|
|
55
55
|
);
|
|
56
56
|
function M(e) {
|
|
57
57
|
var o;
|
|
@@ -80,8 +80,8 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
80
80
|
return (b = u[r]) == null ? void 0 : b.nameKey;
|
|
81
81
|
}) : (l = u[o]) == null ? void 0 : l.nameKey;
|
|
82
82
|
});
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
J().setItem(
|
|
84
|
+
G.SELECTED_SECURITY_SCHEMES,
|
|
85
85
|
JSON.stringify(n)
|
|
86
86
|
);
|
|
87
87
|
} else (t = s.operation) != null && t.uid && T.edit(s.operation.uid, "selectedSecuritySchemeUids", e);
|
|
@@ -101,7 +101,7 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
101
101
|
}, I = p(
|
|
102
102
|
() => {
|
|
103
103
|
var e;
|
|
104
|
-
return
|
|
104
|
+
return ne(
|
|
105
105
|
V.value.filteredRequirements,
|
|
106
106
|
((e = s.collection) == null ? void 0 : e.securitySchemes) ?? [],
|
|
107
107
|
u,
|
|
@@ -109,7 +109,7 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
|
-
return (e, t) => (d(), N(
|
|
112
|
+
return (e, t) => (d(), N(Q, {
|
|
113
113
|
class: "group/params",
|
|
114
114
|
itemCount: c.value.length,
|
|
115
115
|
layout: e.layout
|
|
@@ -124,10 +124,10 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
124
124
|
key: 0,
|
|
125
125
|
class: z(["text-c-3 text-xs leading-[normal]", { "text-c-1": g.value.text === "Required" }])
|
|
126
126
|
}, A(g.value.text), 3)) : j("", !0)
|
|
127
|
-
], 8,
|
|
127
|
+
], 8, se)
|
|
128
128
|
]),
|
|
129
129
|
actions: f(() => [
|
|
130
|
-
a("div",
|
|
130
|
+
a("div", re, [
|
|
131
131
|
y(i(Y), {
|
|
132
132
|
class: "w-72 text-xs",
|
|
133
133
|
isDeletable: i(C) !== "modal" && e.layout !== "reference",
|
|
@@ -149,7 +149,7 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
149
149
|
default: f(() => {
|
|
150
150
|
var n;
|
|
151
151
|
return [
|
|
152
|
-
a("div",
|
|
152
|
+
a("div", ie, [
|
|
153
153
|
c.value.length === 0 ? (d(), S(k, { key: 0 }, [
|
|
154
154
|
t[2] || (t[2] = a("span", { class: "sr-only" }, "Select", -1)),
|
|
155
155
|
t[3] || (t[3] = x(" Auth Type "))
|
|
@@ -176,7 +176,7 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
176
176
|
])
|
|
177
177
|
]),
|
|
178
178
|
default: f(() => [
|
|
179
|
-
y(
|
|
179
|
+
y(ee, {
|
|
180
180
|
collection: e.collection,
|
|
181
181
|
envVariables: e.envVariables,
|
|
182
182
|
environment: e.environment,
|
|
@@ -186,7 +186,7 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
186
186
|
server: e.server,
|
|
187
187
|
workspace: e.workspace
|
|
188
188
|
}, null, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "selectedSchemeOptions", "server", "workspace"]),
|
|
189
|
-
y(
|
|
189
|
+
y(_, {
|
|
190
190
|
scheme: v.value,
|
|
191
191
|
state: i(h),
|
|
192
192
|
onClose: t[0] || (t[0] = (n) => i(h).hide()),
|
|
@@ -201,5 +201,5 @@ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1"
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
export {
|
|
204
|
-
|
|
204
|
+
ve as default
|
|
205
205
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"AAqVA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAOrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAY1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAggBF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./RequestAuthTab.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-7289bc09"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarMarkdown as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useWorkspace as
|
|
6
|
-
import { updateScheme as
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as F, computed as P, ref as R, onMounted as q, createElementBlock as i, openBlock as l, Fragment as p, renderList as C, createBlock as S, createCommentVNode as v, unref as d, normalizeClass as g, withCtx as n, createVNode as u, createTextVNode as m, toDisplayString as _, mergeProps as V, createElementVNode as A, capitalize as U } from "vue";
|
|
2
|
+
import { ScalarMarkdown as z } from "@scalar/components";
|
|
3
|
+
import { safeLocalStorage as I, CLIENT_LS_KEYS as N } from "@scalar/helpers/object/local-storage";
|
|
4
|
+
import { isDefined as j } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import { useWorkspace as D } from "../../../../store/store.js";
|
|
6
|
+
import { updateScheme as H } from "../helpers/update-scheme.js";
|
|
7
|
+
import Q from "./OAuth2.vue.js";
|
|
8
8
|
import w from "./RequestAuthDataTableInput.vue.js";
|
|
9
9
|
import f from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
10
|
+
import B from "../../../../components/DataTable/DataTableCell.vue.js";
|
|
11
|
+
const J = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "flex min-h-8 border-t text-sm"
|
|
14
|
-
},
|
|
14
|
+
}, Y = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, W = ["onClick"], G = { class: "relative z-10" }, ue = /* @__PURE__ */ F({
|
|
15
15
|
__name: "RequestAuthTab",
|
|
16
16
|
props: {
|
|
17
17
|
collection: {},
|
|
@@ -24,27 +24,27 @@ const Q = {
|
|
|
24
24
|
workspace: {}
|
|
25
25
|
},
|
|
26
26
|
setup(c) {
|
|
27
|
-
const T =
|
|
27
|
+
const T = D(), { collectionMutators: L, securitySchemes: x, securitySchemeMutators: M } = T, $ = P(
|
|
28
28
|
() => c.securitySchemeUids.map((t) => ({
|
|
29
29
|
scheme: x[t]
|
|
30
30
|
}))
|
|
31
|
-
),
|
|
31
|
+
), s = R(""), O = (t) => {
|
|
32
32
|
const r = t.description ? `: ${t.description}` : "", e = `${U(t.nameKey)}${r || `: ${t.type}`}`;
|
|
33
33
|
if (t.type === "apiKey")
|
|
34
34
|
return `${U(t.nameKey)}${r || `: ${t.in}`}`;
|
|
35
35
|
if (t.type === "oauth2") {
|
|
36
36
|
const o = Object.values(t.flows ?? {})[0];
|
|
37
|
-
return `${U(t.nameKey)}: ${
|
|
37
|
+
return `${U(t.nameKey)}: ${s.value ? s.value : (o == null ? void 0 : o.type) ?? ""}${r}`;
|
|
38
38
|
}
|
|
39
39
|
return t.type === "http" ? `${U(t.nameKey)}: ${t.scheme}${r}` : `${e}${r}`;
|
|
40
40
|
}, k = (t, r, e) => {
|
|
41
|
-
|
|
41
|
+
H(t, r, e, T, c.persistAuth);
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
q(() => {
|
|
44
44
|
if (!c.persistAuth)
|
|
45
45
|
return;
|
|
46
46
|
const t = JSON.parse(
|
|
47
|
-
|
|
47
|
+
I().getItem(N.AUTH) ?? "{}"
|
|
48
48
|
), r = Object.keys(x).reduce(
|
|
49
49
|
(e, o) => {
|
|
50
50
|
const a = x[o];
|
|
@@ -60,9 +60,9 @@ const Q = {
|
|
|
60
60
|
});
|
|
61
61
|
try {
|
|
62
62
|
const o = JSON.parse(
|
|
63
|
-
|
|
64
|
-
).map((a) => Array.isArray(a) ? a.map((y) => r[y]).filter(
|
|
65
|
-
|
|
63
|
+
I().getItem(N.SELECTED_SECURITY_SCHEMES) ?? ""
|
|
64
|
+
).map((a) => Array.isArray(a) ? a.map((y) => r[y]).filter(j) : r[a]).filter(j);
|
|
65
|
+
L.edit(c.collection.uid, "selectedSecuritySchemeUids", o);
|
|
66
66
|
} catch {
|
|
67
67
|
}
|
|
68
68
|
});
|
|
@@ -71,7 +71,7 @@ const Q = {
|
|
|
71
71
|
envVariables: c.envVariables,
|
|
72
72
|
workspace: c.workspace
|
|
73
73
|
};
|
|
74
|
-
return (t, r) => (l(!0), i(
|
|
74
|
+
return (t, r) => (l(!0), i(p, null, C($.value, ({ scheme: e }) => (l(), i(p, {
|
|
75
75
|
key: e == null ? void 0 : e.uid
|
|
76
76
|
}, [
|
|
77
77
|
$.value.length > 1 ? (l(), S(d(f), {
|
|
@@ -81,7 +81,7 @@ const Q = {
|
|
|
81
81
|
})
|
|
82
82
|
}, {
|
|
83
83
|
default: n(() => [
|
|
84
|
-
u(d(
|
|
84
|
+
u(d(B), {
|
|
85
85
|
class: g(["text-c-2 flex items-center pl-3", t.layout === "reference" && "border-b"])
|
|
86
86
|
}, {
|
|
87
87
|
default: n(() => [
|
|
@@ -94,12 +94,12 @@ const Q = {
|
|
|
94
94
|
}, 1032, ["class"])) : v("", !0),
|
|
95
95
|
e != null && e.description && $.value.length <= 1 ? (l(), S(d(f), { key: 1 }, {
|
|
96
96
|
default: n(() => [
|
|
97
|
-
u(d(
|
|
97
|
+
u(d(B), {
|
|
98
98
|
"aria-label": e.description,
|
|
99
99
|
class: "text-c-2 auth-description-container group/auth -mb-0.25 flex items-center whitespace-nowrap outline-none hover:whitespace-normal"
|
|
100
100
|
}, {
|
|
101
101
|
default: n(() => [
|
|
102
|
-
u(d(
|
|
102
|
+
u(d(z), {
|
|
103
103
|
class: "auth-description bg-b-1 text-c-2 outline-b-3 top-0 z-1 line-clamp-1 h-full w-full px-3 py-1.5 group-hover/auth:line-clamp-none",
|
|
104
104
|
value: e.description
|
|
105
105
|
}, null, 8, ["value"])
|
|
@@ -109,7 +109,7 @@ const Q = {
|
|
|
109
109
|
]),
|
|
110
110
|
_: 2
|
|
111
111
|
}, 1024)) : v("", !0),
|
|
112
|
-
(e == null ? void 0 : e.type) === "http" ? (l(), i(
|
|
112
|
+
(e == null ? void 0 : e.type) === "http" ? (l(), i(p, { key: 2 }, [
|
|
113
113
|
e.scheme === "bearer" ? (l(), S(d(f), { key: 0 }, {
|
|
114
114
|
default: n(() => [
|
|
115
115
|
u(w, V({ ref_for: !0 }, b, {
|
|
@@ -126,7 +126,7 @@ const Q = {
|
|
|
126
126
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
127
127
|
]),
|
|
128
128
|
_: 2
|
|
129
|
-
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (l(), i(
|
|
129
|
+
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (l(), i(p, { key: 1 }, [
|
|
130
130
|
u(d(f), null, {
|
|
131
131
|
default: n(() => [
|
|
132
132
|
u(w, V({ ref_for: !0 }, b, {
|
|
@@ -162,7 +162,7 @@ const Q = {
|
|
|
162
162
|
_: 2
|
|
163
163
|
}, 1024)
|
|
164
164
|
], 64)) : v("", !0)
|
|
165
|
-
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (l(), i(
|
|
165
|
+
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (l(), i(p, { key: 3 }, [
|
|
166
166
|
u(d(f), null, {
|
|
167
167
|
default: n(() => [
|
|
168
168
|
u(w, V({ ref_for: !0 }, b, {
|
|
@@ -195,29 +195,29 @@ const Q = {
|
|
|
195
195
|
]),
|
|
196
196
|
_: 2
|
|
197
197
|
}, 1024)
|
|
198
|
-
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (l(), i(
|
|
198
|
+
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (l(), i(p, { key: 4 }, [
|
|
199
199
|
u(d(f), null, {
|
|
200
200
|
default: n(() => [
|
|
201
|
-
Object.keys(e.flows).length > 1 ? (l(), i("div",
|
|
202
|
-
A("div",
|
|
203
|
-
(l(!0), i(
|
|
201
|
+
Object.keys(e.flows).length > 1 ? (l(), i("div", J, [
|
|
202
|
+
A("div", Y, [
|
|
203
|
+
(l(!0), i(p, null, C(e == null ? void 0 : e.flows, (o, a, y) => (l(), i("button", {
|
|
204
204
|
key: a,
|
|
205
205
|
class: g(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium", {
|
|
206
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (
|
|
207
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (
|
|
206
|
+
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (s.value === a || y === 0 && !s.value),
|
|
207
|
+
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (s.value === a || y === 0 && !s.value)
|
|
208
208
|
}]),
|
|
209
209
|
type: "button",
|
|
210
|
-
onClick: (E) =>
|
|
210
|
+
onClick: (E) => s.value = a
|
|
211
211
|
}, [
|
|
212
|
-
A("span",
|
|
213
|
-
], 10,
|
|
212
|
+
A("span", G, _(a), 1)
|
|
213
|
+
], 10, W))), 128))
|
|
214
214
|
])
|
|
215
215
|
])) : v("", !0)
|
|
216
216
|
]),
|
|
217
217
|
_: 2
|
|
218
218
|
}, 1024),
|
|
219
|
-
(l(!0), i(
|
|
220
|
-
|
|
219
|
+
(l(!0), i(p, null, C(e == null ? void 0 : e.flows, (o, a, y) => (l(), i(p, { key: a }, [
|
|
220
|
+
s.value === a || y === 0 && !s.value ? (l(), S(Q, V({
|
|
221
221
|
key: 0,
|
|
222
222
|
ref_for: !0
|
|
223
223
|
}, b, {
|
|
@@ -237,5 +237,5 @@ const Q = {
|
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
export {
|
|
240
|
-
|
|
240
|
+
ue as default
|
|
241
241
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAoWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAUrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAwYF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ca5f9f37"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as D, computed as v, useId as
|
|
2
|
-
import { ScalarErrorBoundary as
|
|
3
|
-
import { canMethodHaveBody as b, isDefined as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as D, computed as v, useId as P, ref as M, watch as S, createBlock as p, openBlock as r, withCtx as c, createElementVNode as h, withDirectives as s, createCommentVNode as k, createElementBlock as f, createVNode as i, unref as n, vShow as u, Fragment as K, renderList as L, resolveDynamicComponent as Q, toDisplayString as $ } from "vue";
|
|
2
|
+
import { ScalarErrorBoundary as C } from "@scalar/components";
|
|
3
|
+
import { canMethodHaveBody as b, isDefined as j, REGEX as B } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import F from "../../../components/SectionFilter.vue.js";
|
|
5
5
|
import T from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
6
|
import { matchesDomain as W } from "../../../libs/send-request/set-request-cookies.js";
|
|
7
7
|
import z from "./RequestBody.vue.js";
|
|
@@ -29,7 +29,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
29
29
|
workspace: {}
|
|
30
30
|
},
|
|
31
31
|
setup(l) {
|
|
32
|
-
const
|
|
32
|
+
const R = [
|
|
33
33
|
"Auth",
|
|
34
34
|
"Variables",
|
|
35
35
|
"Cookies",
|
|
@@ -37,15 +37,17 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
37
37
|
"Query",
|
|
38
38
|
"Body"
|
|
39
39
|
// 'Scripts',
|
|
40
|
-
], { requestMutators: w, cookies:
|
|
41
|
-
const e = /* @__PURE__ */ new Set(["All", ...
|
|
40
|
+
], { requestMutators: w, cookies: O, securitySchemes: A } = Z(), { layout: d } = x(), q = v(() => {
|
|
41
|
+
const e = /* @__PURE__ */ new Set(["All", ...R]);
|
|
42
42
|
return l.example.parameters.path.length || e.delete("Variables"), b(l.operation.method ?? "get") || e.delete("Body"), y.value && e.delete("Auth"), [...e];
|
|
43
43
|
}), t = v(
|
|
44
44
|
() => Object.fromEntries(
|
|
45
|
-
|
|
45
|
+
q.value.map((e) => [e, P()])
|
|
46
46
|
)
|
|
47
|
-
), y = v(
|
|
48
|
-
|
|
47
|
+
), y = v(
|
|
48
|
+
() => d === "modal" && !l.operation.security && !Object.keys(A ?? {}).length
|
|
49
|
+
), a = M("All");
|
|
50
|
+
S(
|
|
49
51
|
() => l.operation,
|
|
50
52
|
(e) => {
|
|
51
53
|
a.value === "Body" && e && !b(e.method) && (a.value = "All");
|
|
@@ -55,7 +57,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
55
57
|
const o = e.target;
|
|
56
58
|
w.edit(l.operation.uid, "summary", o.value);
|
|
57
59
|
}, H = v(
|
|
58
|
-
() => (l.workspace.cookies ?? []).map((e) =>
|
|
60
|
+
() => (l.workspace.cookies ?? []).map((e) => O[e]).filter(j).filter((e) => e.name).filter(
|
|
59
61
|
(e) => {
|
|
60
62
|
var o;
|
|
61
63
|
return W(((o = l.server) == null ? void 0 : o.url) || l.operation.path, e.domain);
|
|
@@ -71,36 +73,36 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
71
73
|
},
|
|
72
74
|
enabled: !0
|
|
73
75
|
}))
|
|
74
|
-
), N = () => l.operation.summary ? l.operation.summary : l.operation.path.replace(
|
|
75
|
-
return
|
|
76
|
+
), N = () => l.operation.summary ? l.operation.summary : l.operation.path.replace(B.PROTOCOL, "") ? l.operation.path.replace(B.PROTOCOL, "") : "Request Name", g = P(), I = Y().getViewComponents("request.section"), U = (e, o) => w.edit(l.operation.uid, e, o);
|
|
77
|
+
return S(
|
|
76
78
|
() => y.value,
|
|
77
79
|
(e) => {
|
|
78
80
|
e && a.value === "Auth" && (a.value = "All");
|
|
79
81
|
}
|
|
80
|
-
), (e, o) => (
|
|
82
|
+
), (e, o) => (r(), p(T, {
|
|
81
83
|
"aria-label": `Request: ${e.operation.summary}`
|
|
82
84
|
}, {
|
|
83
85
|
title: c(() => [
|
|
84
86
|
h("div", _, [
|
|
85
|
-
|
|
87
|
+
n(d) !== "modal" ? (r(), f("label", {
|
|
86
88
|
key: 0,
|
|
87
89
|
class: "pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0",
|
|
88
|
-
for:
|
|
90
|
+
for: n(g)
|
|
89
91
|
}, null, 8, ee)) : k("", !0),
|
|
90
|
-
|
|
92
|
+
n(d) !== "modal" ? (r(), f("input", {
|
|
91
93
|
key: 1,
|
|
92
|
-
id:
|
|
94
|
+
id: n(g),
|
|
93
95
|
class: "text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
|
|
94
96
|
placeholder: N(),
|
|
95
97
|
value: e.operation.summary,
|
|
96
98
|
onInput: E
|
|
97
|
-
}, null, 40, ae)) : (
|
|
99
|
+
}, null, 40, ae)) : (r(), f("span", le, $(e.operation.summary), 1))
|
|
98
100
|
]),
|
|
99
|
-
i(
|
|
101
|
+
i(F, {
|
|
100
102
|
modelValue: a.value,
|
|
101
103
|
"onUpdate:modelValue": o[0] || (o[0] = (m) => a.value = m),
|
|
102
104
|
filterIds: t.value,
|
|
103
|
-
filters:
|
|
105
|
+
filters: q.value
|
|
104
106
|
}, null, 8, ["modelValue", "filterIds", "filters"])
|
|
105
107
|
]),
|
|
106
108
|
default: c(() => [
|
|
@@ -109,7 +111,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
109
111
|
class: "request-section-content custom-scroll relative flex flex-1 flex-col",
|
|
110
112
|
role: a.value === "All" ? "tabpanel" : "none"
|
|
111
113
|
}, [
|
|
112
|
-
e.collection && e.workspace && (
|
|
114
|
+
e.collection && e.workspace && (n(d) !== "modal" || Object.keys(n(A) ?? {}).length) ? s((r(), p(X, {
|
|
113
115
|
key: 0,
|
|
114
116
|
id: t.value.Auth,
|
|
115
117
|
class: "request-section-content-auth",
|
|
@@ -196,7 +198,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
196
198
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
|
|
197
199
|
[u, a.value === "All" || a.value === "Query"]
|
|
198
200
|
]),
|
|
199
|
-
e.operation.method && (a.value === "All" || a.value === "Body") &&
|
|
201
|
+
e.operation.method && (a.value === "All" || a.value === "Body") && n(b)(e.operation.method) ? (r(), p(z, {
|
|
200
202
|
key: 1,
|
|
201
203
|
id: t.value.Body,
|
|
202
204
|
class: "request-section-content-body",
|
|
@@ -208,11 +210,11 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
208
210
|
title: "Body",
|
|
209
211
|
workspace: e.workspace
|
|
210
212
|
}, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"])) : k("", !0),
|
|
211
|
-
(
|
|
213
|
+
(r(!0), f(K, null, L(n(I), (m) => (r(), p(n(C), {
|
|
212
214
|
key: m.component
|
|
213
215
|
}, {
|
|
214
216
|
default: c(() => [
|
|
215
|
-
s((
|
|
217
|
+
s((r(), p(Q(m.component), {
|
|
216
218
|
"onUpdate:operation": U,
|
|
217
219
|
operation: e.operation
|
|
218
220
|
}, null, 40, ["operation"])), [
|
|
@@ -222,7 +224,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
222
224
|
_: 2
|
|
223
225
|
}, 1024))), 128)),
|
|
224
226
|
o[1] || (o[1] = h("div", { class: "flex flex-grow" }, null, -1)),
|
|
225
|
-
i(
|
|
227
|
+
i(n(C), null, {
|
|
226
228
|
default: c(() => [
|
|
227
229
|
i(J, {
|
|
228
230
|
class: "request-section-content-code-example -mt-1/2 border-t",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { CLIENT_LS_KEYS as
|
|
2
|
-
const
|
|
3
|
-
var
|
|
4
|
-
if (
|
|
1
|
+
import { safeLocalStorage as s, CLIENT_LS_KEYS as m } from "@scalar/helpers/object/local-storage";
|
|
2
|
+
const g = (o, r, n, { securitySchemeMutators: a, securitySchemes: S }, f = !1) => {
|
|
3
|
+
var c;
|
|
4
|
+
if (a.edit(o, r, n), !!f)
|
|
5
5
|
try {
|
|
6
|
-
const e = JSON.parse(
|
|
6
|
+
const e = JSON.parse(s().getItem(m.AUTH) ?? "{}"), t = S[o];
|
|
7
7
|
if (e && (t != null && t.nameKey)) {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const i = e[c = t.nameKey] || (e[c] = {});
|
|
9
|
+
i[r] = n, s().setItem(m.AUTH, JSON.stringify(e));
|
|
10
10
|
}
|
|
11
11
|
} catch (e) {
|
|
12
12
|
console.error(e);
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
g as updateScheme
|
|
17
17
|
};
|
|
@@ -34,7 +34,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
34
34
|
}));
|
|
35
35
|
}, k = (o) => {
|
|
36
36
|
o != null && o.createNew && g.name === "request" && f();
|
|
37
|
-
}, w = "2.5.
|
|
37
|
+
}, w = "2.5.4";
|
|
38
38
|
return R(() => a.hotKeys.on(k)), v(() => a.hotKeys.off(k)), (o, e) => (u(), i("div", W, [
|
|
39
39
|
s("div", {
|
|
40
40
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.5.
|
|
21
|
+
"version": "2.5.4",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -204,22 +204,23 @@
|
|
|
204
204
|
"whatwg-mimetype": "^4.0.0",
|
|
205
205
|
"yaml": "^2.4.5",
|
|
206
206
|
"zod": "3.24.1",
|
|
207
|
-
"@scalar/
|
|
207
|
+
"@scalar/helpers": "0.0.3",
|
|
208
|
+
"@scalar/icons": "0.4.2",
|
|
208
209
|
"@scalar/draggable": "0.2.0",
|
|
209
|
-
"@scalar/
|
|
210
|
-
"@scalar/
|
|
210
|
+
"@scalar/import": "0.4.8",
|
|
211
|
+
"@scalar/components": "0.14.7",
|
|
212
|
+
"@scalar/oas-utils": "0.4.4",
|
|
213
|
+
"@scalar/openapi-parser": "0.15.0",
|
|
211
214
|
"@scalar/object-utils": "1.2.1",
|
|
212
|
-
"@scalar/openapi-
|
|
213
|
-
"@scalar/
|
|
214
|
-
"@scalar/openapi-types": "0.3.1",
|
|
215
|
+
"@scalar/openapi-types": "0.3.2",
|
|
216
|
+
"@scalar/postman-to-openapi": "0.3.7",
|
|
215
217
|
"@scalar/snippetz": "0.3.0",
|
|
216
|
-
"@scalar/
|
|
217
|
-
"@scalar/
|
|
218
|
-
"@scalar/themes": "0.13.1",
|
|
218
|
+
"@scalar/types": "0.2.2",
|
|
219
|
+
"@scalar/use-codemirror": "0.12.8",
|
|
219
220
|
"@scalar/use-hooks": "0.2.2",
|
|
220
221
|
"@scalar/use-toasts": "0.8.0",
|
|
221
|
-
"@scalar/
|
|
222
|
-
"@scalar/use-
|
|
222
|
+
"@scalar/themes": "0.13.2",
|
|
223
|
+
"@scalar/use-tooltip": "1.1.0"
|
|
223
224
|
},
|
|
224
225
|
"devDependencies": {
|
|
225
226
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -232,7 +233,7 @@
|
|
|
232
233
|
"vite": "5.4.19",
|
|
233
234
|
"vite-svg-loader": "^5.1.0",
|
|
234
235
|
"vitest": "^1.6.0",
|
|
235
|
-
"@scalar/build-tooling": "0.2.
|
|
236
|
+
"@scalar/build-tooling": "0.2.2",
|
|
236
237
|
"@scalar/galaxy": "0.5.0"
|
|
237
238
|
},
|
|
238
239
|
"scripts": {
|