@scalar/api-client 2.3.31 → 2.3.33
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 +44 -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 +26 -25
- 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/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/CodeSnippet.vue.d.ts +2 -0
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -13
- 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/Components/CodeSnippet/helpers/get-har-request.d.ts +3 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +74 -31
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +3 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +8 -6
- 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/RequestCodeExample.vue.d.ts +2 -0
- 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 +54 -59
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +3 -3
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +27 -26
- 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 +22 -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 +16 -16
|
@@ -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,5 +1,6 @@
|
|
|
1
1
|
import type { Operation, RequestExample, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
|
|
2
2
|
import type { ClientId, TargetId } from '@scalar/snippetz';
|
|
3
|
+
import type { EnvVariables } from '../../../libs/env-helpers';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
target: TargetId;
|
|
5
6
|
client: ClientId<TargetId>;
|
|
@@ -7,6 +8,7 @@ type __VLS_Props = {
|
|
|
7
8
|
server?: Server | undefined;
|
|
8
9
|
example?: RequestExample | undefined;
|
|
9
10
|
securitySchemes?: SecurityScheme[];
|
|
11
|
+
environment?: EnvVariables | undefined;
|
|
10
12
|
};
|
|
11
13
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
14
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeSnippet.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Components/CodeSnippet/CodeSnippet.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeSnippet.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Components/CodeSnippet/CodeSnippet.vue"],"names":[],"mappings":"AAgGA,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAG1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAKtD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,QAAQ,CAAA;IAChB,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC1B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;IAClC,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CACvC,CAAC;;AAmIF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as u, computed as
|
|
2
|
-
import { ScalarCodeBlock as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { getSnippet as
|
|
1
|
+
import { defineComponent as u, computed as a, createElementBlock as c, createBlock as s, createCommentVNode as d, openBlock as l, toDisplayString as m, unref as f } from "vue";
|
|
2
|
+
import { ScalarCodeBlock as p } from "@scalar/components";
|
|
3
|
+
import { isDefined as v } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { getSnippet as y } from "./helpers/get-snippet.js";
|
|
5
5
|
const g = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "text-c-3 flex min-h-16 items-center justify-center px-4 text-sm"
|
|
@@ -13,28 +13,30 @@ const g = {
|
|
|
13
13
|
operation: {},
|
|
14
14
|
server: {},
|
|
15
15
|
example: {},
|
|
16
|
-
securitySchemes: { default: () => [] }
|
|
16
|
+
securitySchemes: { default: () => [] },
|
|
17
|
+
environment: {}
|
|
17
18
|
},
|
|
18
19
|
setup(t) {
|
|
19
|
-
const i =
|
|
20
|
+
const i = a(
|
|
20
21
|
() => t.securitySchemes.flatMap((e) => e.type === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
|
|
21
22
|
e.token,
|
|
22
23
|
e.password,
|
|
23
24
|
btoa(`${e.username}:${e.password}`)
|
|
24
|
-
] : e.type === "oauth2" ? Object.values(e.flows).map((r) => r == null ? void 0 : r.token).filter(
|
|
25
|
-
),
|
|
26
|
-
const [e, r] =
|
|
25
|
+
] : e.type === "oauth2" ? Object.values(e.flows).map((r) => r == null ? void 0 : r.token).filter(v) : [])
|
|
26
|
+
), n = a(() => {
|
|
27
|
+
const [e, r] = y(t.target, t.client, {
|
|
27
28
|
operation: t.operation,
|
|
28
29
|
example: t.example,
|
|
29
30
|
server: t.server,
|
|
30
|
-
securitySchemes: t.securitySchemes
|
|
31
|
+
securitySchemes: t.securitySchemes,
|
|
32
|
+
environment: t.environment
|
|
31
33
|
});
|
|
32
34
|
return { error: e, payload: r };
|
|
33
|
-
}), o =
|
|
34
|
-
return (e, r) =>
|
|
35
|
+
}), o = a(() => t.target === "shell" && t.client === "curl" ? "curl" : t.target ?? "plaintext");
|
|
36
|
+
return (e, r) => n.value.error ? (l(), c("div", g, m(n.value.error.message), 1)) : n.value.payload ? (l(), s(f(p), {
|
|
35
37
|
key: 1,
|
|
36
38
|
class: "w-full",
|
|
37
|
-
content:
|
|
39
|
+
content: n.value.payload,
|
|
38
40
|
hideCredentials: i.value,
|
|
39
41
|
lang: o.value,
|
|
40
42
|
lineNumbers: ""
|
|
@@ -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,12 +1,14 @@
|
|
|
1
1
|
import type { Operation, RequestExample, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
|
|
2
2
|
import type { HarRequest } from '@scalar/snippetz';
|
|
3
|
+
import type { EnvVariables } from '../../../../libs/env-helpers';
|
|
3
4
|
/**
|
|
4
5
|
* Creates a snippetz-compatible HarRequest from OpenAPI-like store entities
|
|
5
6
|
*/
|
|
6
|
-
export declare const getHarRequest: ({ operation, example, server, securitySchemes, }: {
|
|
7
|
+
export declare const getHarRequest: ({ operation, example, server, securitySchemes, environment, }: {
|
|
7
8
|
operation?: Operation | undefined;
|
|
8
9
|
example?: RequestExample | undefined;
|
|
9
10
|
server?: Server | undefined;
|
|
10
11
|
securitySchemes?: SecurityScheme[];
|
|
12
|
+
environment?: EnvVariables | undefined;
|
|
11
13
|
}) => HarRequest;
|
|
12
14
|
//# sourceMappingURL=get-har-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-har-request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"get-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-har-request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAMtD;;GAEG;AACH,eAAO,MAAM,aAAa,kEAMvB;IACD,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;IAClC,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CACvC,KAAG,UA0GH,CAAA"}
|
|
@@ -1,43 +1,86 @@
|
|
|
1
|
-
import { buildRequestSecurity as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { buildRequestSecurity as V } from "../../../../libs/send-request/build-request-security.js";
|
|
2
|
+
import { replaceTemplateVariables as A } from "../../../../libs/string-template.js";
|
|
3
|
+
import { REGEX as s } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { convertToHarRequest as L } from "./convert-to-har-request.js";
|
|
5
|
+
const v = "YOUR_SECRET_TOKEN", g = ({
|
|
6
|
+
operation: e,
|
|
7
|
+
example: u,
|
|
8
|
+
server: r,
|
|
9
|
+
securitySchemes: i = [],
|
|
10
|
+
environment: E
|
|
8
11
|
}) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const n = E && Array.isArray(E) ? Object.fromEntries(E.map((t) => [t.key, t.value])) : E || {}, T = (() => {
|
|
13
|
+
if (r != null && r.url && (s.VARIABLES.test(r.url) || s.PATH.test(r.url))) {
|
|
14
|
+
const t = Object.entries((r == null ? void 0 : r.variables) || {}).reduce(
|
|
15
|
+
(a, [d, l]) => {
|
|
16
|
+
var o, R;
|
|
17
|
+
const c = (R = (o = u == null ? void 0 : u.parameters) == null ? void 0 : o.path.find((b) => b.enabled && b.key === d)) == null ? void 0 : R.value;
|
|
18
|
+
return c ? a[d] = A(c, n) : l.default && (a[d] = A(l.default, n)), a;
|
|
19
|
+
},
|
|
20
|
+
{}
|
|
21
|
+
);
|
|
22
|
+
return A(A(r.url, n), t);
|
|
23
|
+
}
|
|
24
|
+
return r == null ? void 0 : r.url;
|
|
25
|
+
})(), P = (() => {
|
|
26
|
+
var a;
|
|
27
|
+
const t = (e == null ? void 0 : e.path) ?? "/";
|
|
28
|
+
if (t && (s.VARIABLES.test(t) || s.PATH.test(t))) {
|
|
29
|
+
const d = (((a = u == null ? void 0 : u.parameters) == null ? void 0 : a.path) ?? []).reduce((l, c) => (c.enabled && (l[c.key] = A(c.value, n)), l), {});
|
|
30
|
+
return A(A(t, n), d);
|
|
31
|
+
}
|
|
32
|
+
return t;
|
|
33
|
+
})(), f = V(i, n, v), y = [
|
|
34
|
+
...((u == null ? void 0 : u.parameters.headers) ?? []).map((t) => ({
|
|
35
|
+
...t,
|
|
36
|
+
value: s.VARIABLES.test(t.value) || s.PATH.test(t.value) ? A(t.value, n) : t.value
|
|
37
|
+
})) ?? [],
|
|
38
|
+
...Object.entries(f.headers).map(([t, a]) => ({
|
|
39
|
+
key: t,
|
|
40
|
+
value: a,
|
|
14
41
|
enabled: !0
|
|
15
42
|
}))
|
|
16
|
-
],
|
|
17
|
-
...(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
43
|
+
], S = [
|
|
44
|
+
...((u == null ? void 0 : u.parameters.cookies) ?? []).map((t) => ({
|
|
45
|
+
...t,
|
|
46
|
+
value: s.VARIABLES.test(t.value) || s.PATH.test(t.value) ? A(t.value, n) : t.value
|
|
47
|
+
})) ?? [],
|
|
48
|
+
...f.cookies.map((t) => ({
|
|
49
|
+
key: t.name,
|
|
50
|
+
value: t.value,
|
|
21
51
|
enabled: !0
|
|
22
52
|
}))
|
|
23
|
-
],
|
|
24
|
-
...(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
53
|
+
], h = [
|
|
54
|
+
...((u == null ? void 0 : u.parameters.query) ?? []).map((t) => ({
|
|
55
|
+
...t,
|
|
56
|
+
value: s.VARIABLES.test(t.value) || s.PATH.test(t.value) ? A(t.value, n) : t.value
|
|
57
|
+
})) ?? [],
|
|
58
|
+
...Array.from(f.urlParams.entries()).map(([t, a]) => ({
|
|
59
|
+
key: t,
|
|
60
|
+
value: a,
|
|
28
61
|
enabled: !0
|
|
29
62
|
}))
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
], H = (() => {
|
|
64
|
+
var a;
|
|
65
|
+
const t = u == null ? void 0 : u.body;
|
|
66
|
+
return (a = t == null ? void 0 : t.raw) != null && a.value && (s.VARIABLES.test(t.raw.value) || s.PATH.test(t.raw.value)) ? {
|
|
67
|
+
...t,
|
|
68
|
+
raw: {
|
|
69
|
+
...t.raw,
|
|
70
|
+
value: A(t.raw.value, n)
|
|
71
|
+
}
|
|
72
|
+
} : t;
|
|
73
|
+
})();
|
|
74
|
+
return L({
|
|
75
|
+
baseUrl: T,
|
|
76
|
+
method: (e == null ? void 0 : e.method) ?? "get",
|
|
77
|
+
path: P,
|
|
78
|
+
body: H,
|
|
79
|
+
cookies: S,
|
|
37
80
|
headers: y,
|
|
38
|
-
query:
|
|
81
|
+
query: h
|
|
39
82
|
});
|
|
40
83
|
};
|
|
41
84
|
export {
|
|
42
|
-
|
|
85
|
+
g as getHarRequest
|
|
43
86
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { ErrorResponse } from '../../../../libs/errors';
|
|
2
2
|
import type { Operation, RequestExample, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
|
|
3
3
|
import { type ClientId, type TargetId } from '@scalar/snippetz';
|
|
4
|
+
import type { EnvVariables } from '../../../../libs/env-helpers';
|
|
4
5
|
/**
|
|
5
6
|
* Returns a code example for given operation
|
|
6
7
|
*/
|
|
7
|
-
export declare const getSnippet: <T extends TargetId>(target: T | "javascript", client: ClientId<T>, { operation, example, server, securitySchemes, }: {
|
|
8
|
+
export declare const getSnippet: <T extends TargetId>(target: T | "javascript", client: ClientId<T>, { operation, example, server, securitySchemes, environment, }: {
|
|
8
9
|
operation?: Operation | undefined;
|
|
9
10
|
example?: RequestExample | undefined;
|
|
10
11
|
server?: Server | undefined;
|
|
11
12
|
securitySchemes?: SecurityScheme[];
|
|
13
|
+
environment?: EnvVariables | undefined;
|
|
12
14
|
}) => ErrorResponse<string>;
|
|
13
15
|
//# sourceMappingURL=get-snippet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxG,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAY,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"get-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxG,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAY,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAOtD;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,QAAQ,UACnC,CAAC,GAAG,YAAY,UAChB,QAAQ,CAAC,CAAC,CAAC,iEAOhB;IACD,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;IAClC,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CACvC,KACA,aAAa,CAAC,MAAM,CAkDtB,CAAA"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { snippetz as a } from "@scalar/snippetz";
|
|
2
|
-
import { getHarRequest as
|
|
3
|
-
const s = "ws://replace.me",
|
|
2
|
+
import { getHarRequest as d } from "./get-har-request.js";
|
|
3
|
+
const s = "ws://replace.me", f = (i, t, {
|
|
4
4
|
operation: l,
|
|
5
5
|
example: u,
|
|
6
6
|
server: c,
|
|
7
|
-
securitySchemes: g = []
|
|
7
|
+
securitySchemes: g = [],
|
|
8
|
+
environment: E
|
|
8
9
|
}) => {
|
|
9
10
|
var n;
|
|
10
11
|
try {
|
|
11
|
-
const r =
|
|
12
|
+
const r = d({
|
|
12
13
|
operation: l,
|
|
13
14
|
example: u,
|
|
14
15
|
server: c,
|
|
15
|
-
securitySchemes: g
|
|
16
|
+
securitySchemes: g,
|
|
17
|
+
environment: E
|
|
16
18
|
});
|
|
17
19
|
if (!r.url)
|
|
18
20
|
return [new Error("Please enter a URL to see a code snippet"), null];
|
|
@@ -39,5 +41,5 @@ const s = "ws://replace.me", S = (i, t, {
|
|
|
39
41
|
return [new Error("No snippet found"), null];
|
|
40
42
|
};
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
f as getSnippet
|
|
43
45
|
};
|
|
@@ -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"}
|