@scalar/api-client 2.2.34 → 2.2.37
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 +45 -0
- package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +18 -18
- package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +114 -108
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +1 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.js +21 -18
- 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 +2 -2
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +20 -15
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +43 -43
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.js +3 -3
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/TopNav/TopNav.vue.js +27 -27
- package/dist/layouts/App/create-api-client-app.d.ts +4 -58
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +8 -116
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +4 -58
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +4 -58
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/index.js +18 -19
- package/dist/libs/send-request/index.js +3 -4
- package/dist/libs/send-request/send-request.d.ts +0 -14
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +120 -142
- package/dist/libs/send-request/set-request-cookies.d.ts +27 -0
- package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -0
- package/dist/libs/send-request/set-request-cookies.js +54 -0
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +15 -12
- package/dist/store/cookies.d.ts +4 -58
- package/dist/store/cookies.d.ts.map +1 -1
- package/dist/store/cookies.js +5 -17
- package/dist/store/store.d.ts +4 -58
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +24 -37
- package/dist/views/Cookies/CookieModal.vue.d.ts +21 -0
- package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -0
- package/dist/views/Cookies/CookieModal.vue.js +7 -0
- package/dist/views/Cookies/CookieModal.vue2.js +88 -0
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +98 -119
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +30 -27
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +6 -6
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +7 -0
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +79 -66
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +51 -42
- 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 +90 -64
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +10 -3
- 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 +170 -132
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +5 -64
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +46 -2
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +19 -17
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +31 -31
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +1 -1
- package/dist/views/Request/libs/request.d.ts +12 -0
- package/dist/views/Request/libs/request.d.ts.map +1 -0
- package/dist/views/Request/libs/request.js +4 -0
- package/package.json +14 -16
- package/dist/views/Cookies/CookieRaw.vue.js +0 -28
- package/dist/views/Cookies/CookieRaw.vue2.js +0 -4
|
@@ -16,8 +16,8 @@ const ve = {
|
|
|
16
16
|
class: "border-t-1/2 text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
|
|
17
17
|
}, fe = {
|
|
18
18
|
key: 1,
|
|
19
|
-
class: "flex items-center justify-center p-1.5 overflow-hidden"
|
|
20
|
-
}, pe = { class: "text-c-2 text-xs w-full border rounded
|
|
19
|
+
class: "border-t flex items-center justify-center p-1.5 overflow-hidden"
|
|
20
|
+
}, pe = { class: "text-c-2 text-xs w-full border rounded py-1 px-1.5 max-w-full overflow-hidden whitespace-nowrap" }, Ce = /* @__PURE__ */ ae({
|
|
21
21
|
__name: "RequestBody",
|
|
22
22
|
props: {
|
|
23
23
|
title: {}
|
|
@@ -174,14 +174,14 @@ const ve = {
|
|
|
174
174
|
encoding: t,
|
|
175
175
|
value: ((u = o.value.body.formData) == null ? void 0 : u.value) ?? []
|
|
176
176
|
});
|
|
177
|
-
else if (!t) {
|
|
177
|
+
else if (!t && a !== "binary") {
|
|
178
178
|
const { raw: p, ...h } = o.value.body;
|
|
179
179
|
i.edit(o.value.uid, "body", h);
|
|
180
180
|
}
|
|
181
181
|
const l = [...o.value.parameters.headers], r = l.findIndex(
|
|
182
182
|
(p) => p.key.toLowerCase() === "content-type"
|
|
183
183
|
);
|
|
184
|
-
r >= 0 ? n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1) : n && l.
|
|
184
|
+
r >= 0 ? n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1) : n && l.push({
|
|
185
185
|
key: "Content-Type",
|
|
186
186
|
value: n,
|
|
187
187
|
enabled: !0
|
|
@@ -315,7 +315,7 @@ const ve = {
|
|
|
315
315
|
}, {
|
|
316
316
|
default: m(() => [
|
|
317
317
|
v(c(U), {
|
|
318
|
-
class: "flex gap-1.5 h-full px-
|
|
318
|
+
class: "flex gap-1.5 h-full px-3 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
319
319
|
fullWidth: "",
|
|
320
320
|
variant: "ghost"
|
|
321
321
|
}, {
|
|
@@ -435,7 +435,7 @@ const ve = {
|
|
|
435
435
|
onUploadFile: z
|
|
436
436
|
}, null, 8, ["items"])) : (g(), x(re, {
|
|
437
437
|
key: 4,
|
|
438
|
-
class: "border-t-1/2",
|
|
438
|
+
class: "border-t-1/2 px-1",
|
|
439
439
|
content: "",
|
|
440
440
|
language: Z.value,
|
|
441
441
|
lineNumbers: "",
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { type RequestExample } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
title: string;
|
|
4
5
|
paramKey: keyof RequestExample['parameters'];
|
|
6
|
+
readOnlyEntries?: {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
route: RouteLocationRaw;
|
|
11
|
+
}[];
|
|
5
12
|
};
|
|
6
13
|
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
14
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAqOA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;CACJ,CAAC;;AAwVF,wBAOG"}
|
|
@@ -1,74 +1,75 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import
|
|
5
|
-
import { ScalarTooltip as D, ScalarButton as
|
|
6
|
-
import { requestExampleParametersSchema as
|
|
1
|
+
import { defineComponent as A, computed as m, onMounted as N, ref as V, watch as B, openBlock as v, createBlock as d, withCtx as r, createTextVNode as R, toDisplayString as k, createElementVNode as i, unref as b, createVNode as x, withModifiers as M, createCommentVNode as C, nextTick as E } from "vue";
|
|
2
|
+
import W from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useActiveEntities as z } from "../../../store/active-entities.js";
|
|
4
|
+
import _ from "./RequestTable.vue.js";
|
|
5
|
+
import { ScalarTooltip as D, ScalarButton as G } from "@scalar/components";
|
|
6
|
+
import { requestExampleParametersSchema as q } from "@scalar/oas-utils/entities/spec";
|
|
7
7
|
import { useWorkspace as U } from "../../../store/store.js";
|
|
8
|
-
const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, F = { class: "sr-only" },
|
|
8
|
+
const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, F = { class: "sr-only" }, te = /* @__PURE__ */ A({
|
|
9
9
|
__name: "RequestParams",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
12
|
-
paramKey: {}
|
|
12
|
+
paramKey: {},
|
|
13
|
+
readOnlyEntries: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
15
|
+
setup(w) {
|
|
16
|
+
const n = w, { activeRequest: u, activeExample: s } = z(), { requestExampleMutators: o } = U(), l = m(
|
|
16
17
|
() => {
|
|
17
18
|
var e;
|
|
18
|
-
return ((e = s.value) == null ? void 0 : e.parameters[
|
|
19
|
+
return ((e = s.value) == null ? void 0 : e.parameters[n.paramKey]) ?? [];
|
|
19
20
|
}
|
|
20
21
|
);
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
N(() => {
|
|
23
|
+
y();
|
|
23
24
|
});
|
|
24
25
|
const p = () => {
|
|
25
26
|
if (!u.value || !s.value) return;
|
|
26
|
-
const e =
|
|
27
|
-
|
|
27
|
+
const e = q.parse({ enabled: !1 }), t = [...l.value, e];
|
|
28
|
+
o.edit(
|
|
28
29
|
s.value.uid,
|
|
29
|
-
`parameters.${
|
|
30
|
+
`parameters.${n.paramKey}`,
|
|
30
31
|
t
|
|
31
32
|
);
|
|
32
|
-
},
|
|
33
|
+
}, c = V(null), P = (e, t, g) => {
|
|
33
34
|
if (!u.value || !s.value) return;
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const a = [...
|
|
35
|
+
const f = l.value;
|
|
36
|
+
if (f.length > e) {
|
|
37
|
+
const a = [...f];
|
|
37
38
|
if (!a[e]) return;
|
|
38
|
-
a[e] = { ...a[e], [t]:
|
|
39
|
+
a[e] = { ...a[e], [t]: g }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), o.edit(
|
|
39
40
|
s.value.uid,
|
|
40
|
-
`parameters.${
|
|
41
|
+
`parameters.${n.paramKey}`,
|
|
41
42
|
a
|
|
42
43
|
);
|
|
43
44
|
} else {
|
|
44
|
-
const a = [
|
|
45
|
-
|
|
45
|
+
const a = [q.parse({ [t]: g })];
|
|
46
|
+
o.edit(
|
|
46
47
|
s.value.uid,
|
|
47
|
-
`parameters.${
|
|
48
|
+
`parameters.${n.paramKey}`,
|
|
48
49
|
a
|
|
49
|
-
),
|
|
50
|
-
var
|
|
51
|
-
if (!
|
|
52
|
-
(
|
|
50
|
+
), E(() => {
|
|
51
|
+
var h;
|
|
52
|
+
if (!c.value) return;
|
|
53
|
+
(h = c.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || h.focus();
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
e ===
|
|
56
|
-
},
|
|
56
|
+
e === f.length - 1 && p();
|
|
57
|
+
}, K = (e, t) => u.value && s.value && o.edit(
|
|
57
58
|
s.value.uid,
|
|
58
|
-
`parameters.${
|
|
59
|
+
`parameters.${n.paramKey}.${e}.enabled`,
|
|
59
60
|
t
|
|
60
|
-
),
|
|
61
|
+
), $ = () => {
|
|
61
62
|
if (!u.value || !s.value) return;
|
|
62
63
|
const e = l.value.filter((t) => t.required);
|
|
63
|
-
|
|
64
|
+
o.edit(
|
|
64
65
|
s.value.uid,
|
|
65
|
-
`parameters.${
|
|
66
|
+
`parameters.${n.paramKey}`,
|
|
66
67
|
e
|
|
67
|
-
),
|
|
68
|
+
), E(() => {
|
|
68
69
|
p();
|
|
69
70
|
});
|
|
70
71
|
};
|
|
71
|
-
function
|
|
72
|
+
function y() {
|
|
72
73
|
if (l.value.length === 0)
|
|
73
74
|
p();
|
|
74
75
|
else if (l.value.length >= 1) {
|
|
@@ -76,65 +77,77 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
76
77
|
e && e.key !== "" && e.value !== "" && p();
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
const
|
|
80
|
+
const O = m(
|
|
80
81
|
() => l.value.filter((e) => e.key || e.value).length
|
|
81
|
-
), T =
|
|
82
|
-
|
|
82
|
+
), T = m(() => l.value.length > 1);
|
|
83
|
+
B(
|
|
83
84
|
() => s.value,
|
|
84
85
|
(e, t) => {
|
|
85
|
-
e !== t &&
|
|
86
|
+
e !== t && y();
|
|
86
87
|
},
|
|
87
88
|
{ immediate: !0 }
|
|
88
|
-
)
|
|
89
|
+
);
|
|
90
|
+
const S = m(
|
|
91
|
+
() => (n.readOnlyEntries ?? []).length > 0
|
|
92
|
+
);
|
|
93
|
+
return (e, t) => (v(), d(W, {
|
|
89
94
|
class: "group/params",
|
|
90
|
-
itemCount:
|
|
95
|
+
itemCount: O.value
|
|
91
96
|
}, {
|
|
92
|
-
title:
|
|
93
|
-
k(
|
|
97
|
+
title: r(() => [
|
|
98
|
+
R(k(e.title), 1)
|
|
94
99
|
]),
|
|
95
|
-
actions:
|
|
96
|
-
|
|
97
|
-
T.value ? (
|
|
100
|
+
actions: r(() => [
|
|
101
|
+
i("div", j, [
|
|
102
|
+
T.value ? (v(), d(b(D), {
|
|
98
103
|
key: 0,
|
|
99
104
|
side: "right",
|
|
100
105
|
sideOffset: 12
|
|
101
106
|
}, {
|
|
102
|
-
trigger:
|
|
103
|
-
b(
|
|
107
|
+
trigger: r(() => [
|
|
108
|
+
x(b(G), {
|
|
104
109
|
class: "px-1 transition-none",
|
|
105
110
|
size: "sm",
|
|
106
111
|
variant: "ghost",
|
|
107
|
-
onClick:
|
|
112
|
+
onClick: M($, ["stop"])
|
|
108
113
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
t[0] || (t[0] =
|
|
111
|
-
|
|
114
|
+
default: r(() => [
|
|
115
|
+
t[0] || (t[0] = R(" Clear ")),
|
|
116
|
+
i("span", F, "All " + k(e.title), 1)
|
|
112
117
|
]),
|
|
113
118
|
_: 1
|
|
114
119
|
})
|
|
115
120
|
]),
|
|
116
|
-
content:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
content: r(() => t[1] || (t[1] = [
|
|
122
|
+
i("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 p-2 text-xxs leading-5 z-10 text-c-1" }, [
|
|
123
|
+
i("div", { class: "flex items-center text-c-2" }, [
|
|
124
|
+
i("span", null, "Clear optional parameters")
|
|
120
125
|
])
|
|
121
126
|
], -1)
|
|
122
127
|
])),
|
|
123
128
|
_: 1
|
|
124
|
-
})) :
|
|
129
|
+
})) : C("", !0)
|
|
125
130
|
])
|
|
126
131
|
]),
|
|
127
|
-
default:
|
|
128
|
-
|
|
132
|
+
default: r(() => [
|
|
133
|
+
i("div", {
|
|
129
134
|
ref_key: "tableWrapperRef",
|
|
130
|
-
ref:
|
|
135
|
+
ref: c
|
|
131
136
|
}, [
|
|
132
|
-
|
|
137
|
+
S.value ? (v(), d(_, {
|
|
138
|
+
key: 0,
|
|
139
|
+
class: "flex-1",
|
|
140
|
+
columns: ["32px", "", ""],
|
|
141
|
+
isGlobal: "",
|
|
142
|
+
isReadOnly: "",
|
|
143
|
+
items: e.readOnlyEntries
|
|
144
|
+
}, null, 8, ["items"])) : C("", !0),
|
|
145
|
+
x(_, {
|
|
133
146
|
class: "flex-1",
|
|
134
147
|
columns: ["32px", "", ""],
|
|
135
148
|
items: l.value,
|
|
136
|
-
onToggleRow:
|
|
137
|
-
onUpdateRow:
|
|
149
|
+
onToggleRow: K,
|
|
150
|
+
onUpdateRow: P
|
|
138
151
|
}, null, 8, ["items"])
|
|
139
152
|
], 512)
|
|
140
153
|
]),
|
|
@@ -143,5 +156,5 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
143
156
|
}
|
|
144
157
|
});
|
|
145
158
|
export {
|
|
146
|
-
|
|
159
|
+
te as default
|
|
147
160
|
};
|
|
@@ -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":"AAyJA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAmNF,wBAOG"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as E, computed as P, watch as v, openBlock as g, createBlock as x, withCtx as R, createTextVNode as _, toDisplayString as q, createCommentVNode as V } from "vue";
|
|
2
2
|
import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
3
|
import { useActiveEntities as M } from "../../../store/active-entities.js";
|
|
4
4
|
import N from "./RequestTable.vue.js";
|
|
5
5
|
import { REGEX as T } from "@scalar/oas-utils/helpers";
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
const W = /* @__PURE__ */
|
|
6
|
+
import { useWorkspace as A } from "../../../store/store.js";
|
|
7
|
+
const W = /* @__PURE__ */ E({
|
|
8
8
|
__name: "RequestPathParams",
|
|
9
9
|
props: {
|
|
10
10
|
title: {},
|
|
11
11
|
paramKey: {}
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const u =
|
|
15
|
-
const e =
|
|
13
|
+
setup($) {
|
|
14
|
+
const u = $, { activeRequest: o, activeExample: s, activeServer: l } = M(), { requestMutators: h, requestExampleMutators: y } = A(), c = P(() => {
|
|
15
|
+
const e = s.value;
|
|
16
16
|
return e ? e.parameters[u.paramKey].map((t) => {
|
|
17
17
|
var a;
|
|
18
18
|
return {
|
|
@@ -20,75 +20,84 @@ const W = /* @__PURE__ */ P({
|
|
|
20
20
|
enum: t.enum || ((a = e.serverVariables) == null ? void 0 : a[t.key])
|
|
21
21
|
};
|
|
22
22
|
}) : [];
|
|
23
|
-
}),
|
|
24
|
-
var
|
|
25
|
-
if (!o.value || !
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
23
|
+
}), k = (e, t, a) => {
|
|
24
|
+
var i, r;
|
|
25
|
+
if (!o.value || !s.value) return;
|
|
26
|
+
const p = s.value.parameters[u.paramKey], n = (i = p[e]) == null ? void 0 : i.key;
|
|
27
|
+
if (n) {
|
|
28
28
|
if (t === "key") {
|
|
29
|
-
if ((r =
|
|
29
|
+
if ((r = p[e]) != null && r.required)
|
|
30
30
|
return;
|
|
31
31
|
if (a) {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
`:${
|
|
32
|
+
const d = encodeURIComponent(n), f = encodeURIComponent(a), K = new RegExp(`(?<=/):${d}(?=[/?#]|$)`, "g"), b = o.value.path.replace(
|
|
33
|
+
K,
|
|
34
|
+
`:${f}`
|
|
35
35
|
);
|
|
36
|
-
|
|
36
|
+
h.edit(o.value.uid, "path", b);
|
|
37
37
|
} else {
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
p.splice(e, 1);
|
|
39
|
+
const d = new RegExp(`/:${encodeURIComponent(n)}(?=[/?#]|$)`, "g"), f = o.value.path.replace(d, "");
|
|
40
|
+
h.edit(o.value.uid, "path", f);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
y.edit(
|
|
44
|
+
s.value.uid,
|
|
45
45
|
`parameters.${u.paramKey}.${e}.${t}`,
|
|
46
46
|
a
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
|
-
},
|
|
50
|
-
var
|
|
51
|
-
if (!
|
|
52
|
-
const t = ((
|
|
53
|
-
(r) =>
|
|
49
|
+
}, C = (e) => {
|
|
50
|
+
var i;
|
|
51
|
+
if (!s.value) return;
|
|
52
|
+
const t = ((i = e.match(T.PATH)) == null ? void 0 : i.map((r) => r.slice(1, -1))) || [], a = s.value.parameters[u.paramKey], p = new Map(a.map((r) => [r.key, r])), n = t.map(
|
|
53
|
+
(r) => p.get(r) || { key: r, value: "", enabled: !0 }
|
|
54
54
|
);
|
|
55
55
|
a.forEach((r) => {
|
|
56
|
-
!t.includes(r.key) && (r.value || r.required) &&
|
|
57
|
-
}), a.splice(0, a.length, ...
|
|
58
|
-
|
|
56
|
+
!t.includes(r.key) && (r.value || r.required) && n.push(r);
|
|
57
|
+
}), a.splice(0, a.length, ...n), y.edit(
|
|
58
|
+
s.value.uid,
|
|
59
59
|
`parameters.${u.paramKey}`,
|
|
60
60
|
a
|
|
61
61
|
);
|
|
62
|
-
},
|
|
63
|
-
e &&
|
|
62
|
+
}, m = (e) => {
|
|
63
|
+
e && C(e);
|
|
64
64
|
};
|
|
65
|
-
return
|
|
65
|
+
return v(
|
|
66
66
|
() => o.value,
|
|
67
67
|
(e) => {
|
|
68
68
|
var t, a;
|
|
69
|
-
e && ((t = l.value) != null && t.url) &&
|
|
69
|
+
e && ((t = l.value) != null && t.url) && m((a = l.value) == null ? void 0 : a.url);
|
|
70
70
|
}
|
|
71
|
-
),
|
|
71
|
+
), v(
|
|
72
72
|
() => {
|
|
73
73
|
var e;
|
|
74
74
|
return (e = l.value) == null ? void 0 : e.url;
|
|
75
75
|
},
|
|
76
76
|
(e, t) => {
|
|
77
|
-
e && e !== t &&
|
|
77
|
+
e && e !== t && m(e);
|
|
78
78
|
}
|
|
79
|
-
), (
|
|
79
|
+
), v(
|
|
80
|
+
() => {
|
|
81
|
+
var e;
|
|
82
|
+
return (e = o.value) == null ? void 0 : e.path;
|
|
83
|
+
},
|
|
84
|
+
(e) => {
|
|
85
|
+
e && m(e);
|
|
86
|
+
}
|
|
87
|
+
), (e, t) => (g(), x(w, {
|
|
80
88
|
itemCount: c.value.length
|
|
81
89
|
}, {
|
|
82
|
-
title:
|
|
83
|
-
|
|
90
|
+
title: R(() => [
|
|
91
|
+
_(q(e.title), 1)
|
|
84
92
|
]),
|
|
85
|
-
default:
|
|
86
|
-
c.value.length ? (g(),
|
|
93
|
+
default: R(() => [
|
|
94
|
+
c.value.length ? (g(), x(N, {
|
|
87
95
|
key: 0,
|
|
88
96
|
class: "flex-1",
|
|
89
|
-
|
|
97
|
+
columns: ["32px", "", ""],
|
|
98
|
+
hasCheckboxDisabled: "",
|
|
90
99
|
items: c.value,
|
|
91
|
-
onUpdateRow:
|
|
100
|
+
onUpdateRow: k
|
|
92
101
|
}, null, 8, ["items"])) : V("", !0)
|
|
93
102
|
]),
|
|
94
103
|
_: 1
|
|
@@ -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":"AA4MA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAC;;AA8RF,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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-582c4535"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|