@scalar/api-client 2.3.33 → 2.4.1
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 +77 -0
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +74 -89
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +4 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +2 -0
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.js +19 -18
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +3 -3
- package/dist/components/TopNav/TopNavItem.vue2.js +46 -54
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/hooks/useClientConfig.d.ts +72 -6
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +45 -40
- package/dist/layouts/App/create-api-client-app.d.ts +72 -52
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +144 -104
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +49 -44
- package/dist/layouts/Web/create-api-client-web.d.ts +72 -52
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +72 -52
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +53 -49
- package/dist/libs/electron.d.ts +5 -0
- package/dist/libs/electron.d.ts.map +1 -0
- package/dist/libs/electron.js +4 -0
- package/dist/libs/find-request.d.ts +2 -0
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/index.js +17 -15
- package/dist/libs/send-request/create-fetch-query-params.d.ts +10 -3
- package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-query-params.js +28 -6
- package/dist/libs/send-request/create-request-operation.d.ts +3 -1
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +91 -87
- package/dist/libs/send-request/create-request-operation.test.d.ts +2 -0
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/libs/send-request/index.d.ts +1 -0
- package/dist/libs/send-request/index.d.ts.map +1 -1
- package/dist/libs/send-request/index.js +6 -4
- package/dist/plugins/hooks/usePluginManager.d.ts +8 -0
- package/dist/plugins/hooks/usePluginManager.d.ts.map +1 -0
- package/dist/plugins/hooks/usePluginManager.js +10 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +7 -0
- package/dist/plugins/plugin-manager.d.ts +28 -0
- package/dist/plugins/plugin-manager.d.ts.map +1 -0
- package/dist/plugins/plugin-manager.js +24 -0
- package/dist/store/active-entities.d.ts +2 -0
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/request-example.d.ts +4 -4
- package/dist/store/requests.d.ts +26 -4
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +24 -24
- package/dist/store/store.d.ts +72 -52
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/tags.d.ts +4 -4
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +47 -45
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +61 -70
- 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 +92 -77
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +71 -75
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +34 -35
- package/dist/views/Request/RequestSection/types/post-response.d.ts +7 -0
- package/dist/views/Request/RequestSection/types/post-response.d.ts.map +1 -0
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItem.vue2.js +132 -134
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +82 -70
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -114
- package/package.json +25 -20
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarErrorBoundary as
|
|
3
|
-
import { canMethodHaveBody as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { matchesDomain as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
1
|
+
import { defineComponent as U, computed as v, useId as g, ref as D, watch as M, createBlock as p, openBlock as n, withCtx as c, createElementVNode as y, withDirectives as s, createCommentVNode as h, createElementBlock as f, createVNode as i, unref as r, vShow as m, Fragment as K, renderList as L, resolveDynamicComponent as Q, toDisplayString as $ } from "vue";
|
|
2
|
+
import { ScalarErrorBoundary as P } from "@scalar/components";
|
|
3
|
+
import { canMethodHaveBody as k, isDefined as F, REGEX as S } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import j from "../../../components/SectionFilter.vue.js";
|
|
5
|
+
import T from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
|
+
import { matchesDomain as W } from "../../../libs/send-request/set-request-cookies.js";
|
|
7
|
+
import z from "./RequestBody.vue.js";
|
|
8
|
+
import b from "./RequestParams.vue.js";
|
|
9
|
+
import G from "./RequestPathParams.vue.js";
|
|
10
|
+
import X from "./RequestAuth/RequestAuth.vue.js";
|
|
11
|
+
import J from "./RequestCodeExample.vue.js";
|
|
12
|
+
import { usePluginManager as Y } from "../../../plugins/hooks/usePluginManager.js";
|
|
13
|
+
import { useWorkspace as Z } from "../../../store/store.js";
|
|
14
|
+
import { useLayout as x } from "../../../hooks/useLayout.js";
|
|
15
|
+
const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, ee = ["for"], ae = ["id", "placeholder", "value"], oe = {
|
|
15
16
|
key: 2,
|
|
16
17
|
class: "text-c-1 flex h-8 items-center"
|
|
17
|
-
},
|
|
18
|
+
}, le = ["id", "role"], be = /* @__PURE__ */ U({
|
|
18
19
|
__name: "RequestSection",
|
|
19
20
|
props: {
|
|
20
21
|
collection: {},
|
|
@@ -27,41 +28,42 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
27
28
|
server: {},
|
|
28
29
|
workspace: {}
|
|
29
30
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
31
|
+
setup(o) {
|
|
32
|
+
const C = [
|
|
32
33
|
"Auth",
|
|
33
34
|
"Variables",
|
|
34
35
|
"Cookies",
|
|
35
36
|
"Headers",
|
|
36
37
|
"Query",
|
|
37
|
-
"Body"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
"Body",
|
|
39
|
+
"Scripts"
|
|
40
|
+
], { requestMutators: V, cookies: B, securitySchemes: R } = Z(), { layout: d } = x(), w = v(() => {
|
|
41
|
+
const e = /* @__PURE__ */ new Set(["All", ...C]);
|
|
42
|
+
return o.example.parameters.path.length || e.delete("Variables"), k(o.operation.method ?? "get") || e.delete("Body"), A.value && e.delete("Auth"), [...e];
|
|
43
|
+
}), t = v(
|
|
42
44
|
() => Object.fromEntries(
|
|
43
|
-
|
|
45
|
+
w.value.map((e) => [e, g()])
|
|
44
46
|
)
|
|
45
|
-
),
|
|
47
|
+
), A = v(
|
|
46
48
|
() => {
|
|
47
49
|
var e;
|
|
48
|
-
return
|
|
50
|
+
return d === "modal" && ((e = o.operation.security) == null ? void 0 : e.length) === 0;
|
|
49
51
|
}
|
|
50
|
-
), a =
|
|
51
|
-
|
|
52
|
-
() =>
|
|
52
|
+
), a = D("All");
|
|
53
|
+
M(
|
|
54
|
+
() => o.operation,
|
|
53
55
|
(e) => {
|
|
54
|
-
a.value === "Body" && e && !
|
|
56
|
+
a.value === "Body" && e && !k(e.method) && (a.value = "All");
|
|
55
57
|
}
|
|
56
58
|
);
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
() => (
|
|
59
|
+
const O = (e) => {
|
|
60
|
+
const l = e.target;
|
|
61
|
+
V.edit(o.operation.uid, "summary", l.value);
|
|
62
|
+
}, E = v(
|
|
63
|
+
() => (o.workspace.cookies ?? []).map((e) => B[e]).filter(F).filter((e) => e.name).filter(
|
|
62
64
|
(e) => {
|
|
63
|
-
var
|
|
64
|
-
return
|
|
65
|
+
var l;
|
|
66
|
+
return W(((l = o.server) == null ? void 0 : l.url) || o.operation.path, e.domain);
|
|
65
67
|
}
|
|
66
68
|
).map((e) => ({
|
|
67
69
|
key: e.name,
|
|
@@ -74,42 +76,42 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
74
76
|
},
|
|
75
77
|
enabled: !0
|
|
76
78
|
}))
|
|
77
|
-
),
|
|
78
|
-
return (e,
|
|
79
|
+
), H = () => o.operation.summary ? o.operation.summary : o.operation.path.replace(S.PROTOCOL, "") ? o.operation.path.replace(S.PROTOCOL, "") : "Request Name", q = g(), N = Y().getViewComponents("request.section"), I = (e, l) => V.edit(o.operation.uid, e, l);
|
|
80
|
+
return (e, l) => (n(), p(T, {
|
|
79
81
|
"aria-label": `Request: ${e.operation.summary}`
|
|
80
82
|
}, {
|
|
81
|
-
title:
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
title: c(() => [
|
|
84
|
+
y("div", _, [
|
|
85
|
+
r(d) !== "modal" ? (n(), f("label", {
|
|
84
86
|
key: 0,
|
|
85
87
|
class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
|
|
86
|
-
for:
|
|
87
|
-
}, null, 8,
|
|
88
|
-
|
|
88
|
+
for: r(q)
|
|
89
|
+
}, null, 8, ee)) : h("", !0),
|
|
90
|
+
r(d) !== "modal" ? (n(), f("input", {
|
|
89
91
|
key: 1,
|
|
90
|
-
id:
|
|
92
|
+
id: r(q),
|
|
91
93
|
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",
|
|
92
|
-
placeholder:
|
|
94
|
+
placeholder: H(),
|
|
93
95
|
value: e.operation.summary,
|
|
94
|
-
onInput:
|
|
95
|
-
}, null, 40,
|
|
96
|
+
onInput: O
|
|
97
|
+
}, null, 40, ae)) : (n(), f("span", oe, $(e.operation.summary), 1))
|
|
96
98
|
]),
|
|
97
|
-
|
|
99
|
+
i(j, {
|
|
98
100
|
modelValue: a.value,
|
|
99
|
-
"onUpdate:modelValue":
|
|
100
|
-
filterIds:
|
|
101
|
-
filters:
|
|
101
|
+
"onUpdate:modelValue": l[0] || (l[0] = (u) => a.value = u),
|
|
102
|
+
filterIds: t.value,
|
|
103
|
+
filters: w.value
|
|
102
104
|
}, null, 8, ["modelValue", "filterIds", "filters"])
|
|
103
105
|
]),
|
|
104
|
-
default:
|
|
105
|
-
|
|
106
|
-
id:
|
|
106
|
+
default: c(() => [
|
|
107
|
+
y("div", {
|
|
108
|
+
id: t.value.All,
|
|
107
109
|
class: "request-section-content custom-scroll relative flex flex-1 flex-col",
|
|
108
110
|
role: a.value === "All" ? "tabpanel" : "none"
|
|
109
111
|
}, [
|
|
110
|
-
e.collection && e.workspace && (
|
|
112
|
+
e.collection && e.workspace && (r(d) !== "modal" || Object.keys(r(R) ?? {}).length) ? s((n(), p(X, {
|
|
111
113
|
key: 0,
|
|
112
|
-
id:
|
|
114
|
+
id: t.value.Auth,
|
|
113
115
|
class: "request-section-content-auth",
|
|
114
116
|
collection: e.collection,
|
|
115
117
|
envVariables: e.envVariables,
|
|
@@ -124,11 +126,11 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
124
126
|
}, null, 8, ["id", "collection", "envVariables", "environment", "operation", "role", "selectedSecuritySchemeUids", "server", "workspace"])), [
|
|
125
127
|
[
|
|
126
128
|
m,
|
|
127
|
-
!
|
|
129
|
+
!A.value && (a.value === "All" || a.value === "Auth")
|
|
128
130
|
]
|
|
129
|
-
]) :
|
|
130
|
-
s(
|
|
131
|
-
id:
|
|
131
|
+
]) : h("", !0),
|
|
132
|
+
s(i(G, {
|
|
133
|
+
id: t.value.Variables,
|
|
132
134
|
class: "request-section-content-path-params",
|
|
133
135
|
envVariables: e.envVariables,
|
|
134
136
|
environment: e.environment,
|
|
@@ -145,8 +147,8 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
145
147
|
(a.value === "All" || a.value === "Variables") && e.example.parameters.path.length
|
|
146
148
|
]
|
|
147
149
|
]),
|
|
148
|
-
s(
|
|
149
|
-
id:
|
|
150
|
+
s(i(b, {
|
|
151
|
+
id: t.value.Cookies,
|
|
150
152
|
class: "request-section-content-cookies",
|
|
151
153
|
envVariables: e.envVariables,
|
|
152
154
|
environment: e.environment,
|
|
@@ -155,15 +157,15 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
155
157
|
label: "Cookie",
|
|
156
158
|
operation: e.operation,
|
|
157
159
|
paramKey: "cookies",
|
|
158
|
-
readOnlyEntries:
|
|
160
|
+
readOnlyEntries: E.value,
|
|
159
161
|
role: a.value === "All" ? "none" : "tabpanel",
|
|
160
162
|
title: "Cookies",
|
|
161
163
|
workspace: e.workspace
|
|
162
164
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "readOnlyEntries", "role", "workspace"]), [
|
|
163
165
|
[m, a.value === "All" || a.value === "Cookies"]
|
|
164
166
|
]),
|
|
165
|
-
s(
|
|
166
|
-
id:
|
|
167
|
+
s(i(b, {
|
|
168
|
+
id: t.value.Headers,
|
|
167
169
|
class: "request-section-content-headers",
|
|
168
170
|
envVariables: e.envVariables,
|
|
169
171
|
environment: e.environment,
|
|
@@ -178,8 +180,8 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
178
180
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
|
|
179
181
|
[m, a.value === "All" || a.value === "Headers"]
|
|
180
182
|
]),
|
|
181
|
-
s(
|
|
182
|
-
id:
|
|
183
|
+
s(i(b, {
|
|
184
|
+
id: t.value.Query,
|
|
183
185
|
class: "request-section-content-query",
|
|
184
186
|
envVariables: e.envVariables,
|
|
185
187
|
environment: e.environment,
|
|
@@ -194,9 +196,9 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
194
196
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
|
|
195
197
|
[m, a.value === "All" || a.value === "Query"]
|
|
196
198
|
]),
|
|
197
|
-
e.operation.method && (a.value === "All" || a.value === "Body") &&
|
|
199
|
+
e.operation.method && (a.value === "All" || a.value === "Body") && r(k)(e.operation.method) ? (n(), p(z, {
|
|
198
200
|
key: 1,
|
|
199
|
-
id:
|
|
201
|
+
id: t.value.Body,
|
|
200
202
|
class: "request-section-content-body",
|
|
201
203
|
envVariables: e.envVariables,
|
|
202
204
|
environment: e.environment,
|
|
@@ -205,11 +207,24 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
205
207
|
role: a.value === "All" ? "none" : "tabpanel",
|
|
206
208
|
title: "Body",
|
|
207
209
|
workspace: e.workspace
|
|
208
|
-
}, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"])) :
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
}, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"])) : h("", !0),
|
|
211
|
+
(n(!0), f(K, null, L(r(N), (u) => (n(), p(r(P), {
|
|
212
|
+
key: u.component
|
|
213
|
+
}, {
|
|
214
|
+
default: c(() => [
|
|
215
|
+
s((n(), p(Q(u.component), {
|
|
216
|
+
"onUpdate:operation": I,
|
|
217
|
+
operation: e.operation
|
|
218
|
+
}, null, 40, ["operation"])), [
|
|
219
|
+
[m, a.value === "All" || a.value === u.title]
|
|
220
|
+
])
|
|
221
|
+
]),
|
|
222
|
+
_: 2
|
|
223
|
+
}, 1024))), 128)),
|
|
224
|
+
l[1] || (l[1] = y("div", { class: "flex flex-grow" }, null, -1)),
|
|
225
|
+
i(r(P), null, {
|
|
226
|
+
default: c(() => [
|
|
227
|
+
i(J, {
|
|
213
228
|
class: "request-section-content-code-example -mt-1/2 border-t",
|
|
214
229
|
collection: e.collection,
|
|
215
230
|
example: e.example,
|
|
@@ -221,12 +236,12 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
221
236
|
]),
|
|
222
237
|
_: 1
|
|
223
238
|
})
|
|
224
|
-
], 8,
|
|
239
|
+
], 8, le)
|
|
225
240
|
]),
|
|
226
241
|
_: 1
|
|
227
242
|
}, 8, ["aria-label"]));
|
|
228
243
|
}
|
|
229
244
|
});
|
|
230
245
|
export {
|
|
231
|
-
|
|
246
|
+
be as default
|
|
232
247
|
};
|
|
@@ -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":"AAqQA,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,EAAc,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAQ9D,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;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;;;;;;;;;;;;yBATsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AA2iBxB,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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0277e06b"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarTooltip as D, ScalarIcon as
|
|
1
|
+
import { defineComponent as z, createBlock as i, openBlock as u, withCtx as n, createVNode as r, createElementBlock as b, createTextVNode as f, toDisplayString as c, Fragment as g, renderList as q, normalizeClass as v, unref as s, createCommentVNode as k, createElementVNode as p } from "vue";
|
|
2
|
+
import { ScalarTooltip as D, ScalarIcon as B, ScalarButton as R } from "@scalar/components";
|
|
3
3
|
import { ScalarIconTrash as E } from "@scalar/icons";
|
|
4
4
|
import { RouterLink as G } from "vue-router";
|
|
5
|
-
import
|
|
5
|
+
import C from "../../../components/CodeInput/CodeInput.vue.js";
|
|
6
6
|
import N from "../../../components/DataTable/DataTable.vue.js";
|
|
7
7
|
import y from "../../../components/DataTable/DataTableCell.vue.js";
|
|
8
8
|
import P from "../../../components/DataTable/DataTableCheckbox.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { parameterIsInvalid as j, hasItemProperties as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
9
|
+
import V from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
10
|
+
import $ from "../../../components/DataTable/DataTableRow.vue.js";
|
|
11
|
+
import { parameterIsInvalid as j, hasItemProperties as h } from "../libs/request.js";
|
|
12
|
+
import K from "./RequestTableTooltip.vue.js";
|
|
13
|
+
const O = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify-end overflow-hidden p-1" }, A = ["onClick"], L = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "p-0.5"
|
|
16
|
-
}, ne = /* @__PURE__ */
|
|
16
|
+
}, ne = /* @__PURE__ */ z({
|
|
17
17
|
__name: "RequestTable",
|
|
18
18
|
props: {
|
|
19
19
|
items: {},
|
|
@@ -28,88 +28,83 @@ const A = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
28
28
|
label: {}
|
|
29
29
|
},
|
|
30
30
|
emits: ["updateRow", "toggleRow", "addRow", "deleteRow", "inputFocus", "inputBlur", "uploadFile", "removeFile"],
|
|
31
|
-
setup(
|
|
32
|
-
const m =
|
|
33
|
-
|
|
31
|
+
setup(x, { emit: F }) {
|
|
32
|
+
const m = x, t = F, U = ["", "", "36px"], w = (e, o, l) => {
|
|
33
|
+
t("updateRow", e, o, l);
|
|
34
34
|
}, S = (e) => {
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
return (e, o) => (
|
|
35
|
+
t("uploadFile", e);
|
|
36
|
+
}, T = (e) => Array.isArray(e.default) && e.default.length === 1 ? e.default[0] : e.default, I = (e) => !!(e.key || e.value);
|
|
37
|
+
return (e, o) => (u(), i(N, {
|
|
38
38
|
class: "group/table flex-1",
|
|
39
|
-
columns:
|
|
39
|
+
columns: U
|
|
40
40
|
}, {
|
|
41
41
|
default: n(() => [
|
|
42
|
-
|
|
42
|
+
r($, { class: "sr-only !block" }, {
|
|
43
43
|
default: n(() => [
|
|
44
|
-
|
|
44
|
+
r(V, null, {
|
|
45
45
|
default: n(() => [
|
|
46
|
-
|
|
46
|
+
f(c(e.label) + " Enabled", 1)
|
|
47
47
|
]),
|
|
48
48
|
_: 1
|
|
49
49
|
}),
|
|
50
|
-
|
|
50
|
+
r(V, null, {
|
|
51
51
|
default: n(() => [
|
|
52
|
-
|
|
52
|
+
f(c(e.label) + " Key", 1)
|
|
53
53
|
]),
|
|
54
54
|
_: 1
|
|
55
55
|
}),
|
|
56
|
-
|
|
56
|
+
r(V, null, {
|
|
57
57
|
default: n(() => [
|
|
58
|
-
|
|
58
|
+
f(c(e.label) + " Value", 1)
|
|
59
59
|
]),
|
|
60
60
|
_: 1
|
|
61
61
|
})
|
|
62
62
|
]),
|
|
63
63
|
_: 1
|
|
64
64
|
}),
|
|
65
|
-
(
|
|
65
|
+
(u(!0), b(g, null, q(e.items, (l, d) => (u(), i($, {
|
|
66
66
|
id: l.key,
|
|
67
|
-
key:
|
|
67
|
+
key: d,
|
|
68
68
|
class: v({
|
|
69
|
-
alert:
|
|
69
|
+
alert: s(j)(l).value,
|
|
70
70
|
error: e.invalidParams && e.invalidParams.has(l.key)
|
|
71
71
|
})
|
|
72
72
|
}, {
|
|
73
73
|
default: n(() => [
|
|
74
|
-
e.isGlobal ? (
|
|
74
|
+
e.isGlobal ? (u(), i(s(G), {
|
|
75
75
|
key: 0,
|
|
76
76
|
class: "!border-r-1/2 border-t-1/2 text-c-2 flex items-center justify-center",
|
|
77
77
|
to: l.route ?? {}
|
|
78
78
|
}, {
|
|
79
79
|
default: n(() => [
|
|
80
|
-
o[
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
o[4] || (o[4] = p("span", { class: "sr-only" }, "Global", -1)),
|
|
81
|
+
r(s(D), {
|
|
82
|
+
content: "Global cookies are shared across the whole workspace.",
|
|
83
|
+
placement: "top"
|
|
84
84
|
}, {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
default: n(() => [
|
|
86
|
+
r(s(B), {
|
|
87
|
+
tabindex: "0",
|
|
87
88
|
class: "text-c-1",
|
|
88
89
|
icon: "Globe",
|
|
89
90
|
size: "xs"
|
|
90
91
|
})
|
|
91
92
|
]),
|
|
92
|
-
content: n(() => o[4] || (o[4] = [
|
|
93
|
-
i("div", { class: "w-content bg-b-1 text-xxs text-c-1 z-100 pointer-events-none z-10 grid max-w-[320px] gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
|
|
94
|
-
i("div", { class: "text-c-1 flex items-center" }, [
|
|
95
|
-
i("span", { class: "text-pretty" }, " Global cookies are shared across the whole workspace. ")
|
|
96
|
-
])
|
|
97
|
-
], -1)
|
|
98
|
-
])),
|
|
99
93
|
_: 1
|
|
100
94
|
})
|
|
101
95
|
]),
|
|
102
96
|
_: 2
|
|
103
|
-
}, 1032, ["to"])) : (
|
|
97
|
+
}, 1032, ["to"])) : (u(), i(P, {
|
|
104
98
|
key: 1,
|
|
105
99
|
class: "!border-r-1/2",
|
|
106
100
|
disabled: m.hasCheckboxDisabled,
|
|
107
101
|
modelValue: l.enabled,
|
|
108
|
-
"onUpdate:modelValue": (a) =>
|
|
102
|
+
"onUpdate:modelValue": (a) => t("toggleRow", d, a)
|
|
109
103
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"])),
|
|
110
|
-
|
|
104
|
+
r(y, null, {
|
|
111
105
|
default: n(() => [
|
|
112
|
-
|
|
106
|
+
r(C, {
|
|
107
|
+
"aria-label": `${e.label} Key`,
|
|
113
108
|
disableCloseBrackets: "",
|
|
114
109
|
disabled: m.isReadOnly,
|
|
115
110
|
disableEnter: "",
|
|
@@ -121,19 +116,20 @@ const A = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
121
116
|
placeholder: "Key",
|
|
122
117
|
required: !!l.required,
|
|
123
118
|
workspace: e.workspace,
|
|
124
|
-
onBlur: o[0] || (o[0] = (a) =>
|
|
125
|
-
onFocus: o[1] || (o[1] = (a) =>
|
|
126
|
-
onSelectVariable: (a) =>
|
|
127
|
-
"onUpdate:modelValue": (a) =>
|
|
128
|
-
}, null, 8, ["disabled", "envVariables", "environment", "modelValue", "required", "workspace", "onSelectVariable", "onUpdate:modelValue"])
|
|
119
|
+
onBlur: o[0] || (o[0] = (a) => t("inputBlur")),
|
|
120
|
+
onFocus: o[1] || (o[1] = (a) => t("inputFocus")),
|
|
121
|
+
onSelectVariable: (a) => w(d, "key", a),
|
|
122
|
+
"onUpdate:modelValue": (a) => t("updateRow", d, "key", a)
|
|
123
|
+
}, null, 8, ["aria-label", "disabled", "envVariables", "environment", "modelValue", "required", "workspace", "onSelectVariable", "onUpdate:modelValue"])
|
|
129
124
|
]),
|
|
130
125
|
_: 2
|
|
131
126
|
}, 1024),
|
|
132
|
-
|
|
127
|
+
r(y, null, {
|
|
133
128
|
default: n(() => [
|
|
134
|
-
|
|
129
|
+
r(C, {
|
|
130
|
+
"aria-label": `${e.label} Value`,
|
|
135
131
|
class: v(
|
|
136
|
-
|
|
132
|
+
s(h)(l) ? "pr-6 group-hover:pr-10 group-has-[.cm-focused]:pr-10" : "group-hover:pr-6 group-has-[.cm-focused]:pr-6"
|
|
137
133
|
),
|
|
138
134
|
default: l.default,
|
|
139
135
|
disableCloseBrackets: "",
|
|
@@ -152,62 +148,62 @@ const A = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
152
148
|
placeholder: "Value",
|
|
153
149
|
type: l.type,
|
|
154
150
|
workspace: e.workspace,
|
|
155
|
-
onBlur: o[2] || (o[2] = (a) =>
|
|
156
|
-
onFocus: o[3] || (o[3] = (a) =>
|
|
157
|
-
onSelectVariable: (a) =>
|
|
158
|
-
"onUpdate:modelValue": (a) =>
|
|
151
|
+
onBlur: o[2] || (o[2] = (a) => t("inputBlur")),
|
|
152
|
+
onFocus: o[3] || (o[3] = (a) => t("inputFocus")),
|
|
153
|
+
onSelectVariable: (a) => w(d, "value", a),
|
|
154
|
+
"onUpdate:modelValue": (a) => t("updateRow", d, "value", a)
|
|
159
155
|
}, {
|
|
160
156
|
icon: n(() => [
|
|
161
|
-
|
|
157
|
+
I(l) && !l.required ? (u(), i(s(R), {
|
|
162
158
|
key: 0,
|
|
163
159
|
class: v([{
|
|
164
|
-
"-mr-0.5":
|
|
160
|
+
"-mr-0.5": s(h)(l)
|
|
165
161
|
}, "text-c-2 hover:text-c-1 hover:bg-b-2 z-context hidden h-fit rounded p-1 group-hover:flex group-has-[.cm-focused]:flex"]),
|
|
166
162
|
size: "sm",
|
|
167
163
|
variant: "ghost",
|
|
168
|
-
onClick: (a) =>
|
|
164
|
+
onClick: (a) => t("deleteRow", d)
|
|
169
165
|
}, {
|
|
170
166
|
default: n(() => [
|
|
171
|
-
|
|
167
|
+
r(s(E), { class: "size-3.5" })
|
|
172
168
|
]),
|
|
173
169
|
_: 2
|
|
174
170
|
}, 1032, ["class", "onClick"])) : k("", !0),
|
|
175
|
-
|
|
171
|
+
s(h)(l) ? (u(), i(K, {
|
|
176
172
|
key: 1,
|
|
177
|
-
item: { ...l, default:
|
|
173
|
+
item: { ...l, default: T(l) }
|
|
178
174
|
}, null, 8, ["item"])) : k("", !0)
|
|
179
175
|
]),
|
|
180
176
|
_: 2
|
|
181
|
-
}, 1032, ["class", "default", "disabled", "enum", "envVariables", "environment", "examples", "max", "min", "modelValue", "nullable", "type", "workspace", "onSelectVariable", "onUpdate:modelValue"])
|
|
177
|
+
}, 1032, ["aria-label", "class", "default", "disabled", "enum", "envVariables", "environment", "examples", "max", "min", "modelValue", "nullable", "type", "workspace", "onSelectVariable", "onUpdate:modelValue"])
|
|
182
178
|
]),
|
|
183
179
|
_: 2
|
|
184
180
|
}, 1024),
|
|
185
|
-
e.showUploadButton ? (
|
|
181
|
+
e.showUploadButton ? (u(), i(y, {
|
|
186
182
|
key: 2,
|
|
187
183
|
class: "group/upload flex items-center justify-center whitespace-nowrap"
|
|
188
184
|
}, {
|
|
189
185
|
default: n(() => {
|
|
190
186
|
var a;
|
|
191
187
|
return [
|
|
192
|
-
l.file ? (
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
l.file ? (u(), b(g, { key: 0 }, [
|
|
189
|
+
p("div", O, [
|
|
190
|
+
p("span", null, c((a = l.file) == null ? void 0 : a.name), 1)
|
|
195
191
|
]),
|
|
196
|
-
|
|
192
|
+
p("button", {
|
|
197
193
|
class: "bg-b-2 centered-x centered-y absolute hidden w-[calc(100%_-_8px)] rounded p-0.5 text-center text-xs font-medium group-hover/upload:block",
|
|
198
194
|
type: "button",
|
|
199
|
-
onClick: (
|
|
200
|
-
}, " Delete ", 8,
|
|
201
|
-
], 64)) : (
|
|
202
|
-
|
|
195
|
+
onClick: (_) => t("removeFile", d)
|
|
196
|
+
}, " Delete ", 8, A)
|
|
197
|
+
], 64)) : (u(), b("div", L, [
|
|
198
|
+
r(s(R), {
|
|
203
199
|
class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
|
|
204
200
|
size: "sm",
|
|
205
201
|
variant: "outlined",
|
|
206
|
-
onClick: (
|
|
202
|
+
onClick: (_) => S(d)
|
|
207
203
|
}, {
|
|
208
204
|
default: n(() => [
|
|
209
|
-
o[
|
|
210
|
-
|
|
205
|
+
o[5] || (o[5] = p("span", null, "Upload File", -1)),
|
|
206
|
+
r(s(B), {
|
|
211
207
|
class: "ml-1",
|
|
212
208
|
icon: "Upload",
|
|
213
209
|
size: "xs",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTableTooltip.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTableTooltip.vue"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAO9E,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,uBAAuB,CAAA;CAAE,CAAC;;AAkKrD,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestTableTooltip.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-da15dfd7"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|