@scalar/api-reference 1.30.0 → 1.31.0
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 +42 -0
- package/dist/browser/standalone.js +6352 -6334
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +164 -181
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +56 -51
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +1 -1
- package/dist/components/Content/Content.vue2.js +5 -5
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue2.js +57 -63
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +46 -46
- package/dist/components/Content/Models/Models.vue.d.ts +2 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +7 -6
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts +2 -2
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.preview.d.ts +98 -56
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +6 -3
- 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 +127 -118
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +57 -53
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -2
- 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 +40 -38
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +152 -152
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -2
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.d.ts +2 -2
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +3 -3
- package/dist/components/Layouts/ClassicLayout.vue.js +10 -8
- package/dist/components/Layouts/Layouts.vue.js +11 -9
- package/dist/components/Layouts/ModernLayout.vue2.js +22 -20
- package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeader.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +56 -56
- package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
- package/dist/components/SingleApiReference.vue.js +27 -33
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -50
- package/dist/features/ApiClientModal/useApiClient.d.ts +196 -196
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts +11 -0
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +1 -0
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +38 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +21 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.js +94 -0
- package/dist/features/DocumentSource/index.d.ts +2 -0
- package/dist/features/DocumentSource/index.d.ts.map +1 -0
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue2.js +18 -17
- package/dist/features/DownloadLink/index.d.ts +1 -0
- package/dist/features/DownloadLink/index.d.ts.map +1 -1
- package/dist/features/DownloadLink/openapi-version-symbol.d.ts +2 -0
- package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +1 -0
- package/dist/features/DownloadLink/openapi-version-symbol.js +4 -0
- package/dist/features/Operation/Operation.vue.d.ts +2 -2
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -2
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -2
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
- package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -6
- package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -2
- 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/layouts/ClassicLayout.vue.d.ts +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +55 -55
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +35 -32
- package/dist/features/Operation/types/schemas.d.ts +2 -2
- package/dist/features/Operation/types/schemas.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/helpers/local-storage.d.ts +8 -0
- package/dist/helpers/local-storage.d.ts.map +1 -0
- package/dist/helpers/local-storage.js +6 -0
- package/dist/helpers/measure.d.ts +21 -0
- package/dist/helpers/measure.d.ts.map +1 -0
- package/dist/helpers/measure.js +7 -0
- package/dist/helpers/parse.d.ts +3 -5
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +64 -86
- package/dist/helpers/scroll-to-id.d.ts.map +1 -1
- package/dist/helpers/scroll-to-id.js +18 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -35
- package/dist/libs/openapi.d.ts +3 -3
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +35 -42
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.js +15 -15
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +19 -18
- package/dist/style.css +1 -1
- package/dist/types.d.ts +27 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -14
- package/dist/hooks/useReactiveSpec.d.ts +0 -448
- package/dist/hooks/useReactiveSpec.d.ts.map +0 -1
- package/dist/hooks/useReactiveSpec.js +0 -59
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
3
|
-
import { ScalarMarkdown as
|
|
4
|
-
import { getDiscriminatorMapping as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as L, ref as R, computed as p, watch as U, createBlock as o, createCommentVNode as s, openBlock as l, unref as n, withCtx as v, createElementVNode as V, normalizeClass as N, createElementBlock as t, withDirectives as z, createVNode as h, createTextVNode as P, toDisplayString as H, vShow as A, normalizeStyle as G, Fragment as d, renderList as q } from "vue";
|
|
2
|
+
import { Disclosure as J, DisclosureButton as T, DisclosurePanel as K } from "@headlessui/vue";
|
|
3
|
+
import { ScalarMarkdown as Q, ScalarIcon as S } from "@scalar/components";
|
|
4
|
+
import { getDiscriminatorMapping as W, getDiscriminatorPropertyName as X, mergeDiscriminatorSchemas as Y } from "./helpers/schema-discriminator.js";
|
|
5
|
+
import Z from "./SchemaDiscriminator.vue.js";
|
|
6
|
+
import $ from "../../ScreenReader.vue.js";
|
|
7
|
+
import _ from "./SchemaHeading.vue.js";
|
|
8
|
+
import b from "./SchemaProperty.vue.js";
|
|
9
|
+
const x = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "schema-card-description"
|
|
12
|
-
},
|
|
12
|
+
}, ee = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "schema-properties"
|
|
15
|
-
},
|
|
15
|
+
}, de = /* @__PURE__ */ L({
|
|
16
16
|
__name: "Schema",
|
|
17
17
|
props: {
|
|
18
18
|
value: { type: [Object, Boolean] },
|
|
@@ -22,115 +22,119 @@ const Z = {
|
|
|
22
22
|
noncollapsible: { type: Boolean, default: !1 },
|
|
23
23
|
hideHeading: { type: Boolean },
|
|
24
24
|
additionalProperties: { type: Boolean },
|
|
25
|
+
hideModelNames: { type: Boolean, default: !1 },
|
|
25
26
|
schemas: {}
|
|
26
27
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
return
|
|
31
|
-
}),
|
|
32
|
-
if (
|
|
33
|
-
return
|
|
34
|
-
}), a =
|
|
35
|
-
if (
|
|
36
|
-
return !
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
) ||
|
|
41
|
-
}),
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
setup(E) {
|
|
29
|
+
const i = E, m = R(""), c = p(() => {
|
|
30
|
+
if (i.value)
|
|
31
|
+
return W(i.value);
|
|
32
|
+
}), F = p(() => c.value && Object.keys(c.value)[0] || ""), D = p(() => {
|
|
33
|
+
if (i.value)
|
|
34
|
+
return X(i.value);
|
|
35
|
+
}), a = p(() => {
|
|
36
|
+
if (i.value)
|
|
37
|
+
return !c.value || !m.value ? i.value : Y(
|
|
38
|
+
i.value,
|
|
39
|
+
m.value,
|
|
40
|
+
i.schemas
|
|
41
|
+
) || i.value;
|
|
42
|
+
}), C = p(() => !(i.noncollapsible || i.level === 0)), I = p(() => {
|
|
43
|
+
var e;
|
|
44
|
+
return !(!((e = a.value) != null && e.description) || typeof a.value.description != "string" || a.value.allOf || a.value.oneOf || a.value.anyOf || a.value.enum || i.level === 0);
|
|
45
|
+
}), O = (e) => i.noncollapsible && e.stopPropagation();
|
|
46
|
+
return U(
|
|
47
|
+
c,
|
|
44
48
|
(e) => {
|
|
45
|
-
e && !
|
|
49
|
+
e && !m.value && (m.value = F.value);
|
|
46
50
|
},
|
|
47
51
|
{ immediate: !0 }
|
|
48
|
-
), (e,
|
|
52
|
+
), (e, M) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), o(n(J), {
|
|
49
53
|
key: 0,
|
|
50
54
|
defaultOpen: e.noncollapsible
|
|
51
55
|
}, {
|
|
52
|
-
default:
|
|
53
|
-
var
|
|
56
|
+
default: v(({ open: u }) => {
|
|
57
|
+
var B, w;
|
|
54
58
|
return [
|
|
55
59
|
V("div", {
|
|
56
|
-
class:
|
|
60
|
+
class: N(["schema-card", [
|
|
57
61
|
`schema-card--level-${e.level}`,
|
|
58
|
-
{ "schema-card--compact": e.compact, "schema-card--open":
|
|
59
|
-
{ "border-t
|
|
62
|
+
{ "schema-card--compact": e.compact, "schema-card--open": u },
|
|
63
|
+
{ "border-t": e.additionalProperties && u }
|
|
60
64
|
]])
|
|
61
65
|
}, [
|
|
62
|
-
|
|
63
|
-
a.value.enum ?
|
|
66
|
+
I.value ? (l(), t("div", x, [
|
|
67
|
+
(B = a.value) != null && B.enum ? s("", !0) : (l(), o(n(Q), {
|
|
64
68
|
key: 0,
|
|
65
|
-
value: a.value.description
|
|
69
|
+
value: (w = a.value) == null ? void 0 : w.description
|
|
66
70
|
}, null, 8, ["value"]))
|
|
67
|
-
])) :
|
|
71
|
+
])) : s("", !0),
|
|
68
72
|
V("div", {
|
|
69
|
-
class:
|
|
70
|
-
"schema-properties-open":
|
|
73
|
+
class: N(["schema-properties", {
|
|
74
|
+
"schema-properties-open": u
|
|
71
75
|
}])
|
|
72
76
|
}, [
|
|
73
|
-
e.additionalProperties ? z((l(),
|
|
74
|
-
|
|
77
|
+
e.additionalProperties ? z((l(), t("div", ee, [
|
|
78
|
+
h(n(T), {
|
|
75
79
|
as: "button",
|
|
76
80
|
class: "schema-card-title schema-card-title--compact",
|
|
77
|
-
onClickCapture:
|
|
81
|
+
onClickCapture: O
|
|
78
82
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
|
|
83
|
+
default: v(() => [
|
|
84
|
+
h(n(S), {
|
|
81
85
|
class: "schema-card-title-icon",
|
|
82
86
|
icon: "Add",
|
|
83
87
|
size: "sm"
|
|
84
88
|
}),
|
|
85
|
-
|
|
86
|
-
e.name ? (l(),
|
|
87
|
-
default:
|
|
88
|
-
|
|
89
|
+
M[1] || (M[1] = P(" Show additional properties ")),
|
|
90
|
+
e.name ? (l(), o($, { key: 0 }, {
|
|
91
|
+
default: v(() => [
|
|
92
|
+
P("for " + H(e.name), 1)
|
|
89
93
|
]),
|
|
90
94
|
_: 1
|
|
91
|
-
})) :
|
|
95
|
+
})) : s("", !0)
|
|
92
96
|
]),
|
|
93
97
|
_: 1
|
|
94
98
|
})
|
|
95
99
|
], 512)), [
|
|
96
|
-
[A, !
|
|
97
|
-
]) :
|
|
100
|
+
[A, !u]
|
|
101
|
+
]) : C.value ? z((l(), o(n(T), {
|
|
98
102
|
key: 1,
|
|
99
103
|
as: e.noncollapsible ? "div" : "button",
|
|
100
|
-
class:
|
|
101
|
-
style:
|
|
104
|
+
class: N(["schema-card-title", { "schema-card-title--compact": e.compact }]),
|
|
105
|
+
style: G({
|
|
102
106
|
top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
|
|
103
107
|
}),
|
|
104
|
-
onClickCapture:
|
|
108
|
+
onClickCapture: O
|
|
105
109
|
}, {
|
|
106
|
-
default:
|
|
107
|
-
var
|
|
110
|
+
default: v(() => {
|
|
111
|
+
var f, y, g;
|
|
108
112
|
return [
|
|
109
|
-
e.compact ? (l(),
|
|
110
|
-
|
|
111
|
-
class:
|
|
113
|
+
e.compact ? (l(), t(d, { key: 0 }, [
|
|
114
|
+
h(n(S), {
|
|
115
|
+
class: N(["schema-card-title-icon", { "schema-card-title-icon--open": u }]),
|
|
112
116
|
icon: "Add",
|
|
113
117
|
size: "sm"
|
|
114
118
|
}, null, 8, ["class"]),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
], 64)) : (l(),
|
|
118
|
-
|
|
119
|
+
u ? (l(), t(d, { key: 0 }, [
|
|
120
|
+
P(" Hide " + H(((f = e.value) == null ? void 0 : f.title) ?? "Child Attributes"), 1)
|
|
121
|
+
], 64)) : (l(), t(d, { key: 1 }, [
|
|
122
|
+
P(" Show " + H(((y = e.value) == null ? void 0 : y.title) ?? "Child Attributes"), 1)
|
|
119
123
|
], 64)),
|
|
120
|
-
e.name ? (l(),
|
|
121
|
-
default:
|
|
122
|
-
|
|
124
|
+
e.name ? (l(), o($, { key: 2 }, {
|
|
125
|
+
default: v(() => [
|
|
126
|
+
P("for " + H(e.name), 1)
|
|
123
127
|
]),
|
|
124
128
|
_: 1
|
|
125
|
-
})) :
|
|
126
|
-
], 64)) : (l(),
|
|
127
|
-
|
|
128
|
-
class:
|
|
129
|
+
})) : s("", !0)
|
|
130
|
+
], 64)) : (l(), t(d, { key: 1 }, [
|
|
131
|
+
h(n(S), {
|
|
132
|
+
class: N(["schema-card-title-icon", { "schema-card-title-icon--open": u }]),
|
|
129
133
|
icon: "Add",
|
|
130
134
|
size: "sm"
|
|
131
135
|
}, null, 8, ["class"]),
|
|
132
|
-
|
|
133
|
-
name: ((
|
|
136
|
+
h(_, {
|
|
137
|
+
name: ((g = e.value) == null ? void 0 : g.title) ?? e.name,
|
|
134
138
|
value: e.value
|
|
135
139
|
}, null, 8, ["name", "value"])
|
|
136
140
|
], 64))
|
|
@@ -139,56 +143,58 @@ const Z = {
|
|
|
139
143
|
_: 2
|
|
140
144
|
}, 1032, ["as", "class", "style"])), [
|
|
141
145
|
[A, !e.hideHeading && !(e.noncollapsible && e.compact)]
|
|
142
|
-
]) :
|
|
143
|
-
|
|
146
|
+
]) : s("", !0),
|
|
147
|
+
h(n(K), {
|
|
144
148
|
as: "ul",
|
|
145
|
-
static: !
|
|
149
|
+
static: !C.value
|
|
146
150
|
}, {
|
|
147
|
-
default:
|
|
148
|
-
var
|
|
151
|
+
default: v(() => {
|
|
152
|
+
var f, y, g;
|
|
149
153
|
return [
|
|
150
|
-
|
|
154
|
+
c.value && ((f = a.value) != null && f.properties) ? (l(), o(Z, {
|
|
151
155
|
key: 0,
|
|
152
|
-
modelValue:
|
|
153
|
-
"onUpdate:modelValue":
|
|
154
|
-
discriminatorMapping:
|
|
155
|
-
discriminatorPropertyName:
|
|
156
|
-
}, null, 8, ["modelValue", "discriminatorMapping", "discriminatorPropertyName"])) :
|
|
157
|
-
a.value && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (l(),
|
|
158
|
-
a.value.properties ? (l(!0),
|
|
159
|
-
var
|
|
160
|
-
return l(),
|
|
161
|
-
key:
|
|
156
|
+
modelValue: m.value,
|
|
157
|
+
"onUpdate:modelValue": M[0] || (M[0] = (r) => m.value = r),
|
|
158
|
+
discriminatorMapping: c.value,
|
|
159
|
+
discriminatorPropertyName: D.value
|
|
160
|
+
}, null, 8, ["modelValue", "discriminatorMapping", "discriminatorPropertyName"])) : s("", !0),
|
|
161
|
+
a.value && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (l(), t(d, { key: 1 }, [
|
|
162
|
+
a.value.properties ? (l(!0), t(d, { key: 0 }, q(Object.keys(a.value.properties), (r) => {
|
|
163
|
+
var k, j;
|
|
164
|
+
return l(), o(b, {
|
|
165
|
+
key: r,
|
|
162
166
|
compact: e.compact,
|
|
163
167
|
hideHeading: e.hideHeading,
|
|
164
168
|
level: e.level + 1,
|
|
165
|
-
name:
|
|
166
|
-
required: ((
|
|
169
|
+
name: r,
|
|
170
|
+
required: ((k = a.value.required) == null ? void 0 : k.includes(r)) || ((j = a.value.properties[r]) == null ? void 0 : j.required) === !0,
|
|
167
171
|
schemas: e.schemas,
|
|
168
172
|
value: {
|
|
169
|
-
...a.value.properties[
|
|
173
|
+
...a.value.properties[r],
|
|
170
174
|
parent: a.value,
|
|
171
|
-
isDiscriminator:
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
isDiscriminator: r === D.value
|
|
176
|
+
},
|
|
177
|
+
hideModelNames: e.hideModelNames
|
|
178
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "required", "schemas", "value", "hideModelNames"]);
|
|
179
|
+
}), 128)) : s("", !0),
|
|
180
|
+
a.value.patternProperties ? (l(!0), t(d, { key: 1 }, q(Object.keys(
|
|
176
181
|
a.value.patternProperties
|
|
177
|
-
), (
|
|
178
|
-
var
|
|
179
|
-
return l(),
|
|
180
|
-
key:
|
|
182
|
+
), (r) => {
|
|
183
|
+
var k;
|
|
184
|
+
return l(), o(b, {
|
|
185
|
+
key: r,
|
|
181
186
|
compact: e.compact,
|
|
182
187
|
hideHeading: e.hideHeading,
|
|
183
188
|
level: e.level,
|
|
184
|
-
name:
|
|
189
|
+
name: r,
|
|
185
190
|
pattern: "",
|
|
186
191
|
schemas: e.schemas,
|
|
187
|
-
value: ((
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
value: ((k = e.value.discriminator) == null ? void 0 : k.propertyName) === r ? e.value : a.value.patternProperties[r],
|
|
193
|
+
hideModelNames: e.hideModelNames
|
|
194
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value", "hideModelNames"]);
|
|
195
|
+
}), 128)) : s("", !0),
|
|
196
|
+
a.value.additionalProperties ? (l(), t(d, { key: 2 }, [
|
|
197
|
+
a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (l(), o(b, {
|
|
192
198
|
key: 0,
|
|
193
199
|
additional: "",
|
|
194
200
|
compact: e.compact,
|
|
@@ -199,8 +205,9 @@ const Z = {
|
|
|
199
205
|
value: {
|
|
200
206
|
type: "anything",
|
|
201
207
|
...typeof a.value.additionalProperties == "object" ? a.value.additionalProperties : {}
|
|
202
|
-
}
|
|
203
|
-
|
|
208
|
+
},
|
|
209
|
+
hideModelNames: e.hideModelNames
|
|
210
|
+
}, null, 8, ["compact", "hideHeading", "level", "schemas", "value", "hideModelNames"])) : (l(), o(b, {
|
|
204
211
|
key: 1,
|
|
205
212
|
additional: "",
|
|
206
213
|
compact: e.compact,
|
|
@@ -208,18 +215,20 @@ const Z = {
|
|
|
208
215
|
level: e.level,
|
|
209
216
|
noncollapsible: "",
|
|
210
217
|
schemas: e.schemas,
|
|
211
|
-
value: ((y = e.value.discriminator) == null ? void 0 : y.propertyName) === e.name ? e.value : a.value.additionalProperties
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
218
|
+
value: ((y = e.value.discriminator) == null ? void 0 : y.propertyName) === e.name ? e.value : a.value.additionalProperties,
|
|
219
|
+
hideModelNames: e.hideModelNames
|
|
220
|
+
}, null, 8, ["compact", "hideHeading", "level", "schemas", "value", "hideModelNames"]))
|
|
221
|
+
], 64)) : s("", !0)
|
|
222
|
+
], 64)) : (l(), o(b, {
|
|
215
223
|
key: 2,
|
|
216
224
|
compact: e.compact,
|
|
217
225
|
hideHeading: e.hideHeading,
|
|
218
226
|
level: e.level,
|
|
219
227
|
name: a.value.name,
|
|
220
228
|
schemas: e.schemas,
|
|
221
|
-
value: ((
|
|
222
|
-
|
|
229
|
+
value: ((g = e.value.discriminator) == null ? void 0 : g.propertyName) === e.name ? e.value : a.value,
|
|
230
|
+
hideModelNames: e.hideModelNames
|
|
231
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value", "hideModelNames"]))
|
|
223
232
|
];
|
|
224
233
|
}),
|
|
225
234
|
_: 1
|
|
@@ -229,9 +238,9 @@ const Z = {
|
|
|
229
238
|
];
|
|
230
239
|
}),
|
|
231
240
|
_: 1
|
|
232
|
-
}, 8, ["defaultOpen"])) :
|
|
241
|
+
}, 8, ["defaultOpen"])) : s("", !0);
|
|
233
242
|
}
|
|
234
243
|
});
|
|
235
244
|
export {
|
|
236
|
-
|
|
245
|
+
de as default
|
|
237
246
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
2
|
import { type CompositionKeyword } from './helpers/schema-composition.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
composition: CompositionKeyword;
|
|
5
|
-
schemas?:
|
|
5
|
+
schemas?: Record<string, OpenAPIV3_1.SchemaObject> | unknown;
|
|
6
6
|
name?: string;
|
|
7
7
|
value: Record<string, any>;
|
|
8
8
|
level: number;
|
|
@@ -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":"AAuSA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAMxD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAA;IAC5D,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;;AAgWF,wBAOG"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { ScalarIconCaretDown as
|
|
4
|
-
import { stringify as
|
|
5
|
-
import { mergeAllOfSchemas as
|
|
1
|
+
import { defineComponent as U, ref as D, computed as s, resolveComponent as E, createElementBlock as u, openBlock as m, createCommentVNode as p, createBlock as f, Fragment as H, renderList as F, createVNode as b, createElementVNode as d, unref as v, withCtx as I, toDisplayString as w } from "vue";
|
|
2
|
+
import { ScalarListbox as M, ScalarMarkdown as $ } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCaretDown as R } from "@scalar/icons";
|
|
4
|
+
import { stringify as j } from "flatted";
|
|
5
|
+
import { mergeAllOfSchemas as Z } from "./helpers/merge-all-of-schemas.js";
|
|
6
6
|
import { hasComposition as g } from "./helpers/schema-composition.js";
|
|
7
7
|
import S from "./Schema.vue.js";
|
|
8
|
-
const
|
|
9
|
-
class: "composition-selector bg-b-1.5 hover:bg-b-2
|
|
8
|
+
const G = { class: "property-rule" }, J = {
|
|
9
|
+
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",
|
|
10
10
|
type: "button"
|
|
11
|
-
},
|
|
11
|
+
}, K = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1 relative" }, Q = { class: "composition-panel" }, X = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "property-description border-x border-t p-2"
|
|
14
|
-
},
|
|
14
|
+
}, te = /* @__PURE__ */ U({
|
|
15
15
|
__name: "SchemaComposition",
|
|
16
16
|
props: {
|
|
17
17
|
composition: {},
|
|
@@ -23,21 +23,21 @@ const P = { class: "property-rule" }, Q = {
|
|
|
23
23
|
hideHeading: { type: Boolean }
|
|
24
24
|
},
|
|
25
25
|
setup(l) {
|
|
26
|
-
const y =
|
|
26
|
+
const y = D(0), C = s(
|
|
27
27
|
() => N.value.map((e, o) => ({
|
|
28
28
|
id: String(o),
|
|
29
|
-
label:
|
|
29
|
+
label: A(e) || "Schema"
|
|
30
30
|
}))
|
|
31
|
-
), O =
|
|
31
|
+
), O = s({
|
|
32
32
|
get: () => C.value.find(
|
|
33
33
|
(e) => e.id === String(y.value)
|
|
34
34
|
),
|
|
35
35
|
set: (e) => y.value = Number(e.id)
|
|
36
|
-
}), q =
|
|
36
|
+
}), q = s(() => {
|
|
37
37
|
var t;
|
|
38
38
|
const e = ["oneOf", "anyOf"].includes(l.composition), o = l.composition === "allOf" && ((t = l.value[l.composition]) == null ? void 0 : t.some((n) => g(n)));
|
|
39
39
|
return e || o;
|
|
40
|
-
}),
|
|
40
|
+
}), A = (e) => {
|
|
41
41
|
if (!e)
|
|
42
42
|
return null;
|
|
43
43
|
if (e.title)
|
|
@@ -46,7 +46,7 @@ const P = { class: "property-rule" }, Q = {
|
|
|
46
46
|
return e.name;
|
|
47
47
|
if (l.schemas && typeof l.schemas == "object") {
|
|
48
48
|
for (const [o, t] of Object.entries(l.schemas))
|
|
49
|
-
if (
|
|
49
|
+
if (j(t) === j(e))
|
|
50
50
|
return o;
|
|
51
51
|
}
|
|
52
52
|
if (e.type === "array" && e.items)
|
|
@@ -59,11 +59,11 @@ const P = { class: "property-rule" }, Q = {
|
|
|
59
59
|
return o[0];
|
|
60
60
|
}
|
|
61
61
|
return null;
|
|
62
|
-
}, k = (e) => e.find((o) => g(o)), N =
|
|
62
|
+
}, k = (e) => e.find((o) => g(o)), N = s(() => {
|
|
63
63
|
if (!k(l.value[l.composition]))
|
|
64
64
|
return l.value[l.composition];
|
|
65
65
|
const e = k(l.value[l.composition]);
|
|
66
|
-
return (e.oneOf || e.anyOf).map((t) => {
|
|
66
|
+
return (e.oneOf || e.anyOf || e.allOf).map((t) => {
|
|
67
67
|
if (t.allOf) {
|
|
68
68
|
const n = t.allOf.find((c) => c.title), r = t.allOf.find((c) => !c.title);
|
|
69
69
|
return n && r ? {
|
|
@@ -82,7 +82,7 @@ const P = { class: "property-rule" }, Q = {
|
|
|
82
82
|
}
|
|
83
83
|
return t;
|
|
84
84
|
});
|
|
85
|
-
}),
|
|
85
|
+
}), B = (e) => {
|
|
86
86
|
var o, t;
|
|
87
87
|
if (e === "allOf") {
|
|
88
88
|
const n = (t = (o = l.value) == null ? void 0 : o[e]) == null ? void 0 : t.find(
|
|
@@ -94,57 +94,60 @@ const P = { class: "property-rule" }, Q = {
|
|
|
94
94
|
return "Any of";
|
|
95
95
|
}
|
|
96
96
|
return e.replace(/([A-Z])/g, " $1").replace(/^./, (n) => n.toUpperCase()).toLowerCase().replace(/^(\w)/, (n) => n.toUpperCase());
|
|
97
|
-
},
|
|
97
|
+
}, i = s(
|
|
98
98
|
() => N.value[y.value]
|
|
99
|
-
), h =
|
|
99
|
+
), h = s(() => {
|
|
100
100
|
var e;
|
|
101
|
-
return (e =
|
|
102
|
-
}),
|
|
101
|
+
return (e = i.value) != null && e.oneOf ? "oneOf" : "anyOf";
|
|
102
|
+
}), T = s(() => {
|
|
103
103
|
var o;
|
|
104
104
|
const e = h.value;
|
|
105
|
-
return (o =
|
|
105
|
+
return (o = i.value) == null ? void 0 : o[e];
|
|
106
|
+
}), z = s(() => {
|
|
107
|
+
const e = i.value;
|
|
108
|
+
return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
|
|
106
109
|
});
|
|
107
110
|
return (e, o) => {
|
|
108
|
-
var n, r, c, V
|
|
109
|
-
const t =
|
|
110
|
-
return
|
|
111
|
-
e.composition === "allOf" && e.value[e.composition].some((
|
|
112
|
-
(
|
|
113
|
-
), (
|
|
114
|
-
key:
|
|
111
|
+
var n, r, c, V;
|
|
112
|
+
const t = E("SchemaComposition", !0);
|
|
113
|
+
return m(), u("div", G, [
|
|
114
|
+
e.composition === "allOf" && e.value[e.composition].some((a) => a.oneOf || a.anyOf) ? (m(!0), u(H, { key: 0 }, F(e.value[e.composition].filter(
|
|
115
|
+
(a) => !a.oneOf && !a.anyOf
|
|
116
|
+
), (a, L) => (m(), f(S, {
|
|
117
|
+
key: L,
|
|
115
118
|
compact: e.compact,
|
|
116
119
|
level: e.level,
|
|
117
120
|
name: e.name,
|
|
118
121
|
noncollapsible: e.level == 0,
|
|
119
122
|
schemas: e.schemas,
|
|
120
|
-
value:
|
|
123
|
+
value: a
|
|
121
124
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : p("", !0),
|
|
122
|
-
q.value ? (
|
|
123
|
-
b(v(
|
|
125
|
+
q.value ? (m(), u(H, { key: 1 }, [
|
|
126
|
+
b(v(M), {
|
|
124
127
|
modelValue: O.value,
|
|
125
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
128
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => O.value = a),
|
|
126
129
|
options: C.value,
|
|
127
130
|
resize: ""
|
|
128
131
|
}, {
|
|
129
|
-
default:
|
|
130
|
-
var
|
|
132
|
+
default: I(() => {
|
|
133
|
+
var a;
|
|
131
134
|
return [
|
|
132
|
-
d("button",
|
|
133
|
-
d("span",
|
|
134
|
-
d("span",
|
|
135
|
-
b(v(
|
|
135
|
+
d("button", J, [
|
|
136
|
+
d("span", K, w(B(e.composition)), 1),
|
|
137
|
+
d("span", P, w(((a = O.value) == null ? void 0 : a.label) || "Schema"), 1),
|
|
138
|
+
b(v(R), { class: "z-1" })
|
|
136
139
|
])
|
|
137
140
|
];
|
|
138
141
|
}),
|
|
139
142
|
_: 1
|
|
140
143
|
}, 8, ["modelValue", "options"]),
|
|
141
|
-
d("div",
|
|
142
|
-
(n =
|
|
143
|
-
b(v(
|
|
144
|
-
value:
|
|
144
|
+
d("div", Q, [
|
|
145
|
+
(n = i.value) != null && n.description ? (m(), u("div", X, [
|
|
146
|
+
b(v($), {
|
|
147
|
+
value: i.value.description
|
|
145
148
|
}, null, 8, ["value"])
|
|
146
149
|
])) : p("", !0),
|
|
147
|
-
|
|
150
|
+
z.value ? (m(), f(S, {
|
|
148
151
|
key: 1,
|
|
149
152
|
compact: e.compact,
|
|
150
153
|
level: e.level + 1,
|
|
@@ -152,12 +155,13 @@ const P = { class: "property-rule" }, Q = {
|
|
|
152
155
|
name: e.name,
|
|
153
156
|
noncollapsible: !0,
|
|
154
157
|
schemas: e.schemas,
|
|
155
|
-
value: (
|
|
158
|
+
value: (r = i.value) != null && r.properties ? {
|
|
156
159
|
type: "object",
|
|
157
|
-
properties:
|
|
158
|
-
|
|
160
|
+
properties: i.value.properties,
|
|
161
|
+
required: i.value.required
|
|
162
|
+
} : i.value
|
|
159
163
|
}, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : p("", !0),
|
|
160
|
-
(
|
|
164
|
+
(c = i.value) != null && c.oneOf || (V = i.value) != null && V.anyOf ? (m(), f(t, {
|
|
161
165
|
key: 2,
|
|
162
166
|
compact: e.compact,
|
|
163
167
|
composition: h.value,
|
|
@@ -167,23 +171,23 @@ const P = { class: "property-rule" }, Q = {
|
|
|
167
171
|
noncollapsible: !0,
|
|
168
172
|
schemas: e.schemas,
|
|
169
173
|
value: {
|
|
170
|
-
[h.value]:
|
|
174
|
+
[h.value]: T.value
|
|
171
175
|
}
|
|
172
176
|
}, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : p("", !0)
|
|
173
177
|
])
|
|
174
|
-
], 64)) : (
|
|
178
|
+
], 64)) : (m(), f(S, {
|
|
175
179
|
key: 2,
|
|
176
180
|
compact: e.compact,
|
|
177
181
|
level: e.level,
|
|
178
182
|
name: e.name,
|
|
179
183
|
noncollapsible: e.level == 0,
|
|
180
184
|
schemas: e.schemas,
|
|
181
|
-
value: v(
|
|
185
|
+
value: v(Z)(e.value[e.composition])
|
|
182
186
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
|
|
183
187
|
]);
|
|
184
188
|
};
|
|
185
189
|
}
|
|
186
190
|
});
|
|
187
191
|
export {
|
|
188
|
-
|
|
192
|
+
te as default
|
|
189
193
|
};
|
|
@@ -2,7 +2,7 @@ import { defineComponent as c, computed as n, createBlock as u, openBlock as b,
|
|
|
2
2
|
import { ScalarListbox as x } from "@scalar/components";
|
|
3
3
|
import { ScalarIconCaretDown as g } from "@scalar/icons";
|
|
4
4
|
const v = {
|
|
5
|
-
class: "bg-b-1.5 hover:bg-b-2
|
|
5
|
+
class: "bg-b-1.5 hover:bg-b-2 flex w-full items-center gap-1 border-b px-2 py-1.25",
|
|
6
6
|
type: "button"
|
|
7
7
|
}, y = { class: "composition-selector-label text-c-1 relative" }, _ = /* @__PURE__ */ c({
|
|
8
8
|
__name: "SchemaDiscriminator",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
value:
|
|
3
|
+
value: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject;
|
|
4
4
|
name?: string;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAIxD,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAgFF,wBAMG"}
|