@scalar/api-client 2.0.44 → 2.0.45
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 +15 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +77 -69
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +5 -23
- package/dist/components/ContextBar.vue2.js +25 -2
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +1 -1
- package/dist/components/Form/Form.vue.d.ts +12 -3
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.js +24 -24
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +25 -22
- package/dist/components/SideNav/SideHelp.vue.js +1 -1
- package/dist/components/SideNav/SideNavLink.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +21 -21
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +19 -18
- package/dist/components/Sidebar/SidebarToggle.vue.js +1 -1
- package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
- package/dist/components/SubpageHeader.vue.js +3 -3
- package/dist/components/SubpageHeader.vue2.js +7 -7
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +2 -2
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +2 -2
- package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.js +6 -6
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/errors.d.ts +5 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +7 -0
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/libs/eventBusses/index.d.ts +1 -0
- package/dist/libs/eventBusses/index.d.ts.map +1 -1
- package/dist/libs/eventBusses/index.js +3 -1
- package/dist/libs/eventBusses/requestStatusBus.d.ts +5 -0
- package/dist/libs/eventBusses/requestStatusBus.d.ts.map +1 -0
- package/dist/libs/eventBusses/requestStatusBus.js +5 -0
- package/dist/libs/index.js +7 -5
- package/dist/libs/sendRequest.d.ts +2 -0
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +46 -37
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +34 -17
- package/dist/views/Cookies/Cookies.vue2.js +9 -9
- package/dist/views/Environment/Environment.vue2.js +24 -24
- 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 +170 -166
- package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth.vue2.js +115 -126
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +63 -42
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +69 -51
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +4 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +18 -18
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
- package/package.json +6 -6
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import
|
|
6
|
-
import { ScalarComboboxMultiselect as
|
|
7
|
-
import { camelToTitleWords as
|
|
8
|
-
import { ADD_AUTH_OPTIONS as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as j, ref as z, computed as I, openBlock as i, createBlock as k, withCtx as a, createElementVNode as h, toDisplayString as U, createVNode as u, unref as n, createElementBlock as c, Fragment as v, renderList as B, createTextVNode as p, withModifiers as E, createCommentVNode as w, capitalize as W, pushScopeId as H, popScopeId as Q } from "vue";
|
|
2
|
+
import K from "../../../components/DataTable/DataTableCell.vue.js";
|
|
3
|
+
import L from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
4
|
+
import { useWorkspace as G } from "../../../store/workspace.js";
|
|
5
|
+
import V from "./RequestAuthDataTableInput.vue.js";
|
|
6
|
+
import { ScalarComboboxMultiselect as J, ScalarButton as X, ScalarIcon as O } from "@scalar/components";
|
|
7
|
+
import { camelToTitleWords as Y } from "@scalar/oas-utils/helpers";
|
|
8
|
+
import { ADD_AUTH_OPTIONS as Z, ADD_AUTH_DICT as ee } from "../consts/new-auth-options.js";
|
|
9
|
+
import te from "../../../components/DataTable/DataTable.vue.js";
|
|
10
|
+
import f from "../../../components/DataTable/DataTableRow.vue.js";
|
|
11
|
+
import le from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
12
|
+
import ae from "../components/OAuth2.vue.js";
|
|
13
|
+
const C = (S) => (H("data-v-24e41ef0"), S = S(), Q(), S), oe = { class: "flex gap-1" }, ue = /* @__PURE__ */ C(() => /* @__PURE__ */ h("div", { class: "text-c-2 h-8 flex min-w-[120px] items-center border-r-1/2 pr-0 pl-2" }, " Auth Type ", -1)), ne = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "flex relative scroll-timeline-x w-full"
|
|
16
|
-
},
|
|
16
|
+
}, ie = /* @__PURE__ */ C(() => /* @__PURE__ */ h("div", { class: "fade-left" }, null, -1)), de = { class: "flex flex-1 gap-0.75 mr-1.5 items-center" }, re = /* @__PURE__ */ C(() => /* @__PURE__ */ h("div", { class: "fade-right" }, null, -1)), se = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "pl-2"
|
|
19
|
-
},
|
|
19
|
+
}, Se = /* @__PURE__ */ j({
|
|
20
20
|
__name: "RequestAuth",
|
|
21
21
|
props: {
|
|
22
22
|
title: {}
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
24
|
+
setup(S) {
|
|
25
25
|
const {
|
|
26
|
-
activeCollection:
|
|
27
|
-
activeRequest:
|
|
26
|
+
activeCollection: g,
|
|
27
|
+
activeRequest: b,
|
|
28
28
|
activeSecurityRequirements: q,
|
|
29
|
-
activeSecuritySchemes:
|
|
30
|
-
isReadOnly:
|
|
31
|
-
requestMutators:
|
|
32
|
-
securitySchemeMutators:
|
|
33
|
-
securitySchemes:
|
|
34
|
-
} =
|
|
29
|
+
activeSecuritySchemes: T,
|
|
30
|
+
isReadOnly: $,
|
|
31
|
+
requestMutators: F,
|
|
32
|
+
securitySchemeMutators: D,
|
|
33
|
+
securitySchemes: N
|
|
34
|
+
} = G(), R = z(null), A = (l) => {
|
|
35
35
|
switch (l == null ? void 0 : l.type) {
|
|
36
36
|
case "apiKey":
|
|
37
|
-
return `${
|
|
37
|
+
return `${W(l.in)}`;
|
|
38
38
|
case "http":
|
|
39
|
-
return `${
|
|
39
|
+
return `${W(l.scheme)} Authentication`;
|
|
40
40
|
case "oauth2":
|
|
41
|
-
return
|
|
41
|
+
return Y(l.flow.type);
|
|
42
42
|
case "openIdConnect":
|
|
43
43
|
return "Open ID Connect";
|
|
44
44
|
default:
|
|
@@ -47,34 +47,36 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
|
|
|
47
47
|
}, M = I(
|
|
48
48
|
() => {
|
|
49
49
|
var e;
|
|
50
|
-
const l = (e =
|
|
50
|
+
const l = (e = g.value) == null ? void 0 : e.securitySchemeDict, o = q.value.flatMap((r) => {
|
|
51
51
|
const t = Object.keys(r);
|
|
52
|
-
return t.length === 0 &&
|
|
52
|
+
return t.length === 0 && $.value ? { id: "none", label: "None", labelWithoutId: "None" } : t.flatMap((m) => {
|
|
53
53
|
if (!l) return [];
|
|
54
|
-
const
|
|
54
|
+
const s = l[m], y = N[s], x = A(y);
|
|
55
55
|
return {
|
|
56
|
-
id:
|
|
57
|
-
label: `${
|
|
58
|
-
labelWithoutId:
|
|
56
|
+
id: s,
|
|
57
|
+
label: `${x} (${m})`,
|
|
58
|
+
labelWithoutId: x
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
|
-
if (
|
|
62
|
+
if ($.value)
|
|
63
63
|
return o;
|
|
64
64
|
{
|
|
65
|
-
const r =
|
|
66
|
-
const
|
|
65
|
+
const r = b.value.securitySchemeUids.map((s) => {
|
|
66
|
+
const y = N[s], x = A(y);
|
|
67
67
|
return {
|
|
68
|
-
id:
|
|
69
|
-
label: "name" in
|
|
70
|
-
labelWithoutId:
|
|
68
|
+
id: s,
|
|
69
|
+
label: "name" in y && y.name.length ? `${x} (${y.name})` : x,
|
|
70
|
+
labelWithoutId: x
|
|
71
71
|
};
|
|
72
|
-
})
|
|
72
|
+
}), t = b.value.selectedSecuritySchemeUids, m = r.filter(
|
|
73
|
+
(s) => t.includes(s.id)
|
|
74
|
+
);
|
|
73
75
|
return [
|
|
74
|
-
{ label: "Select auth", options: [...o, ...
|
|
76
|
+
{ label: "Select auth", options: [...o, ...m] },
|
|
75
77
|
{
|
|
76
78
|
label: "Add new auth",
|
|
77
|
-
options:
|
|
79
|
+
options: Z
|
|
78
80
|
}
|
|
79
81
|
];
|
|
80
82
|
}
|
|
@@ -86,57 +88,57 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
|
|
|
86
88
|
).filter(
|
|
87
89
|
({ id: o }) => {
|
|
88
90
|
var e, r;
|
|
89
|
-
return (r = (e =
|
|
91
|
+
return (r = (e = b.value) == null ? void 0 : e.selectedSecuritySchemeUids) == null ? void 0 : r.find(
|
|
90
92
|
(t) => t === o
|
|
91
93
|
);
|
|
92
94
|
}
|
|
93
95
|
),
|
|
94
96
|
// Update the selected auth per this request
|
|
95
97
|
set: (l) => {
|
|
96
|
-
var e, r, t,
|
|
98
|
+
var e, r, t, m;
|
|
97
99
|
const o = l.find(
|
|
98
|
-
(
|
|
100
|
+
(s) => ee[s.id]
|
|
99
101
|
);
|
|
100
|
-
o != null && o.payload &&
|
|
102
|
+
o != null && o.payload && g.value ? ((m = (t = (r = (e = R.value) == null ? void 0 : e.comboboxPopoverRef) == null ? void 0 : r.popoverButtonRef) == null ? void 0 : t.el) == null || m.click(), D.add(
|
|
101
103
|
o.payload,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
g.value.uid,
|
|
105
|
+
b.value,
|
|
104
106
|
!0
|
|
105
|
-
)) :
|
|
106
|
-
|
|
107
|
+
)) : F.edit(
|
|
108
|
+
b.value.uid,
|
|
107
109
|
"selectedSecuritySchemeUids",
|
|
108
|
-
l.map((
|
|
110
|
+
l.map((s) => s.id)
|
|
109
111
|
);
|
|
110
112
|
}
|
|
111
|
-
}),
|
|
113
|
+
}), _ = (l, o, e) => D.edit(l.uid ?? "", o, e);
|
|
112
114
|
I(() => d.value.length > 1 ? d.value.map(({ labelWithoutId: l }) => l).join(", ") : d.value.length ? d.value[0].label : "None");
|
|
113
|
-
const
|
|
115
|
+
const P = (l) => {
|
|
114
116
|
const o = d.value.filter(
|
|
115
117
|
(e) => e.id !== l
|
|
116
118
|
);
|
|
117
119
|
d.value = o;
|
|
118
120
|
};
|
|
119
|
-
return (l, o) => (i(),
|
|
121
|
+
return (l, o) => (i(), k(L, {
|
|
120
122
|
class: "group/params",
|
|
121
123
|
itemCount: d.value.length
|
|
122
124
|
}, {
|
|
123
125
|
title: a(() => [
|
|
124
|
-
|
|
126
|
+
h("div", oe, U(l.title), 1)
|
|
125
127
|
]),
|
|
126
128
|
default: a(() => [
|
|
127
|
-
|
|
128
|
-
u(n(
|
|
129
|
+
h("form", null, [
|
|
130
|
+
u(n(te), {
|
|
129
131
|
class: "flex-1",
|
|
130
132
|
columns: [""]
|
|
131
133
|
}, {
|
|
132
134
|
default: a(() => [
|
|
133
|
-
u(n(
|
|
135
|
+
u(n(f), null, {
|
|
134
136
|
default: a(() => [
|
|
135
|
-
u(n(
|
|
137
|
+
u(n(le), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
|
|
136
138
|
default: a(() => [
|
|
137
|
-
u(n(
|
|
139
|
+
u(n(J), {
|
|
138
140
|
ref_key: "comboboxRef",
|
|
139
|
-
ref:
|
|
141
|
+
ref: R,
|
|
140
142
|
modelValue: d.value,
|
|
141
143
|
"onUpdate:modelValue": o[0] || (o[0] = (e) => d.value = e),
|
|
142
144
|
class: "text-xs w-full",
|
|
@@ -147,32 +149,32 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
|
|
|
147
149
|
teleport: ""
|
|
148
150
|
}, {
|
|
149
151
|
default: a(() => [
|
|
150
|
-
u(n(
|
|
152
|
+
u(n(X), {
|
|
151
153
|
class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start",
|
|
152
154
|
fullWidth: "",
|
|
153
155
|
variant: "ghost"
|
|
154
156
|
}, {
|
|
155
157
|
default: a(() => [
|
|
156
|
-
|
|
157
|
-
d.value.length ? (i(),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
(i(!0),
|
|
158
|
+
ue,
|
|
159
|
+
d.value.length ? (i(), c("div", ne, [
|
|
160
|
+
ie,
|
|
161
|
+
h("div", de, [
|
|
162
|
+
(i(!0), c(v, null, B(d.value, (e) => (i(), c("span", {
|
|
161
163
|
key: e.id,
|
|
162
|
-
class: "cm-pill flex items-center mx-0"
|
|
164
|
+
class: "cm-pill flex items-center mx-0 h-fit"
|
|
163
165
|
}, [
|
|
164
|
-
|
|
165
|
-
u(n(
|
|
166
|
-
class: "ml-1 cursor-pointer hover:text-c-1",
|
|
166
|
+
p(U(e.labelWithoutId) + " ", 1),
|
|
167
|
+
u(n(O), {
|
|
168
|
+
class: "ml-1 cursor-pointer text-c-3 hover:text-c-1",
|
|
167
169
|
icon: "Close",
|
|
168
170
|
size: "xs",
|
|
169
|
-
onClick:
|
|
171
|
+
onClick: E((r) => P(e.id), ["stop"])
|
|
170
172
|
}, null, 8, ["onClick"])
|
|
171
173
|
]))), 128))
|
|
172
174
|
]),
|
|
173
|
-
|
|
174
|
-
])) : (i(),
|
|
175
|
-
u(n(
|
|
175
|
+
re
|
|
176
|
+
])) : (i(), c("div", se, " None ")),
|
|
177
|
+
u(n(O), {
|
|
176
178
|
class: "min-w-3 ml-auto mr-2.5",
|
|
177
179
|
icon: "ChevronDown",
|
|
178
180
|
size: "xs"
|
|
@@ -189,136 +191,123 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
|
|
|
189
191
|
]),
|
|
190
192
|
_: 1
|
|
191
193
|
}),
|
|
192
|
-
(i(!0),
|
|
194
|
+
(i(!0), c(v, null, B(n(T), (e, r) => (i(), c(v, {
|
|
193
195
|
key: e.uid
|
|
194
196
|
}, [
|
|
195
|
-
n(
|
|
197
|
+
n(T).length > 1 ? (i(), k(n(f), {
|
|
196
198
|
key: 0,
|
|
197
199
|
class: "group/delete"
|
|
198
200
|
}, {
|
|
199
201
|
default: a(() => [
|
|
200
|
-
u(
|
|
202
|
+
u(K, { class: "text-c-2 pl-2 text-xs font-medium flex items-center bg-b-2" }, {
|
|
201
203
|
default: a(() => {
|
|
202
204
|
var t;
|
|
203
205
|
return [
|
|
204
|
-
|
|
205
|
-
_("div", pe, [
|
|
206
|
-
u(n(W), {
|
|
207
|
-
class: "px-1 transition-none",
|
|
208
|
-
size: "sm",
|
|
209
|
-
variant: "ghost",
|
|
210
|
-
onClick: B((s) => Q(e), ["stop"])
|
|
211
|
-
}, {
|
|
212
|
-
default: a(() => [
|
|
213
|
-
f(" Delete ")
|
|
214
|
-
]),
|
|
215
|
-
_: 2
|
|
216
|
-
}, 1032, ["onClick"])
|
|
217
|
-
])
|
|
206
|
+
p(U((t = d.value[r]) == null ? void 0 : t.label), 1)
|
|
218
207
|
];
|
|
219
208
|
}),
|
|
220
209
|
_: 2
|
|
221
210
|
}, 1024)
|
|
222
211
|
]),
|
|
223
212
|
_: 2
|
|
224
|
-
}, 1024)) :
|
|
225
|
-
e.type === "http" ? (i(),
|
|
226
|
-
e.scheme === "bearer" ? (i(),
|
|
213
|
+
}, 1024)) : w("", !0),
|
|
214
|
+
e.type === "http" ? (i(), c(v, { key: 1 }, [
|
|
215
|
+
e.scheme === "bearer" ? (i(), k(n(f), { key: 0 }, {
|
|
227
216
|
default: a(() => [
|
|
228
|
-
u(
|
|
217
|
+
u(V, {
|
|
229
218
|
id: `http-bearer-token-${e.uid}`,
|
|
230
219
|
modelValue: e.value,
|
|
231
|
-
placeholder: "
|
|
220
|
+
placeholder: "Token",
|
|
232
221
|
type: "password",
|
|
233
|
-
"onUpdate:modelValue": (t) =>
|
|
222
|
+
"onUpdate:modelValue": (t) => _(e, "value", t)
|
|
234
223
|
}, {
|
|
235
224
|
default: a(() => [
|
|
236
|
-
|
|
225
|
+
p(" Bearer Token ")
|
|
237
226
|
]),
|
|
238
227
|
_: 2
|
|
239
228
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
240
229
|
]),
|
|
241
230
|
_: 2
|
|
242
|
-
}, 1024)) : e.scheme === "basic" ? (i(),
|
|
243
|
-
u(n(
|
|
231
|
+
}, 1024)) : e.scheme === "basic" ? (i(), c(v, { key: 1 }, [
|
|
232
|
+
u(n(f), null, {
|
|
244
233
|
default: a(() => [
|
|
245
|
-
u(
|
|
234
|
+
u(V, {
|
|
246
235
|
id: `http-basic-username-${e.uid}`,
|
|
247
236
|
class: "text-c-2",
|
|
248
237
|
modelValue: e.value,
|
|
249
238
|
placeholder: "ScalarEnjoyer01",
|
|
250
239
|
required: "",
|
|
251
|
-
"onUpdate:modelValue": (t) =>
|
|
240
|
+
"onUpdate:modelValue": (t) => _(e, "value", t)
|
|
252
241
|
}, {
|
|
253
242
|
default: a(() => [
|
|
254
|
-
|
|
243
|
+
p(" Username ")
|
|
255
244
|
]),
|
|
256
245
|
_: 2
|
|
257
246
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
258
247
|
]),
|
|
259
248
|
_: 2
|
|
260
249
|
}, 1024),
|
|
261
|
-
u(n(
|
|
250
|
+
u(n(f), null, {
|
|
262
251
|
default: a(() => [
|
|
263
|
-
u(
|
|
252
|
+
u(V, {
|
|
264
253
|
id: `http-basic-password-${e.uid}`,
|
|
265
254
|
modelValue: e.secondValue,
|
|
266
255
|
placeholder: "xxxxxx",
|
|
267
256
|
type: "password",
|
|
268
|
-
"onUpdate:modelValue": (t) =>
|
|
257
|
+
"onUpdate:modelValue": (t) => _(e, "secondValue", t)
|
|
269
258
|
}, {
|
|
270
259
|
default: a(() => [
|
|
271
|
-
|
|
260
|
+
p(" Password ")
|
|
272
261
|
]),
|
|
273
262
|
_: 2
|
|
274
263
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
275
264
|
]),
|
|
276
265
|
_: 2
|
|
277
266
|
}, 1024)
|
|
278
|
-
], 64)) :
|
|
279
|
-
], 64)) : e.type === "apiKey" ? (i(),
|
|
280
|
-
n(
|
|
267
|
+
], 64)) : w("", !0)
|
|
268
|
+
], 64)) : e.type === "apiKey" ? (i(), c(v, { key: 2 }, [
|
|
269
|
+
n($) ? (i(), k(n(f), { key: 1 }, {
|
|
281
270
|
default: a(() => [
|
|
282
|
-
u(
|
|
271
|
+
u(V, {
|
|
283
272
|
id: `api-key-value-${e.uid}`,
|
|
284
273
|
modelValue: e.value,
|
|
285
274
|
placeholder: "Value",
|
|
286
|
-
"onUpdate:modelValue": (t) =>
|
|
275
|
+
"onUpdate:modelValue": (t) => _(e, "value", t)
|
|
287
276
|
}, {
|
|
288
277
|
default: a(() => [
|
|
289
|
-
|
|
278
|
+
p(U(e.name), 1)
|
|
290
279
|
]),
|
|
291
280
|
_: 2
|
|
292
281
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
293
282
|
]),
|
|
294
283
|
_: 2
|
|
295
|
-
}, 1024)) : (i(),
|
|
296
|
-
u(n(
|
|
284
|
+
}, 1024)) : (i(), c(v, { key: 0 }, [
|
|
285
|
+
u(n(f), null, {
|
|
297
286
|
default: a(() => [
|
|
298
|
-
u(
|
|
287
|
+
u(V, {
|
|
299
288
|
id: `api-key-name-${e.uid}`,
|
|
300
289
|
modelValue: e.name,
|
|
301
290
|
placeholder: "api-key",
|
|
302
|
-
"onUpdate:modelValue": (t) =>
|
|
291
|
+
"onUpdate:modelValue": (t) => _(e, "name", t)
|
|
303
292
|
}, {
|
|
304
293
|
default: a(() => [
|
|
305
|
-
|
|
294
|
+
p(" Name ")
|
|
306
295
|
]),
|
|
307
296
|
_: 2
|
|
308
297
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
309
298
|
]),
|
|
310
299
|
_: 2
|
|
311
300
|
}, 1024),
|
|
312
|
-
u(n(
|
|
301
|
+
u(n(f), null, {
|
|
313
302
|
default: a(() => [
|
|
314
|
-
u(
|
|
303
|
+
u(V, {
|
|
315
304
|
id: `api-key-value-add-${e.uid}`,
|
|
316
305
|
modelValue: e.value,
|
|
317
306
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
318
|
-
"onUpdate:modelValue": (t) =>
|
|
307
|
+
"onUpdate:modelValue": (t) => _(e, "value", t)
|
|
319
308
|
}, {
|
|
320
309
|
default: a(() => [
|
|
321
|
-
|
|
310
|
+
p(" Value ")
|
|
322
311
|
]),
|
|
323
312
|
_: 2
|
|
324
313
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
@@ -326,10 +315,10 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
|
|
|
326
315
|
_: 2
|
|
327
316
|
}, 1024)
|
|
328
317
|
], 64))
|
|
329
|
-
], 64)) : e.type === "oauth2" ? (i(),
|
|
318
|
+
], 64)) : e.type === "oauth2" ? (i(), k(n(ae), {
|
|
330
319
|
key: 3,
|
|
331
320
|
scheme: e
|
|
332
|
-
}, null, 8, ["scheme"])) :
|
|
321
|
+
}, null, 8, ["scheme"])) : w("", !0)
|
|
333
322
|
], 64))), 128))
|
|
334
323
|
]),
|
|
335
324
|
_: 1
|
|
@@ -341,5 +330,5 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
|
|
|
341
330
|
}
|
|
342
331
|
});
|
|
343
332
|
export {
|
|
344
|
-
|
|
333
|
+
Se as default
|
|
345
334
|
};
|
|
@@ -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":"AAgIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;;WAMtE,MAAM;cACH,MAAM,cAAc,CAAC,YAAY,CAAC;;WADrC,MAAM;cACH,MAAM,cAAc,CAAC,YAAY,CAAC;;AA6L9C,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,68 +1,89 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as K, computed as R, watch as E, openBlock as d, createBlock as f, withCtx as y, createTextVNode as g, toDisplayString as q, createElementBlock as C, createElementVNode as w } from "vue";
|
|
2
|
+
import P from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useWorkspace as M } from "../../../store/workspace.js";
|
|
4
|
+
import V from "./RequestTable.vue.js";
|
|
5
|
+
const B = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "text-c-3 px-4 text-sm border rounded min-h-12 justify-center flex items-center bg-b-1 mx-1"
|
|
8
|
-
},
|
|
8
|
+
}, N = /* @__PURE__ */ w("code", { class: "bg-b-2 ml-1 px-1 rounded" }, "/endpoint/{my_path_variable}", -1), H = /* @__PURE__ */ K({
|
|
9
9
|
__name: "RequestPathParams",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
12
12
|
paramKey: {}
|
|
13
13
|
},
|
|
14
14
|
setup(_) {
|
|
15
|
-
const
|
|
16
|
-
activeRequest:
|
|
17
|
-
activeExample:
|
|
18
|
-
requestMutators:
|
|
19
|
-
requestExampleMutators:
|
|
20
|
-
} =
|
|
15
|
+
const s = _, {
|
|
16
|
+
activeRequest: o,
|
|
17
|
+
activeExample: r,
|
|
18
|
+
requestMutators: h,
|
|
19
|
+
requestExampleMutators: v
|
|
20
|
+
} = M(), u = R(
|
|
21
21
|
() => {
|
|
22
22
|
var e;
|
|
23
|
-
return ((e =
|
|
23
|
+
return ((e = r.value) == null ? void 0 : e.parameters[s.paramKey]) ?? [];
|
|
24
24
|
}
|
|
25
|
-
),
|
|
26
|
-
var
|
|
27
|
-
if (!
|
|
28
|
-
const c =
|
|
29
|
-
if (
|
|
30
|
-
if ((
|
|
25
|
+
), x = (e, n, a) => {
|
|
26
|
+
var p, t;
|
|
27
|
+
if (!o.value || !r.value) return;
|
|
28
|
+
const c = r.value.parameters[s.paramKey], l = (p = c[e]) == null ? void 0 : p.key;
|
|
29
|
+
if (n === "key") {
|
|
30
|
+
if ((t = c[e]) != null && t.required)
|
|
31
31
|
return;
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
`:${
|
|
32
|
+
if (a) {
|
|
33
|
+
const i = encodeURIComponent(l), m = encodeURIComponent(a), $ = new RegExp(`(?<=/):${i}(?=[/?#]|$)`, "g"), k = o.value.path.replace(
|
|
34
|
+
$,
|
|
35
|
+
`:${m}`
|
|
36
36
|
);
|
|
37
|
-
|
|
37
|
+
h.edit(o.value.uid, "path", k);
|
|
38
38
|
} else {
|
|
39
39
|
c.splice(e, 1);
|
|
40
|
-
const
|
|
41
|
-
|
|
40
|
+
const i = new RegExp(`/:${encodeURIComponent(l)}(?=[/?#]|$)`, "g"), m = o.value.path.replace(i, "");
|
|
41
|
+
h.edit(o.value.uid, "path", m);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
`parameters.${
|
|
47
|
-
|
|
44
|
+
v.edit(
|
|
45
|
+
r.value.uid,
|
|
46
|
+
`parameters.${s.paramKey}.${e}.${n}`,
|
|
47
|
+
a
|
|
48
|
+
);
|
|
49
|
+
}, b = (e) => {
|
|
50
|
+
var p;
|
|
51
|
+
if (!r.value) return;
|
|
52
|
+
const n = ((p = e.match(new RegExp("(?<!{){([^{}]+)}(?!})", "g"))) == null ? void 0 : p.map((t) => t.slice(1, -1))) || [], a = r.value.parameters[s.paramKey], c = new Map(a.map((t) => [t.key, t])), l = n.map(
|
|
53
|
+
(t) => c.get(t) || { key: t, value: "", enabled: !0 }
|
|
54
|
+
);
|
|
55
|
+
a.forEach((t) => {
|
|
56
|
+
!n.includes(t.key) && (t.value || t.required) && l.push(t);
|
|
57
|
+
}), a.splice(0, a.length, ...l), v.edit(
|
|
58
|
+
r.value.uid,
|
|
59
|
+
`parameters.${s.paramKey}`,
|
|
60
|
+
a
|
|
48
61
|
);
|
|
49
62
|
};
|
|
50
|
-
return (
|
|
51
|
-
|
|
63
|
+
return E(
|
|
64
|
+
() => {
|
|
65
|
+
var e;
|
|
66
|
+
return (e = r.value) == null ? void 0 : e.url;
|
|
67
|
+
},
|
|
68
|
+
(e) => {
|
|
69
|
+
e && b(e);
|
|
70
|
+
}
|
|
71
|
+
), (e, n) => (d(), f(P, {
|
|
72
|
+
itemCount: u.value.length
|
|
52
73
|
}, {
|
|
53
|
-
title:
|
|
54
|
-
|
|
74
|
+
title: y(() => [
|
|
75
|
+
g(q(e.title), 1)
|
|
55
76
|
]),
|
|
56
|
-
default:
|
|
57
|
-
|
|
77
|
+
default: y(() => [
|
|
78
|
+
u.value.length ? (d(), f(V, {
|
|
58
79
|
key: 0,
|
|
59
80
|
class: "flex-1",
|
|
60
81
|
isEnabledHidden: "",
|
|
61
|
-
items:
|
|
62
|
-
onUpdateRow:
|
|
63
|
-
}, null, 8, ["items"])) : (
|
|
64
|
-
|
|
65
|
-
|
|
82
|
+
items: u.value,
|
|
83
|
+
onUpdateRow: x
|
|
84
|
+
}, null, 8, ["items"])) : (d(), C("div", B, [
|
|
85
|
+
g(" You can use variables in your path: "),
|
|
86
|
+
N
|
|
66
87
|
]))
|
|
67
88
|
]),
|
|
68
89
|
_: 1
|
|
@@ -70,5 +91,5 @@ const U = {
|
|
|
70
91
|
}
|
|
71
92
|
});
|
|
72
93
|
export {
|
|
73
|
-
|
|
94
|
+
H as default
|
|
74
95
|
};
|
|
@@ -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":";AA8aA,wBAKG"}
|