@scalar/api-reference 1.25.111 → 1.25.113
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 +29 -0
- package/dist/browser/standalone.js +5991 -6107
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +103 -104
- package/dist/components/Content/Content.vue.d.ts +1 -3
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +1 -1
- package/dist/components/Content/Content.vue2.js +53 -55
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +24 -34
- package/dist/features/ApiClientModal/useApiClient.d.ts +60 -80
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts +1 -16
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +36 -29
- package/dist/features/BaseUrl/index.d.ts +0 -1
- package/dist/features/BaseUrl/index.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useRequestExample.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useRequestExample.js +39 -51
- package/dist/index.js +1 -1
- package/dist/legacy/helpers/index.d.ts +0 -1
- package/dist/legacy/helpers/index.d.ts.map +1 -1
- package/dist/legacy/stores/index.d.ts +1 -2
- package/dist/legacy/stores/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -8
- package/dist/features/BaseUrl/ServerForm.vue.d.ts +0 -18
- package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerForm.vue.js +0 -7
- package/dist/features/BaseUrl/ServerForm.vue2.js +0 -76
- package/dist/features/BaseUrl/ServerUrl.vue.d.ts +0 -9
- package/dist/features/BaseUrl/ServerUrl.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerUrl.vue.js +0 -7
- package/dist/features/BaseUrl/ServerUrl.vue2.js +0 -27
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts +0 -28
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +0 -7
- package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +0 -61
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts +0 -14
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerVariablesForm.vue.js +0 -7
- package/dist/features/BaseUrl/ServerVariablesForm.vue2.js +0 -59
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts +0 -12
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +0 -7
- package/dist/features/BaseUrl/ServerVariablesSelect.vue2.js +0 -54
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts +0 -11
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.js +0 -7
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue2.js +0 -29
- package/dist/features/BaseUrl/types.d.ts +0 -9
- package/dist/features/BaseUrl/types.d.ts.map +0 -1
- package/dist/features/BaseUrl/utils/getServers.d.ts +0 -15
- package/dist/features/BaseUrl/utils/getServers.d.ts.map +0 -1
- package/dist/features/BaseUrl/utils/getServers.js +0 -31
- package/dist/legacy/helpers/getUrlFromServerState.d.ts +0 -10
- package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +0 -1
- package/dist/legacy/helpers/getUrlFromServerState.js +0 -18
- package/dist/legacy/stores/useServerStore.d.ts +0 -44
- package/dist/legacy/stores/useServerStore.d.ts.map +0 -1
- package/dist/legacy/stores/useServerStore.js +0 -88
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as b, useId as _, openBlock as l, createElementBlock as x, Fragment as k, createElementVNode as v, unref as e, createBlock as d, createCommentVNode as m, createVNode as S } from "vue";
|
|
2
|
+
import { ServerDropdown as g, ServerVariablesForm as V } from "@scalar/api-client/components/Server";
|
|
3
|
+
import { useActiveEntities as y, useWorkspace as B } from "@scalar/api-client/store";
|
|
4
|
+
import { ScalarMarkdown as C } from "@scalar/components";
|
|
5
|
+
const E = ["id"], U = /* @__PURE__ */ b({
|
|
5
6
|
__name: "BaseUrl",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
setup(N) {
|
|
8
|
+
const { activeCollection: s, activeServer: r } = y(), { serverMutators: p } = B(), n = _(), f = (o, a) => {
|
|
9
|
+
if (!r.value) return;
|
|
10
|
+
const t = r.value.variables || {};
|
|
11
|
+
t[o] = { ...t[o], default: a }, p.edit(r.value.uid, "variables", t);
|
|
12
|
+
};
|
|
13
|
+
return (o, a) => {
|
|
14
|
+
var t, i, c, u;
|
|
15
|
+
return l(), x(k, null, [
|
|
16
|
+
a[0] || (a[0] = v("label", { class: "bg-b-2 flex font-medium items-center h-8 px-3 py-2.5 text-sm" }, " Server ", -1)),
|
|
17
|
+
v("div", { id: e(n) }, [
|
|
18
|
+
(i = (t = e(s)) == null ? void 0 : t.servers) != null && i.length ? (l(), d(e(g), {
|
|
19
|
+
key: 0,
|
|
20
|
+
collection: e(s),
|
|
21
|
+
layout: "reference",
|
|
22
|
+
server: e(r),
|
|
23
|
+
target: e(n)
|
|
24
|
+
}, null, 8, ["collection", "server", "target"])) : m("", !0)
|
|
25
|
+
], 8, E),
|
|
26
|
+
S(e(V), {
|
|
27
|
+
variables: (c = e(r)) == null ? void 0 : c.variables,
|
|
28
|
+
"onUpdate:variable": f
|
|
29
|
+
}, null, 8, ["variables"]),
|
|
30
|
+
(u = e(r)) != null && u.description ? (l(), d(e(C), {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "px-3 py-1.5 text-c-3",
|
|
33
|
+
value: e(r).description
|
|
34
|
+
}, null, 8, ["value"])) : m("", !0)
|
|
35
|
+
], 64);
|
|
36
|
+
};
|
|
30
37
|
}
|
|
31
38
|
});
|
|
32
39
|
export {
|
|
33
|
-
|
|
40
|
+
U as default
|
|
34
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,KAAK,CAAA;AAEhD,qGAAqG;AACrG,eAAO,MAAM,iBAAiB,mFAO3B;IACD,SAAS,EAAE,oBAAoB,CAAA;IAC/B,UAAU,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC/C,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IACpC,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACxC;;;CA6FA,CAAA"}
|
|
@@ -1,54 +1,42 @@
|
|
|
1
|
-
import { getRequest as
|
|
2
|
-
import { createRequestOperation as
|
|
3
|
-
import { computed as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const { server: K } = w(), V = ({
|
|
7
|
-
operation: i,
|
|
1
|
+
import { getRequest as S } from "../../../helpers/get-request.js";
|
|
2
|
+
import { createRequestOperation as k } from "@scalar/api-client/libs";
|
|
3
|
+
import { computed as c } from "vue";
|
|
4
|
+
const w = ({
|
|
5
|
+
operation: p,
|
|
8
6
|
collection: d,
|
|
9
|
-
requests:
|
|
7
|
+
requests: v,
|
|
10
8
|
requestExamples: q,
|
|
11
|
-
securitySchemes:
|
|
12
|
-
server:
|
|
9
|
+
securitySchemes: f,
|
|
10
|
+
server: b
|
|
13
11
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
() =>
|
|
16
|
-
),
|
|
17
|
-
var
|
|
18
|
-
const t = ((
|
|
19
|
-
(
|
|
20
|
-
), e = s.map((
|
|
12
|
+
const o = c(
|
|
13
|
+
() => S(v, p.path, p.httpVerb)
|
|
14
|
+
), y = c(() => {
|
|
15
|
+
var n, u, a, l;
|
|
16
|
+
const t = ((n = o.value) == null ? void 0 : n.security) ?? ((u = d.value) == null ? void 0 : u.security) ?? [], s = t.filter(
|
|
17
|
+
(r) => Object.keys(r).length
|
|
18
|
+
), e = s.map((r) => Object.keys(r)[0]);
|
|
21
19
|
if (s.length < t.length)
|
|
22
|
-
return ((
|
|
20
|
+
return ((a = d.value) == null ? void 0 : a.selectedSecuritySchemeUids) ?? [];
|
|
23
21
|
{
|
|
24
|
-
const
|
|
25
|
-
var
|
|
26
|
-
return (
|
|
22
|
+
const r = Object.values(f), g = e.map((m) => {
|
|
23
|
+
var i;
|
|
24
|
+
return (i = r.find((j) => j.nameKey === m)) == null ? void 0 : i.uid;
|
|
27
25
|
}).filter(Boolean);
|
|
28
|
-
return (
|
|
29
|
-
(
|
|
26
|
+
return (l = d.value) == null ? void 0 : l.selectedSecuritySchemeUids.filter(
|
|
27
|
+
(m) => g.find((i) => i === m)
|
|
30
28
|
);
|
|
31
29
|
}
|
|
32
|
-
}),
|
|
33
|
-
var
|
|
34
|
-
const t = (
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
uid: (t == null ? void 0 : t.uid) || "",
|
|
40
|
-
url: b.value || ""
|
|
41
|
-
};
|
|
42
|
-
}), U = u(() => {
|
|
43
|
-
var o, l, a, n;
|
|
44
|
-
const t = q[((l = (o = c.value) == null ? void 0 : o.examples) == null ? void 0 : l[0]) ?? ""];
|
|
45
|
-
if (!c.value || !t) return null;
|
|
46
|
-
const [s, e] = x({
|
|
47
|
-
request: c.value,
|
|
30
|
+
}), h = c(() => {
|
|
31
|
+
var u, a, l, r;
|
|
32
|
+
const t = q[((a = (u = o.value) == null ? void 0 : u.examples) == null ? void 0 : a[0]) ?? ""];
|
|
33
|
+
if (!o.value || !t) return null;
|
|
34
|
+
const [s, e] = k({
|
|
35
|
+
request: o.value,
|
|
48
36
|
example: t,
|
|
49
|
-
server:
|
|
50
|
-
securitySchemes:
|
|
51
|
-
selectedSecuritySchemeUids:
|
|
37
|
+
server: b.value,
|
|
38
|
+
securitySchemes: f,
|
|
39
|
+
selectedSecuritySchemeUids: y.value,
|
|
52
40
|
// TODO: env vars if we want em
|
|
53
41
|
environment: {},
|
|
54
42
|
// TODO: cookies if we want em
|
|
@@ -56,25 +44,25 @@ const { server: K } = w(), V = ({
|
|
|
56
44
|
});
|
|
57
45
|
if (s)
|
|
58
46
|
return console.error("[useRequestExample]", s), null;
|
|
59
|
-
const
|
|
60
|
-
((
|
|
47
|
+
const n = Object.keys(
|
|
48
|
+
((r = (l = p.information) == null ? void 0 : l.requestBody) == null ? void 0 : r.content) ?? {}
|
|
61
49
|
);
|
|
62
|
-
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" &&
|
|
63
|
-
}),
|
|
50
|
+
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" && n.length && e.request.headers.set("content-type", n[0]), e.request;
|
|
51
|
+
}), O = c(
|
|
64
52
|
() => {
|
|
65
53
|
var t;
|
|
66
|
-
return ((t =
|
|
67
|
-
const e =
|
|
54
|
+
return ((t = y.value) == null ? void 0 : t.flatMap((s) => {
|
|
55
|
+
const e = f[s];
|
|
68
56
|
return (e == null ? void 0 : e.type) === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
|
|
69
57
|
e.token,
|
|
70
58
|
e.password,
|
|
71
59
|
btoa(`${e.username}:${e.password}`)
|
|
72
|
-
] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((
|
|
60
|
+
] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((n) => n.token) : [];
|
|
73
61
|
})) ?? [];
|
|
74
62
|
}
|
|
75
63
|
);
|
|
76
|
-
return { request:
|
|
64
|
+
return { request: h, secretCredentials: O };
|
|
77
65
|
};
|
|
78
66
|
export {
|
|
79
|
-
|
|
67
|
+
w as useRequestExample
|
|
80
68
|
};
|