@scalar/api-client 2.3.32 → 2.3.34
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 +52 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +63 -61
- package/dist/components/DataTable/DataTable.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +58 -48
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -2
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +34 -32
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
- package/dist/hooks/useClientConfig.d.ts +3 -0
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +64 -24
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +128 -48
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +64 -24
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +64 -24
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/index.js +32 -29
- package/dist/libs/local-storage.d.ts +8 -0
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/local-storage.js +28 -24
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +8 -8
- package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/libs/send-request/decode-buffer.js +4 -4
- 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/store/active-entities.d.ts +2 -2
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +22 -22
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +42 -2
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts +64 -24
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue2.js +32 -32
- package/dist/views/Collection/CollectionEnvironment.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue.js +3 -2
- package/dist/views/Collection/CollectionEnvironment.vue2.js +233 -9
- package/dist/views/Collection/CollectionNavigation.vue.js +36 -36
- package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionServers.vue2.js +6 -6
- package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +13 -0
- package/dist/views/Collection/components/EnvironmentForm.vue.d.ts.map +1 -0
- package/dist/views/Collection/components/EnvironmentForm.vue.js +7 -0
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +274 -0
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +35 -34
- package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentModal.vue.js +32 -28
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +67 -65
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +94 -97
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +116 -99
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +27 -25
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +114 -73
- 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 +15 -15
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +42 -40
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +8 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +17 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts +2 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts.map +1 -0
- 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 +87 -84
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +21 -21
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +11 -11
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/consts/index.js +7 -5
- package/dist/views/Request/consts/mediaTypes.d.ts +4 -0
- package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
- package/dist/views/Request/consts/mediaTypes.js +21 -4
- package/dist/views/Request/consts/mediaTypes.test.d.ts +2 -0
- package/dist/views/Request/consts/mediaTypes.test.d.ts.map +1 -0
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +53 -47
- package/package.json +14 -14
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { defineComponent as $, ref as f, computed as b, watch as E, onMounted as D, createBlock as V, openBlock as d, withCtx as u, createVNode as v, createElementBlock as O, createTextVNode as K, Fragment as j, renderList as F, normalizeClass as A, createSlots as J, unref as g, createCommentVNode as L, withModifiers as q, nextTick as p } from "vue";
|
|
2
|
+
import { ScalarButton as G } from "@scalar/components";
|
|
3
|
+
import { ScalarIconWarning as H, ScalarIconTrash as P } from "@scalar/icons";
|
|
4
|
+
import T from "../../../components/CodeInput/CodeInput.vue.js";
|
|
5
|
+
import Q from "../../../components/DataTable/DataTable.vue.js";
|
|
6
|
+
import U from "../../../components/DataTable/DataTableCell.vue.js";
|
|
7
|
+
import z from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
8
|
+
import M from "../../../components/DataTable/DataTableRow.vue.js";
|
|
9
|
+
import { useWorkspace as X } from "../../../store/store.js";
|
|
10
|
+
const re = /* @__PURE__ */ $({
|
|
11
|
+
__name: "EnvironmentForm",
|
|
12
|
+
props: {
|
|
13
|
+
collection: {},
|
|
14
|
+
environment: {},
|
|
15
|
+
workspace: {},
|
|
16
|
+
envVariables: {}
|
|
17
|
+
},
|
|
18
|
+
setup(o) {
|
|
19
|
+
const { collectionMutators: y } = X(), r = f([]), k = f(/* @__PURE__ */ new Set()), w = f(/* @__PURE__ */ new Map()), c = f(!1), x = b(() => {
|
|
20
|
+
var e;
|
|
21
|
+
if (!((e = o.environment) != null && e.value))
|
|
22
|
+
return [{ key: "", value: "" }];
|
|
23
|
+
try {
|
|
24
|
+
const n = JSON.parse(o.environment.value), l = Object.entries(n).map(([t, a]) => ({
|
|
25
|
+
key: t,
|
|
26
|
+
value: String(a)
|
|
27
|
+
}));
|
|
28
|
+
return l.length === 0 ? [{ key: "", value: "" }] : l;
|
|
29
|
+
} catch {
|
|
30
|
+
return [{ key: "", value: "" }];
|
|
31
|
+
}
|
|
32
|
+
}), N = b(() => {
|
|
33
|
+
const e = r.value[r.value.length - 1];
|
|
34
|
+
return e ? e.key || e.value ? [...r.value, { key: "", value: "" }] : r.value : [{ key: "", value: "" }];
|
|
35
|
+
}), C = b(() => {
|
|
36
|
+
const e = /* @__PURE__ */ new Map();
|
|
37
|
+
return r.value.forEach((n, l) => {
|
|
38
|
+
if (n.key) {
|
|
39
|
+
const t = e.get(n.key) || [];
|
|
40
|
+
t.push(l), e.set(n.key, t);
|
|
41
|
+
}
|
|
42
|
+
}), w.value.forEach((n, l) => {
|
|
43
|
+
if (n) {
|
|
44
|
+
const t = e.get(n) || [];
|
|
45
|
+
t.push(l), e.set(n, t);
|
|
46
|
+
}
|
|
47
|
+
}), Array.from(e.values()).filter((n) => n.length > 1).flat();
|
|
48
|
+
});
|
|
49
|
+
E(
|
|
50
|
+
x,
|
|
51
|
+
(e) => {
|
|
52
|
+
r.value = [...e], k.value = new Set(e.map((n) => n.key).filter(Boolean));
|
|
53
|
+
},
|
|
54
|
+
{ immediate: !0 }
|
|
55
|
+
);
|
|
56
|
+
const S = async (e, n, l) => {
|
|
57
|
+
var t;
|
|
58
|
+
if (!c.value) {
|
|
59
|
+
if (n === "key") {
|
|
60
|
+
w.value.set(e, l);
|
|
61
|
+
const a = new Set(k.value), s = r.value[e];
|
|
62
|
+
if (s && a.delete(s.key), a.has(l))
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
c.value = !0;
|
|
66
|
+
try {
|
|
67
|
+
const a = [...r.value], s = a[e];
|
|
68
|
+
if (!s)
|
|
69
|
+
return;
|
|
70
|
+
a[e] = {
|
|
71
|
+
key: n === "key" ? l : s.key,
|
|
72
|
+
value: n === "value" ? l : s.value
|
|
73
|
+
}, !a[e].key && !a[e].value && e !== a.length - 1 && a.splice(e, 1);
|
|
74
|
+
const m = a.reduce(
|
|
75
|
+
(i, { key: I, value: R }) => ((I || R) && (i[I] = R), i),
|
|
76
|
+
{}
|
|
77
|
+
);
|
|
78
|
+
if (o.collection) {
|
|
79
|
+
const i = {
|
|
80
|
+
...o.collection["x-scalar-environments"],
|
|
81
|
+
[o.environment.name]: {
|
|
82
|
+
...(t = o.collection["x-scalar-environments"]) == null ? void 0 : t[o.environment.name],
|
|
83
|
+
variables: m
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
await y.edit(
|
|
87
|
+
o.collection.uid,
|
|
88
|
+
"x-scalar-environments",
|
|
89
|
+
i
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
if (e === r.value.length - 1) {
|
|
93
|
+
const i = a[a.length - 1];
|
|
94
|
+
i && (i.key || i.value) && await h();
|
|
95
|
+
}
|
|
96
|
+
await p(), r.value = a, n === "key" && (k.value = new Set(
|
|
97
|
+
a.map((i) => i.key).filter(Boolean)
|
|
98
|
+
), w.value.delete(e));
|
|
99
|
+
} finally {
|
|
100
|
+
c.value = !1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, h = async () => {
|
|
104
|
+
var e;
|
|
105
|
+
if (!c.value) {
|
|
106
|
+
c.value = !0;
|
|
107
|
+
try {
|
|
108
|
+
const n = [...r.value, { key: "", value: "" }], l = n.reduce(
|
|
109
|
+
(t, { key: a, value: s }) => ((a || s) && (t[a] = s), t),
|
|
110
|
+
{}
|
|
111
|
+
);
|
|
112
|
+
if (o.collection) {
|
|
113
|
+
const t = {
|
|
114
|
+
...o.collection["x-scalar-environments"],
|
|
115
|
+
[o.environment.name]: {
|
|
116
|
+
...(e = o.collection["x-scalar-environments"]) == null ? void 0 : e[o.environment.name],
|
|
117
|
+
variables: l
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
await y.edit(
|
|
121
|
+
o.collection.uid,
|
|
122
|
+
"x-scalar-environments",
|
|
123
|
+
t
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
await p(), r.value = n;
|
|
127
|
+
} finally {
|
|
128
|
+
c.value = !1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}, W = async (e) => {
|
|
132
|
+
var n;
|
|
133
|
+
if (!c.value) {
|
|
134
|
+
c.value = !0;
|
|
135
|
+
try {
|
|
136
|
+
const l = [...r.value];
|
|
137
|
+
l.splice(e, 1);
|
|
138
|
+
const t = l.reduce(
|
|
139
|
+
(a, { key: s, value: m }) => ((s || m) && (a[s] = m), a),
|
|
140
|
+
{}
|
|
141
|
+
);
|
|
142
|
+
if (o.collection) {
|
|
143
|
+
const a = {
|
|
144
|
+
...o.collection["x-scalar-environments"],
|
|
145
|
+
[o.environment.name]: {
|
|
146
|
+
...(n = o.collection["x-scalar-environments"]) == null ? void 0 : n[o.environment.name],
|
|
147
|
+
variables: t
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
await y.edit(
|
|
151
|
+
o.collection.uid,
|
|
152
|
+
"x-scalar-environments",
|
|
153
|
+
a
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
await p(), r.value = l;
|
|
157
|
+
} finally {
|
|
158
|
+
c.value = !1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, B = async () => {
|
|
162
|
+
if (r.value.length === 0)
|
|
163
|
+
await h();
|
|
164
|
+
else if (r.value.length >= 1) {
|
|
165
|
+
const e = r.value[r.value.length - 1];
|
|
166
|
+
e && (e.key || e.value) && await h();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
return D(() => {
|
|
170
|
+
B();
|
|
171
|
+
}), E(
|
|
172
|
+
() => r.value,
|
|
173
|
+
() => {
|
|
174
|
+
B();
|
|
175
|
+
}
|
|
176
|
+
), (e, n) => (d(), V(Q, {
|
|
177
|
+
class: "group/table flex-1",
|
|
178
|
+
columns: ["", ""]
|
|
179
|
+
}, {
|
|
180
|
+
default: u(() => [
|
|
181
|
+
v(M, { class: "sr-only !block" }, {
|
|
182
|
+
default: u(() => [
|
|
183
|
+
v(z, null, {
|
|
184
|
+
default: u(() => n[0] || (n[0] = [
|
|
185
|
+
K("Key")
|
|
186
|
+
])),
|
|
187
|
+
_: 1
|
|
188
|
+
}),
|
|
189
|
+
v(z, null, {
|
|
190
|
+
default: u(() => n[1] || (n[1] = [
|
|
191
|
+
K("Value")
|
|
192
|
+
])),
|
|
193
|
+
_: 1
|
|
194
|
+
})
|
|
195
|
+
]),
|
|
196
|
+
_: 1
|
|
197
|
+
}),
|
|
198
|
+
(d(!0), O(j, null, F(N.value, (l, t) => (d(), V(M, {
|
|
199
|
+
key: t,
|
|
200
|
+
class: A({
|
|
201
|
+
error: C.value.includes(t)
|
|
202
|
+
})
|
|
203
|
+
}, {
|
|
204
|
+
default: u(() => [
|
|
205
|
+
v(U, null, {
|
|
206
|
+
default: u(() => [
|
|
207
|
+
v(T, {
|
|
208
|
+
disableCloseBrackets: "",
|
|
209
|
+
disableEnter: "",
|
|
210
|
+
disableTabIndent: "",
|
|
211
|
+
lineWrapping: "",
|
|
212
|
+
environment: e.environment,
|
|
213
|
+
envVariables: e.envVariables,
|
|
214
|
+
modelValue: l.key,
|
|
215
|
+
placeholder: "Key",
|
|
216
|
+
workspace: e.workspace,
|
|
217
|
+
"onUpdate:modelValue": (a) => S(t, "key", a)
|
|
218
|
+
}, J({ _: 2 }, [
|
|
219
|
+
C.value.includes(t) ? {
|
|
220
|
+
name: "icon",
|
|
221
|
+
fn: u(() => [
|
|
222
|
+
v(g(H), { class: "text-red mr-0.75 size-3.5 brightness-[.9]" })
|
|
223
|
+
]),
|
|
224
|
+
key: "0"
|
|
225
|
+
} : void 0
|
|
226
|
+
]), 1032, ["environment", "envVariables", "modelValue", "workspace", "onUpdate:modelValue"])
|
|
227
|
+
]),
|
|
228
|
+
_: 2
|
|
229
|
+
}, 1024),
|
|
230
|
+
v(U, null, {
|
|
231
|
+
default: u(() => [
|
|
232
|
+
v(T, {
|
|
233
|
+
class: "pr-6 group-hover:pr-10 group-has-[.cm-focused]:pr-10",
|
|
234
|
+
disableCloseBrackets: "",
|
|
235
|
+
disableEnter: "",
|
|
236
|
+
disableTabIndent: "",
|
|
237
|
+
lineWrapping: "",
|
|
238
|
+
environment: e.environment,
|
|
239
|
+
envVariables: e.envVariables,
|
|
240
|
+
modelValue: l.value,
|
|
241
|
+
placeholder: "Value",
|
|
242
|
+
workspace: e.workspace,
|
|
243
|
+
"onUpdate:modelValue": (a) => S(t, "value", a)
|
|
244
|
+
}, {
|
|
245
|
+
icon: u(() => [
|
|
246
|
+
l.key || l.value ? (d(), V(g(G), {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: "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",
|
|
249
|
+
size: "sm",
|
|
250
|
+
variant: "ghost",
|
|
251
|
+
onClick: q((a) => W(t), ["stop"])
|
|
252
|
+
}, {
|
|
253
|
+
default: u(() => [
|
|
254
|
+
v(g(P), { class: "size-3.5" })
|
|
255
|
+
]),
|
|
256
|
+
_: 2
|
|
257
|
+
}, 1032, ["onClick"])) : L("", !0)
|
|
258
|
+
]),
|
|
259
|
+
_: 2
|
|
260
|
+
}, 1032, ["environment", "envVariables", "modelValue", "workspace", "onUpdate:modelValue"])
|
|
261
|
+
]),
|
|
262
|
+
_: 2
|
|
263
|
+
}, 1024)
|
|
264
|
+
]),
|
|
265
|
+
_: 2
|
|
266
|
+
}, 1032, ["class"]))), 128))
|
|
267
|
+
]),
|
|
268
|
+
_: 1
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
export {
|
|
273
|
+
re as default
|
|
274
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/convert-to-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"convert-to-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/convert-to-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAA;AAEjE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACzC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC1D,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8DAQ7B,KAAK,KAAG,UAoGV,CAAA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { mergeUrls as
|
|
1
|
+
import { mergeUrls as D } from "@scalar/oas-utils/helpers";
|
|
2
2
|
const w = ({
|
|
3
|
-
baseUrl:
|
|
4
|
-
method:
|
|
5
|
-
body:
|
|
6
|
-
path:
|
|
7
|
-
cookies:
|
|
3
|
+
baseUrl: f = "",
|
|
4
|
+
method: u,
|
|
5
|
+
body: a,
|
|
6
|
+
path: g,
|
|
7
|
+
cookies: p,
|
|
8
8
|
headers: o,
|
|
9
9
|
query: m
|
|
10
10
|
}) => {
|
|
11
|
-
var
|
|
12
|
-
const
|
|
13
|
-
method:
|
|
14
|
-
url:
|
|
11
|
+
var s, l, c;
|
|
12
|
+
const h = D(f, g, void 0, !0), r = {
|
|
13
|
+
method: u.toUpperCase(),
|
|
14
|
+
url: h.toString(),
|
|
15
15
|
httpVersion: "HTTP/1.1",
|
|
16
16
|
headers: [],
|
|
17
17
|
queryString: [],
|
|
@@ -19,43 +19,44 @@ const w = ({
|
|
|
19
19
|
headersSize: -1,
|
|
20
20
|
bodySize: -1
|
|
21
21
|
};
|
|
22
|
-
if (
|
|
22
|
+
if (p.length && (r.cookies = p.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
|
|
23
23
|
name: e,
|
|
24
24
|
value: t
|
|
25
|
-
}))), o.length && (
|
|
26
|
-
name: e.replace(/\b\w/g, (
|
|
25
|
+
}))), o.length && (r.headers = o.filter((e) => e.enabled && !(e.key.toLowerCase() === "accept" && e.value === "*/*")).map(({ key: e, value: t }) => ({
|
|
26
|
+
name: e.replace(/\b\w/g, (n) => n.toUpperCase()),
|
|
27
27
|
value: t
|
|
28
|
-
}))), m.length && (
|
|
28
|
+
}))), m.length && (r.queryString = m.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
|
|
29
29
|
name: e,
|
|
30
30
|
value: t
|
|
31
|
-
}))),
|
|
31
|
+
}))), a)
|
|
32
32
|
try {
|
|
33
|
-
const e = ((
|
|
34
|
-
if (
|
|
35
|
-
const t =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
const e = ((s = o.find((t) => t.key.toLowerCase() === "content-type")) == null ? void 0 : s.value) || "application/json";
|
|
34
|
+
if (a.activeBody === "formData" && a.formData) {
|
|
35
|
+
const t = [];
|
|
36
|
+
a.formData.value.forEach(({ key: n, value: v, file: i, enabled: T }) => {
|
|
37
|
+
T && (i ? t.push({
|
|
38
|
+
name: n || "blob",
|
|
39
|
+
value: "BINARY",
|
|
40
|
+
fileName: i.name,
|
|
41
|
+
contentType: i.type || "application/octet-stream"
|
|
42
|
+
}) : t.push({
|
|
43
|
+
name: n,
|
|
44
|
+
value: v
|
|
45
|
+
}));
|
|
46
|
+
}), ((l = a.formData) == null ? void 0 : l.encoding) === "urlencoded" ? r.postData = {
|
|
46
47
|
mimeType: e,
|
|
47
|
-
|
|
48
|
-
} :
|
|
48
|
+
params: t
|
|
49
|
+
} : r.postData = {
|
|
49
50
|
mimeType: e,
|
|
50
|
-
|
|
51
|
+
params: t
|
|
51
52
|
};
|
|
52
|
-
} else
|
|
53
|
+
} else a.activeBody === "raw" && a.raw && (r.postData = {
|
|
53
54
|
mimeType: e,
|
|
54
|
-
text: ((
|
|
55
|
+
text: ((c = a.raw) == null ? void 0 : c.value) ?? ""
|
|
55
56
|
});
|
|
56
57
|
} catch {
|
|
57
58
|
}
|
|
58
|
-
return
|
|
59
|
+
return r;
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
62
|
w as convertToHarRequest
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"AA+JA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAYjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,0BAA0B,EAAE,UAAU,EAAE,CAAA;IACxC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAC;;;cAQU,MAAM;eACL,MAAM;cACP,MAAM;sBACE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;;;;;cAHrC,MAAM;eACL,MAAM;cACP,MAAM;sBACE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;;;;AAsSjD,wBAQG"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as _, ref as
|
|
2
|
-
import { ScalarModal as T, ScalarListbox as $, ScalarButton as
|
|
1
|
+
import { defineComponent as _, ref as m, computed as h, watch as w, createBlock as u, openBlock as v, unref as s, withCtx as a, createVNode as r, createElementVNode as p, createTextVNode as I, normalizeClass as E, toDisplayString as N } from "vue";
|
|
2
|
+
import { ScalarModal as T, ScalarListbox as $, ScalarButton as x, ScalarIcon as z } from "@scalar/components";
|
|
3
3
|
import { useToasts as B } from "@scalar/use-toasts";
|
|
4
4
|
import D from "../../components/CommandPalette/CommandActionForm.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const
|
|
5
|
+
import P from "../../components/CommandPalette/CommandActionInput.vue.js";
|
|
6
|
+
import U from "./EnvironmentColors.vue.js";
|
|
7
|
+
import { useWorkspace as W } from "../../store/store.js";
|
|
8
|
+
const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
9
9
|
__name: "EnvironmentModal",
|
|
10
10
|
props: {
|
|
11
11
|
state: {},
|
|
@@ -13,8 +13,8 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
13
13
|
collectionId: {}
|
|
14
14
|
},
|
|
15
15
|
emits: ["cancel", "submit"],
|
|
16
|
-
setup(
|
|
17
|
-
const n =
|
|
16
|
+
setup(g, { emit: F }) {
|
|
17
|
+
const n = g, f = F, { events: S } = W(), i = m(""), c = m("#FFFFFF"), d = h(() => [
|
|
18
18
|
...n.activeWorkspaceCollections.filter((t) => {
|
|
19
19
|
var e;
|
|
20
20
|
return ((e = t.info) == null ? void 0 : e.title) !== "Drafts";
|
|
@@ -25,54 +25,58 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
25
25
|
label: ((e = t.info) == null ? void 0 : e.title) ?? "Untitled Collection"
|
|
26
26
|
};
|
|
27
27
|
})
|
|
28
|
-
]), l =
|
|
28
|
+
]), l = m(
|
|
29
29
|
d.value.find((t) => t.id === n.collectionId)
|
|
30
|
-
), { toast:
|
|
30
|
+
), { toast: b } = B(), V = (t) => {
|
|
31
31
|
c.value = t;
|
|
32
32
|
};
|
|
33
33
|
w(
|
|
34
34
|
() => n.state.open,
|
|
35
35
|
(t) => {
|
|
36
|
-
t && (
|
|
36
|
+
t && (i.value = "", c.value = "#FFFFFF", n.collectionId ? l.value = d.value.find(
|
|
37
37
|
(e) => e.id === n.collectionId
|
|
38
38
|
) : l.value = void 0);
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
const k = () => {
|
|
42
|
-
var t, e, o,
|
|
42
|
+
var t, e, o, C;
|
|
43
|
+
if (!i.value.trim()) {
|
|
44
|
+
b("Please enter a name before adding an environment.", "error");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
43
47
|
if (!((t = l.value) != null && t.id)) {
|
|
44
|
-
|
|
48
|
+
b("Please select a collection before adding an environment.", "error");
|
|
45
49
|
return;
|
|
46
50
|
}
|
|
47
51
|
f("submit", {
|
|
48
|
-
name:
|
|
52
|
+
name: i.value,
|
|
49
53
|
color: c.value,
|
|
50
54
|
type: ((e = l.value) == null ? void 0 : e.id) === "global" ? "global" : "collection",
|
|
51
|
-
collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (
|
|
55
|
+
collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (C = l.value) == null ? void 0 : C.id : void 0
|
|
52
56
|
});
|
|
53
57
|
}, y = () => {
|
|
54
|
-
n.state.hide(),
|
|
58
|
+
n.state.hide(), S.commandPalette.emit({ commandName: "Create Collection" });
|
|
55
59
|
};
|
|
56
|
-
return (t, e) => (v(),
|
|
60
|
+
return (t, e) => (v(), u(s(T), {
|
|
57
61
|
bodyClass: "border-t-0 rounded-t-lg",
|
|
58
62
|
size: "xs",
|
|
59
63
|
state: t.state
|
|
60
64
|
}, {
|
|
61
65
|
default: a(() => [
|
|
62
|
-
|
|
63
|
-
disabled: !l.value,
|
|
66
|
+
r(D, {
|
|
67
|
+
disabled: !l.value || !i.value.trim(),
|
|
64
68
|
onCancel: e[2] || (e[2] = (o) => f("cancel")),
|
|
65
69
|
onSubmit: k
|
|
66
70
|
}, {
|
|
67
71
|
options: a(() => [
|
|
68
|
-
s(
|
|
72
|
+
r(s($), {
|
|
69
73
|
modelValue: l.value,
|
|
70
74
|
"onUpdate:modelValue": e[1] || (e[1] = (o) => l.value = o),
|
|
71
75
|
options: d.value,
|
|
72
76
|
placeholder: "Select Type"
|
|
73
77
|
}, {
|
|
74
78
|
default: a(() => [
|
|
75
|
-
d.value.length > 0 ? (v(),
|
|
79
|
+
d.value.length > 0 ? (v(), u(s(x), {
|
|
76
80
|
key: 0,
|
|
77
81
|
class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
|
|
78
82
|
variant: "outlined"
|
|
@@ -81,14 +85,14 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
81
85
|
p("span", {
|
|
82
86
|
class: E(l.value ? "text-c-1" : "text-c-3")
|
|
83
87
|
}, N(l.value ? l.value.label : "Select Collection"), 3),
|
|
84
|
-
s(
|
|
88
|
+
r(s(z), {
|
|
85
89
|
class: "text-c-3",
|
|
86
90
|
icon: "ChevronDown",
|
|
87
91
|
size: "xs"
|
|
88
92
|
})
|
|
89
93
|
]),
|
|
90
94
|
_: 1
|
|
91
|
-
})) : (v(),
|
|
95
|
+
})) : (v(), u(s(x), {
|
|
92
96
|
key: 1,
|
|
93
97
|
class: "hover:bg-b-2 max-h-8 justify-between gap-1 p-2 text-xs",
|
|
94
98
|
variant: "outlined",
|
|
@@ -107,16 +111,16 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
107
111
|
I(" Add Environment ")
|
|
108
112
|
])),
|
|
109
113
|
default: a(() => [
|
|
110
|
-
p("div",
|
|
111
|
-
|
|
114
|
+
p("div", j, [
|
|
115
|
+
r(U, {
|
|
112
116
|
activeColor: c.value,
|
|
113
117
|
class: "peer",
|
|
114
118
|
selector: "",
|
|
115
119
|
onSelect: V
|
|
116
120
|
}, null, 8, ["activeColor"]),
|
|
117
|
-
|
|
118
|
-
modelValue:
|
|
119
|
-
"onUpdate:modelValue": e[0] || (e[0] = (o) =>
|
|
121
|
+
r(P, {
|
|
122
|
+
modelValue: i.value,
|
|
123
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => i.value = o),
|
|
120
124
|
class: "-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden",
|
|
121
125
|
placeholder: "Environment name"
|
|
122
126
|
}, null, 8, ["modelValue"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuth2.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuth2.vue"],"names":[],"mappings":"AAwQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAifF,wBAMG"}
|