@scalar/api-reference 1.24.20 → 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.
Files changed (82) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/browser/standalone.js +8172 -8136
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
  5. package/dist/components/ApiClientModal.vue.js +1 -1
  6. package/dist/components/ApiClientModal.vue3.js +5 -0
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  9. package/dist/components/ApiReferenceLayout.vue2.js +105 -116
  10. package/dist/components/Content/Content.vue.d.ts +0 -3
  11. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Content.vue.js +2 -2
  13. package/dist/components/Content/Content.vue2.js +70 -93
  14. package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
  15. package/dist/components/Content/Schema/Schema.vue.d.ts +2 -2
  16. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
  17. package/dist/components/api-client-bus.d.ts +1 -1
  18. package/dist/components/api-client-bus.d.ts.map +1 -1
  19. package/dist/{components/Content/BaseUrl/ServerVariables.vue.d.ts → features/BaseUrl/BaseUrl.vue.d.ts} +18 -4
  20. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -0
  21. package/dist/features/BaseUrl/BaseUrl.vue.js +87 -0
  22. package/dist/features/BaseUrl/BaseUrl.vue2.js +4 -0
  23. package/dist/features/BaseUrl/ServerForm.vue.d.ts +41 -0
  24. package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +1 -0
  25. package/dist/features/BaseUrl/ServerForm.vue.js +7 -0
  26. package/dist/features/BaseUrl/ServerForm.vue2.js +66 -0
  27. package/dist/{components/Content/BaseUrl/ServerItem.vue.d.ts → features/BaseUrl/ServerUrl.vue.d.ts} +6 -6
  28. package/dist/features/BaseUrl/ServerUrl.vue.d.ts.map +1 -0
  29. package/dist/features/BaseUrl/ServerUrl.vue.js +8 -0
  30. package/dist/features/BaseUrl/ServerUrl.vue2.js +29 -0
  31. package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts +30 -0
  32. package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -0
  33. package/dist/features/BaseUrl/ServerUrlSelect.vue.js +7 -0
  34. package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +56 -0
  35. package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts +23 -0
  36. package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts.map +1 -0
  37. package/dist/features/BaseUrl/ServerVariablesForm.vue.js +7 -0
  38. package/dist/features/BaseUrl/ServerVariablesForm.vue2.js +53 -0
  39. package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue.d.ts → features/BaseUrl/ServerVariablesSelect.vue.d.ts} +1 -1
  40. package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +1 -0
  41. package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +7 -0
  42. package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue2.js → features/BaseUrl/ServerVariablesSelect.vue2.js} +1 -1
  43. package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts → features/BaseUrl/ServerVariablesTextbox.vue.d.ts} +1 -1
  44. package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts.map +1 -0
  45. package/dist/features/BaseUrl/ServerVariablesTextbox.vue.js +7 -0
  46. package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue2.js → features/BaseUrl/ServerVariablesTextbox.vue2.js} +6 -6
  47. package/dist/features/BaseUrl/index.d.ts +3 -0
  48. package/dist/features/BaseUrl/index.d.ts.map +1 -0
  49. package/dist/features/BaseUrl/types.d.ts +10 -0
  50. package/dist/features/BaseUrl/types.d.ts.map +1 -0
  51. package/dist/features/BaseUrl/utils/getServers.d.ts +15 -0
  52. package/dist/features/BaseUrl/utils/getServers.d.ts.map +1 -0
  53. package/dist/features/BaseUrl/utils/getServers.js +29 -0
  54. package/dist/features/BaseUrl/utils/index.d.ts +2 -0
  55. package/dist/features/BaseUrl/utils/index.d.ts.map +1 -0
  56. package/dist/helpers/createEmptySpecification.d.ts +1 -1
  57. package/dist/helpers/createEmptySpecification.d.ts.map +1 -1
  58. package/dist/helpers/createEmptySpecification.js +5 -4
  59. package/dist/helpers/getModels.d.ts +1 -1
  60. package/dist/hooks/useReactiveSpec.d.ts +8 -8
  61. package/dist/index.js +1 -1
  62. package/dist/style.css +1 -1
  63. package/dist/types.d.ts +1 -4
  64. package/dist/types.d.ts.map +1 -1
  65. package/package.json +7 -7
  66. package/dist/components/ApiClientModal.vue2.js +0 -4
  67. package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts +0 -3
  68. package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts.map +0 -1
  69. package/dist/components/Content/BaseUrl/BaseUrl.vue.js +0 -7
  70. package/dist/components/Content/BaseUrl/BaseUrl.vue2.js +0 -90
  71. package/dist/components/Content/BaseUrl/ServerItem.vue.d.ts.map +0 -1
  72. package/dist/components/Content/BaseUrl/ServerItem.vue.js +0 -8
  73. package/dist/components/Content/BaseUrl/ServerItem.vue2.js +0 -35
  74. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.d.ts.map +0 -1
  75. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.js +0 -7
  76. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts.map +0 -1
  77. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.js +0 -7
  78. package/dist/components/Content/BaseUrl/ServerVariables.vue.d.ts.map +0 -1
  79. package/dist/components/Content/BaseUrl/ServerVariables.vue.js +0 -7
  80. package/dist/components/Content/BaseUrl/ServerVariables.vue2.js +0 -47
  81. package/dist/components/Content/BaseUrl/index.d.ts +0 -2
  82. package/dist/components/Content/BaseUrl/index.d.ts.map +0 -1
