@scalar/api-reference 1.35.3 → 1.35.4
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 +11 -0
- package/dist/browser/standalone.js +2161 -2145
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +4 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +71 -65
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +4 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +44 -38
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +4 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +49 -41
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -0
- 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/Content/Schema/SchemaProperty.vue2.js +96 -88
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +20 -19
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +28 -25
- package/dist/features/api-client-modal/useApiClient.d.ts +90 -90
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +11 -11
|
@@ -10,6 +10,10 @@ type __VLS_Props = {
|
|
|
10
10
|
noncollapsible?: boolean;
|
|
11
11
|
/** Hide the heading */
|
|
12
12
|
hideHeading?: boolean;
|
|
13
|
+
/** Hide read-only properties */
|
|
14
|
+
hideReadOnly?: boolean;
|
|
15
|
+
/** Hide write-only properties */
|
|
16
|
+
hideWriteOnly?: boolean;
|
|
13
17
|
/** Show a special one way toggle for additional properties, also has a top border when open */
|
|
14
18
|
additionalProperties?: boolean;
|
|
15
19
|
/** Hide model names in type display */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AAoVA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAUrE,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,uBAAuB;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;AA8aF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Schema.vue2.js";
|
|
2
2
|
import "./Schema.vue3.js";
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6897f9dc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
3
|
-
import { ScalarMarkdown as
|
|
1
|
+
import { defineComponent as R, computed as B, createBlock as d, createCommentVNode as n, openBlock as l, unref as i, withCtx as s, createElementVNode as S, normalizeClass as m, createElementBlock as r, createVNode as o, withDirectives as C, createTextVNode as h, toDisplayString as y, vShow as N, normalizeStyle as M, Fragment as u } from "vue";
|
|
2
|
+
import { Disclosure as w, DisclosureButton as H, DisclosurePanel as W } from "@headlessui/vue";
|
|
3
|
+
import { ScalarMarkdown as D, ScalarIcon as p } from "@scalar/components";
|
|
4
4
|
import P from "../../ScreenReader.vue.js";
|
|
5
|
-
import { isTypeObject as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
5
|
+
import { isTypeObject as z } from "./helpers/is-type-object.js";
|
|
6
|
+
import A from "./SchemaHeading.vue.js";
|
|
7
|
+
import V from "./SchemaObjectProperties.vue.js";
|
|
8
|
+
import j from "./SchemaProperty.vue.js";
|
|
9
|
+
const T = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "schema-card-description"
|
|
12
|
-
},
|
|
12
|
+
}, $ = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "schema-properties"
|
|
15
|
-
},
|
|
15
|
+
}, Q = /* @__PURE__ */ R({
|
|
16
16
|
__name: "Schema",
|
|
17
17
|
props: {
|
|
18
18
|
schema: {},
|
|
@@ -21,98 +21,100 @@ const E = {
|
|
|
21
21
|
compact: { type: Boolean },
|
|
22
22
|
noncollapsible: { type: Boolean, default: !1 },
|
|
23
23
|
hideHeading: { type: Boolean },
|
|
24
|
+
hideReadOnly: { type: Boolean },
|
|
25
|
+
hideWriteOnly: { type: Boolean },
|
|
24
26
|
additionalProperties: { type: Boolean },
|
|
25
27
|
hideModelNames: { type: Boolean, default: !1 },
|
|
26
28
|
discriminator: {},
|
|
27
29
|
breadcrumb: {}
|
|
28
30
|
},
|
|
29
31
|
setup(a) {
|
|
30
|
-
const
|
|
31
|
-
var e,
|
|
32
|
-
return (e = a.schema) != null && e.allOf && a.schema.allOf.length > 0 && a.name === "Request Body" ? a.schema.description || a.schema.allOf[0].description : !((
|
|
32
|
+
const f = B(() => !a.noncollapsible && a.level > 0), v = B(() => {
|
|
33
|
+
var e, c;
|
|
34
|
+
return (e = a.schema) != null && e.allOf && a.schema.allOf.length > 0 && a.name === "Request Body" ? a.schema.description || a.schema.allOf[0].description : !((c = a.schema) != null && c.description) || typeof a.schema.description != "string" || a.schema.oneOf || a.schema.anyOf || a.schema.enum || !("properties" in a.schema) && !("patternProperties" in a.schema) && !("additionalProperties" in a.schema) ? null : a.schema.description;
|
|
33
35
|
}), b = (e) => a.noncollapsible && e.stopPropagation();
|
|
34
|
-
return (e,
|
|
36
|
+
return (e, c) => typeof e.schema == "object" && Object.keys(e.schema).length ? (l(), d(i(w), {
|
|
35
37
|
key: 0,
|
|
36
38
|
defaultOpen: e.noncollapsible
|
|
37
39
|
}, {
|
|
38
|
-
default:
|
|
39
|
-
|
|
40
|
-
class:
|
|
40
|
+
default: s(({ open: t }) => [
|
|
41
|
+
S("div", {
|
|
42
|
+
class: m(["schema-card", [
|
|
41
43
|
`schema-card--level-${e.level}`,
|
|
42
44
|
{ "schema-card--compact": e.compact, "schema-card--open": t },
|
|
43
45
|
{ "border-t": e.additionalProperties && t }
|
|
44
46
|
]])
|
|
45
47
|
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
])) :
|
|
49
|
-
|
|
50
|
-
class:
|
|
48
|
+
v.value ? (l(), r("div", T, [
|
|
49
|
+
o(i(D), { value: v.value }, null, 8, ["value"])
|
|
50
|
+
])) : n("", !0),
|
|
51
|
+
S("div", {
|
|
52
|
+
class: m(["schema-properties", {
|
|
51
53
|
"schema-properties-open": t
|
|
52
54
|
}])
|
|
53
55
|
}, [
|
|
54
|
-
e.additionalProperties ?
|
|
55
|
-
|
|
56
|
+
e.additionalProperties ? C((l(), r("div", $, [
|
|
57
|
+
o(i(H), {
|
|
56
58
|
as: "button",
|
|
57
59
|
class: "schema-card-title schema-card-title--compact",
|
|
58
60
|
onClickCapture: b
|
|
59
61
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
|
|
62
|
+
default: s(() => [
|
|
63
|
+
o(i(p), {
|
|
62
64
|
class: "schema-card-title-icon",
|
|
63
65
|
icon: "Add",
|
|
64
66
|
size: "sm"
|
|
65
67
|
}),
|
|
66
|
-
|
|
67
|
-
e.name ? (l(),
|
|
68
|
-
default:
|
|
69
|
-
h("for " +
|
|
68
|
+
c[0] || (c[0] = h(" Show additional properties ")),
|
|
69
|
+
e.name ? (l(), d(P, { key: 0 }, {
|
|
70
|
+
default: s(() => [
|
|
71
|
+
h("for " + y(e.name), 1)
|
|
70
72
|
]),
|
|
71
73
|
_: 1
|
|
72
|
-
})) :
|
|
74
|
+
})) : n("", !0)
|
|
73
75
|
]),
|
|
74
76
|
_: 1,
|
|
75
77
|
__: [0]
|
|
76
78
|
})
|
|
77
79
|
], 512)), [
|
|
78
|
-
[
|
|
79
|
-
]) :
|
|
80
|
+
[N, !t]
|
|
81
|
+
]) : f.value ? C((l(), d(i(H), {
|
|
80
82
|
key: 1,
|
|
81
83
|
as: e.noncollapsible ? "div" : "button",
|
|
82
|
-
class:
|
|
83
|
-
style:
|
|
84
|
+
class: m(["schema-card-title", { "schema-card-title--compact": e.compact }]),
|
|
85
|
+
style: M({
|
|
84
86
|
top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
|
|
85
87
|
}),
|
|
86
88
|
onClickCapture: b
|
|
87
89
|
}, {
|
|
88
|
-
default:
|
|
89
|
-
var k, g
|
|
90
|
+
default: s(() => {
|
|
91
|
+
var O, k, g;
|
|
90
92
|
return [
|
|
91
|
-
e.compact ? (l(),
|
|
92
|
-
|
|
93
|
-
class:
|
|
93
|
+
e.compact ? (l(), r(u, { key: 0 }, [
|
|
94
|
+
o(i(p), {
|
|
95
|
+
class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
94
96
|
icon: "Add",
|
|
95
97
|
size: "sm"
|
|
96
98
|
}, null, 8, ["class"]),
|
|
97
|
-
t ? (l(),
|
|
98
|
-
h(" Hide " +
|
|
99
|
-
], 64)) : (l(),
|
|
100
|
-
h(" Show " +
|
|
99
|
+
t ? (l(), r(u, { key: 0 }, [
|
|
100
|
+
h(" Hide " + y(((O = e.schema) == null ? void 0 : O.title) ?? "Child Attributes"), 1)
|
|
101
|
+
], 64)) : (l(), r(u, { key: 1 }, [
|
|
102
|
+
h(" Show " + y(((k = e.schema) == null ? void 0 : k.title) ?? "Child Attributes"), 1)
|
|
101
103
|
], 64)),
|
|
102
|
-
e.name ? (l(),
|
|
103
|
-
default:
|
|
104
|
-
h("for " +
|
|
104
|
+
e.name ? (l(), d(P, { key: 2 }, {
|
|
105
|
+
default: s(() => [
|
|
106
|
+
h("for " + y(e.name), 1)
|
|
105
107
|
]),
|
|
106
108
|
_: 1
|
|
107
|
-
})) :
|
|
108
|
-
], 64)) : (l(),
|
|
109
|
-
|
|
110
|
-
class:
|
|
109
|
+
})) : n("", !0)
|
|
110
|
+
], 64)) : (l(), r(u, { key: 1 }, [
|
|
111
|
+
o(i(p), {
|
|
112
|
+
class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
111
113
|
icon: "Add",
|
|
112
114
|
size: "sm"
|
|
113
115
|
}, null, 8, ["class"]),
|
|
114
|
-
|
|
115
|
-
name: ((
|
|
116
|
+
o(A, {
|
|
117
|
+
name: ((g = e.schema) == null ? void 0 : g.title) ?? e.name,
|
|
116
118
|
value: e.schema
|
|
117
119
|
}, null, 8, ["name", "value"])
|
|
118
120
|
], 64))
|
|
@@ -120,44 +122,48 @@ const E = {
|
|
|
120
122
|
}),
|
|
121
123
|
_: 2
|
|
122
124
|
}, 1032, ["as", "class", "style"])), [
|
|
123
|
-
[
|
|
124
|
-
]) :
|
|
125
|
-
!e.additionalProperties || t ? (l(),
|
|
125
|
+
[N, !e.hideHeading && !(e.noncollapsible && e.compact)]
|
|
126
|
+
]) : n("", !0),
|
|
127
|
+
!e.additionalProperties || t ? (l(), d(i(W), {
|
|
126
128
|
key: 2,
|
|
127
129
|
as: "ul",
|
|
128
|
-
static: !
|
|
130
|
+
static: !f.value
|
|
129
131
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
i(
|
|
132
|
+
default: s(() => [
|
|
133
|
+
i(z)(e.schema) ? (l(), d(V, {
|
|
132
134
|
key: 0,
|
|
133
135
|
breadcrumb: e.breadcrumb,
|
|
134
136
|
compact: e.compact,
|
|
135
137
|
discriminator: e.discriminator,
|
|
136
138
|
hideHeading: e.hideHeading,
|
|
137
139
|
hideModelNames: e.hideModelNames,
|
|
140
|
+
hideReadOnly: e.hideReadOnly,
|
|
141
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
138
142
|
level: e.level + 1,
|
|
139
143
|
schema: e.schema
|
|
140
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "schema"])) : (l(),
|
|
141
|
-
e.schema ? (l(),
|
|
144
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "schema"])) : (l(), r(u, { key: 1 }, [
|
|
145
|
+
e.schema ? (l(), d(j, {
|
|
142
146
|
key: 0,
|
|
143
147
|
breadcrumb: e.breadcrumb,
|
|
144
148
|
compact: e.compact,
|
|
145
149
|
hideHeading: e.hideHeading,
|
|
146
150
|
hideModelNames: e.hideModelNames,
|
|
151
|
+
hideReadOnly: e.hideReadOnly,
|
|
152
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
147
153
|
level: e.level,
|
|
148
154
|
value: e.schema
|
|
149
|
-
}, null, 8, ["breadcrumb", "compact", "hideHeading", "hideModelNames", "level", "value"])) :
|
|
155
|
+
}, null, 8, ["breadcrumb", "compact", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "value"])) : n("", !0)
|
|
150
156
|
], 64))
|
|
151
157
|
]),
|
|
152
158
|
_: 1
|
|
153
|
-
}, 8, ["static"])) :
|
|
159
|
+
}, 8, ["static"])) : n("", !0)
|
|
154
160
|
], 2)
|
|
155
161
|
], 2)
|
|
156
162
|
]),
|
|
157
163
|
_: 1
|
|
158
|
-
}, 8, ["defaultOpen"])) :
|
|
164
|
+
}, 8, ["defaultOpen"])) : n("", !0);
|
|
159
165
|
}
|
|
160
166
|
});
|
|
161
167
|
export {
|
|
162
|
-
|
|
168
|
+
Q as default
|
|
163
169
|
};
|
|
@@ -15,6 +15,10 @@ type __VLS_Props = {
|
|
|
15
15
|
compact?: boolean;
|
|
16
16
|
/** Whether to hide the heading */
|
|
17
17
|
hideHeading?: boolean;
|
|
18
|
+
/** Whether to hide read-only properties */
|
|
19
|
+
hideReadOnly?: boolean;
|
|
20
|
+
/** Hide write-only properties */
|
|
21
|
+
hideWriteOnly?: boolean;
|
|
18
22
|
/** Breadcrumb for navigation */
|
|
19
23
|
breadcrumb?: string[];
|
|
20
24
|
};
|
|
@@ -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":"AAwJA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGtE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,KAAK,EAAE,YAAY,CAAA;IACnB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;aATU,OAAO;iBAEH,OAAO;;AA+NzB,wBAOG"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { ScalarIconCaretDown as
|
|
5
|
-
import { getResolvedRef as
|
|
6
|
-
import { getSchemaType as
|
|
7
|
-
import { mergeAllOfSchemas as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as O, computed as d, ref as C, createElementBlock as m, openBlock as t, createBlock as S, unref as s, Fragment as R, createVNode as c, createElementVNode as r, withCtx as B, createCommentVNode as H, toDisplayString as v, normalizeClass as W } from "vue";
|
|
2
|
+
import { ScalarListbox as k } from "@scalar/components";
|
|
3
|
+
import { isDefined as V } from "@scalar/helpers/array/is-defined";
|
|
4
|
+
import { ScalarIconCaretDown as w } from "@scalar/icons";
|
|
5
|
+
import { getResolvedRef as N } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
6
|
+
import { getSchemaType as z } from "./helpers/get-schema-type.js";
|
|
7
|
+
import { mergeAllOfSchemas as D } from "./helpers/merge-all-of-schemas.js";
|
|
8
|
+
import f from "./Schema.vue.js";
|
|
9
|
+
const U = { class: "property-rule" }, A = {
|
|
10
10
|
class: "composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border border-b-0 px-2 py-1.25 pr-3 text-left",
|
|
11
11
|
type: "button"
|
|
12
|
-
},
|
|
12
|
+
}, E = { class: "text-c-2" }, L = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "text-red"
|
|
15
|
-
}, T = { class: "composition-panel" }, K = /* @__PURE__ */
|
|
15
|
+
}, T = { class: "composition-panel" }, K = /* @__PURE__ */ O({
|
|
16
16
|
__name: "SchemaComposition",
|
|
17
17
|
props: {
|
|
18
18
|
composition: {},
|
|
@@ -22,65 +22,71 @@ const A = { class: "property-rule" }, E = {
|
|
|
22
22
|
level: {},
|
|
23
23
|
compact: { type: Boolean, default: !1 },
|
|
24
24
|
hideHeading: { type: Boolean, default: !1 },
|
|
25
|
+
hideReadOnly: { type: Boolean },
|
|
26
|
+
hideWriteOnly: { type: Boolean },
|
|
25
27
|
breadcrumb: {}
|
|
26
28
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const a =
|
|
29
|
-
() => [a.value[a.composition]].flat().map((e) => ({ value:
|
|
30
|
-
), u =
|
|
31
|
-
() =>
|
|
29
|
+
setup(y) {
|
|
30
|
+
const a = y, p = d(
|
|
31
|
+
() => [a.value[a.composition]].flat().map((e) => ({ value: N(e), original: e })).filter((e) => V(e.value))
|
|
32
|
+
), u = d(
|
|
33
|
+
() => p.value.map((e, o) => ({
|
|
32
34
|
id: String(o),
|
|
33
|
-
label:
|
|
35
|
+
label: z(e.original) || "Schema"
|
|
34
36
|
}))
|
|
35
|
-
),
|
|
36
|
-
() =>
|
|
37
|
+
), i = C(u.value[0]), g = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (o) => o.toUpperCase()).toLowerCase().replace(/^(\w)/, (o) => o.toUpperCase()), n = d(
|
|
38
|
+
() => p.value[Number(i.value.id)].value
|
|
37
39
|
);
|
|
38
|
-
return (e, o) => (
|
|
39
|
-
a.composition === "allOf" ? (
|
|
40
|
+
return (e, o) => (t(), m("div", U, [
|
|
41
|
+
a.composition === "allOf" ? (t(), S(f, {
|
|
40
42
|
key: 0,
|
|
41
43
|
breadcrumb: e.breadcrumb,
|
|
42
44
|
compact: e.compact,
|
|
43
45
|
discriminator: e.discriminator,
|
|
44
46
|
hideHeading: e.hideHeading,
|
|
47
|
+
hideReadOnly: e.hideReadOnly,
|
|
48
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
45
49
|
level: e.level,
|
|
46
50
|
name: e.name,
|
|
47
51
|
noncollapsible: !0,
|
|
48
|
-
schema:
|
|
49
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "level", "name", "schema"])) : (
|
|
50
|
-
|
|
51
|
-
modelValue:
|
|
52
|
-
"onUpdate:modelValue": o[0] || (o[0] = (l) =>
|
|
52
|
+
schema: s(D)(a.value)
|
|
53
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideReadOnly", "hideWriteOnly", "level", "name", "schema"])) : (t(), m(R, { key: 1 }, [
|
|
54
|
+
c(s(k), {
|
|
55
|
+
modelValue: i.value,
|
|
56
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => i.value = l),
|
|
53
57
|
options: u.value,
|
|
54
58
|
resize: ""
|
|
55
59
|
}, {
|
|
56
|
-
default:
|
|
57
|
-
var l,
|
|
60
|
+
default: B(() => {
|
|
61
|
+
var l, h, b;
|
|
58
62
|
return [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class:
|
|
63
|
+
r("button", A, [
|
|
64
|
+
r("span", E, v(g(a.composition)), 1),
|
|
65
|
+
r("span", {
|
|
66
|
+
class: W(["composition-selector-label text-c-1", {
|
|
63
67
|
"line-through": (l = n.value) == null ? void 0 : l.deprecated
|
|
64
68
|
}])
|
|
65
|
-
},
|
|
66
|
-
(
|
|
67
|
-
|
|
69
|
+
}, v(((h = i.value) == null ? void 0 : h.label) || "Schema"), 3),
|
|
70
|
+
(b = n.value) != null && b.deprecated ? (t(), m("div", L, " deprecated ")) : H("", !0),
|
|
71
|
+
c(s(w))
|
|
68
72
|
])
|
|
69
73
|
];
|
|
70
74
|
}),
|
|
71
75
|
_: 1
|
|
72
76
|
}, 8, ["modelValue", "options"]),
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
r("div", T, [
|
|
78
|
+
c(f, {
|
|
75
79
|
breadcrumb: e.breadcrumb,
|
|
76
80
|
compact: e.compact,
|
|
77
81
|
discriminator: e.discriminator,
|
|
78
82
|
hideHeading: e.hideHeading,
|
|
83
|
+
hideReadOnly: e.hideReadOnly,
|
|
84
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
79
85
|
level: e.level + 1,
|
|
80
86
|
name: e.name,
|
|
81
87
|
noncollapsible: !0,
|
|
82
88
|
schema: n.value
|
|
83
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "level", "name", "schema"])
|
|
89
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideReadOnly", "hideWriteOnly", "level", "name", "schema"])
|
|
84
90
|
])
|
|
85
91
|
], 64))
|
|
86
92
|
]));
|
|
@@ -7,6 +7,10 @@ type __VLS_Props = {
|
|
|
7
7
|
hideHeading?: boolean;
|
|
8
8
|
level?: number;
|
|
9
9
|
hideModelNames?: boolean;
|
|
10
|
+
/** Hide readonly properties */
|
|
11
|
+
hideReadOnly?: boolean;
|
|
12
|
+
/** Hide write-only properties */
|
|
13
|
+
hideWriteOnly?: boolean;
|
|
10
14
|
breadcrumb?: string[];
|
|
11
15
|
orderSchemaPropertiesBy?: ApiReferenceConfiguration['orderSchemaPropertiesBy'];
|
|
12
16
|
orderRequiredPropertiesFirst?: ApiReferenceConfiguration['orderRequiredPropertiesFirst'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAiNA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAOrE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,uBAAuB,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;IAC9E,4BAA4B,CAAC,EAAE,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;CACzF,CAAC;;AAiQF,wBAMG"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getResolvedRef as
|
|
3
|
-
import { isTypeObject as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as W, computed as B, createElementBlock as l, openBlock as d, Fragment as s, createCommentVNode as h, createBlock as c, unref as n, renderList as N } from "vue";
|
|
2
|
+
import { getResolvedRef as o } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { isTypeObject as m } from "./helpers/is-type-object.js";
|
|
4
|
+
import u from "./SchemaProperty.vue.js";
|
|
5
|
+
const k = /* @__PURE__ */ W({
|
|
6
6
|
__name: "SchemaObjectProperties",
|
|
7
7
|
props: {
|
|
8
8
|
schema: {},
|
|
@@ -11,81 +11,89 @@ const O = /* @__PURE__ */ j({
|
|
|
11
11
|
hideHeading: { type: Boolean },
|
|
12
12
|
level: {},
|
|
13
13
|
hideModelNames: { type: Boolean },
|
|
14
|
+
hideReadOnly: { type: Boolean },
|
|
15
|
+
hideWriteOnly: { type: Boolean },
|
|
14
16
|
breadcrumb: {},
|
|
15
17
|
orderSchemaPropertiesBy: { default: "alpha" },
|
|
16
18
|
orderRequiredPropertiesFirst: { default: !0 }
|
|
17
19
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
20
|
+
setup(r) {
|
|
21
|
+
const g = B(() => {
|
|
22
|
+
if (!m(r.schema) || !r.schema.properties)
|
|
21
23
|
return [];
|
|
22
|
-
const e = Object.keys(
|
|
23
|
-
return e.sort((
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
24
|
+
const e = Object.keys(r.schema.properties), a = new Set(r.schema.required || []);
|
|
25
|
+
return e.sort((i, t) => {
|
|
26
|
+
var f, v;
|
|
27
|
+
const y = i === ((f = r.discriminator) == null ? void 0 : f.propertyName), p = t === ((v = r.discriminator) == null ? void 0 : v.propertyName), b = a.has(i), O = a.has(t);
|
|
28
|
+
if (y && !p)
|
|
27
29
|
return -1;
|
|
28
|
-
if (!
|
|
30
|
+
if (!y && p)
|
|
29
31
|
return 1;
|
|
30
|
-
if (
|
|
31
|
-
if (
|
|
32
|
+
if (r.orderRequiredPropertiesFirst) {
|
|
33
|
+
if (b && !O)
|
|
32
34
|
return -1;
|
|
33
|
-
if (!
|
|
35
|
+
if (!b && O)
|
|
34
36
|
return 1;
|
|
35
37
|
}
|
|
36
|
-
return
|
|
37
|
-
});
|
|
38
|
-
}),
|
|
39
|
-
const a =
|
|
38
|
+
return r.orderSchemaPropertiesBy === "alpha" ? i.localeCompare(t) : 0;
|
|
39
|
+
}).filter((i) => r.hideReadOnly ? !(r.schema.properties && o(r.schema.properties[i]).readOnly === !0) : r.hideWriteOnly ? !(r.schema.properties && o(r.schema.properties[i]).writeOnly === !0) : !0);
|
|
40
|
+
}), R = (e) => {
|
|
41
|
+
const a = o(e);
|
|
40
42
|
return typeof a == "object" && typeof a["x-additionalPropertiesName"] == "string" && a["x-additionalPropertiesName"].trim().length > 0 ? `${a["x-additionalPropertiesName"].trim()}*` : "propertyName*";
|
|
41
|
-
},
|
|
43
|
+
}, P = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
|
|
42
44
|
// @ts-expect-error - ask hans
|
|
43
45
|
type: "anything",
|
|
44
46
|
...typeof e == "object" ? e : {}
|
|
45
47
|
} : e;
|
|
46
|
-
return (e, a) => (
|
|
47
|
-
m
|
|
48
|
+
return (e, a) => (d(), l(s, null, [
|
|
49
|
+
n(m)(e.schema) && e.schema.properties ? (d(!0), l(s, { key: 0 }, N(g.value, (i) => {
|
|
48
50
|
var t;
|
|
49
|
-
return
|
|
50
|
-
key:
|
|
51
|
+
return d(), c(u, {
|
|
52
|
+
key: i,
|
|
51
53
|
breadcrumb: e.breadcrumb,
|
|
52
54
|
compact: e.compact,
|
|
53
55
|
discriminator: e.discriminator,
|
|
54
56
|
hideHeading: e.hideHeading,
|
|
55
57
|
hideModelNames: e.hideModelNames,
|
|
58
|
+
hideReadOnly: e.hideReadOnly,
|
|
59
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
56
60
|
level: e.level,
|
|
57
|
-
name:
|
|
58
|
-
required: (t = e.schema.required) == null ? void 0 : t.includes(
|
|
59
|
-
value:
|
|
60
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "required", "value"]);
|
|
61
|
-
}), 128)) :
|
|
62
|
-
m
|
|
63
|
-
key:
|
|
61
|
+
name: i,
|
|
62
|
+
required: (t = e.schema.required) == null ? void 0 : t.includes(i),
|
|
63
|
+
value: n(o)(e.schema.properties[i])
|
|
64
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "required", "value"]);
|
|
65
|
+
}), 128)) : h("", !0),
|
|
66
|
+
n(m)(e.schema) && e.schema.patternProperties ? (d(!0), l(s, { key: 1 }, N(Object.entries(e.schema.patternProperties), ([i, t]) => (d(), c(u, {
|
|
67
|
+
key: i,
|
|
64
68
|
breadcrumb: e.breadcrumb,
|
|
65
69
|
compact: e.compact,
|
|
66
70
|
discriminator: e.discriminator,
|
|
67
71
|
hideHeading: e.hideHeading,
|
|
68
72
|
hideModelNames: e.hideModelNames,
|
|
73
|
+
hideReadOnly: e.hideReadOnly,
|
|
74
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
69
75
|
level: e.level,
|
|
70
|
-
name:
|
|
71
|
-
value:
|
|
72
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "value"]))), 128)) :
|
|
73
|
-
m
|
|
76
|
+
name: i,
|
|
77
|
+
value: n(o)(t)
|
|
78
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "value"]))), 128)) : h("", !0),
|
|
79
|
+
n(m)(e.schema) && e.schema.additionalProperties ? (d(), c(u, {
|
|
74
80
|
key: 2,
|
|
75
81
|
breadcrumb: e.breadcrumb,
|
|
76
82
|
compact: e.compact,
|
|
77
83
|
discriminator: e.discriminator,
|
|
78
84
|
hideHeading: e.hideHeading,
|
|
79
85
|
hideModelNames: e.hideModelNames,
|
|
86
|
+
hideReadOnly: e.hideReadOnly,
|
|
87
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
80
88
|
level: e.level,
|
|
81
|
-
name:
|
|
89
|
+
name: R(e.schema.additionalProperties),
|
|
82
90
|
noncollapsible: "",
|
|
83
|
-
value:
|
|
91
|
+
value: P(e.schema.additionalProperties),
|
|
84
92
|
variant: "additionalProperties"
|
|
85
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "value"])) :
|
|
93
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "value"])) : h("", !0)
|
|
86
94
|
], 64));
|
|
87
95
|
}
|
|
88
96
|
});
|
|
89
97
|
export {
|
|
90
|
-
|
|
98
|
+
k as default
|
|
91
99
|
};
|
|
@@ -18,6 +18,10 @@ type __VLS_Props = {
|
|
|
18
18
|
description?: string;
|
|
19
19
|
hideModelNames?: boolean;
|
|
20
20
|
hideHeading?: boolean;
|
|
21
|
+
/** Hide read-only properties */
|
|
22
|
+
hideReadOnly?: boolean;
|
|
23
|
+
/** Hide write-only properties */
|
|
24
|
+
hideWriteOnly?: boolean;
|
|
21
25
|
variant?: 'additionalProperties' | 'patternProperties';
|
|
22
26
|
breadcrumb?: string[];
|
|
23
27
|
};
|
|
@@ -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":"AAijBA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAErE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAa9C;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;;AA+jB5B,0BAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaProperty.vue2.js";
|
|
2
2
|
import "./SchemaProperty.vue3.js";
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7569fa08"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|