@scalar/api-reference 1.25.68 → 1.25.69
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 +21 -0
- package/dist/browser/standalone.js +48 -46
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +2 -2
- package/dist/components/Section/SectionContainer.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainer.vue.js +2 -2
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +3 -3
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +55 -52
- package/dist/index.js +1 -1
- package/dist/legacy/components/CardFormGroup.vue.d.ts.map +1 -1
- package/dist/legacy/components/CardFormGroup.vue.js +1 -1
- package/dist/legacy/components/SecuritySchemeSelector.vue.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AA0YA,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;cAJW,OAAO;WAFV,MAAM;aAGJ,OAAO;;AA0WrB,0BAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaProperty.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const p = /* @__PURE__ */
|
|
3
|
+
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7ebbc3d9"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/Section.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Section.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/Section.vue"],"names":[],"mappings":"AAqFA,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAkCF,iBAAS,cAAc;WAoET,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Section.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8687f476"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionContainer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/SectionContainer.vue"],"names":[],"mappings":"AA6BA,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"SectionContainer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/SectionContainer.vue"],"names":[],"mappings":"AA6BA,iBAAS,cAAc;WAyCT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,12 +2,12 @@ import { openBlock as t, createElementBlock as o, renderSlot as n } from "vue";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const c = {}, s = { class: "section-container" };
|
|
5
|
-
function
|
|
5
|
+
function a(e, i) {
|
|
6
6
|
return t(), o("div", s, [
|
|
7
7
|
n(e.$slots, "default", {}, void 0, !0)
|
|
8
8
|
]);
|
|
9
9
|
}
|
|
10
|
-
const l = /* @__PURE__ */ r(c, [["render",
|
|
10
|
+
const l = /* @__PURE__ */ r(c, [["render", a], ["__scopeId", "data-v-1913755a"]]);
|
|
11
11
|
export {
|
|
12
12
|
l as default
|
|
13
13
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r from "./ServerUrlSelect.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const c = /* @__PURE__ */ e(r, [["__scopeId", "data-v-6a8c344e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAMhD,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAMhD,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,OAAO,CAAC,IAAI,CAyDd,CAAA"}
|
package/dist/helpers/parse.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { redirectToProxy as
|
|
1
|
+
import { redirectToProxy as R } from "@scalar/oas-utils/helpers";
|
|
2
2
|
import { load as j, dereference as M } from "@scalar/openapi-parser";
|
|
3
3
|
import { fetchUrls as q } from "@scalar/openapi-parser/plugins/fetch-urls";
|
|
4
4
|
import { createEmptySpecification as m } from "./createEmptySpecification.js";
|
|
5
5
|
import { normalizeRequestMethod as E } from "../legacy/helpers/normalizeRequestMethod.js";
|
|
6
|
-
import { validRequestMethods as
|
|
7
|
-
const
|
|
8
|
-
proxy:
|
|
6
|
+
import { validRequestMethods as A } from "../legacy/fixtures/httpRequestMethods.js";
|
|
7
|
+
const z = (p, {
|
|
8
|
+
proxy: e
|
|
9
9
|
} = {}) => new Promise(async (a, h) => {
|
|
10
10
|
var s;
|
|
11
11
|
try {
|
|
@@ -13,102 +13,105 @@ const D = (p, {
|
|
|
13
13
|
return a(
|
|
14
14
|
u(m())
|
|
15
15
|
);
|
|
16
|
-
const
|
|
16
|
+
const o = performance.now(), { filesystem: n } = await j(p, {
|
|
17
17
|
plugins: [
|
|
18
18
|
q({
|
|
19
|
-
fetch: (
|
|
19
|
+
fetch: (i) => fetch(e ? R(e, i) : i)
|
|
20
20
|
})
|
|
21
21
|
]
|
|
22
|
-
}), { schema:
|
|
23
|
-
return console.log(`dereference: ${Math.round(
|
|
22
|
+
}), { schema: t, errors: r } = await M(n), c = performance.now();
|
|
23
|
+
return console.log(`dereference: ${Math.round(c - o)} ms`), r != null && r.length && console.warn(
|
|
24
24
|
`Please open an issue on https://github.com/scalar/scalar
|
|
25
25
|
`,
|
|
26
26
|
`Scalar OpenAPI Parser Warning:
|
|
27
27
|
`,
|
|
28
28
|
r
|
|
29
|
-
),
|
|
29
|
+
), t === void 0 ? (h(((s = r == null ? void 0 : r[0]) == null ? void 0 : s.message) ?? "Failed to parse the OpenAPI file."), a(
|
|
30
30
|
u(m())
|
|
31
|
-
)) : a(u(
|
|
32
|
-
} catch (
|
|
33
|
-
|
|
31
|
+
)) : a(u(t));
|
|
32
|
+
} catch (o) {
|
|
33
|
+
console.error(
|
|
34
|
+
"[@scalar/api-reference]",
|
|
35
|
+
"Failed to parse the OpenAPI document. It might be invalid?"
|
|
36
|
+
), console.error(o), h(o);
|
|
34
37
|
}
|
|
35
38
|
return a(
|
|
36
39
|
u(m())
|
|
37
40
|
);
|
|
38
41
|
}), u = (p) => {
|
|
39
|
-
let
|
|
40
|
-
p && typeof p == "object" ?
|
|
42
|
+
let e = {};
|
|
43
|
+
p && typeof p == "object" ? e = structuredClone(p) : e = m(), e.tags || (e.tags = []), e.paths || (e.paths = {});
|
|
41
44
|
const a = {};
|
|
42
|
-
return Object.keys(
|
|
43
|
-
var
|
|
44
|
-
Object.keys(((
|
|
45
|
-
var r,
|
|
46
|
-
const
|
|
47
|
-
(
|
|
45
|
+
return Object.keys(e.webhooks ?? {}).forEach((s) => {
|
|
46
|
+
var o;
|
|
47
|
+
Object.keys(((o = e.webhooks) == null ? void 0 : o[s]) ?? {}).forEach((n) => {
|
|
48
|
+
var r, c, i;
|
|
49
|
+
const t = (r = e.webhooks) == null ? void 0 : r[s][n];
|
|
50
|
+
(t == null ? void 0 : t["x-internal"]) !== !0 && (a[s] === void 0 && (a[s] = {}), a[s][n] = {
|
|
48
51
|
// Transformed data
|
|
49
52
|
httpVerb: E(n),
|
|
50
53
|
path: s,
|
|
51
|
-
operationId: (
|
|
52
|
-
name: (
|
|
53
|
-
description: (
|
|
54
|
-
pathParameters: (
|
|
54
|
+
operationId: (t == null ? void 0 : t.operationId) || s,
|
|
55
|
+
name: (t == null ? void 0 : t.summary) || s || "",
|
|
56
|
+
description: (t == null ? void 0 : t.description) || "",
|
|
57
|
+
pathParameters: (i = (c = e.paths) == null ? void 0 : c[s]) == null ? void 0 : i.parameters,
|
|
55
58
|
// Original webhook
|
|
56
59
|
information: {
|
|
57
|
-
...
|
|
60
|
+
...t
|
|
58
61
|
}
|
|
59
62
|
});
|
|
60
63
|
});
|
|
61
|
-
}), Object.keys(
|
|
62
|
-
Object.keys(
|
|
63
|
-
(n) =>
|
|
64
|
+
}), Object.keys(e.paths).forEach((s) => {
|
|
65
|
+
Object.keys(e.paths[s]).filter(
|
|
66
|
+
(n) => A.includes(n.toUpperCase())
|
|
64
67
|
).forEach((n) => {
|
|
65
|
-
var
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
+
var c, i, g, w, y, I;
|
|
69
|
+
const t = e.paths[s][n];
|
|
70
|
+
if (t === void 0 || t["x-internal"] === !0)
|
|
68
71
|
return;
|
|
69
72
|
const r = {
|
|
70
73
|
httpVerb: E(n),
|
|
71
74
|
path: s,
|
|
72
|
-
operationId:
|
|
73
|
-
name:
|
|
74
|
-
description:
|
|
75
|
+
operationId: t.operationId || s,
|
|
76
|
+
name: t.summary || s || "",
|
|
77
|
+
description: t.description || "",
|
|
75
78
|
information: {
|
|
76
|
-
...
|
|
79
|
+
...t
|
|
77
80
|
},
|
|
78
|
-
pathParameters: (
|
|
81
|
+
pathParameters: (i = (c = e.paths) == null ? void 0 : c[s]) == null ? void 0 : i.parameters
|
|
79
82
|
};
|
|
80
|
-
if (!
|
|
81
|
-
(g =
|
|
82
|
-
(
|
|
83
|
-
) || (w =
|
|
83
|
+
if (!t.tags || t.tags.length === 0) {
|
|
84
|
+
(g = e.tags) != null && g.find(
|
|
85
|
+
(f) => f.name === "default"
|
|
86
|
+
) || (w = e.tags) == null || w.push({
|
|
84
87
|
name: "default",
|
|
85
88
|
description: "",
|
|
86
89
|
operations: []
|
|
87
90
|
});
|
|
88
|
-
const d = (y =
|
|
89
|
-
(
|
|
91
|
+
const d = (y = e.tags) == null ? void 0 : y.findIndex(
|
|
92
|
+
(f) => f.name === "default"
|
|
90
93
|
);
|
|
91
|
-
d >= 0 && ((
|
|
94
|
+
d >= 0 && ((I = e.tags[d]) == null || I.operations.push(r));
|
|
92
95
|
} else
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
const
|
|
96
|
+
t.tags.forEach((d) => {
|
|
97
|
+
var O, x, P;
|
|
98
|
+
const f = (O = e.tags) == null ? void 0 : O.findIndex(
|
|
96
99
|
// @ts-expect-error TODO: The types are just screwed, needs refactoring
|
|
97
|
-
(
|
|
100
|
+
(b) => b.name === d
|
|
98
101
|
);
|
|
99
|
-
|
|
102
|
+
f === -1 && ((x = e.tags) == null || x.push({
|
|
100
103
|
name: d,
|
|
101
104
|
description: ""
|
|
102
105
|
}));
|
|
103
|
-
const l =
|
|
104
|
-
typeof ((P =
|
|
106
|
+
const l = f !== -1 ? f : e.tags.length - 1;
|
|
107
|
+
typeof ((P = e.tags[l]) == null ? void 0 : P.operations) > "u" && (e.tags[l].operations = []), e.tags[l].operations.push(r);
|
|
105
108
|
});
|
|
106
109
|
});
|
|
107
110
|
}), {
|
|
108
|
-
...
|
|
111
|
+
...e,
|
|
109
112
|
webhooks: a
|
|
110
113
|
};
|
|
111
114
|
};
|
|
112
115
|
export {
|
|
113
|
-
|
|
116
|
+
z as parse
|
|
114
117
|
};
|