@@ -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,7 @@
1
+ import r from "./ServerVariablesForm.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d5675216"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -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
+ };
@@ -19,4 +19,4 @@ type __VLS_TypePropsToOption<T> = {
19
19
  required: true;
20
20
  };
21
21
  };
22
- //# sourceMappingURL=ServerVariableSelect.vue.d.ts.map
22
+ //# sourceMappingURL=ServerVariablesSelect.vue.d.ts.map
@@ -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"}
@@ -0,0 +1,7 @@
1
+ import r from "./ServerVariablesSelect.vue2.js";
2
+ /* empty css */
3
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ e(r, [["__scopeId", "data-v-4b092d90"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -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: "ServerVariableSelect",
4
+ __name: "ServerVariablesSelect",
5
5
  props: {
6
6
  enum: {},
7
7
  value: {}
@@ -17,4 +17,4 @@ type __VLS_TypePropsToOption<T> = {
17
17
  required: true;
18
18
  };
19
19
  };
20
- //# sourceMappingURL=ServerVariableTextbox.vue.d.ts.map
20
+ //# sourceMappingURL=ServerVariablesTextbox.vue.d.ts.map
@@ -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"}
@@ -0,0 +1,7 @@
1
+ import o from "./ServerVariablesTextbox.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fbcac0a4"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -1,17 +1,17 @@
1
- import { defineComponent as r, computed as s, withDirectives as u, openBlock as m, createElementBlock as i, vModelText as v } from "vue";
2
- const x = /* @__PURE__ */ r({
3
- __name: "ServerVariableTextbox",
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, c = a, e = s({
9
+ const n = l, s = a, e = r({
10
10
  get: () => n.value,
11
- set: (t) => c("change", 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] = (p) => e.value = p),
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,3 @@
1
+ export { default as BaseUrl } from './BaseUrl.vue.js';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export * from './getServers.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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;AAE7C;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAsB/C"}
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
- function e() {
2
- return {
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
- e as createEmptySpecification
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> | OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.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
- uid: string;
151
- url: string;
150
+ url?: string | undefined;
152
151
  description?: string | undefined;
153
- variables?: Record<string, {
154
- default: string;
155
- uid: string;
156
- description?: string | undefined;
157
- enum?: string[] | undefined;
158
- }> | null | undefined;
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?: {