@scalar/api-client 2.3.14 → 2.3.16
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 +16 -0
- package/dist/components/DataTable/DataTable.vue.d.ts +2 -0
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.vue.js +17 -15
- package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.js +6 -9
- package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +68 -23
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +41 -54
- package/dist/components/ImportCollection/utils/import-collection.d.ts +12 -0
- package/dist/components/ImportCollection/utils/import-collection.d.ts.map +1 -0
- package/dist/components/ImportCollection/utils/import-collection.js +29 -0
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts +6 -0
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts.map +1 -0
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.js +7 -0
- package/dist/components/ScalarAsciiArt.vue.d.ts.map +1 -1
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +11 -8
- package/dist/components/ScalarHotkey.test.d.ts +2 -0
- package/dist/components/ScalarHotkey.test.d.ts.map +1 -0
- package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.js +34 -11
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- 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/Request.vue2.js +39 -36
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +2 -1
- 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 +4 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +4 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +19 -16
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +67 -64
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +123 -126
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +72 -69
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +53 -35
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts +5 -0
- 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 +56 -59
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +53 -35
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +5 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +40 -34
- package/package.json +7 -7
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarErrorBoundary as
|
|
3
|
-
import { canMethodHaveBody as f, isDefined as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { matchesDomain as
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as H, computed as p, useId as w, ref as N, watch as I, openBlock as m, createBlock as V, withCtx as d, createElementVNode as v, unref as n, createElementBlock as c, createCommentVNode as A, toDisplayString as K, createVNode as t, withDirectives as i, vShow as s } from "vue";
|
|
2
|
+
import { ScalarErrorBoundary as U } from "@scalar/components";
|
|
3
|
+
import { canMethodHaveBody as f, isDefined as D, REGEX as q } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import Q from "../../../components/SectionFilter.vue.js";
|
|
5
|
+
import $ from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
|
+
import { matchesDomain as L } from "../../../libs/send-request/set-request-cookies.js";
|
|
7
|
+
import j from "./RequestBody.vue.js";
|
|
8
8
|
import y from "./RequestParams.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useWorkspace as
|
|
13
|
-
import { useLayout as
|
|
14
|
-
const
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
|
|
17
|
-
for: "requestname"
|
|
18
|
-
}, X = ["placeholder", "value"], J = {
|
|
9
|
+
import F from "./RequestPathParams.vue.js";
|
|
10
|
+
import M from "./RequestAuth/RequestAuth.vue.js";
|
|
11
|
+
import T from "./RequestCodeExample.vue.js";
|
|
12
|
+
import { useWorkspace as W } from "../../../store/store.js";
|
|
13
|
+
import { useLayout as z } from "../../../hooks/useLayout.js";
|
|
14
|
+
const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, X = ["for"], J = ["id", "placeholder", "value"], Y = {
|
|
19
15
|
key: 2,
|
|
20
16
|
class: "text-c-1 flex h-8 items-center"
|
|
21
|
-
},
|
|
17
|
+
}, Z = ["id", "role"], pe = /* @__PURE__ */ H({
|
|
22
18
|
__name: "RequestSection",
|
|
23
19
|
props: {
|
|
24
20
|
collection: {},
|
|
@@ -32,40 +28,40 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
32
28
|
workspace: {}
|
|
33
29
|
},
|
|
34
30
|
setup(l) {
|
|
35
|
-
const
|
|
31
|
+
const P = [
|
|
36
32
|
"Auth",
|
|
37
33
|
"Variables",
|
|
38
34
|
"Cookies",
|
|
39
35
|
"Headers",
|
|
40
36
|
"Query",
|
|
41
37
|
"Body"
|
|
42
|
-
], { requestMutators:
|
|
43
|
-
const e = /* @__PURE__ */ new Set(["All", ...
|
|
38
|
+
], { requestMutators: S, cookies: g, securitySchemes: B } = W(), { layout: u } = z(), h = p(() => {
|
|
39
|
+
const e = /* @__PURE__ */ new Set(["All", ...P]);
|
|
44
40
|
return l.example.parameters.path.length || e.delete("Variables"), f(l.operation.method ?? "get") || e.delete("Body"), k.value && e.delete("Auth"), [...e];
|
|
45
41
|
}), r = p(
|
|
46
42
|
() => Object.fromEntries(
|
|
47
|
-
h.value.map((e) => [e,
|
|
43
|
+
h.value.map((e) => [e, w()])
|
|
48
44
|
)
|
|
49
45
|
), k = p(
|
|
50
46
|
() => {
|
|
51
47
|
var e;
|
|
52
48
|
return u === "modal" && ((e = l.operation.security) == null ? void 0 : e.length) === 0;
|
|
53
49
|
}
|
|
54
|
-
), a =
|
|
55
|
-
|
|
50
|
+
), a = N("All");
|
|
51
|
+
I(
|
|
56
52
|
() => l.operation,
|
|
57
53
|
(e) => {
|
|
58
54
|
a.value === "Body" && e && !f(e.method) && (a.value = "All");
|
|
59
55
|
}
|
|
60
56
|
);
|
|
61
|
-
const
|
|
57
|
+
const C = (e) => {
|
|
62
58
|
const o = e.target;
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
() => (l.workspace.cookies ?? []).map((e) =>
|
|
59
|
+
S.edit(l.operation.uid, "summary", o.value);
|
|
60
|
+
}, R = p(
|
|
61
|
+
() => (l.workspace.cookies ?? []).map((e) => g[e]).filter(D).filter((e) => e.name).filter(
|
|
66
62
|
(e) => {
|
|
67
63
|
var o;
|
|
68
|
-
return
|
|
64
|
+
return L(((o = l.server) == null ? void 0 : o.url) || l.operation.path, e.domain);
|
|
69
65
|
}
|
|
70
66
|
).map((e) => ({
|
|
71
67
|
key: e.name,
|
|
@@ -78,39 +74,43 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
78
74
|
},
|
|
79
75
|
enabled: !0
|
|
80
76
|
}))
|
|
81
|
-
),
|
|
82
|
-
return (e, o) => (m(),
|
|
77
|
+
), E = () => l.operation.summary ? l.operation.summary : l.operation.path.replace(q.PROTOCOL, "") ? l.operation.path.replace(q.PROTOCOL, "") : "Request Name", b = w();
|
|
78
|
+
return (e, o) => (m(), V($, {
|
|
83
79
|
"aria-label": `Request: ${e.operation.summary}`
|
|
84
80
|
}, {
|
|
85
|
-
title:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
title: d(() => [
|
|
82
|
+
v("div", G, [
|
|
83
|
+
n(u) !== "modal" ? (m(), c("label", {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
|
|
86
|
+
for: n(b)
|
|
87
|
+
}, null, 8, X)) : A("", !0),
|
|
88
|
+
n(u) !== "modal" ? (m(), c("input", {
|
|
89
89
|
key: 1,
|
|
90
|
-
id:
|
|
90
|
+
id: n(b),
|
|
91
91
|
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:
|
|
92
|
+
placeholder: E(),
|
|
93
93
|
value: e.operation.summary,
|
|
94
|
-
onInput:
|
|
95
|
-
}, null, 40,
|
|
94
|
+
onInput: C
|
|
95
|
+
}, null, 40, J)) : (m(), c("span", Y, K(e.operation.summary), 1))
|
|
96
96
|
]),
|
|
97
|
-
|
|
97
|
+
t(Q, {
|
|
98
98
|
modelValue: a.value,
|
|
99
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
99
|
+
"onUpdate:modelValue": o[0] || (o[0] = (O) => a.value = O),
|
|
100
100
|
filterIds: r.value,
|
|
101
101
|
filters: h.value
|
|
102
102
|
}, null, 8, ["modelValue", "filterIds", "filters"])
|
|
103
103
|
]),
|
|
104
|
-
default:
|
|
105
|
-
|
|
104
|
+
default: d(() => [
|
|
105
|
+
v("div", {
|
|
106
106
|
id: r.value.All,
|
|
107
107
|
class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y",
|
|
108
108
|
role: a.value === "All" ? "tabpanel" : "none"
|
|
109
109
|
}, [
|
|
110
|
-
e.collection && e.workspace && (
|
|
110
|
+
e.collection && e.workspace && (n(u) !== "modal" || Object.keys(n(B) ?? {}).length) ? i((m(), V(M, {
|
|
111
111
|
key: 0,
|
|
112
|
-
class: "request-section-content-auth border-b-0",
|
|
113
112
|
id: r.value.Auth,
|
|
113
|
+
class: "request-section-content-auth border-b-0",
|
|
114
114
|
collection: e.collection,
|
|
115
115
|
envVariables: e.envVariables,
|
|
116
116
|
environment: e.environment,
|
|
@@ -126,10 +126,10 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
126
126
|
s,
|
|
127
127
|
!k.value && (a.value === "All" || a.value === "Auth")
|
|
128
128
|
]
|
|
129
|
-
]) :
|
|
130
|
-
i(
|
|
131
|
-
class: "request-section-content-path-params",
|
|
129
|
+
]) : A("", !0),
|
|
130
|
+
i(t(F, {
|
|
132
131
|
id: r.value.Variables,
|
|
132
|
+
class: "request-section-content-path-params",
|
|
133
133
|
envVariables: e.envVariables,
|
|
134
134
|
environment: e.environment,
|
|
135
135
|
example: e.example,
|
|
@@ -145,16 +145,17 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
145
145
|
(a.value === "All" || a.value === "Variables") && e.example.parameters.path.length
|
|
146
146
|
]
|
|
147
147
|
]),
|
|
148
|
-
i(
|
|
149
|
-
class: "request-section-content-cookies",
|
|
148
|
+
i(t(y, {
|
|
150
149
|
id: r.value.Cookies,
|
|
150
|
+
class: "request-section-content-cookies",
|
|
151
151
|
envVariables: e.envVariables,
|
|
152
152
|
environment: e.environment,
|
|
153
153
|
example: e.example,
|
|
154
154
|
invalidParams: e.invalidParams,
|
|
155
|
+
label: "Cookie",
|
|
155
156
|
operation: e.operation,
|
|
156
157
|
paramKey: "cookies",
|
|
157
|
-
readOnlyEntries:
|
|
158
|
+
readOnlyEntries: R.value,
|
|
158
159
|
role: a.value === "All" ? "none" : "tabpanel",
|
|
159
160
|
title: "Cookies",
|
|
160
161
|
workspace: e.workspace,
|
|
@@ -162,13 +163,14 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
162
163
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "readOnlyEntries", "role", "workspace"]), [
|
|
163
164
|
[s, a.value === "All" || a.value === "Cookies"]
|
|
164
165
|
]),
|
|
165
|
-
i(
|
|
166
|
-
class: "request-section-content-headers",
|
|
166
|
+
i(t(y, {
|
|
167
167
|
id: r.value.Headers,
|
|
168
|
+
class: "request-section-content-headers",
|
|
168
169
|
envVariables: e.envVariables,
|
|
169
170
|
environment: e.environment,
|
|
170
171
|
example: e.example,
|
|
171
172
|
invalidParams: e.invalidParams,
|
|
173
|
+
label: "Header",
|
|
172
174
|
operation: e.operation,
|
|
173
175
|
paramKey: "headers",
|
|
174
176
|
role: a.value === "All" ? "none" : "tabpanel",
|
|
@@ -177,13 +179,14 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
177
179
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
|
|
178
180
|
[s, a.value === "All" || a.value === "Headers"]
|
|
179
181
|
]),
|
|
180
|
-
i(
|
|
181
|
-
class: "request-section-content-query",
|
|
182
|
+
i(t(y, {
|
|
182
183
|
id: r.value.Query,
|
|
184
|
+
class: "request-section-content-query",
|
|
183
185
|
envVariables: e.envVariables,
|
|
184
186
|
environment: e.environment,
|
|
185
187
|
example: e.example,
|
|
186
188
|
invalidParams: e.invalidParams,
|
|
189
|
+
label: "Parameter",
|
|
187
190
|
operation: e.operation,
|
|
188
191
|
paramKey: "query",
|
|
189
192
|
role: a.value === "All" ? "none" : "tabpanel",
|
|
@@ -192,9 +195,9 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
192
195
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
|
|
193
196
|
[s, a.value === "All" || a.value === "Query"]
|
|
194
197
|
]),
|
|
195
|
-
i(
|
|
196
|
-
class: "request-section-content-body",
|
|
198
|
+
i(t(j, {
|
|
197
199
|
id: r.value.Body,
|
|
200
|
+
class: "request-section-content-body",
|
|
198
201
|
envVariables: e.envVariables,
|
|
199
202
|
environment: e.environment,
|
|
200
203
|
example: e.example,
|
|
@@ -205,13 +208,13 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
205
208
|
}, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"]), [
|
|
206
209
|
[
|
|
207
210
|
s,
|
|
208
|
-
e.operation.method && (a.value === "All" || a.value === "Body") &&
|
|
211
|
+
e.operation.method && (a.value === "All" || a.value === "Body") && n(f)(e.operation.method)
|
|
209
212
|
]
|
|
210
213
|
]),
|
|
211
|
-
o[1] || (o[1] =
|
|
212
|
-
n(
|
|
213
|
-
default:
|
|
214
|
-
|
|
214
|
+
o[1] || (o[1] = v("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
|
|
215
|
+
t(n(U), null, {
|
|
216
|
+
default: d(() => [
|
|
217
|
+
t(T, {
|
|
215
218
|
class: "request-section-content-code-example",
|
|
216
219
|
collection: e.collection,
|
|
217
220
|
example: e.example,
|
|
@@ -222,12 +225,12 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
222
225
|
]),
|
|
223
226
|
_: 1
|
|
224
227
|
})
|
|
225
|
-
], 8,
|
|
228
|
+
], 8, Z)
|
|
226
229
|
]),
|
|
227
230
|
_: 1
|
|
228
231
|
}, 8, ["aria-label"]));
|
|
229
232
|
}
|
|
230
233
|
});
|
|
231
234
|
export {
|
|
232
|
-
|
|
235
|
+
pe as default
|
|
233
236
|
};
|
|
@@ -16,6 +16,7 @@ type __VLS_Props = {
|
|
|
16
16
|
envVariables: EnvVariable[];
|
|
17
17
|
workspace: Workspace;
|
|
18
18
|
invalidParams?: Set<string>;
|
|
19
|
+
label?: string;
|
|
19
20
|
};
|
|
20
21
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
22
|
updateRow: (idx: number, field: "value" | "key", value: string) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAqPA,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;;AA6gBxB,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-5b22d4e0"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarTooltip as z, ScalarIcon as
|
|
3
|
-
import { RouterLink as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as I, openBlock as r, createBlock as p, withCtx as n, createVNode as t, createTextVNode as c, toDisplayString as m, createElementBlock as f, Fragment as w, renderList as _, normalizeClass as V, unref as u, createElementVNode as i, createCommentVNode as g } from "vue";
|
|
2
|
+
import { ScalarTooltip as z, ScalarIcon as B, ScalarButton as q } from "@scalar/components";
|
|
3
|
+
import { RouterLink as D } from "vue-router";
|
|
4
|
+
import x from "../../../components/CodeInput/CodeInput.vue.js";
|
|
5
|
+
import E from "../../../components/DataTable/DataTable.vue.js";
|
|
6
|
+
import v from "../../../components/DataTable/DataTableCell.vue.js";
|
|
7
7
|
import G from "../../../components/DataTable/DataTableCheckbox.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { parameterIsInvalid as N, hasItemProperties as
|
|
8
|
+
import k from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
9
|
+
import h from "../../../components/DataTable/DataTableRow.vue.js";
|
|
10
|
+
import { parameterIsInvalid as N, hasItemProperties as R } from "../libs/request.js";
|
|
11
11
|
import P from "./RequestTableTooltip.vue.js";
|
|
12
|
-
const j = { class: "
|
|
12
|
+
const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify-end overflow-hidden p-1" }, O = ["onClick"], A = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "p-0.5"
|
|
15
|
-
},
|
|
15
|
+
}, le = /* @__PURE__ */ I({
|
|
16
16
|
__name: "RequestTable",
|
|
17
17
|
props: {
|
|
18
18
|
items: {},
|
|
@@ -23,177 +23,174 @@ const j = { class: "contents" }, O = { class: "sr-only" }, A = { class: "text-c-
|
|
|
23
23
|
environment: {},
|
|
24
24
|
envVariables: {},
|
|
25
25
|
workspace: {},
|
|
26
|
-
invalidParams: {}
|
|
26
|
+
invalidParams: {},
|
|
27
|
+
label: {}
|
|
27
28
|
},
|
|
28
29
|
emits: ["updateRow", "toggleRow", "addRow", "deleteRow", "inputFocus", "inputBlur", "uploadFile", "removeFile"],
|
|
29
|
-
setup(
|
|
30
|
-
const b =
|
|
31
|
-
|
|
32
|
-
}, S = (
|
|
33
|
-
|
|
34
|
-
}, $ = (
|
|
35
|
-
return (
|
|
30
|
+
setup(C, { emit: F }) {
|
|
31
|
+
const b = C, s = F, U = ["", "", "36px"], y = (e, a, l) => {
|
|
32
|
+
s("updateRow", e, a, l);
|
|
33
|
+
}, S = (e) => {
|
|
34
|
+
s("uploadFile", e);
|
|
35
|
+
}, $ = (e) => Array.isArray(e.default) && e.default.length === 1 ? e.default[0] : e.default;
|
|
36
|
+
return (e, a) => (r(), p(E, {
|
|
36
37
|
class: "group/table flex-1",
|
|
37
38
|
columns: U
|
|
38
39
|
}, {
|
|
39
40
|
default: n(() => [
|
|
40
|
-
t(
|
|
41
|
+
t(h, { class: "sr-only !block" }, {
|
|
41
42
|
default: n(() => [
|
|
42
|
-
t(
|
|
43
|
-
default: n(() =>
|
|
44
|
-
|
|
45
|
-
])
|
|
43
|
+
t(k, null, {
|
|
44
|
+
default: n(() => [
|
|
45
|
+
c(m(e.label) + " Enabled", 1)
|
|
46
|
+
]),
|
|
46
47
|
_: 1
|
|
47
48
|
}),
|
|
48
|
-
t(
|
|
49
|
-
default: n(() =>
|
|
50
|
-
|
|
51
|
-
])
|
|
49
|
+
t(k, null, {
|
|
50
|
+
default: n(() => [
|
|
51
|
+
c(m(e.label) + " Key", 1)
|
|
52
|
+
]),
|
|
52
53
|
_: 1
|
|
53
54
|
}),
|
|
54
|
-
t(
|
|
55
|
-
default: n(() =>
|
|
56
|
-
|
|
57
|
-
])
|
|
55
|
+
t(k, null, {
|
|
56
|
+
default: n(() => [
|
|
57
|
+
c(m(e.label) + " Value", 1)
|
|
58
|
+
]),
|
|
58
59
|
_: 1
|
|
59
60
|
})
|
|
60
61
|
]),
|
|
61
62
|
_: 1
|
|
62
63
|
}),
|
|
63
|
-
(
|
|
64
|
-
id:
|
|
65
|
-
key:
|
|
66
|
-
class:
|
|
67
|
-
alert:
|
|
68
|
-
error:
|
|
64
|
+
(r(!0), f(w, null, _(e.items, (l, d) => (r(), p(h, {
|
|
65
|
+
id: l.key,
|
|
66
|
+
key: d,
|
|
67
|
+
class: V({
|
|
68
|
+
alert: u(N)(l).value,
|
|
69
|
+
error: e.invalidParams && e.invalidParams.has(l.key)
|
|
69
70
|
})
|
|
70
71
|
}, {
|
|
71
72
|
default: n(() => [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"])
|
|
110
|
-
], 64))
|
|
111
|
-
]),
|
|
112
|
-
t(c, null, {
|
|
73
|
+
e.isGlobal ? (r(), p(u(D), {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: "!border-r-1/2 border-t-1/2 text-c-2 flex items-center justify-center",
|
|
76
|
+
to: l.route ?? {}
|
|
77
|
+
}, {
|
|
78
|
+
default: n(() => [
|
|
79
|
+
a[5] || (a[5] = i("span", { class: "sr-only" }, "Global", -1)),
|
|
80
|
+
t(u(z), {
|
|
81
|
+
as: "div",
|
|
82
|
+
side: "top"
|
|
83
|
+
}, {
|
|
84
|
+
trigger: n(() => [
|
|
85
|
+
t(u(B), {
|
|
86
|
+
class: "text-c-1",
|
|
87
|
+
icon: "Globe",
|
|
88
|
+
size: "xs"
|
|
89
|
+
})
|
|
90
|
+
]),
|
|
91
|
+
content: n(() => a[4] || (a[4] = [
|
|
92
|
+
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" }, [
|
|
93
|
+
i("div", { class: "text-c-1 flex items-center" }, [
|
|
94
|
+
i("span", { class: "text-pretty" }, " Global cookies are shared across the whole workspace. ")
|
|
95
|
+
])
|
|
96
|
+
], -1)
|
|
97
|
+
])),
|
|
98
|
+
_: 1
|
|
99
|
+
})
|
|
100
|
+
]),
|
|
101
|
+
_: 2
|
|
102
|
+
}, 1032, ["to"])) : (r(), p(G, {
|
|
103
|
+
key: 1,
|
|
104
|
+
class: "!border-r-1/2",
|
|
105
|
+
disabled: b.hasCheckboxDisabled,
|
|
106
|
+
modelValue: l.enabled,
|
|
107
|
+
"onUpdate:modelValue": (o) => s("toggleRow", d, o)
|
|
108
|
+
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"])),
|
|
109
|
+
t(v, null, {
|
|
113
110
|
default: n(() => [
|
|
114
|
-
t(
|
|
111
|
+
t(x, {
|
|
115
112
|
disableCloseBrackets: "",
|
|
116
113
|
disabled: b.isReadOnly,
|
|
117
114
|
disableEnter: "",
|
|
118
115
|
disableTabIndent: "",
|
|
119
|
-
envVariables:
|
|
120
|
-
environment:
|
|
121
|
-
modelValue:
|
|
116
|
+
envVariables: e.envVariables,
|
|
117
|
+
environment: e.environment,
|
|
118
|
+
modelValue: l.key,
|
|
122
119
|
placeholder: "Key",
|
|
123
|
-
required: !!
|
|
124
|
-
workspace:
|
|
125
|
-
onBlur:
|
|
126
|
-
onFocus:
|
|
127
|
-
onSelectVariable: (o) => y(
|
|
128
|
-
"onUpdate:modelValue": (o) =>
|
|
120
|
+
required: !!l.required,
|
|
121
|
+
workspace: e.workspace,
|
|
122
|
+
onBlur: a[0] || (a[0] = (o) => s("inputBlur")),
|
|
123
|
+
onFocus: a[1] || (a[1] = (o) => s("inputFocus")),
|
|
124
|
+
onSelectVariable: (o) => y(d, "key", o),
|
|
125
|
+
"onUpdate:modelValue": (o) => s("updateRow", d, "key", o)
|
|
129
126
|
}, null, 8, ["disabled", "envVariables", "environment", "modelValue", "required", "workspace", "onSelectVariable", "onUpdate:modelValue"])
|
|
130
127
|
]),
|
|
131
128
|
_: 2
|
|
132
129
|
}, 1024),
|
|
133
|
-
t(
|
|
130
|
+
t(v, null, {
|
|
134
131
|
default: n(() => [
|
|
135
|
-
t(
|
|
136
|
-
class:
|
|
137
|
-
"pr-6":
|
|
132
|
+
t(x, {
|
|
133
|
+
class: V({
|
|
134
|
+
"pr-6": u(R)(l)
|
|
138
135
|
}),
|
|
139
|
-
default:
|
|
136
|
+
default: l.default,
|
|
140
137
|
disableCloseBrackets: "",
|
|
141
138
|
disabled: b.isReadOnly,
|
|
142
139
|
disableEnter: "",
|
|
143
140
|
disableTabIndent: "",
|
|
144
|
-
enum:
|
|
145
|
-
envVariables:
|
|
146
|
-
environment:
|
|
147
|
-
examples:
|
|
148
|
-
max:
|
|
149
|
-
min:
|
|
150
|
-
modelValue:
|
|
151
|
-
nullable: !!
|
|
141
|
+
enum: l.enum ?? [],
|
|
142
|
+
envVariables: e.envVariables,
|
|
143
|
+
environment: e.environment,
|
|
144
|
+
examples: l.examples ?? [],
|
|
145
|
+
max: l.maximum,
|
|
146
|
+
min: l.minimum,
|
|
147
|
+
modelValue: l.value,
|
|
148
|
+
nullable: !!l.nullable,
|
|
152
149
|
placeholder: "Value",
|
|
153
|
-
type:
|
|
154
|
-
workspace:
|
|
155
|
-
onBlur:
|
|
156
|
-
onFocus:
|
|
157
|
-
onSelectVariable: (o) => y(
|
|
158
|
-
"onUpdate:modelValue": (o) =>
|
|
150
|
+
type: l.type,
|
|
151
|
+
workspace: e.workspace,
|
|
152
|
+
onBlur: a[2] || (a[2] = (o) => s("inputBlur")),
|
|
153
|
+
onFocus: a[3] || (a[3] = (o) => s("inputFocus")),
|
|
154
|
+
onSelectVariable: (o) => y(d, "value", o),
|
|
155
|
+
"onUpdate:modelValue": (o) => s("updateRow", d, "value", o)
|
|
159
156
|
}, {
|
|
160
157
|
icon: n(() => [
|
|
161
|
-
|
|
158
|
+
u(R)(l) ? (r(), p(P, {
|
|
162
159
|
key: 0,
|
|
163
|
-
item: { ...
|
|
164
|
-
}, null, 8, ["item"])) :
|
|
160
|
+
item: { ...l, default: $(l) }
|
|
161
|
+
}, null, 8, ["item"])) : g("", !0)
|
|
165
162
|
]),
|
|
166
163
|
_: 2
|
|
167
164
|
}, 1032, ["class", "default", "disabled", "enum", "envVariables", "environment", "examples", "max", "min", "modelValue", "nullable", "type", "workspace", "onSelectVariable", "onUpdate:modelValue"])
|
|
168
165
|
]),
|
|
169
166
|
_: 2
|
|
170
167
|
}, 1024),
|
|
171
|
-
|
|
172
|
-
key:
|
|
168
|
+
e.showUploadButton ? (r(), p(v, {
|
|
169
|
+
key: 2,
|
|
173
170
|
class: "group/upload flex items-center justify-center whitespace-nowrap"
|
|
174
171
|
}, {
|
|
175
172
|
default: n(() => {
|
|
176
173
|
var o;
|
|
177
174
|
return [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
l.file ? (r(), f(w, { key: 0 }, [
|
|
176
|
+
i("div", j, [
|
|
177
|
+
i("span", null, m((o = l.file) == null ? void 0 : o.name), 1)
|
|
181
178
|
]),
|
|
182
|
-
|
|
179
|
+
i("button", {
|
|
183
180
|
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",
|
|
184
181
|
type: "button",
|
|
185
|
-
onClick: (T) =>
|
|
186
|
-
}, " Delete ", 8,
|
|
187
|
-
], 64)) : (
|
|
188
|
-
t(
|
|
182
|
+
onClick: (T) => s("removeFile", d)
|
|
183
|
+
}, " Delete ", 8, O)
|
|
184
|
+
], 64)) : (r(), f("div", A, [
|
|
185
|
+
t(u(q), {
|
|
189
186
|
class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
|
|
190
187
|
size: "sm",
|
|
191
188
|
variant: "outlined",
|
|
192
|
-
onClick: (T) => S(
|
|
189
|
+
onClick: (T) => S(d)
|
|
193
190
|
}, {
|
|
194
191
|
default: n(() => [
|
|
195
|
-
|
|
196
|
-
t(
|
|
192
|
+
a[6] || (a[6] = i("span", null, "Upload File", -1)),
|
|
193
|
+
t(u(B), {
|
|
197
194
|
class: "ml-1",
|
|
198
195
|
icon: "UploadSimple",
|
|
199
196
|
size: "xs",
|
|
@@ -206,7 +203,7 @@ const j = { class: "contents" }, O = { class: "sr-only" }, A = { class: "text-c-
|
|
|
206
203
|
];
|
|
207
204
|
}),
|
|
208
205
|
_: 2
|
|
209
|
-
}, 1024)) :
|
|
206
|
+
}, 1024)) : g("", !0)
|
|
210
207
|
]),
|
|
211
208
|
_: 2
|
|
212
209
|
}, 1032, ["id", "class"]))), 128))
|
|
@@ -216,5 +213,5 @@ const j = { class: "contents" }, O = { class: "sr-only" }, A = { class: "text-c-
|
|
|
216
213
|
}
|
|
217
214
|
});
|
|
218
215
|
export {
|
|
219
|
-
|
|
216
|
+
le as default
|
|
220
217
|
};
|
|
@@ -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":";;;cA4jBuC,MAAM;aAAO,MAAM;;;;;cAAnB,MAAM;aAAO,MAAM;;;AAoyB1D,wBAMG"}
|