@scalar/api-reference 1.31.14 → 1.31.15
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 +13 -0
- package/README.md +4 -0
- package/dist/browser/standalone.js +1631 -1634
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +32 -34
- package/dist/components/Content/Schema/helpers/schema-name.d.ts +2 -2
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +30 -39
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA8QA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AA+TF,wBAOG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, ref as M, computed as
|
|
1
|
+
import { defineComponent as F, ref as M, computed as t, resolveComponent as T, createElementBlock as c, openBlock as r, createCommentVNode as u, createBlock as p, Fragment as N, renderList as j, createVNode as y, createElementVNode as f, unref as d, withCtx as R, toDisplayString as V } from "vue";
|
|
2
2
|
import { ScalarListbox as Z, ScalarMarkdown as $ } from "@scalar/components";
|
|
3
3
|
import { ScalarIconCaretDown as G } from "@scalar/icons";
|
|
4
4
|
import { mergeAllOfSchemas as w } from "./helpers/merge-all-of-schemas.js";
|
|
@@ -22,34 +22,32 @@ const K = { class: "property-rule" }, P = {
|
|
|
22
22
|
compact: { type: Boolean },
|
|
23
23
|
hideHeading: { type: Boolean }
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
s(() => a.value[a.composition] || []);
|
|
28
|
-
const B = s(() => k.value), C = s(
|
|
25
|
+
setup(s) {
|
|
26
|
+
const v = M(0), B = t(() => k.value), C = t(
|
|
29
27
|
() => B.value.map(
|
|
30
28
|
(e, o) => ({
|
|
31
29
|
id: String(o),
|
|
32
|
-
label: J(e
|
|
30
|
+
label: J(e) || "Schema"
|
|
33
31
|
})
|
|
34
32
|
)
|
|
35
|
-
), O =
|
|
33
|
+
), O = t({
|
|
36
34
|
get: () => C.value.find(
|
|
37
|
-
(e) => e.id === String(
|
|
35
|
+
(e) => e.id === String(v.value)
|
|
38
36
|
),
|
|
39
|
-
set: (e) =>
|
|
40
|
-
}), D =
|
|
37
|
+
set: (e) => v.value = Number(e.id)
|
|
38
|
+
}), D = t(() => {
|
|
41
39
|
var i;
|
|
42
|
-
const e = ["oneOf", "anyOf"].includes(
|
|
40
|
+
const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) => b(l)));
|
|
43
41
|
return e || o;
|
|
44
42
|
}), I = (e) => e.find((o) => b(o)), L = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
|
|
45
43
|
(o) => o.oneOf || o.anyOf || o.allOf
|
|
46
|
-
), S = (e) => e.allOf && Array.isArray(e.allOf) ? L(e) ? e : w(e.allOf) : e, k =
|
|
47
|
-
const e =
|
|
48
|
-
return !o ||
|
|
44
|
+
), S = (e) => e.allOf && Array.isArray(e.allOf) ? L(e) ? e : w(e.allOf) : e, k = t(() => {
|
|
45
|
+
const e = s.value[s.composition], o = I(e);
|
|
46
|
+
return !o || s.composition !== "allOf" && o.allOf ? e.map(S) : (o.oneOf || o.anyOf || o.allOf).map(S);
|
|
49
47
|
}), U = (e) => {
|
|
50
48
|
var o, i;
|
|
51
49
|
if (e === "allOf") {
|
|
52
|
-
const l = (i = (o =
|
|
50
|
+
const l = (i = (o = s.value) == null ? void 0 : o[e]) == null ? void 0 : i.find(
|
|
53
51
|
(m) => b(m)
|
|
54
52
|
);
|
|
55
53
|
if (l != null && l.oneOf)
|
|
@@ -58,17 +56,17 @@ const K = { class: "property-rule" }, P = {
|
|
|
58
56
|
return "Any of";
|
|
59
57
|
}
|
|
60
58
|
return e.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).toLowerCase().replace(/^(\w)/, (l) => l.toUpperCase());
|
|
61
|
-
},
|
|
62
|
-
() => k.value[
|
|
63
|
-
), h =
|
|
59
|
+
}, a = t(
|
|
60
|
+
() => k.value[v.value]
|
|
61
|
+
), h = t(() => {
|
|
64
62
|
var e;
|
|
65
|
-
return (e =
|
|
66
|
-
}), q =
|
|
63
|
+
return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
|
|
64
|
+
}), q = t(() => {
|
|
67
65
|
var o;
|
|
68
66
|
const e = h.value;
|
|
69
|
-
return (o =
|
|
70
|
-
}), z =
|
|
71
|
-
const e =
|
|
67
|
+
return (o = a.value) == null ? void 0 : o[e];
|
|
68
|
+
}), z = t(() => {
|
|
69
|
+
const e = a.value;
|
|
72
70
|
return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
|
|
73
71
|
});
|
|
74
72
|
return (e, o) => {
|
|
@@ -87,7 +85,7 @@ const K = { class: "property-rule" }, P = {
|
|
|
87
85
|
value: n
|
|
88
86
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : u("", !0),
|
|
89
87
|
D.value ? (r(), c(N, { key: 1 }, [
|
|
90
|
-
y(
|
|
88
|
+
y(d(Z), {
|
|
91
89
|
modelValue: O.value,
|
|
92
90
|
"onUpdate:modelValue": o[0] || (o[0] = (n) => O.value = n),
|
|
93
91
|
options: C.value,
|
|
@@ -99,16 +97,16 @@ const K = { class: "property-rule" }, P = {
|
|
|
99
97
|
f("button", P, [
|
|
100
98
|
f("span", Q, V(U(e.composition)), 1),
|
|
101
99
|
f("span", X, V(((n = O.value) == null ? void 0 : n.label) || "Schema"), 1),
|
|
102
|
-
y(
|
|
100
|
+
y(d(G))
|
|
103
101
|
])
|
|
104
102
|
];
|
|
105
103
|
}),
|
|
106
104
|
_: 1
|
|
107
105
|
}, 8, ["modelValue", "options"]),
|
|
108
106
|
f("div", Y, [
|
|
109
|
-
(l =
|
|
110
|
-
y(
|
|
111
|
-
value:
|
|
107
|
+
(l = a.value) != null && l.description ? (r(), c("div", W, [
|
|
108
|
+
y(d($), {
|
|
109
|
+
value: a.value.description
|
|
112
110
|
}, null, 8, ["value"])
|
|
113
111
|
])) : u("", !0),
|
|
114
112
|
z.value ? (r(), p(g, {
|
|
@@ -119,13 +117,13 @@ const K = { class: "property-rule" }, P = {
|
|
|
119
117
|
name: e.name,
|
|
120
118
|
noncollapsible: !0,
|
|
121
119
|
schemas: e.schemas,
|
|
122
|
-
value: (m =
|
|
120
|
+
value: (m = a.value) != null && m.properties ? {
|
|
123
121
|
type: "object",
|
|
124
|
-
properties:
|
|
125
|
-
required:
|
|
126
|
-
} :
|
|
122
|
+
properties: a.value.properties,
|
|
123
|
+
required: a.value.required
|
|
124
|
+
} : a.value
|
|
127
125
|
}, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : u("", !0),
|
|
128
|
-
(A =
|
|
126
|
+
(A = a.value) != null && A.oneOf || (H = a.value) != null && H.anyOf ? (r(), p(i, {
|
|
129
127
|
key: 2,
|
|
130
128
|
compact: e.compact,
|
|
131
129
|
composition: h.value,
|
|
@@ -146,7 +144,7 @@ const K = { class: "property-rule" }, P = {
|
|
|
146
144
|
name: e.name,
|
|
147
145
|
noncollapsible: e.level == 0,
|
|
148
146
|
schemas: e.schemas,
|
|
149
|
-
value:
|
|
147
|
+
value: d(w)(e.value[e.composition])
|
|
150
148
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
|
|
151
149
|
]);
|
|
152
150
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
1
|
import type { Schemas } from '../../../../features/Operation/types/schemas';
|
|
2
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
3
3
|
/**
|
|
4
4
|
* Extract schema name from various schema formats
|
|
5
5
|
* Handles $ref, title, name, type, and schema dictionary lookup
|
|
6
6
|
*/
|
|
7
|
-
export declare function getModelNameFromSchema(schema: OpenAPIV3_1.SchemaObject
|
|
7
|
+
export declare function getModelNameFromSchema(schema: OpenAPIV3_1.SchemaObject): string | null;
|
|
8
8
|
/**
|
|
9
9
|
* Find schema name by matching against component schemas
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGxD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,MAAM,GAAG,IAAI,CA6CtF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAwB3G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,OAAO,EACjB,cAAc,UAAQ,EACtB,0BAA0B,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,GAC7E,MAAM,GAAG,IAAI,CA2Df;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAgBpD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,CAAC,YAAY,EAAE,EACvC,kBAAkB,EAAE,WAAW,CAAC,YAAY,EAAE,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,WAAW,CAAC,YAAY,EAAE,CA0B5B"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { stringify as
|
|
2
|
-
function
|
|
1
|
+
import { stringify as $ } from "flatted";
|
|
2
|
+
function s(t) {
|
|
3
3
|
if (!t)
|
|
4
4
|
return null;
|
|
5
5
|
if ("title" in t && t.title)
|
|
6
6
|
return t.title;
|
|
7
7
|
if ("name" in t && t.name)
|
|
8
8
|
return t.name;
|
|
9
|
-
if (r && typeof r == "object") {
|
|
10
|
-
for (const [i, n] of Object.entries(r))
|
|
11
|
-
if (p(n) === p(t))
|
|
12
|
-
return i;
|
|
13
|
-
}
|
|
14
9
|
if ("$ref" in t) {
|
|
15
10
|
const n = t.$ref.match(/\/([^\/]+)$/);
|
|
16
11
|
if (n)
|
|
@@ -21,56 +16,52 @@ function m(t, r) {
|
|
|
21
16
|
if ("type" in t && t.type)
|
|
22
17
|
return Array.isArray(t.type) ? t.type.join(" | ") : t.type;
|
|
23
18
|
if (typeof t == "object") {
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
19
|
+
const r = Object.keys(t);
|
|
20
|
+
if (r.length > 0)
|
|
21
|
+
return r[0];
|
|
27
22
|
}
|
|
28
23
|
return null;
|
|
29
24
|
}
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
if (!t || !r || typeof r != "object")
|
|
25
|
+
function b(t, r) {
|
|
26
|
+
var n, y;
|
|
27
|
+
if (!t || !r || typeof r != "object" || t.type !== "array" && t.type !== "object")
|
|
33
28
|
return null;
|
|
34
|
-
for (const [e,
|
|
35
|
-
if (
|
|
29
|
+
for (const [e, i] of Object.entries(r))
|
|
30
|
+
if (i.type === t.type && (t.type === "array" && ((n = i.items) == null ? void 0 : n.type) === ((y = t.items) == null ? void 0 : y.type) || t.type === "object" && i.properties && t.properties && $(i.properties) === $(t.properties)))
|
|
36
31
|
return e;
|
|
37
32
|
return null;
|
|
38
33
|
}
|
|
39
|
-
function
|
|
34
|
+
function p(t, r) {
|
|
40
35
|
return t === "array" ? `${t} ${r}[]` : `${t} ${r}`;
|
|
41
36
|
}
|
|
42
|
-
function
|
|
43
|
-
var
|
|
37
|
+
function u(t, r, n = !1, y) {
|
|
38
|
+
var o;
|
|
44
39
|
if (!(t != null && t.type))
|
|
45
40
|
return null;
|
|
46
|
-
if (
|
|
47
|
-
return t.type === "array" && ((
|
|
48
|
-
const e =
|
|
41
|
+
if (n)
|
|
42
|
+
return t.type === "array" && ((o = t.items) != null && o.type) ? `array ${t.items.type}[]` : null;
|
|
43
|
+
const e = s(t);
|
|
49
44
|
if (e && (t.title || t.name))
|
|
50
45
|
return t.type === "array" ? `array ${e}[]` : e;
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return t.type === "array" ? `array ${
|
|
46
|
+
const i = b(t, r);
|
|
47
|
+
if (i)
|
|
48
|
+
return t.type === "array" ? `array ${i}[]` : i;
|
|
54
49
|
if (t.type === "array" && t.items) {
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
50
|
+
if (y) {
|
|
51
|
+
const m = y(t.items, r);
|
|
52
|
+
if (m)
|
|
53
|
+
return p(t.type, m);
|
|
59
54
|
}
|
|
60
55
|
if (t.items.title || t.items.name)
|
|
61
|
-
return
|
|
62
|
-
const
|
|
63
|
-
return
|
|
56
|
+
return p(t.type, t.items.title || t.items.name);
|
|
57
|
+
const f = s(t.items);
|
|
58
|
+
return f && f !== t.items.type ? p(t.type, f) : t.items.type ? p(t.type, t.items.type) : p(t.type, "object");
|
|
64
59
|
}
|
|
65
60
|
return e && e !== t.type ? e.startsWith("Array of ") ? `array ${e.replace("Array of ", "")}[]` : e : null;
|
|
66
61
|
}
|
|
67
|
-
function b(t) {
|
|
68
|
-
return !t || ["anyOf", "oneOf", "allOf"].includes(t) ? !1 : /[A-Z]/.test(t) || /\s/.test(t) || /\(\d+\)/.test(t);
|
|
69
|
-
}
|
|
70
62
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
b as hasName
|
|
63
|
+
p as formatTypeWithModel,
|
|
64
|
+
u as getModelName,
|
|
65
|
+
s as getModelNameFromSchema,
|
|
66
|
+
b as getSchemaNameFromSchemas
|
|
76
67
|
};
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.31.
|
|
23
|
+
"version": "1.31.15",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=20"
|
|
26
26
|
},
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
"nanoid": "^5.1.5",
|
|
55
55
|
"vue": "^3.5.12",
|
|
56
56
|
"zod": "3.24.1",
|
|
57
|
-
"@scalar/api-client": "2.5.
|
|
57
|
+
"@scalar/api-client": "2.5.9",
|
|
58
|
+
"@scalar/code-highlight": "0.1.4",
|
|
59
|
+
"@scalar/components": "0.14.10",
|
|
58
60
|
"@scalar/helpers": "0.0.4",
|
|
59
61
|
"@scalar/icons": "0.4.3",
|
|
60
|
-
"@scalar/components": "0.14.9",
|
|
61
|
-
"@scalar/code-highlight": "0.1.4",
|
|
62
|
-
"@scalar/oas-utils": "0.4.5",
|
|
63
62
|
"@scalar/openapi-types": "0.3.3",
|
|
64
|
-
"@scalar/
|
|
63
|
+
"@scalar/oas-utils": "0.4.6",
|
|
65
64
|
"@scalar/openapi-parser": "0.18.0",
|
|
65
|
+
"@scalar/snippetz": "0.3.1",
|
|
66
66
|
"@scalar/themes": "0.13.3",
|
|
67
67
|
"@scalar/types": "0.2.3",
|
|
68
68
|
"@scalar/use-hooks": "0.2.2",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"vite-plugin-banner": "^0.7.1",
|
|
85
85
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
86
86
|
"vitest": "^1.6.0",
|
|
87
|
-
"@scalar/build-tooling": "0.2.3",
|
|
88
87
|
"@scalar/galaxy": "0.5.1",
|
|
89
|
-
"@scalar/react-renderer": "0.2.0"
|
|
88
|
+
"@scalar/react-renderer": "0.2.0",
|
|
89
|
+
"@scalar/build-tooling": "0.2.3"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"build": "pnpm build:default && pnpm build:standalone && pnpm types:build && tsc-alias -p tsconfig.build.json",
|