@scalar/api-reference 1.25.63 → 1.25.64
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 +15 -0
- package/dist/browser/standalone.js +11608 -11548
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +17 -17
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +2 -2
- package/dist/features/BaseUrl/ServerVariablesSelect.vue2.js +26 -21
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +5 -5
- package/dist/helpers/getApiClientRequest.js +19 -19
- package/dist/helpers/getExampleCode.d.ts.map +1 -1
- package/dist/helpers/getExampleCode.js +16 -14
- package/dist/index.js +1 -1
- package/dist/legacy/components/SecurityScheme.vue.js +2 -2
- package/dist/legacy/components/SecurityScheme.vue2.js +8 -8
- package/dist/legacy/helpers/getUrlFromServerState.d.ts +4 -1
- package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -1
- package/dist/legacy/helpers/getUrlFromServerState.js +15 -6
- package/dist/legacy/stores/useServerStore.d.ts.map +1 -1
- package/dist/legacy/stores/useServerStore.js +47 -36
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useApiClient as
|
|
3
|
-
import { useServerStore as
|
|
1
|
+
import { defineComponent as s, ref as p, onMounted as v, watch as u, onBeforeUnmount as m, openBlock as d, createElementBlock as S } from "vue";
|
|
2
|
+
import { useApiClient as g } from "./useApiClient.js";
|
|
3
|
+
import { useServerStore as _ } from "../../legacy/stores/useServerStore.js";
|
|
4
4
|
import { getUrlFromServerState as x } from "../../legacy/helpers/getUrlFromServerState.js";
|
|
5
|
-
const h = /* @__PURE__ */
|
|
5
|
+
const h = /* @__PURE__ */ s({
|
|
6
6
|
__name: "ApiClientModal",
|
|
7
7
|
props: {
|
|
8
8
|
configuration: {}
|
|
9
9
|
},
|
|
10
10
|
setup(i) {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
if (!
|
|
11
|
+
const t = p(null), { server: o, setServer: a } = _(), { client: n, init: c } = g();
|
|
12
|
+
return v(async () => {
|
|
13
|
+
if (!t.value) return;
|
|
14
14
|
(await c({
|
|
15
|
-
el:
|
|
15
|
+
el: t.value,
|
|
16
16
|
configuration: i.configuration
|
|
17
17
|
})).onUpdateServer((r) => {
|
|
18
18
|
if (!o.servers) return;
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const l = o.servers.findIndex((f) => f.url === r);
|
|
20
|
+
l >= 0 && a({ selectedServer: l });
|
|
21
21
|
});
|
|
22
|
-
}),
|
|
23
|
-
const r = x(e);
|
|
24
|
-
r &&
|
|
25
|
-
}),
|
|
22
|
+
}), u(o, (e) => {
|
|
23
|
+
const { originalUrl: r } = x(e);
|
|
24
|
+
r && n.value && n.value.updateServer(r);
|
|
25
|
+
}), u(
|
|
26
26
|
() => i.configuration,
|
|
27
27
|
(e) => {
|
|
28
28
|
var r;
|
|
29
|
-
return e && ((r =
|
|
29
|
+
return e && ((r = n.value) == null ? void 0 : r.updateConfig(e));
|
|
30
30
|
},
|
|
31
31
|
{ deep: !0 }
|
|
32
32
|
), m(() => {
|
|
33
33
|
var e;
|
|
34
|
-
return (e =
|
|
34
|
+
return (e = n.value) == null ? void 0 : e.app.unmount();
|
|
35
35
|
}), (e, r) => (d(), S("div", {
|
|
36
36
|
ref_key: "el",
|
|
37
|
-
ref:
|
|
37
|
+
ref: t
|
|
38
38
|
}, null, 512));
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesSelect.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesSelect.vue"],"names":[],"mappings":"AAsFA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;;;;;AA4GF,wBAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./ServerVariablesSelect.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(e, [["__scopeId", "data-v-7e5c5f9f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as v, computed as s, openBlock as r, createBlock as f, unref as a, withCtx as c, createVNode as i, createElementVNode as S, normalizeClass as V, createElementBlock as h, createCommentVNode as g, createTextVNode as C, toDisplayString as b } from "vue";
|
|
2
|
+
import { ScalarListbox as k, ScalarButton as B, ScalarIcon as N } from "@scalar/components";
|
|
3
|
+
const _ = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "sr-only"
|
|
6
|
+
}, w = /* @__PURE__ */ v({
|
|
4
7
|
__name: "ServerVariablesSelect",
|
|
5
8
|
props: {
|
|
6
9
|
enum: {},
|
|
@@ -8,32 +11,34 @@ const N = /* @__PURE__ */ f({
|
|
|
8
11
|
controls: {}
|
|
9
12
|
},
|
|
10
13
|
emits: ["change"],
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
() =>
|
|
14
|
-
),
|
|
15
|
-
get: () =>
|
|
14
|
+
setup(u, { emit: d }) {
|
|
15
|
+
const t = u, m = d, l = s(
|
|
16
|
+
() => t.enum.map((e) => ({ id: e, label: e }))
|
|
17
|
+
), o = s({
|
|
18
|
+
get: () => l.value.find((e) => e.id === t.value),
|
|
16
19
|
set: (e) => m("change", (e == null ? void 0 : e.id) ?? "")
|
|
17
20
|
});
|
|
18
|
-
return (e,
|
|
19
|
-
modelValue:
|
|
20
|
-
"onUpdate:modelValue":
|
|
21
|
+
return (e, n) => (r(), f(a(k), {
|
|
22
|
+
modelValue: o.value,
|
|
23
|
+
"onUpdate:modelValue": n[0] || (n[0] = (p) => o.value = p),
|
|
21
24
|
fullWidth: "",
|
|
22
|
-
options:
|
|
25
|
+
options: l.value
|
|
23
26
|
}, {
|
|
24
|
-
default:
|
|
25
|
-
i(
|
|
27
|
+
default: c(() => [
|
|
28
|
+
i(a(B), {
|
|
26
29
|
"aria-controls": e.controls,
|
|
27
30
|
class: "variable-select",
|
|
28
31
|
fullWidth: "",
|
|
29
32
|
variant: "ghost"
|
|
30
33
|
}, {
|
|
31
|
-
default:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
default: c(() => [
|
|
35
|
+
S("span", {
|
|
36
|
+
class: V({ "text-c-1": e.value })
|
|
37
|
+
}, [
|
|
38
|
+
e.value ? (r(), h("span", _, "Selected:")) : g("", !0),
|
|
39
|
+
C(" " + b(e.value || "Select value"), 1)
|
|
40
|
+
], 2),
|
|
41
|
+
i(a(N), {
|
|
37
42
|
icon: "ChevronDown",
|
|
38
43
|
size: "xs"
|
|
39
44
|
})
|
|
@@ -46,5 +51,5 @@ const N = /* @__PURE__ */ f({
|
|
|
46
51
|
}
|
|
47
52
|
});
|
|
48
53
|
export {
|
|
49
|
-
|
|
54
|
+
w as default
|
|
50
55
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleRequest.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a5c927ad"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -36,9 +36,9 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
36
36
|
httpClient: u,
|
|
37
37
|
setHttpClient: w,
|
|
38
38
|
availableTargets: b,
|
|
39
|
-
httpTargetTitle:
|
|
40
|
-
httpClientTitle:
|
|
41
|
-
} = ce(), { server:
|
|
39
|
+
httpTargetTitle: U,
|
|
40
|
+
httpClientTitle: A
|
|
41
|
+
} = ce(), { server: J } = pe(), { authentication: q } = de(), v = D(), m = d(() => {
|
|
42
42
|
var t;
|
|
43
43
|
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
44
44
|
for (const o of e)
|
|
@@ -78,7 +78,7 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
78
78
|
return ((n = m.value[s.value.clientKey]) == null ? void 0 : n.source) ?? "";
|
|
79
79
|
const e = fe(
|
|
80
80
|
{
|
|
81
|
-
url: ye(
|
|
81
|
+
url: ye(J).modifiedUrl
|
|
82
82
|
},
|
|
83
83
|
te(
|
|
84
84
|
i.operation,
|
|
@@ -173,7 +173,7 @@ const ve = ["id"], he = ["id"], ge = {
|
|
|
173
173
|
])),
|
|
174
174
|
_: 1
|
|
175
175
|
}),
|
|
176
|
-
f(" " + S(a(
|
|
176
|
+
f(" " + S(a(U)) + " " + S(a(A)), 1)
|
|
177
177
|
], 64))
|
|
178
178
|
]),
|
|
179
179
|
_: 1
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { getRequestFromOperation as
|
|
2
|
-
import { getHarRequest as
|
|
1
|
+
import { getRequestFromOperation as a, getParametersFromOperation as p } from "@scalar/oas-utils/spec-getters";
|
|
2
|
+
import { getHarRequest as q } from "./getHarRequest.js";
|
|
3
3
|
import { getRequestFromAuthentication as c } from "../legacy/helpers/getRequestFromAuthentication.js";
|
|
4
|
-
import { getUrlFromServerState as
|
|
4
|
+
import { getUrlFromServerState as n } from "../legacy/helpers/getUrlFromServerState.js";
|
|
5
5
|
function O({
|
|
6
6
|
serverState: t,
|
|
7
7
|
authenticationState: o,
|
|
8
8
|
operation: e,
|
|
9
|
-
globalSecurity:
|
|
9
|
+
globalSecurity: d
|
|
10
10
|
}) {
|
|
11
|
-
var
|
|
12
|
-
const r =
|
|
11
|
+
var m, u;
|
|
12
|
+
const r = q(
|
|
13
13
|
{
|
|
14
|
-
url:
|
|
14
|
+
url: n(t).modifiedUrl
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
a(e, { requiredOnly: !1 }),
|
|
17
17
|
// Only generate authentication parameters if an authentication state is passed.
|
|
18
18
|
o ? c(
|
|
19
19
|
o,
|
|
20
|
-
((
|
|
20
|
+
((m = e.information) == null ? void 0 : m.security) ?? d ?? []
|
|
21
21
|
) : {}
|
|
22
|
-
),
|
|
22
|
+
), l = a(e, {
|
|
23
23
|
requiredOnly: !1
|
|
24
|
-
}),
|
|
24
|
+
}), f = p(e, "path", !1);
|
|
25
25
|
return {
|
|
26
26
|
id: e.operationId,
|
|
27
27
|
name: e.name,
|
|
28
28
|
type: r.method,
|
|
29
|
-
path:
|
|
30
|
-
variables:
|
|
31
|
-
cookies:
|
|
32
|
-
query: r.queryString.map((
|
|
33
|
-
headers:
|
|
34
|
-
url:
|
|
35
|
-
body: (
|
|
29
|
+
path: l.path ?? "",
|
|
30
|
+
variables: f,
|
|
31
|
+
cookies: s(r.cookies),
|
|
32
|
+
query: r.queryString.map((i) => ({ ...i, enabled: i.required ?? !0 })),
|
|
33
|
+
headers: s(r.headers),
|
|
34
|
+
url: n(t).modifiedUrl ?? "",
|
|
35
|
+
body: (u = r.postData) == null ? void 0 : u.text
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function s(t) {
|
|
39
39
|
return (t ?? []).map((o) => ({ ...o, enabled: !0 }));
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,mBAyCjB"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { snippetz as
|
|
1
|
+
import { snippetz as r } from "@scalar/snippetz";
|
|
2
2
|
import { HTTPSnippet as s } from "httpsnippet-lite";
|
|
3
|
-
async function
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
6
|
-
return
|
|
7
|
-
e,
|
|
3
|
+
async function f(e, t, p) {
|
|
4
|
+
const o = t;
|
|
5
|
+
if (r().hasPlugin(o, p))
|
|
6
|
+
return r().print(
|
|
8
7
|
t,
|
|
9
|
-
|
|
8
|
+
p,
|
|
9
|
+
e
|
|
10
10
|
);
|
|
11
|
+
if (e.url.startsWith("__"))
|
|
12
|
+
return e.url;
|
|
11
13
|
try {
|
|
12
|
-
const
|
|
14
|
+
const n = t == null ? void 0 : t.replace(
|
|
13
15
|
"js",
|
|
14
16
|
"javascript"
|
|
15
|
-
), c =
|
|
16
|
-
|
|
17
|
+
), c = p, i = await new s(e).convert(
|
|
18
|
+
n,
|
|
17
19
|
c
|
|
18
20
|
);
|
|
19
|
-
if (typeof
|
|
20
|
-
} catch (
|
|
21
|
+
if (typeof i == "string") return i;
|
|
22
|
+
} catch (n) {
|
|
21
23
|
console.error(
|
|
22
24
|
"[getExampleCode] Failed to generate example code with httpsnippet-lite:",
|
|
23
|
-
|
|
25
|
+
n
|
|
24
26
|
);
|
|
25
27
|
}
|
|
26
28
|
return "";
|
|
27
29
|
}
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
f as getExampleCode
|
|
30
32
|
};
|