@scalar/api-client 2.2.54 → 2.2.55
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 +18 -0
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.js +15 -14
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +121 -106
- package/dist/components/{ImportCurl/ImportCurlModal.vue.d.ts → CommandPalette/CommandPaletteImportCurl.vue.d.ts} +9 -17
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +7 -0
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +141 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +98 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +128 -113
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +122 -94
- package/dist/components/TopNav/TopNavItem.vue.d.ts +1 -0
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue2.js +49 -42
- package/dist/layouts/App/create-api-client-app.d.ts +12 -12
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/create-api-client-modal.d.ts +24 -24
- package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
- package/dist/libs/create-client.d.ts +12 -12
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +91 -115
- package/dist/libs/get-request-uid-by-path-method.d.ts +7 -0
- package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -0
- package/dist/libs/get-request-uid-by-path-method.js +10 -0
- package/dist/libs/get-request-uid-by-path-method.test.d.ts +2 -0
- package/dist/libs/get-request-uid-by-path-method.test.d.ts.map +1 -0
- package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
- package/dist/libs/validate-parameters.d.ts +6 -0
- package/dist/libs/validate-parameters.d.ts.map +1 -0
- package/dist/libs/validate-parameters.js +12 -0
- package/dist/libs/validate-parameters.test.d.ts +2 -0
- package/dist/libs/validate-parameters.test.d.ts.map +1 -0
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/request-example.d.ts +4 -4
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/store.d.ts +12 -12
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts +6 -3
- 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 +96 -145
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +2 -2
- package/dist/views/Request/RequestRoot.vue2.js +68 -57
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +34 -31
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +35 -33
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -0
- 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 +59 -54
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +29 -27
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +23 -23
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/request.js +1 -2
- package/package.json +13 -13
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +0 -1
- package/dist/components/ImportCurl/ImportCurlModal.vue.js +0 -7
- package/dist/components/ImportCurl/ImportCurlModal.vue2.js +0 -125
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as O, computed as m, onMounted as T, ref as S, watch as N, openBlock as p, createBlock as d, withCtx as l, createTextVNode as b, toDisplayString as k, createElementVNode as
|
|
1
|
+
import { defineComponent as O, computed as m, onMounted as T, ref as S, watch as N, openBlock as p, createBlock as d, withCtx as l, createTextVNode as b, toDisplayString as k, createElementVNode as i, unref as h, createVNode as w, withModifiers as z, createCommentVNode as P, normalizeClass as A, nextTick as R } from "vue";
|
|
2
2
|
import { ScalarTooltip as B, ScalarButton as M } from "@scalar/components";
|
|
3
|
-
import { requestExampleParametersSchema as
|
|
3
|
+
import { requestExampleParametersSchema as x } from "@scalar/oas-utils/entities/spec";
|
|
4
4
|
import W from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import V from "./RequestTable.vue.js";
|
|
6
6
|
import { useWorkspace as D } from "../../../store/store.js";
|
|
7
7
|
const G = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, U = { class: "sr-only" }, Z = /* @__PURE__ */ O({
|
|
8
8
|
__name: "RequestParams",
|
|
@@ -13,46 +13,47 @@ const G = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
13
13
|
workspace: {},
|
|
14
14
|
title: {},
|
|
15
15
|
paramKey: {},
|
|
16
|
-
readOnlyEntries: { default: () => [] }
|
|
16
|
+
readOnlyEntries: { default: () => [] },
|
|
17
|
+
invalidParams: {}
|
|
17
18
|
},
|
|
18
19
|
setup(t) {
|
|
19
|
-
const { requestExampleMutators:
|
|
20
|
-
T(() =>
|
|
20
|
+
const { requestExampleMutators: r } = D(), s = m(() => t.example.parameters[t.paramKey] ?? []);
|
|
21
|
+
T(() => v());
|
|
21
22
|
const o = () => {
|
|
22
|
-
const e =
|
|
23
|
-
|
|
24
|
-
}, u = S(null),
|
|
23
|
+
const e = x.parse({ enabled: !1 }), a = [...s.value, e];
|
|
24
|
+
r.edit(t.example.uid, `parameters.${t.paramKey}`, a);
|
|
25
|
+
}, u = S(null), C = (e, a, g) => {
|
|
25
26
|
const c = s.value;
|
|
26
27
|
if (c.length > e) {
|
|
27
28
|
const n = [...c];
|
|
28
29
|
if (!n[e]) return;
|
|
29
|
-
n[e] = { ...n[e], [a]: g }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1),
|
|
30
|
+
n[e] = { ...n[e], [a]: g }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), r.edit(
|
|
30
31
|
t.example.uid,
|
|
31
32
|
`parameters.${t.paramKey}`,
|
|
32
33
|
n
|
|
33
34
|
);
|
|
34
35
|
} else {
|
|
35
|
-
const n = [
|
|
36
|
-
|
|
36
|
+
const n = [x.parse({ [a]: g })];
|
|
37
|
+
r.edit(t.example.uid, `parameters.${t.paramKey}`, n), R(() => {
|
|
37
38
|
var y;
|
|
38
39
|
if (!u.value) return;
|
|
39
40
|
(y = u.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || y.focus();
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
e === c.length - 1 && o();
|
|
43
|
-
}, q = (e, a) =>
|
|
44
|
+
}, q = (e, a) => r.edit(
|
|
44
45
|
t.example.uid,
|
|
45
46
|
`parameters.${t.paramKey}.${e}.enabled`,
|
|
46
47
|
a
|
|
47
48
|
), E = () => {
|
|
48
49
|
const e = s.value.filter((a) => a.required);
|
|
49
|
-
|
|
50
|
+
r.edit(
|
|
50
51
|
t.example.uid,
|
|
51
52
|
`parameters.${t.paramKey}`,
|
|
52
53
|
e
|
|
53
54
|
), R(() => o());
|
|
54
55
|
};
|
|
55
|
-
function
|
|
56
|
+
function v() {
|
|
56
57
|
if (s.value.length === 0)
|
|
57
58
|
o();
|
|
58
59
|
else if (s.value.length >= 1) {
|
|
@@ -66,11 +67,11 @@ const G = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
66
67
|
N(
|
|
67
68
|
() => t.example,
|
|
68
69
|
(e, a) => {
|
|
69
|
-
e !== a &&
|
|
70
|
+
e !== a && v();
|
|
70
71
|
},
|
|
71
72
|
{ immediate: !0 }
|
|
72
73
|
);
|
|
73
|
-
const
|
|
74
|
+
const f = m(() => (t.readOnlyEntries ?? []).length > 0);
|
|
74
75
|
return (e, a) => (p(), d(W, {
|
|
75
76
|
class: "group/params",
|
|
76
77
|
itemCount: K.value
|
|
@@ -79,7 +80,7 @@ const G = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
79
80
|
b(k(e.title), 1)
|
|
80
81
|
]),
|
|
81
82
|
actions: l(() => [
|
|
82
|
-
|
|
83
|
+
i("div", G, [
|
|
83
84
|
$.value ? (p(), d(h(B), {
|
|
84
85
|
key: 0,
|
|
85
86
|
side: "right",
|
|
@@ -94,31 +95,31 @@ const G = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
94
95
|
}, {
|
|
95
96
|
default: l(() => [
|
|
96
97
|
a[0] || (a[0] = b(" Clear ")),
|
|
97
|
-
|
|
98
|
+
i("span", U, "All " + k(e.title), 1)
|
|
98
99
|
]),
|
|
99
100
|
_: 1
|
|
100
101
|
})
|
|
101
102
|
]),
|
|
102
103
|
content: l(() => a[1] || (a[1] = [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
i("div", { class: "w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
|
|
105
|
+
i("div", { class: "text-c-2 flex items-center" }, [
|
|
106
|
+
i("span", null, "Clear optional parameters")
|
|
106
107
|
])
|
|
107
108
|
], -1)
|
|
108
109
|
])),
|
|
109
110
|
_: 1
|
|
110
|
-
})) :
|
|
111
|
+
})) : P("", !0)
|
|
111
112
|
])
|
|
112
113
|
]),
|
|
113
114
|
default: l(() => [
|
|
114
|
-
|
|
115
|
+
i("div", {
|
|
115
116
|
ref_key: "tableWrapperRef",
|
|
116
117
|
ref: u
|
|
117
118
|
}, [
|
|
118
|
-
|
|
119
|
+
f.value ? (p(), d(V, {
|
|
119
120
|
key: 0,
|
|
120
121
|
class: A(["flex-1", {
|
|
121
|
-
"bg-mix-transparent bg-mix-amount-95 bg-c-3":
|
|
122
|
+
"bg-mix-transparent bg-mix-amount-95 bg-c-3": f.value
|
|
122
123
|
}]),
|
|
123
124
|
columns: ["32px", "", ""],
|
|
124
125
|
envVariables: e.envVariables,
|
|
@@ -126,18 +127,20 @@ const G = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
126
127
|
isGlobal: "",
|
|
127
128
|
isReadOnly: "",
|
|
128
129
|
items: e.readOnlyEntries,
|
|
129
|
-
workspace: e.workspace
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
workspace: e.workspace,
|
|
131
|
+
invalidParams: e.invalidParams
|
|
132
|
+
}, null, 8, ["class", "envVariables", "environment", "items", "workspace", "invalidParams"])) : P("", !0),
|
|
133
|
+
w(V, {
|
|
132
134
|
class: "flex-1",
|
|
133
135
|
columns: ["32px", "", ""],
|
|
134
136
|
envVariables: e.envVariables,
|
|
135
137
|
environment: e.environment,
|
|
136
138
|
items: s.value,
|
|
137
139
|
workspace: e.workspace,
|
|
140
|
+
invalidParams: e.invalidParams,
|
|
138
141
|
onToggleRow: q,
|
|
139
|
-
onUpdateRow:
|
|
140
|
-
}, null, 8, ["envVariables", "environment", "items", "workspace"])
|
|
142
|
+
onUpdateRow: C
|
|
143
|
+
}, null, 8, ["envVariables", "environment", "items", "workspace", "invalidParams"])
|
|
141
144
|
], 512)
|
|
142
145
|
]),
|
|
143
146
|
_: 1
|
|
@@ -10,6 +10,7 @@ type __VLS_Props = {
|
|
|
10
10
|
environment: Environment;
|
|
11
11
|
envVariables: EnvVariable[];
|
|
12
12
|
workspace: Workspace;
|
|
13
|
+
invalidParams: Set<string>;
|
|
13
14
|
};
|
|
14
15
|
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>;
|
|
15
16
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AAiIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK1D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAC;;AAoLF,wBAOG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { REGEX as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as w, computed as $, watch as b, openBlock as d, createBlock as h, withCtx as f, createTextVNode as x, toDisplayString as K, createCommentVNode as R } from "vue";
|
|
2
|
+
import { REGEX as V } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import C from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
4
4
|
import q from "./RequestTable.vue.js";
|
|
5
5
|
import { useWorkspace as E } from "../../../store/store.js";
|
|
6
|
-
const A = /* @__PURE__ */
|
|
6
|
+
const A = /* @__PURE__ */ w({
|
|
7
7
|
__name: "RequestPathParams",
|
|
8
8
|
props: {
|
|
9
9
|
example: {},
|
|
@@ -12,57 +12,58 @@ const A = /* @__PURE__ */ x({
|
|
|
12
12
|
title: {},
|
|
13
13
|
environment: {},
|
|
14
14
|
envVariables: {},
|
|
15
|
-
workspace: {}
|
|
15
|
+
workspace: {},
|
|
16
|
+
invalidParams: {}
|
|
16
17
|
},
|
|
17
|
-
setup(
|
|
18
|
+
setup(a) {
|
|
18
19
|
const { requestMutators: p, requestExampleMutators: u } = E(), s = $(
|
|
19
|
-
() =>
|
|
20
|
+
() => a.example.parameters[a.paramKey].map((e) => ({
|
|
20
21
|
...e,
|
|
21
22
|
enum: e.enum
|
|
22
23
|
}))
|
|
23
|
-
),
|
|
24
|
-
var m,
|
|
25
|
-
const i =
|
|
26
|
-
if (
|
|
27
|
-
if (
|
|
28
|
-
if ((
|
|
24
|
+
), v = (e, r, n) => {
|
|
25
|
+
var m, t;
|
|
26
|
+
const i = a.example.parameters[a.paramKey], o = (m = i[e]) == null ? void 0 : m.key;
|
|
27
|
+
if (o) {
|
|
28
|
+
if (r === "key") {
|
|
29
|
+
if ((t = i[e]) != null && t.required)
|
|
29
30
|
return;
|
|
30
31
|
if (n) {
|
|
31
|
-
const
|
|
32
|
-
p.edit(
|
|
32
|
+
const l = encodeURIComponent(o), c = encodeURIComponent(n), g = new RegExp(`(?<=/):${l}(?=[/?#]|$)`, "g"), k = a.operation.path.replace(g, `:${c}`);
|
|
33
|
+
p.edit(a.operation.uid, "path", k);
|
|
33
34
|
} else {
|
|
34
35
|
i.splice(e, 1);
|
|
35
|
-
const
|
|
36
|
-
p.edit(
|
|
36
|
+
const l = new RegExp(`/:${encodeURIComponent(o)}(?=[/?#]|$)`, "g"), c = a.operation.path.replace(l, "");
|
|
37
|
+
p.edit(a.operation.uid, "path", c);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
u.edit(
|
|
40
|
-
|
|
41
|
-
`parameters.${
|
|
41
|
+
a.example.uid,
|
|
42
|
+
`parameters.${a.paramKey}.${e}.${r}`,
|
|
42
43
|
n
|
|
43
44
|
);
|
|
44
45
|
}
|
|
45
|
-
},
|
|
46
|
+
}, y = (e) => {
|
|
46
47
|
var m;
|
|
47
|
-
const
|
|
48
|
-
(
|
|
48
|
+
const r = ((m = e.match(V.PATH)) == null ? void 0 : m.map((t) => t.slice(1, -1))) || [], n = a.example.parameters[a.paramKey], i = new Map(n.map((t) => [t.key, t])), o = r.map(
|
|
49
|
+
(t) => i.get(t) || { key: t, value: "", enabled: !0 }
|
|
49
50
|
);
|
|
50
|
-
n.forEach((
|
|
51
|
-
!
|
|
52
|
-
}), n.splice(0, n.length, ...
|
|
53
|
-
},
|
|
54
|
-
e &&
|
|
51
|
+
n.forEach((t) => {
|
|
52
|
+
!r.includes(t.key) && (t.value || t.required) && o.push(t);
|
|
53
|
+
}), n.splice(0, n.length, ...o), u.edit(a.example.uid, `parameters.${a.paramKey}`, n);
|
|
54
|
+
}, P = (e) => {
|
|
55
|
+
e && y(e);
|
|
55
56
|
};
|
|
56
57
|
return b(
|
|
57
|
-
() =>
|
|
58
|
+
() => a.operation.path,
|
|
58
59
|
(e) => {
|
|
59
|
-
e &&
|
|
60
|
+
e && P(e);
|
|
60
61
|
}
|
|
61
|
-
), (e,
|
|
62
|
+
), (e, r) => (d(), h(C, {
|
|
62
63
|
itemCount: s.value.length
|
|
63
64
|
}, {
|
|
64
65
|
title: f(() => [
|
|
65
|
-
K(
|
|
66
|
+
x(K(e.title), 1)
|
|
66
67
|
]),
|
|
67
68
|
default: f(() => [
|
|
68
69
|
s.value.length ? (d(), h(q, {
|
|
@@ -73,8 +74,9 @@ const A = /* @__PURE__ */ x({
|
|
|
73
74
|
environment: e.environment,
|
|
74
75
|
items: s.value,
|
|
75
76
|
workspace: e.workspace,
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
invalidParams: e.invalidParams,
|
|
78
|
+
onUpdateRow: v
|
|
79
|
+
}, null, 8, ["envVariables", "environment", "items", "workspace", "invalidParams"])) : R("", !0)
|
|
78
80
|
]),
|
|
79
81
|
_: 1
|
|
80
82
|
}, 8, ["itemCount"]));
|
|
@@ -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":"AA8QA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,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;AASxC,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;;AA8TF,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 c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5ec43a7d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarErrorBoundary as
|
|
3
|
-
import { canMethodHaveBody as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { matchesDomain as
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as q, computed as p, ref as B, watch as C, openBlock as s, createBlock as y, withCtx as u, createElementVNode as v, unref as l, createElementBlock as d, createCommentVNode as h, toDisplayString as R, createVNode as n, withDirectives as i, vShow as t } from "vue";
|
|
2
|
+
import { ScalarErrorBoundary as E } from "@scalar/components";
|
|
3
|
+
import { canMethodHaveBody as c, isDefined as H } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import K from "../../../components/ContextBar.vue.js";
|
|
5
|
+
import N from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
|
+
import { matchesDomain as D } from "../../../libs/send-request/set-request-cookies.js";
|
|
7
|
+
import U from "./RequestBody.vue.js";
|
|
8
8
|
import f from "./RequestParams.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useWorkspace as
|
|
9
|
+
import $ from "./RequestPathParams.vue.js";
|
|
10
|
+
import Q from "./RequestAuth/RequestAuth.vue.js";
|
|
11
|
+
import M from "./RequestCodeExample.vue.js";
|
|
12
|
+
import { useWorkspace as O } from "../../../store/store.js";
|
|
13
13
|
import { useLayout as W } from "../../../hooks/useLayout.js";
|
|
14
14
|
const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, z = {
|
|
15
15
|
key: 0,
|
|
@@ -18,20 +18,21 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
18
18
|
}, I = ["value"], L = {
|
|
19
19
|
key: 2,
|
|
20
20
|
class: "text-c-1 flex h-8 items-center"
|
|
21
|
-
}, F = { class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y" }, le = /* @__PURE__ */
|
|
21
|
+
}, F = { class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y" }, le = /* @__PURE__ */ q({
|
|
22
22
|
__name: "RequestSection",
|
|
23
23
|
props: {
|
|
24
24
|
collection: {},
|
|
25
25
|
environment: {},
|
|
26
26
|
envVariables: {},
|
|
27
27
|
example: {},
|
|
28
|
+
invalidParams: {},
|
|
28
29
|
operation: {},
|
|
29
30
|
selectedSecuritySchemeUids: {},
|
|
30
31
|
server: {},
|
|
31
32
|
workspace: {}
|
|
32
33
|
},
|
|
33
34
|
setup(r) {
|
|
34
|
-
const { requestMutators: w, cookies: b, securitySchemes: V } =
|
|
35
|
+
const { requestMutators: w, cookies: b, securitySchemes: V } = O(), { layout: m } = W(), S = p(() => {
|
|
35
36
|
const e = /* @__PURE__ */ new Set([
|
|
36
37
|
"All",
|
|
37
38
|
"Query",
|
|
@@ -41,27 +42,27 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
41
42
|
"Headers",
|
|
42
43
|
"Body"
|
|
43
44
|
]);
|
|
44
|
-
return r.example.parameters.path.length || e.delete("Variables"),
|
|
45
|
+
return r.example.parameters.path.length || e.delete("Variables"), c(r.operation.method ?? "get") || e.delete("Body"), k.value && e.delete("Auth"), [...e];
|
|
45
46
|
}), k = p(
|
|
46
47
|
() => {
|
|
47
48
|
var e;
|
|
48
49
|
return m === "modal" && ((e = r.operation.security) == null ? void 0 : e.length) === 0;
|
|
49
50
|
}
|
|
50
|
-
),
|
|
51
|
-
|
|
51
|
+
), a = B("All");
|
|
52
|
+
C(
|
|
52
53
|
() => r.operation,
|
|
53
54
|
(e) => {
|
|
54
|
-
|
|
55
|
+
a.value === "Body" && e && !c(e.method) && (a.value = "All");
|
|
55
56
|
}
|
|
56
57
|
);
|
|
57
58
|
const A = (e) => {
|
|
58
|
-
const
|
|
59
|
-
w.edit(r.operation.uid, "summary",
|
|
60
|
-
},
|
|
61
|
-
() => (r.workspace.cookies ?? []).map((e) => b[e]).filter(
|
|
59
|
+
const o = e.target;
|
|
60
|
+
w.edit(r.operation.uid, "summary", o.value);
|
|
61
|
+
}, P = p(
|
|
62
|
+
() => (r.workspace.cookies ?? []).map((e) => b[e]).filter(H).filter((e) => e.name).filter(
|
|
62
63
|
(e) => {
|
|
63
|
-
var
|
|
64
|
-
return
|
|
64
|
+
var o;
|
|
65
|
+
return D(((o = r.server) == null ? void 0 : o.url) || r.operation.path, e.domain);
|
|
65
66
|
}
|
|
66
67
|
).map((e) => ({
|
|
67
68
|
key: e.name,
|
|
@@ -75,30 +76,30 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
75
76
|
enabled: !0
|
|
76
77
|
}))
|
|
77
78
|
);
|
|
78
|
-
return (e,
|
|
79
|
+
return (e, o) => (s(), y(N, {
|
|
79
80
|
"aria-label": `Request: ${e.operation.summary}`
|
|
80
81
|
}, {
|
|
81
82
|
title: u(() => [
|
|
82
83
|
v("div", j, [
|
|
83
|
-
l(m) !== "modal" ? (s(),
|
|
84
|
-
l(m) !== "modal" ? (s(),
|
|
84
|
+
l(m) !== "modal" ? (s(), d("label", z)) : h("", !0),
|
|
85
|
+
l(m) !== "modal" ? (s(), d("input", {
|
|
85
86
|
key: 1,
|
|
86
87
|
id: "requestname",
|
|
87
88
|
class: "text-c-1 group-hover-input pl-1.25 md:-ml-1.25 pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded has-[:focus-visible]:outline",
|
|
88
89
|
placeholder: "Request Name",
|
|
89
90
|
value: e.operation.summary,
|
|
90
91
|
onInput: A
|
|
91
|
-
}, null, 40, I)) : (s(),
|
|
92
|
+
}, null, 40, I)) : (s(), d("span", L, R(e.operation.summary), 1))
|
|
92
93
|
]),
|
|
93
|
-
n(
|
|
94
|
-
activeSection:
|
|
94
|
+
n(K, {
|
|
95
|
+
activeSection: a.value,
|
|
95
96
|
sections: S.value,
|
|
96
|
-
onSetActiveSection:
|
|
97
|
+
onSetActiveSection: o[0] || (o[0] = (g) => a.value = g)
|
|
97
98
|
}, null, 8, ["activeSection", "sections"])
|
|
98
99
|
]),
|
|
99
100
|
default: u(() => [
|
|
100
101
|
v("div", F, [
|
|
101
|
-
e.collection && e.workspace && (l(m) !== "modal" || Object.keys(l(V) ?? {}).length) ?
|
|
102
|
+
e.collection && e.workspace && (l(m) !== "modal" || Object.keys(l(V) ?? {}).length) ? i((s(), y(Q, {
|
|
102
103
|
key: 0,
|
|
103
104
|
collection: e.collection,
|
|
104
105
|
envVariables: e.envVariables,
|
|
@@ -111,60 +112,64 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
111
112
|
workspace: e.workspace
|
|
112
113
|
}, null, 8, ["collection", "envVariables", "environment", "operation", "selectedSecuritySchemeUids", "server", "workspace"])), [
|
|
113
114
|
[
|
|
114
|
-
|
|
115
|
-
!k.value && (
|
|
115
|
+
t,
|
|
116
|
+
!k.value && (a.value === "All" || a.value === "Auth")
|
|
116
117
|
]
|
|
117
118
|
]) : h("", !0),
|
|
118
|
-
|
|
119
|
+
i(n($, {
|
|
119
120
|
envVariables: e.envVariables,
|
|
120
121
|
environment: e.environment,
|
|
121
122
|
example: e.example,
|
|
122
123
|
operation: e.operation,
|
|
123
124
|
paramKey: "path",
|
|
124
125
|
title: "Variables",
|
|
125
|
-
workspace: e.workspace
|
|
126
|
-
|
|
126
|
+
workspace: e.workspace,
|
|
127
|
+
invalidParams: e.invalidParams
|
|
128
|
+
}, null, 8, ["envVariables", "environment", "example", "operation", "workspace", "invalidParams"]), [
|
|
127
129
|
[
|
|
128
|
-
|
|
129
|
-
(
|
|
130
|
+
t,
|
|
131
|
+
(a.value === "All" || a.value === "Variables") && e.example.parameters.path.length
|
|
130
132
|
]
|
|
131
133
|
]),
|
|
132
|
-
|
|
134
|
+
i(n(f, {
|
|
133
135
|
envVariables: e.envVariables,
|
|
134
136
|
environment: e.environment,
|
|
135
137
|
example: e.example,
|
|
138
|
+
invalidParams: e.invalidParams,
|
|
136
139
|
operation: e.operation,
|
|
137
140
|
paramKey: "cookies",
|
|
138
|
-
readOnlyEntries:
|
|
141
|
+
readOnlyEntries: P.value,
|
|
139
142
|
title: "Cookies",
|
|
140
143
|
workspace: e.workspace,
|
|
141
144
|
workspaceParamKey: "cookies"
|
|
142
|
-
}, null, 8, ["envVariables", "environment", "example", "operation", "readOnlyEntries", "workspace"]), [
|
|
143
|
-
[
|
|
145
|
+
}, null, 8, ["envVariables", "environment", "example", "invalidParams", "operation", "readOnlyEntries", "workspace"]), [
|
|
146
|
+
[t, a.value === "All" || a.value === "Cookies"]
|
|
144
147
|
]),
|
|
145
|
-
|
|
148
|
+
i(n(f, {
|
|
146
149
|
envVariables: e.envVariables,
|
|
147
150
|
environment: e.environment,
|
|
148
151
|
example: e.example,
|
|
152
|
+
invalidParams: e.invalidParams,
|
|
149
153
|
operation: e.operation,
|
|
150
154
|
paramKey: "headers",
|
|
151
155
|
title: "Headers",
|
|
152
156
|
workspace: e.workspace
|
|
153
|
-
}, null, 8, ["envVariables", "environment", "example", "operation", "workspace"]), [
|
|
154
|
-
[
|
|
157
|
+
}, null, 8, ["envVariables", "environment", "example", "invalidParams", "operation", "workspace"]), [
|
|
158
|
+
[t, a.value === "All" || a.value === "Headers"]
|
|
155
159
|
]),
|
|
156
|
-
|
|
160
|
+
i(n(f, {
|
|
157
161
|
envVariables: e.envVariables,
|
|
158
162
|
environment: e.environment,
|
|
159
163
|
example: e.example,
|
|
164
|
+
invalidParams: e.invalidParams,
|
|
160
165
|
operation: e.operation,
|
|
161
166
|
paramKey: "query",
|
|
162
167
|
title: "Query Parameters",
|
|
163
168
|
workspace: e.workspace
|
|
164
|
-
}, null, 8, ["envVariables", "environment", "example", "operation", "workspace"]), [
|
|
165
|
-
[
|
|
169
|
+
}, null, 8, ["envVariables", "environment", "example", "invalidParams", "operation", "workspace"]), [
|
|
170
|
+
[t, a.value === "All" || a.value === "Query"]
|
|
166
171
|
]),
|
|
167
|
-
|
|
172
|
+
i(n(U, {
|
|
168
173
|
envVariables: e.envVariables,
|
|
169
174
|
environment: e.environment,
|
|
170
175
|
example: e.example,
|
|
@@ -173,14 +178,14 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
173
178
|
workspace: e.workspace
|
|
174
179
|
}, null, 8, ["envVariables", "environment", "example", "operation", "workspace"]), [
|
|
175
180
|
[
|
|
176
|
-
|
|
177
|
-
e.operation.method && (
|
|
181
|
+
t,
|
|
182
|
+
e.operation.method && (a.value === "All" || a.value === "Body") && l(c)(e.operation.method)
|
|
178
183
|
]
|
|
179
184
|
]),
|
|
180
|
-
|
|
181
|
-
n(l(
|
|
185
|
+
o[1] || (o[1] = v("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
|
|
186
|
+
n(l(E), null, {
|
|
182
187
|
default: u(() => [
|
|
183
|
-
n(
|
|
188
|
+
n(M, {
|
|
184
189
|
collection: e.collection,
|
|
185
190
|
example: e.example,
|
|
186
191
|
operation: e.operation,
|
|
@@ -15,6 +15,7 @@ type __VLS_Props = {
|
|
|
15
15
|
environment: Environment;
|
|
16
16
|
envVariables: EnvVariable[];
|
|
17
17
|
workspace: Workspace;
|
|
18
|
+
invalidParams?: Set<string>;
|
|
18
19
|
};
|
|
19
20
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
21
|
updateRow: (idx: number, field: "value" | "key", value: string) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAiPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC5B,CAAC;;;;;;;;;;;;;;;;;;;;yBARsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAyexB,wBASG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-22d199d5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|