@scalar/api-reference 1.24.19 → 1.24.21
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 +39 -0
- package/dist/browser/standalone.js +11841 -11462
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/components/ApiClientModal.vue.js +18 -12
- package/dist/components/ApiClientModal.vue3.js +5 -0
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +105 -116
- package/dist/components/Content/Content.vue.d.ts +0 -3
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +70 -93
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue2.js +8 -6
- package/dist/components/Content/Schema/Schema.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
- package/dist/components/api-client-bus.d.ts +15 -3
- package/dist/components/api-client-bus.d.ts.map +1 -1
- package/dist/{components/Content/BaseUrl/ServerVariables.vue.d.ts → features/BaseUrl/BaseUrl.vue.d.ts} +18 -4
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/BaseUrl.vue.js +87 -0
- package/dist/features/BaseUrl/BaseUrl.vue2.js +4 -0
- package/dist/features/BaseUrl/ServerForm.vue.d.ts +41 -0
- package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerForm.vue.js +7 -0
- package/dist/features/BaseUrl/ServerForm.vue2.js +66 -0
- package/dist/{components/Content/BaseUrl/ServerItem.vue.d.ts → features/BaseUrl/ServerUrl.vue.d.ts} +6 -6
- package/dist/features/BaseUrl/ServerUrl.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerUrl.vue.js +8 -0
- package/dist/features/BaseUrl/ServerUrl.vue2.js +29 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts +30 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +7 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +56 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts +23 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue.js +7 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue2.js +53 -0
- package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue.d.ts → features/BaseUrl/ServerVariablesSelect.vue.d.ts} +1 -1
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +7 -0
- package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue2.js → features/BaseUrl/ServerVariablesSelect.vue2.js} +1 -1
- package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts → features/BaseUrl/ServerVariablesTextbox.vue.d.ts} +1 -1
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.js +7 -0
- package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue2.js → features/BaseUrl/ServerVariablesTextbox.vue2.js} +6 -6
- package/dist/features/BaseUrl/index.d.ts +3 -0
- package/dist/features/BaseUrl/index.d.ts.map +1 -0
- package/dist/features/BaseUrl/types.d.ts +10 -0
- package/dist/features/BaseUrl/types.d.ts.map +1 -0
- package/dist/features/BaseUrl/utils/getServers.d.ts +15 -0
- package/dist/features/BaseUrl/utils/getServers.d.ts.map +1 -0
- package/dist/features/BaseUrl/utils/getServers.js +29 -0
- package/dist/features/BaseUrl/utils/index.d.ts +2 -0
- package/dist/features/BaseUrl/utils/index.d.ts.map +1 -0
- package/dist/helpers/createEmptySpecification.d.ts +1 -1
- package/dist/helpers/createEmptySpecification.d.ts.map +1 -1
- package/dist/helpers/createEmptySpecification.js +5 -4
- package/dist/helpers/getModels.d.ts +1 -1
- package/dist/hooks/useReactiveSpec.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -10
- package/dist/components/ApiClientModal.vue2.js +0 -4
- package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts +0 -3
- package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/BaseUrl.vue.js +0 -7
- package/dist/components/Content/BaseUrl/BaseUrl.vue2.js +0 -90
- package/dist/components/Content/BaseUrl/ServerItem.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerItem.vue.js +0 -8
- package/dist/components/Content/BaseUrl/ServerItem.vue2.js +0 -35
- package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.js +0 -7
- package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.js +0 -7
- package/dist/components/Content/BaseUrl/ServerVariables.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerVariables.vue.js +0 -7
- package/dist/components/Content/BaseUrl/ServerVariables.vue2.js +0 -47
- package/dist/components/Content/BaseUrl/index.d.ts +0 -2
- package/dist/components/Content/BaseUrl/index.d.ts.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as u, computed as i, openBlock as p, createElementBlock as m, createCommentVNode as v } from "vue";
|
|
2
|
+
import { replaceVariables as d } from "@scalar/oas-utils/helpers";
|
|
3
|
+
const f = ["title", "innerHTML"], k = /* @__PURE__ */ u({
|
|
4
|
+
__name: "ServerUrl",
|
|
5
|
+
props: {
|
|
6
|
+
server: {},
|
|
7
|
+
variables: {}
|
|
8
|
+
},
|
|
9
|
+
setup(a) {
|
|
10
|
+
const r = a, c = i(() => {
|
|
11
|
+
var s;
|
|
12
|
+
const t = (((s = r.server) == null ? void 0 : s.url) ?? "").replace(/(<([^>]+)>)/gi, "");
|
|
13
|
+
return d(t, (n) => {
|
|
14
|
+
var o;
|
|
15
|
+
const l = ((o = r.variables) == null ? void 0 : o[n]) ?? "";
|
|
16
|
+
return `<span class="base-url-variable">${l !== "" ? l : `{${n}}`}</span>`;
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return (e, t) => e.server ? (p(), m("a", {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "base-url",
|
|
22
|
+
title: e.server.description,
|
|
23
|
+
innerHTML: c.value
|
|
24
|
+
}, null, 8, f)) : v("", !0);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
k as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Server } from './types';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
|
+
options: Server[];
|
|
4
|
+
value: number;
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
change: (v: string) => void;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
8
|
+
options: Server[];
|
|
9
|
+
value: number;
|
|
10
|
+
}>>> & {
|
|
11
|
+
onChange?: ((v: string) => any) | undefined;
|
|
12
|
+
}, {}, {}>, {
|
|
13
|
+
default?(_: {}): any;
|
|
14
|
+
}>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToOption<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=ServerUrlSelect.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerUrlSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerUrlSelect.vue"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;;;;;;;;;;;;;;AAmIrC,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent as v, computed as s, openBlock as r, createElementBlock as f, createVNode as i, unref as l, withCtx as u, normalizeClass as g, createElementVNode as h, renderSlot as S, createBlock as _, createCommentVNode as V } from "vue";
|
|
2
|
+
import { ScalarListbox as C, ScalarButton as k, ScalarIcon as x } from "@scalar/components";
|
|
3
|
+
const B = { class: "w-full" }, N = /* @__PURE__ */ v({
|
|
4
|
+
__name: "ServerUrlSelect",
|
|
5
|
+
props: {
|
|
6
|
+
options: {},
|
|
7
|
+
value: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["change"],
|
|
10
|
+
setup(c, { emit: d }) {
|
|
11
|
+
const n = c, m = d, o = s(
|
|
12
|
+
() => n.options.map((e, t) => ({
|
|
13
|
+
id: t.toString(),
|
|
14
|
+
label: e.url ?? ""
|
|
15
|
+
}))
|
|
16
|
+
), a = s({
|
|
17
|
+
get: () => {
|
|
18
|
+
var e;
|
|
19
|
+
return (e = o.value) == null ? void 0 : e.find((t) => t.id === n.value.toString());
|
|
20
|
+
},
|
|
21
|
+
set: (e) => m("change", (e == null ? void 0 : e.id) ?? "")
|
|
22
|
+
});
|
|
23
|
+
return (e, t) => (r(), f("div", B, [
|
|
24
|
+
i(l(C), {
|
|
25
|
+
modelValue: a.value,
|
|
26
|
+
"onUpdate:modelValue": t[0] || (t[0] = (p) => a.value = p),
|
|
27
|
+
options: o.value,
|
|
28
|
+
resize: ""
|
|
29
|
+
}, {
|
|
30
|
+
default: u(() => [
|
|
31
|
+
i(l(k), {
|
|
32
|
+
class: g(["url-select", { "pointer-events-none": o.value.length <= 1 }]),
|
|
33
|
+
fullWidth: "",
|
|
34
|
+
variant: "ghost"
|
|
35
|
+
}, {
|
|
36
|
+
default: u(() => [
|
|
37
|
+
h("span", null, [
|
|
38
|
+
S(e.$slots, "default", {}, void 0, !0)
|
|
39
|
+
]),
|
|
40
|
+
o.value.length > 1 ? (r(), _(l(x), {
|
|
41
|
+
key: 0,
|
|
42
|
+
icon: "ChevronDown",
|
|
43
|
+
size: "xs"
|
|
44
|
+
})) : V("", !0)
|
|
45
|
+
]),
|
|
46
|
+
_: 3
|
|
47
|
+
}, 8, ["class"])
|
|
48
|
+
]),
|
|
49
|
+
_: 3
|
|
50
|
+
}, 8, ["modelValue", "options"])
|
|
51
|
+
]));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
N as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ServerVariableValues, ServerVariables } from './types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
|
+
variables?: ServerVariables | undefined;
|
|
4
|
+
values?: ServerVariableValues | undefined;
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:variable": (name: string, value: string) => void;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
8
|
+
variables?: ServerVariables | undefined;
|
|
9
|
+
values?: ServerVariableValues | undefined;
|
|
10
|
+
}>>> & {
|
|
11
|
+
"onUpdate:variable"?: ((name: string, value: string) => any) | undefined;
|
|
12
|
+
}, {}, {}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToOption<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ServerVariablesForm.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerVariablesForm.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesForm.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;;;;;;;;;;;;AAmIpE,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as h, openBlock as t, createElementBlock as o, Fragment as k, renderList as y, createElementVNode as m, toDisplayString as V, createBlock as p, createCommentVNode as C } from "vue";
|
|
2
|
+
import S from "./ServerVariablesSelect.vue.js";
|
|
3
|
+
import _ from "./ServerVariablesTextbox.vue.js";
|
|
4
|
+
const B = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "variable-container"
|
|
7
|
+
}, j = ["for"], O = /* @__PURE__ */ h({
|
|
8
|
+
__name: "ServerVariablesForm",
|
|
9
|
+
props: {
|
|
10
|
+
variables: {},
|
|
11
|
+
values: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:variable"],
|
|
14
|
+
setup(d, { emit: f }) {
|
|
15
|
+
const i = d, g = f;
|
|
16
|
+
function n(a, r) {
|
|
17
|
+
g("update:variable", a, r);
|
|
18
|
+
}
|
|
19
|
+
const s = (a) => {
|
|
20
|
+
var r, e;
|
|
21
|
+
return (((r = i.values) == null ? void 0 : r[a]) ?? ((e = i.variables) == null ? void 0 : e[a].default) ?? "").toString();
|
|
22
|
+
};
|
|
23
|
+
return (a, r) => a.variables && Object.keys(a.variables ?? {}).length ? (t(), o("div", B, [
|
|
24
|
+
(t(!0), o(k, null, y(Object.keys(a.variables), (e) => {
|
|
25
|
+
var u, v, b, c;
|
|
26
|
+
return t(), o("div", {
|
|
27
|
+
key: e,
|
|
28
|
+
class: "variable-container-item"
|
|
29
|
+
}, [
|
|
30
|
+
m("label", {
|
|
31
|
+
class: "variable-label",
|
|
32
|
+
for: `variable-${e}`
|
|
33
|
+
}, [
|
|
34
|
+
m("code", null, V(e), 1)
|
|
35
|
+
], 8, j),
|
|
36
|
+
(v = (u = a.variables) == null ? void 0 : u[e].enum) != null && v.length ? (t(), p(S, {
|
|
37
|
+
key: 0,
|
|
38
|
+
enum: ((c = (b = a.variables[e]) == null ? void 0 : b.enum) == null ? void 0 : c.map((l) => `${l}`)) ?? [],
|
|
39
|
+
value: s(e),
|
|
40
|
+
onChange: (l) => n(e, l)
|
|
41
|
+
}, null, 8, ["enum", "value", "onChange"])) : (t(), p(_, {
|
|
42
|
+
key: 1,
|
|
43
|
+
value: s(e),
|
|
44
|
+
onChange: (l) => n(e, l)
|
|
45
|
+
}, null, 8, ["value", "onChange"]))
|
|
46
|
+
]);
|
|
47
|
+
}), 128))
|
|
48
|
+
])) : C("", !0);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
O as default
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesSelect.vue"],"names":[],"mappings":";;;;;;;;;;;AA6LA,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as p, computed as i, openBlock as v, createElementBlock as f, createVNode as t, unref as a, withCtx as r, createElementVNode as _, toDisplayString as h } from "vue";
|
|
2
2
|
import { ScalarListbox as S, ScalarButton as V, ScalarIcon as g } from "@scalar/components";
|
|
3
3
|
const b = { class: "w-full" }, B = /* @__PURE__ */ p({
|
|
4
|
-
__name: "
|
|
4
|
+
__name: "ServerVariablesSelect",
|
|
5
5
|
props: {
|
|
6
6
|
enum: {},
|
|
7
7
|
value: {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerVariablesTextbox.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesTextbox.vue"],"names":[],"mappings":";;;;;;;;;AAwGA,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const x = /* @__PURE__ */
|
|
3
|
-
__name: "
|
|
1
|
+
import { defineComponent as p, computed as r, withDirectives as u, openBlock as m, createElementBlock as i, vModelText as v } from "vue";
|
|
2
|
+
const x = /* @__PURE__ */ p({
|
|
3
|
+
__name: "ServerVariablesTextbox",
|
|
4
4
|
props: {
|
|
5
5
|
value: {}
|
|
6
6
|
},
|
|
7
7
|
emits: ["change"],
|
|
8
8
|
setup(l, { emit: a }) {
|
|
9
|
-
const n = l,
|
|
9
|
+
const n = l, s = a, e = r({
|
|
10
10
|
get: () => n.value,
|
|
11
|
-
set: (t) =>
|
|
11
|
+
set: (t) => s("change", t)
|
|
12
12
|
});
|
|
13
13
|
return (t, o) => u((m(), i("input", {
|
|
14
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
14
|
+
"onUpdate:modelValue": o[0] || (o[0] = (c) => e.value = c),
|
|
15
15
|
autocomplete: "off",
|
|
16
16
|
class: "variable-textbox",
|
|
17
17
|
placeholder: "value",
|
|
@@ -0,0 +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;AAElD,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
|
|
2
|
+
export type Server = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject;
|
|
3
|
+
export type ServerVariables = {
|
|
4
|
+
[variable: string]: ServerVariable;
|
|
5
|
+
};
|
|
6
|
+
export type ServerVariableValues = {
|
|
7
|
+
[variable: string]: string;
|
|
8
|
+
};
|
|
9
|
+
export type ServerVariable = OpenAPIV3.ServerVariableObject | OpenAPIV3_1.ServerVariableObject;
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;AAEtE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,cAAc,GACtB,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Spec } from '@scalar/oas-utils';
|
|
2
|
+
import type { Server } from '../types';
|
|
3
|
+
export type DefaultServerUrlOption = {
|
|
4
|
+
/**
|
|
5
|
+
* Sometimes you can’t add an URL to your OpenAPI document, so you can provide a default one here.
|
|
6
|
+
*/
|
|
7
|
+
defaultServerUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Provide a specification and get the servers from it.
|
|
11
|
+
* If no servers are found, it will default to a specified URL or the current URL.
|
|
12
|
+
* Relative paths will be prepended with the default server URL or the current URL.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getServers(specification: Spec | undefined, options?: DefaultServerUrlOption): Server[];
|
|
15
|
+
//# sourceMappingURL=getServers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getServers.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/getServers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,sBAAsB,YA6DjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { findVariables as v, concatenateUrlAndPath as w } from "@scalar/oas-utils/helpers";
|
|
2
|
+
function S(r, l) {
|
|
3
|
+
var h;
|
|
4
|
+
let e = [];
|
|
5
|
+
return r != null && r.servers && (r == null ? void 0 : r.servers.length) > 0 ? e = r.servers : r != null && r.host ? e = [
|
|
6
|
+
{
|
|
7
|
+
url: `${((h = r.schemes) == null ? void 0 : h[0]) ?? "http"}://${r.host}${(r == null ? void 0 : r.basePath) ?? ""}`
|
|
8
|
+
}
|
|
9
|
+
] : e = [
|
|
10
|
+
{
|
|
11
|
+
url: l != null && l.defaultServerUrl ? l == null ? void 0 : l.defaultServerUrl : typeof window < "u" ? window.location.origin : "/"
|
|
12
|
+
}
|
|
13
|
+
], (l != null && l.defaultServerUrl || typeof window < "u") && (e = e.map((d) => b(d, l))), e.map((d) => {
|
|
14
|
+
const a = d.variables ?? {};
|
|
15
|
+
return v(d.url ?? "").filter((u) => !a[u]).forEach((u) => {
|
|
16
|
+
d.variables === void 0 && (d.variables = {}), d.variables[u] = {};
|
|
17
|
+
}), d;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function b(r, l) {
|
|
21
|
+
var e;
|
|
22
|
+
return (e = r.url) != null && e.match(/^(?!(https?|file):\/\/|{).+/) && (r.url = w(
|
|
23
|
+
l != null && l.defaultServerUrl ? l == null ? void 0 : l.defaultServerUrl : typeof window < "u" ? window.location.origin : "",
|
|
24
|
+
r.url
|
|
25
|
+
)), r;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
S as getServers
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -3,5 +3,5 @@ import type { Spec } from '@scalar/oas-utils';
|
|
|
3
3
|
* Creates an empty specification object.
|
|
4
4
|
* The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
|
|
5
5
|
*/
|
|
6
|
-
export declare function createEmptySpecification(): Spec;
|
|
6
|
+
export declare function createEmptySpecification(partialSpecification?: Partial<Spec>): Spec;
|
|
7
7
|
//# sourceMappingURL=createEmptySpecification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAI7C;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,QAsB5E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { deepMerge as r } from "./deepMerge.js";
|
|
2
|
+
function i(e) {
|
|
3
|
+
return r(e ?? {}, {
|
|
3
4
|
info: {
|
|
4
5
|
title: "",
|
|
5
6
|
description: "",
|
|
@@ -19,8 +20,8 @@ function e() {
|
|
|
19
20
|
},
|
|
20
21
|
servers: [],
|
|
21
22
|
tags: []
|
|
22
|
-
};
|
|
23
|
+
});
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
i as createEmptySpecification
|
|
26
27
|
};
|
|
@@ -3,5 +3,5 @@ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns all models from the specification, no matter if it’s Swagger 2.0 or OpenAPI 3.x.
|
|
5
5
|
*/
|
|
6
|
-
export declare function getModels(spec?: Spec): Record<string, OpenAPIV3_1.SchemaObject> |
|
|
6
|
+
export declare function getModels(spec?: Spec): OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3_1.SchemaObject> | Record<string, OpenAPIV3.SchemaObject>;
|
|
7
7
|
//# sourceMappingURL=getModels.d.ts.map
|
|
@@ -147,15 +147,15 @@ export declare function useReactiveSpec({ specConfig, proxy, }: {
|
|
|
147
147
|
description?: string | undefined;
|
|
148
148
|
} | undefined;
|
|
149
149
|
servers?: {
|
|
150
|
-
|
|
151
|
-
url: string;
|
|
150
|
+
url?: string | undefined;
|
|
152
151
|
description?: string | undefined;
|
|
153
|
-
variables?:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
variables?: {
|
|
153
|
+
[variable: string]: import("@scalar/openapi-parser").OpenAPIV3.ServerVariableObject;
|
|
154
|
+
} | undefined;
|
|
155
|
+
}[] | {
|
|
156
|
+
url?: string | undefined;
|
|
157
|
+
description?: string | undefined;
|
|
158
|
+
variables?: Record<string, import("@scalar/openapi-parser").OpenAPIV3_1.ServerVariableObject> | undefined;
|
|
159
159
|
}[] | undefined;
|
|
160
160
|
components?: {
|
|
161
161
|
schemas?: {
|