@scalar/api-client 2.2.4 → 2.2.7
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 +62 -0
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +28 -28
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +41 -41
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -5
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +5 -6
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +8 -8
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +9 -10
- 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 +24 -25
- package/dist/components/HttpMethod/index.d.ts +0 -1
- package/dist/components/HttpMethod/index.d.ts.map +1 -1
- package/dist/components/HttpMethod/index.js +2 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +121 -103
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +24 -26
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +6 -0
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +28 -23
- package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/OpenApiClientButton.vue2.js +21 -15
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +45 -41
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -6
- package/dist/layouts/App/create-api-client-app.d.ts +1 -0
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
- package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -0
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +1 -0
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +3 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +50 -48
- package/dist/store/store.d.ts +3 -1
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +47 -45
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +18 -20
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +63 -60
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +20 -19
- 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 +84 -86
- 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 +37 -36
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +60 -61
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +187 -195
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -36
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +5 -5
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -25
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +41 -30
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +3 -5
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +77 -78
- package/dist/views/Request/libs/oauth2.d.ts +6 -2
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +43 -37
- package/package.json +10 -11
- package/dist/components/HttpMethod/helpers.d.ts +0 -4
- package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
- package/dist/components/HttpMethod/helpers.js +0 -5
|
@@ -1,78 +1,77 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import { useModal as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import oe from "./RequestExampleAuth.vue.js";
|
|
1
|
+
import { defineComponent as F, ref as b, computed as f, openBlock as u, createBlock as z, withCtx as r, createElementVNode as m, createTextVNode as _, toDisplayString as g, createElementBlock as p, createVNode as c, unref as i, createCommentVNode as W, Fragment as L, renderList as H, withModifiers as D, withKeys as P } from "vue";
|
|
2
|
+
import G from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useActiveEntities as J } from "../../../../store/active-entities.js";
|
|
4
|
+
import { useModal as Q, ScalarIcon as O, ScalarComboboxMultiselect as X, ScalarButton as Y, ScalarIconButton as Z } from "@scalar/components";
|
|
5
|
+
import ee from "./DeleteRequestAuthModal.vue.js";
|
|
6
|
+
import te from "./RequestExampleAuth.vue.js";
|
|
8
7
|
import { displaySchemeFormatter as k } from "../../libs/auth.js";
|
|
9
|
-
import { ADD_AUTH_OPTIONS as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { useWorkspace as
|
|
14
|
-
const
|
|
8
|
+
import { ADD_AUTH_OPTIONS as le } from "../../consts/new-auth-options.js";
|
|
9
|
+
import se from "../../../../components/DataTable/DataTable.vue.js";
|
|
10
|
+
import oe from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
11
|
+
import ie from "../../../../components/DataTable/DataTableHeader.vue.js";
|
|
12
|
+
import { useWorkspace as ne } from "../../../../store/store.js";
|
|
13
|
+
const ce = { class: "flex flex-1 gap-1 items-center justify-between" }, re = {
|
|
15
14
|
key: 0,
|
|
16
15
|
class: "flex items-center gap-1 text-c-3"
|
|
17
|
-
},
|
|
16
|
+
}, ae = {
|
|
18
17
|
key: 0,
|
|
19
18
|
class: "flex relative scroll-timeline-x w-full"
|
|
20
|
-
},
|
|
19
|
+
}, ue = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, me = {
|
|
21
20
|
key: 1,
|
|
22
21
|
class: "pl-2"
|
|
23
|
-
},
|
|
22
|
+
}, Re = /* @__PURE__ */ F({
|
|
24
23
|
__name: "RequestAuth",
|
|
25
24
|
props: {
|
|
26
25
|
selectedSecuritySchemeUids: {},
|
|
27
26
|
title: {}
|
|
28
27
|
},
|
|
29
28
|
setup(R) {
|
|
30
|
-
const { activeCollection:
|
|
31
|
-
collectionMutators:
|
|
29
|
+
const { activeCollection: a, activeRequest: h } = J(), {
|
|
30
|
+
collectionMutators: B,
|
|
32
31
|
isReadOnly: x,
|
|
33
|
-
requestMutators:
|
|
32
|
+
requestMutators: M,
|
|
34
33
|
securitySchemes: q,
|
|
35
|
-
securitySchemeMutators:
|
|
36
|
-
} =
|
|
37
|
-
var l,
|
|
38
|
-
const e = ((l = h.value) == null ? void 0 : l.security) ?? ((
|
|
34
|
+
securitySchemeMutators: V
|
|
35
|
+
} = ne(), K = b(null), w = b(null), y = Q(), C = b(void 0), U = f(() => {
|
|
36
|
+
var l, o;
|
|
37
|
+
const e = ((l = h.value) == null ? void 0 : l.security) ?? ((o = a.value) == null ? void 0 : o.security) ?? [];
|
|
39
38
|
return { filteredRequirements: e.filter((n) => Object.keys(n).length), requirements: e };
|
|
40
39
|
}), T = f(() => {
|
|
41
40
|
var t;
|
|
42
|
-
return (((t =
|
|
41
|
+
return (((t = a.value) == null ? void 0 : t.securitySchemes) ?? []).map((l) => q[l]).filter((l) => l);
|
|
43
42
|
}), j = f(
|
|
44
43
|
() => {
|
|
45
44
|
const e = [...T.value], t = [];
|
|
46
|
-
U.value.filteredRequirements.forEach((
|
|
45
|
+
U.value.filteredRequirements.forEach((s) => {
|
|
47
46
|
const d = e.findIndex(
|
|
48
|
-
(
|
|
47
|
+
(E) => E.nameKey === Object.keys(s)[0]
|
|
49
48
|
);
|
|
50
49
|
d > -1 && (t.push(e[d]), e.splice(d, 1));
|
|
51
50
|
});
|
|
52
51
|
const l = e.map(
|
|
53
|
-
(
|
|
54
|
-
),
|
|
55
|
-
(
|
|
52
|
+
(s) => k(s)
|
|
53
|
+
), o = t.map(
|
|
54
|
+
(s) => k(s)
|
|
56
55
|
), n = [
|
|
57
|
-
{ label: "Required authentication", options:
|
|
56
|
+
{ label: "Required authentication", options: o },
|
|
58
57
|
{ label: "Available authentication", options: l }
|
|
59
58
|
];
|
|
60
|
-
return x ?
|
|
59
|
+
return x ? o.length ? n : l : (n.push({
|
|
61
60
|
label: "Add new authentication",
|
|
62
|
-
options:
|
|
61
|
+
options: le
|
|
63
62
|
}), n);
|
|
64
63
|
}
|
|
65
64
|
), S = f(() => {
|
|
66
65
|
const { filteredRequirements: e, requirements: t } = U.value;
|
|
67
66
|
if (!t.length) return null;
|
|
68
|
-
const l = e.length < t.length,
|
|
69
|
-
return { icon:
|
|
70
|
-
}),
|
|
71
|
-
!
|
|
72
|
-
|
|
67
|
+
const l = e.length < t.length, o = l ? "Unlock" : "Lock", n = l ? "Optional" : "Required", d = `${e.length === 1 ? Object.keys(e[0])[0] : "Authentication"} ${n}`;
|
|
68
|
+
return { icon: o, text: d };
|
|
69
|
+
}), $ = (e) => {
|
|
70
|
+
!a.value || !h.value || (x ? B.edit(
|
|
71
|
+
a.value.uid,
|
|
73
72
|
"selectedSecuritySchemeUids",
|
|
74
73
|
e
|
|
75
|
-
) :
|
|
74
|
+
) : M.edit(
|
|
76
75
|
h.value.uid,
|
|
77
76
|
"selectedSecuritySchemeUids",
|
|
78
77
|
e
|
|
@@ -82,57 +81,57 @@ const ae = { class: "flex flex-1 gap-1 items-center justify-between" }, ue = {
|
|
|
82
81
|
(e) => k(q[e])
|
|
83
82
|
)
|
|
84
83
|
);
|
|
85
|
-
function
|
|
86
|
-
var
|
|
87
|
-
if (!((
|
|
88
|
-
const t = e.find((
|
|
84
|
+
function I(e) {
|
|
85
|
+
var o, n;
|
|
86
|
+
if (!((o = a.value) != null && o.uid) || !((n = h.value) != null && n.uid)) return;
|
|
87
|
+
const t = e.find((s) => s.payload), l = e.filter((s) => !s.payload).map(({ id: s }) => s);
|
|
89
88
|
if (t != null && t.payload) {
|
|
90
|
-
const
|
|
89
|
+
const s = V.add(
|
|
91
90
|
t.payload,
|
|
92
|
-
|
|
91
|
+
a.value.uid
|
|
93
92
|
);
|
|
94
|
-
|
|
93
|
+
s && l.push(s.uid);
|
|
95
94
|
}
|
|
96
|
-
|
|
95
|
+
$(l);
|
|
97
96
|
}
|
|
98
|
-
const
|
|
97
|
+
const A = (e) => {
|
|
99
98
|
var t;
|
|
100
|
-
|
|
99
|
+
$(
|
|
101
100
|
R.selectedSecuritySchemeUids.filter((l) => l !== e)
|
|
102
|
-
), (t =
|
|
101
|
+
), (t = w.value) == null || t.$el.focus();
|
|
103
102
|
};
|
|
104
|
-
function
|
|
105
|
-
|
|
103
|
+
function N(e) {
|
|
104
|
+
C.value = e, y.show();
|
|
106
105
|
}
|
|
107
|
-
return (e, t) => (
|
|
106
|
+
return (e, t) => (u(), z(G, {
|
|
108
107
|
class: "group/params",
|
|
109
108
|
itemCount: v.value.length
|
|
110
109
|
}, {
|
|
111
110
|
title: r(() => [
|
|
112
|
-
|
|
111
|
+
m("div", ce, [
|
|
113
112
|
_(g(e.title) + " ", 1),
|
|
114
|
-
S.value ? (
|
|
113
|
+
S.value ? (u(), p("div", re, [
|
|
115
114
|
_(g(S.value.text) + " ", 1),
|
|
116
|
-
c(i(
|
|
115
|
+
c(i(O), {
|
|
117
116
|
class: "text-c-3",
|
|
118
117
|
icon: S.value.icon,
|
|
119
118
|
size: "xs"
|
|
120
119
|
}, null, 8, ["icon"])
|
|
121
|
-
])) :
|
|
120
|
+
])) : W("", !0)
|
|
122
121
|
])
|
|
123
122
|
]),
|
|
124
123
|
default: r(() => [
|
|
125
|
-
|
|
126
|
-
c(i(
|
|
124
|
+
m("form", null, [
|
|
125
|
+
c(i(se), {
|
|
127
126
|
class: "flex-1",
|
|
128
127
|
columns: [""]
|
|
129
128
|
}, {
|
|
130
129
|
default: r(() => [
|
|
131
|
-
c(i(
|
|
130
|
+
c(i(oe), null, {
|
|
132
131
|
default: r(() => [
|
|
133
|
-
c(i(
|
|
132
|
+
c(i(ie), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
|
|
134
133
|
default: r(() => [
|
|
135
|
-
c(i(
|
|
134
|
+
c(i(X), {
|
|
136
135
|
ref_key: "comboboxRef",
|
|
137
136
|
ref: K,
|
|
138
137
|
class: "text-xs w-full",
|
|
@@ -142,67 +141,66 @@ const ae = { class: "flex flex-1 gap-1 items-center justify-between" }, ue = {
|
|
|
142
141
|
multiple: "",
|
|
143
142
|
options: j.value,
|
|
144
143
|
style: { "margin-left": "120px" },
|
|
145
|
-
teleport:
|
|
146
|
-
onDelete:
|
|
147
|
-
"onUpdate:modelValue":
|
|
144
|
+
teleport: "",
|
|
145
|
+
onDelete: N,
|
|
146
|
+
"onUpdate:modelValue": I
|
|
148
147
|
}, {
|
|
149
148
|
default: r(() => [
|
|
150
|
-
c(i(
|
|
149
|
+
c(i(Y), {
|
|
151
150
|
ref_key: "comboboxButtonRef",
|
|
152
|
-
ref:
|
|
151
|
+
ref: w,
|
|
153
152
|
class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start -outline-offset-2",
|
|
154
153
|
fullWidth: "",
|
|
155
154
|
variant: "ghost"
|
|
156
155
|
}, {
|
|
157
156
|
default: r(() => [
|
|
158
|
-
t[3] || (t[3] =
|
|
159
|
-
v.value.length ? (
|
|
160
|
-
t[1] || (t[1] =
|
|
161
|
-
|
|
162
|
-
(
|
|
157
|
+
t[3] || (t[3] = m("div", { class: "text-c-1 h-8 flex min-w-[94px] items-center pr-0 pl-2" }, " Auth Type ", -1)),
|
|
158
|
+
v.value.length ? (u(), p("div", ae, [
|
|
159
|
+
t[1] || (t[1] = m("div", { class: "fade-left" }, null, -1)),
|
|
160
|
+
m("div", ue, [
|
|
161
|
+
(u(!0), p(L, null, H(v.value, (l) => (u(), p("span", {
|
|
163
162
|
key: l.id,
|
|
164
163
|
class: "cm-pill flex items-center mx-0 h-fit pr-0.5 !bg-b-2 text-c-1"
|
|
165
164
|
}, [
|
|
166
165
|
_(g(l.label) + " ", 1),
|
|
167
|
-
c(i(
|
|
166
|
+
c(i(Z), {
|
|
168
167
|
class: "cursor-pointer -ml-0.5 text-c-3 hover:text-c-1 rounded-full",
|
|
169
168
|
icon: "Close",
|
|
170
169
|
label: `Remove ${l.label}`,
|
|
171
170
|
size: "xs",
|
|
172
|
-
onClick:
|
|
173
|
-
onKeydown:
|
|
171
|
+
onClick: D((o) => A(l.id), ["stop"]),
|
|
172
|
+
onKeydown: P(D((o) => A(l.id), ["stop"]), ["enter"])
|
|
174
173
|
}, null, 8, ["label", "onClick", "onKeydown"])
|
|
175
174
|
]))), 128))
|
|
176
175
|
]),
|
|
177
|
-
t[2] || (t[2] =
|
|
178
|
-
])) : (
|
|
179
|
-
c(i(
|
|
180
|
-
class: "
|
|
176
|
+
t[2] || (t[2] = m("div", { class: "fade-right" }, null, -1))
|
|
177
|
+
])) : (u(), p("div", me, " None ")),
|
|
178
|
+
c(i(O), {
|
|
179
|
+
class: "mr-[9px]",
|
|
181
180
|
icon: "ChevronDown",
|
|
182
|
-
size: "
|
|
181
|
+
size: "md"
|
|
183
182
|
})
|
|
184
183
|
]),
|
|
185
184
|
_: 1
|
|
186
185
|
}, 512)
|
|
187
186
|
]),
|
|
188
187
|
_: 1
|
|
189
|
-
}, 8, ["isDeletable", "modelValue", "options"
|
|
188
|
+
}, 8, ["isDeletable", "modelValue", "options"])
|
|
190
189
|
]),
|
|
191
190
|
_: 1
|
|
192
191
|
})
|
|
193
192
|
]),
|
|
194
193
|
_: 1
|
|
195
194
|
}),
|
|
196
|
-
c(
|
|
195
|
+
c(te, { selectedSecuritySchemeUids: e.selectedSecuritySchemeUids }, null, 8, ["selectedSecuritySchemeUids"])
|
|
197
196
|
]),
|
|
198
197
|
_: 1
|
|
199
198
|
}),
|
|
200
|
-
c(
|
|
201
|
-
scheme:
|
|
199
|
+
c(ee, {
|
|
200
|
+
scheme: C.value,
|
|
202
201
|
state: i(y),
|
|
203
202
|
onClose: t[0] || (t[0] = (l) => i(y).hide())
|
|
204
|
-
}, null, 8, ["scheme", "state"])
|
|
205
|
-
a("div", { id: C })
|
|
203
|
+
}, null, 8, ["scheme", "state"])
|
|
206
204
|
])
|
|
207
205
|
]),
|
|
208
206
|
_: 1
|
|
@@ -210,5 +208,5 @@ const ae = { class: "flex flex-1 gap-1 items-center justify-between" }, ue = {
|
|
|
210
208
|
}
|
|
211
209
|
});
|
|
212
210
|
export {
|
|
213
|
-
|
|
211
|
+
Re as default
|
|
214
212
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAklBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AAo4BF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestBody.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-77d0f477"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as Z, computed as b, ref as I, watch as W, openBlock as
|
|
1
|
+
import { defineComponent as Z, computed as b, ref as I, watch as W, openBlock as p, createBlock as h, withCtx as d, createTextVNode as z, toDisplayString as F, createVNode as s, unref as u, createElementVNode as w, createCommentVNode as ee, createElementBlock as U, Fragment as ae, nextTick as te } from "vue";
|
|
2
2
|
import oe from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
3
|
import ne from "../../../components/DataTable/DataTable.vue.js";
|
|
4
4
|
import le from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
5
|
import T from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
6
|
import re from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
7
|
import { useActiveEntities as ie } from "../../../store/active-entities.js";
|
|
8
|
-
import { ScalarListbox as A, ScalarButton as
|
|
8
|
+
import { ScalarListbox as A, ScalarButton as k, ScalarIcon as E } from "@scalar/components";
|
|
9
9
|
import { requestExampleParametersSchema as J } from "@scalar/oas-utils/entities/spec";
|
|
10
10
|
import { canMethodHaveBody as ue } from "@scalar/oas-utils/helpers";
|
|
11
11
|
import $ from "./RequestTable.vue.js";
|
|
@@ -59,9 +59,9 @@ const se = {
|
|
|
59
59
|
function V() {
|
|
60
60
|
console.log("deleteRow");
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const P = (e, a, t) => {
|
|
63
63
|
if (!c.value || !o.value) return;
|
|
64
|
-
const l =
|
|
64
|
+
const l = f.value;
|
|
65
65
|
if (l.length > e) {
|
|
66
66
|
const n = [...l];
|
|
67
67
|
n[e] = { ...n[e], [a]: t }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), i.edit(
|
|
@@ -82,16 +82,19 @@ const se = {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
e === l.length - 1 && j();
|
|
85
|
-
},
|
|
85
|
+
}, f = b(
|
|
86
86
|
() => {
|
|
87
87
|
var e, a, t;
|
|
88
88
|
return ((t = (a = (e = o.value) == null ? void 0 : e.body) == null ? void 0 : a.formData) == null ? void 0 : t.value) ?? [];
|
|
89
89
|
}
|
|
90
|
-
),
|
|
90
|
+
), C = () => {
|
|
91
|
+
const e = f.value[f.value.length - 1];
|
|
92
|
+
(!e || e.key !== "" || e.value !== "") && j();
|
|
93
|
+
}, j = () => {
|
|
91
94
|
if (!c.value || !o.value) return;
|
|
92
95
|
const e = J.parse({
|
|
93
96
|
enabled: !1
|
|
94
|
-
}), a = [...
|
|
97
|
+
}), a = [...f.value, e];
|
|
95
98
|
o.value.body.formData ? i.edit(
|
|
96
99
|
o.value.uid,
|
|
97
100
|
"body.formData.value",
|
|
@@ -102,7 +105,7 @@ const se = {
|
|
|
102
105
|
});
|
|
103
106
|
}, N = (e, a) => {
|
|
104
107
|
if (!c.value || !o.value) return;
|
|
105
|
-
const t =
|
|
108
|
+
const t = f.value;
|
|
106
109
|
if (t.length > e) {
|
|
107
110
|
const l = [...t];
|
|
108
111
|
l[e].enabled = a, i.edit(
|
|
@@ -184,7 +187,7 @@ const se = {
|
|
|
184
187
|
onChange: async (t) => {
|
|
185
188
|
const l = t == null ? void 0 : t[0];
|
|
186
189
|
if (l && c.value && o.value) {
|
|
187
|
-
const r = [...
|
|
190
|
+
const r = [...f.value];
|
|
188
191
|
r[e] = {
|
|
189
192
|
...r[e],
|
|
190
193
|
file: l
|
|
@@ -205,7 +208,7 @@ const se = {
|
|
|
205
208
|
}
|
|
206
209
|
function M(e) {
|
|
207
210
|
if (!c.value || !o.value) return;
|
|
208
|
-
const t = [...
|
|
211
|
+
const t = [...f.value];
|
|
209
212
|
t[e] = {
|
|
210
213
|
...t[e],
|
|
211
214
|
file: void 0
|
|
@@ -233,7 +236,7 @@ const se = {
|
|
|
233
236
|
W(
|
|
234
237
|
v,
|
|
235
238
|
(e) => {
|
|
236
|
-
["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) &&
|
|
239
|
+
["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) && C();
|
|
237
240
|
},
|
|
238
241
|
{ immediate: !0 }
|
|
239
242
|
), W(
|
|
@@ -245,7 +248,7 @@ const se = {
|
|
|
245
248
|
var e;
|
|
246
249
|
(e = c.value) != null && e.method && ue(c.value.method) && q(R.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
247
250
|
R.value
|
|
248
|
-
) &&
|
|
251
|
+
) && C();
|
|
249
252
|
},
|
|
250
253
|
{ immediate: !0 }
|
|
251
254
|
);
|
|
@@ -275,9 +278,9 @@ const se = {
|
|
|
275
278
|
}
|
|
276
279
|
}
|
|
277
280
|
});
|
|
278
|
-
return (e, a) => (
|
|
281
|
+
return (e, a) => (p(), h(re, null, {
|
|
279
282
|
title: d(() => [
|
|
280
|
-
z(
|
|
283
|
+
z(F(e.title), 1)
|
|
281
284
|
]),
|
|
282
285
|
default: d(() => [
|
|
283
286
|
s(ne, { columns: [""] }, {
|
|
@@ -293,7 +296,7 @@ const se = {
|
|
|
293
296
|
teleport: ""
|
|
294
297
|
}, {
|
|
295
298
|
default: d(() => [
|
|
296
|
-
s(u(
|
|
299
|
+
s(u(k), {
|
|
297
300
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
298
301
|
fullWidth: "",
|
|
299
302
|
variant: "ghost"
|
|
@@ -301,11 +304,10 @@ const se = {
|
|
|
301
304
|
default: d(() => {
|
|
302
305
|
var t;
|
|
303
306
|
return [
|
|
304
|
-
w("span", null,
|
|
307
|
+
w("span", null, F((t = v.value) == null ? void 0 : t.label), 1),
|
|
305
308
|
s(u(E), {
|
|
306
309
|
icon: "ChevronDown",
|
|
307
|
-
size: "
|
|
308
|
-
thickness: "2.5"
|
|
310
|
+
size: "md"
|
|
309
311
|
})
|
|
310
312
|
];
|
|
311
313
|
}),
|
|
@@ -314,7 +316,7 @@ const se = {
|
|
|
314
316
|
]),
|
|
315
317
|
_: 1
|
|
316
318
|
}, 8, ["modelValue", "options"]),
|
|
317
|
-
g.value.length > 0 ? (
|
|
319
|
+
g.value.length > 0 ? (p(), h(u(A), {
|
|
318
320
|
key: 0,
|
|
319
321
|
modelValue: _.value,
|
|
320
322
|
"onUpdate:modelValue": a[1] || (a[1] = (t) => _.value = t),
|
|
@@ -323,7 +325,7 @@ const se = {
|
|
|
323
325
|
teleport: ""
|
|
324
326
|
}, {
|
|
325
327
|
default: d(() => [
|
|
326
|
-
s(u(
|
|
328
|
+
s(u(k), {
|
|
327
329
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
328
330
|
fullWidth: "",
|
|
329
331
|
variant: "ghost"
|
|
@@ -331,11 +333,10 @@ const se = {
|
|
|
331
333
|
default: d(() => {
|
|
332
334
|
var t;
|
|
333
335
|
return [
|
|
334
|
-
w("span", null,
|
|
336
|
+
w("span", null, F((t = _.value) == null ? void 0 : t.label), 1),
|
|
335
337
|
s(u(E), {
|
|
336
338
|
icon: "ChevronDown",
|
|
337
|
-
size: "
|
|
338
|
-
thickness: "2.5"
|
|
339
|
+
size: "md"
|
|
339
340
|
})
|
|
340
341
|
];
|
|
341
342
|
}),
|
|
@@ -354,12 +355,12 @@ const se = {
|
|
|
354
355
|
default: d(() => {
|
|
355
356
|
var t, l, n, r, m;
|
|
356
357
|
return [
|
|
357
|
-
v.value.id === "none" ? (
|
|
358
|
+
v.value.id === "none" ? (p(), U("div", se, a[2] || (a[2] = [
|
|
358
359
|
w("span", null, "No Body", -1)
|
|
359
|
-
]))) : v.value.id === "binaryFile" ? (
|
|
360
|
-
(t = u(o)) != null && t.body.binary ? (
|
|
361
|
-
w("span", me,
|
|
362
|
-
s(u(
|
|
360
|
+
]))) : v.value.id === "binaryFile" ? (p(), U("div", ce, [
|
|
361
|
+
(t = u(o)) != null && t.body.binary ? (p(), U(ae, { key: 0 }, [
|
|
362
|
+
w("span", me, F(((l = u(o)) == null ? void 0 : l.body.binary).name), 1),
|
|
363
|
+
s(u(k), {
|
|
363
364
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
|
|
364
365
|
size: "sm",
|
|
365
366
|
variant: "outlined",
|
|
@@ -370,7 +371,7 @@ const se = {
|
|
|
370
371
|
])),
|
|
371
372
|
_: 1
|
|
372
373
|
})
|
|
373
|
-
], 64)) : (
|
|
374
|
+
], 64)) : (p(), h(u(k), {
|
|
374
375
|
key: 1,
|
|
375
376
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
|
|
376
377
|
size: "sm",
|
|
@@ -388,33 +389,33 @@ const se = {
|
|
|
388
389
|
]),
|
|
389
390
|
_: 1
|
|
390
391
|
}))
|
|
391
|
-
])) : v.value.id == "multipartForm" ? (
|
|
392
|
+
])) : v.value.id == "multipartForm" ? (p(), h($, {
|
|
392
393
|
key: 2,
|
|
393
394
|
ref_key: "tableWrapperRef",
|
|
394
395
|
ref: B,
|
|
395
396
|
class: "!m-0 rounded-t-none shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
396
397
|
columns: ["32px", "", "", "61px"],
|
|
397
|
-
items:
|
|
398
|
+
items: f.value,
|
|
398
399
|
showUploadButton: "",
|
|
399
400
|
onDeleteRow: V,
|
|
400
401
|
onRemoveFile: M,
|
|
401
402
|
onToggleRow: N,
|
|
402
|
-
onUpdateRow:
|
|
403
|
+
onUpdateRow: P,
|
|
403
404
|
onUploadFile: L
|
|
404
|
-
}, null, 8, ["items"])) : v.value.id == "formUrlEncoded" ? (
|
|
405
|
+
}, null, 8, ["items"])) : v.value.id == "formUrlEncoded" ? (p(), h($, {
|
|
405
406
|
key: 3,
|
|
406
407
|
ref_key: "tableWrapperRef",
|
|
407
408
|
ref: B,
|
|
408
409
|
class: "!m-0 rounded-t-none border-t-0 shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
409
410
|
columns: ["32px", "", "", "61px"],
|
|
410
|
-
items:
|
|
411
|
+
items: f.value,
|
|
411
412
|
showUploadButton: "",
|
|
412
413
|
onDeleteRow: V,
|
|
413
414
|
onRemoveFile: M,
|
|
414
415
|
onToggleRow: N,
|
|
415
|
-
onUpdateRow:
|
|
416
|
+
onUpdateRow: P,
|
|
416
417
|
onUploadFile: L
|
|
417
|
-
}, null, 8, ["items"])) : (
|
|
418
|
+
}, null, 8, ["items"])) : (p(), h(oe, {
|
|
418
419
|
key: 4,
|
|
419
420
|
content: "",
|
|
420
421
|
language: Y.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AA+ZA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;;;cAKqC,MAAM;aAAO,MAAM;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AA+nB1D,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./RequestSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */
|
|
3
|
+
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ o(e, [["__scopeId", "data-v-360eb73e"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|