@scalar/api-reference 1.28.5 → 1.28.7
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 +41 -0
- package/dist/browser/standalone.js +6284 -6218
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +26 -15
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +128 -129
- 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/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +57 -55
- package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Description.vue.js +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 +24 -24
- package/dist/components/Content/Lazy/Lazy.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +4 -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 +18 -17
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +4 -4
- package/dist/components/Content/Schema/Schema.vue2.js +79 -67
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +12 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +109 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue2.js +26 -31
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +143 -141
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +83 -99
- package/dist/components/Content/Tag/OperationsList.vue.js +2 -2
- package/dist/components/Content/Tag/OperationsList.vue2.js +3 -3
- package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Tag.vue.js +41 -36
- package/dist/components/Content/Tag/TagList.vue.d.ts +2 -0
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +38 -36
- package/dist/components/Content/Tag/TagSection.vue.js +2 -2
- package/dist/components/Content/Tag/TagSection.vue2.js +3 -3
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.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/SectionHeaderTag.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeaderTag.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 +2 -1
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarElement.vue2.js +40 -39
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts +2 -4
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +2 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +2 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +3 -3
- package/dist/features/ExampleResponses/ExampleResponses.vue2.js +6 -8
- package/dist/features/Operation/Operation.vue.d.ts +2 -0
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +13 -10
- package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -1
- package/dist/features/Operation/Webhooks.vue.js +2 -2
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +4 -4
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +37 -31
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -0
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +15 -13
- package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -0
- 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/ParameterList.vue2.js +14 -12
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -0
- 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 -18
- package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -0
- 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 +20 -18
- package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useResponses.js +2 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +2 -0
- 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 +29 -24
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +66 -56
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +2 -2
- package/dist/features/Search/SearchModal.vue2.js +2 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +9 -9
- package/dist/helpers/index.d.ts +4 -4
- package/dist/helpers/scrollToId.d.ts.map +1 -1
- package/dist/helpers/specHelpers.js +15 -14
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.d.ts +7 -2
- package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.js +43 -33
- package/dist/hooks/useNavState.d.ts +13 -4
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +52 -47
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +3 -2
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -76
- package/dist/libs/operation.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.d.ts +4 -4
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -10
- package/dist/helpers/getVariableNames.js +0 -7
- package/dist/helpers/hasSecuritySchemes.js +0 -7
- package/dist/helpers/mapFromObject.js +0 -7
- package/dist/helpers/mergeAllObjects.js +0 -7
- package/dist/hooks/useClientStore.d.ts +0 -2
- package/dist/hooks/useClientStore.d.ts.map +0 -1
- package/dist/hooks/useClientStore.js +0 -5
- package/dist/hooks/useRefOnMount.d.ts +0 -6
- package/dist/hooks/useRefOnMount.d.ts.map +0 -1
- package/dist/hooks/useRefOnMount.js +0 -10
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, computed as q, openBlock as a, createBlock as s, unref as r, withCtx as y, createElementVNode as P, normalizeClass as m, createElementBlock as i, createVNode as v, createCommentVNode as n, withDirectives as z, normalizeStyle as A, Fragment as o, createTextVNode as O, toDisplayString as S, vShow as N, renderList as C } from "vue";
|
|
2
2
|
import { Disclosure as V, DisclosureButton as E, DisclosurePanel as T } from "@headlessui/vue";
|
|
3
|
-
import { ScalarMarkdown as $, ScalarIcon as
|
|
3
|
+
import { ScalarMarkdown as $, ScalarIcon as B } from "@scalar/components";
|
|
4
4
|
import F from "./SchemaHeading.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import p from "./SchemaProperty.vue.js";
|
|
6
6
|
const I = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "schema-card-description"
|
|
9
|
-
}, R = /* @__PURE__ */
|
|
9
|
+
}, R = /* @__PURE__ */ D({
|
|
10
10
|
__name: "Schema",
|
|
11
11
|
props: {
|
|
12
12
|
value: { type: [Object, Boolean] },
|
|
@@ -14,63 +14,66 @@ const I = {
|
|
|
14
14
|
name: {},
|
|
15
15
|
compact: { type: Boolean },
|
|
16
16
|
noncollapsible: { type: Boolean },
|
|
17
|
-
hideHeading: { type: Boolean }
|
|
17
|
+
hideHeading: { type: Boolean },
|
|
18
|
+
schemas: {}
|
|
18
19
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const h =
|
|
21
|
-
return (e, L) => typeof e.value == "object" && Object.keys(e.value).length ? (
|
|
20
|
+
setup(j) {
|
|
21
|
+
const h = j, g = q(() => !(h.noncollapsible || h.level === 0)), w = (e) => h.noncollapsible && e.stopPropagation();
|
|
22
|
+
return (e, L) => typeof e.value == "object" && Object.keys(e.value).length ? (a(), s(r(V), {
|
|
22
23
|
key: 0,
|
|
23
24
|
defaultOpen: e.noncollapsible
|
|
24
25
|
}, {
|
|
25
|
-
default: y(({ open:
|
|
26
|
-
var
|
|
26
|
+
default: y(({ open: t }) => {
|
|
27
|
+
var k;
|
|
27
28
|
return [
|
|
28
|
-
|
|
29
|
-
class:
|
|
29
|
+
P("div", {
|
|
30
|
+
class: m(["schema-card", [
|
|
30
31
|
`schema-card--level-${e.level}`,
|
|
31
|
-
{ "schema-card--compact": e.compact, "schema-card--open":
|
|
32
|
+
{ "schema-card--compact": e.compact, "schema-card--open": t }
|
|
32
33
|
]])
|
|
33
34
|
}, [
|
|
34
|
-
(
|
|
35
|
-
|
|
35
|
+
(k = e.value) != null && k.description && typeof e.value.description == "string" && !e.value.allOf && !e.value.oneOf && !e.value.anyOf && !e.compact ? (a(), i("div", I, [
|
|
36
|
+
v(r($), {
|
|
36
37
|
value: e.value.description
|
|
37
38
|
}, null, 8, ["value"])
|
|
38
|
-
])) :
|
|
39
|
-
|
|
40
|
-
class:
|
|
39
|
+
])) : n("", !0),
|
|
40
|
+
P("div", {
|
|
41
|
+
class: m(["schema-properties", {
|
|
42
|
+
"schema-properties-open": t
|
|
43
|
+
}])
|
|
41
44
|
}, [
|
|
42
|
-
|
|
45
|
+
z(v(r(E), {
|
|
43
46
|
as: e.noncollapsible ? "div" : "button",
|
|
44
|
-
class:
|
|
45
|
-
style:
|
|
47
|
+
class: m(["schema-card-title", { "schema-card-title--compact": e.compact }]),
|
|
48
|
+
style: A({
|
|
46
49
|
top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
|
|
47
50
|
}),
|
|
48
|
-
onClickCapture:
|
|
51
|
+
onClickCapture: w
|
|
49
52
|
}, {
|
|
50
53
|
default: y(() => {
|
|
51
|
-
var
|
|
54
|
+
var d, u, l;
|
|
52
55
|
return [
|
|
53
|
-
e.compact ? (
|
|
54
|
-
|
|
56
|
+
e.compact ? (a(), i(o, { key: 0 }, [
|
|
57
|
+
g.value ? (a(), s(r(B), {
|
|
55
58
|
key: 0,
|
|
56
|
-
class:
|
|
59
|
+
class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
57
60
|
icon: "Add",
|
|
58
61
|
size: "sm"
|
|
59
|
-
}, null, 8, ["class"])) :
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
], 64)) : (
|
|
63
|
-
|
|
62
|
+
}, null, 8, ["class"])) : n("", !0),
|
|
63
|
+
t ? (a(), i(o, { key: 1 }, [
|
|
64
|
+
O(" Hide " + S(((d = e.value) == null ? void 0 : d.title) ?? "Child Attributes"), 1)
|
|
65
|
+
], 64)) : (a(), i(o, { key: 2 }, [
|
|
66
|
+
O(" Show " + S(((u = e.value) == null ? void 0 : u.title) ?? "Child Attributes"), 1)
|
|
64
67
|
], 64))
|
|
65
|
-
], 64)) : (
|
|
66
|
-
|
|
68
|
+
], 64)) : (a(), i(o, { key: 1 }, [
|
|
69
|
+
g.value ? (a(), s(r(B), {
|
|
67
70
|
key: 0,
|
|
68
|
-
class:
|
|
71
|
+
class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
69
72
|
icon: "Add",
|
|
70
73
|
size: "sm"
|
|
71
|
-
}, null, 8, ["class"])) :
|
|
72
|
-
|
|
73
|
-
name: ((
|
|
74
|
+
}, null, 8, ["class"])) : n("", !0),
|
|
75
|
+
v(F, {
|
|
76
|
+
name: ((l = e.value) == null ? void 0 : l.title) ?? e.name,
|
|
74
77
|
value: e.value
|
|
75
78
|
}, null, 8, ["name", "value"])
|
|
76
79
|
], 64))
|
|
@@ -80,63 +83,72 @@ const I = {
|
|
|
80
83
|
}, 1032, ["as", "class", "style"]), [
|
|
81
84
|
[N, !e.hideHeading && !(e.noncollapsible && e.compact)]
|
|
82
85
|
]),
|
|
83
|
-
|
|
86
|
+
v(r(T), {
|
|
84
87
|
as: "ul",
|
|
85
88
|
static: e.noncollapsible
|
|
86
89
|
}, {
|
|
87
90
|
default: y(() => {
|
|
88
|
-
var
|
|
91
|
+
var d, u;
|
|
89
92
|
return [
|
|
90
|
-
e.value.properties || e.value.additionalProperties || e.value.patternProperties ? (
|
|
91
|
-
e.value.properties ? (
|
|
92
|
-
var
|
|
93
|
-
return
|
|
94
|
-
key:
|
|
93
|
+
e.value.properties || e.value.additionalProperties || e.value.patternProperties ? (a(), i(o, { key: 0 }, [
|
|
94
|
+
e.value.properties ? (a(!0), i(o, { key: 0 }, C(Object.keys((d = e.value) == null ? void 0 : d.properties), (l) => {
|
|
95
|
+
var c, f, b, H;
|
|
96
|
+
return a(), s(p, {
|
|
97
|
+
key: l,
|
|
95
98
|
compact: e.compact,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
value: (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
hideHeading: e.hideHeading,
|
|
100
|
+
level: e.level + 1,
|
|
101
|
+
name: l,
|
|
102
|
+
required: ((c = e.value.required) == null ? void 0 : c.includes(l)) || ((b = (f = e.value.properties) == null ? void 0 : f[l]) == null ? void 0 : b.required) === !0,
|
|
103
|
+
schemas: e.schemas,
|
|
104
|
+
value: (H = e.value.properties) == null ? void 0 : H[l]
|
|
105
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "required", "schemas", "value"]);
|
|
106
|
+
}), 128)) : n("", !0),
|
|
107
|
+
e.value.patternProperties ? (a(!0), i(o, { key: 1 }, C(Object.keys((u = e.value) == null ? void 0 : u.patternProperties), (l) => {
|
|
108
|
+
var c;
|
|
109
|
+
return a(), s(p, {
|
|
110
|
+
key: l,
|
|
106
111
|
compact: e.compact,
|
|
112
|
+
hideHeading: e.hideHeading,
|
|
107
113
|
level: e.level,
|
|
108
|
-
name:
|
|
114
|
+
name: l,
|
|
109
115
|
pattern: "",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
schemas: e.schemas,
|
|
117
|
+
value: (c = e.value.patternProperties) == null ? void 0 : c[l]
|
|
118
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value"]);
|
|
119
|
+
}), 128)) : n("", !0),
|
|
120
|
+
e.value.additionalProperties ? (a(), i(o, { key: 2 }, [
|
|
121
|
+
e.value.additionalProperties === !0 || Object.keys(e.value.additionalProperties).length === 0 || !e.value.additionalProperties.type ? (a(), s(p, {
|
|
115
122
|
key: 0,
|
|
116
123
|
additional: "",
|
|
117
124
|
compact: e.compact,
|
|
125
|
+
hideHeading: e.hideHeading,
|
|
118
126
|
level: e.level,
|
|
119
127
|
noncollapsible: "",
|
|
128
|
+
schemas: e.schemas,
|
|
120
129
|
value: {
|
|
121
130
|
type: "anything",
|
|
122
131
|
...typeof e.value.additionalProperties == "object" ? e.value.additionalProperties : {}
|
|
123
132
|
}
|
|
124
|
-
}, null, 8, ["compact", "level", "value"])) : (
|
|
133
|
+
}, null, 8, ["compact", "hideHeading", "level", "schemas", "value"])) : (a(), s(p, {
|
|
125
134
|
key: 1,
|
|
126
135
|
additional: "",
|
|
127
136
|
compact: e.compact,
|
|
137
|
+
hideHeading: e.hideHeading,
|
|
128
138
|
level: e.level,
|
|
129
139
|
noncollapsible: "",
|
|
140
|
+
schemas: e.schemas,
|
|
130
141
|
value: e.value.additionalProperties
|
|
131
|
-
}, null, 8, ["compact", "level", "value"]))
|
|
132
|
-
], 64)) :
|
|
133
|
-
], 64)) : (
|
|
142
|
+
}, null, 8, ["compact", "hideHeading", "level", "schemas", "value"]))
|
|
143
|
+
], 64)) : n("", !0)
|
|
144
|
+
], 64)) : (a(), s(p, {
|
|
134
145
|
key: 1,
|
|
135
146
|
compact: e.compact,
|
|
136
|
-
|
|
147
|
+
hideHeading: e.hideHeading,
|
|
137
148
|
name: e.value.name,
|
|
149
|
+
schemas: e.schemas,
|
|
138
150
|
value: e.value
|
|
139
|
-
}, null, 8, ["compact", "
|
|
151
|
+
}, null, 8, ["compact", "hideHeading", "name", "schemas", "value"]))
|
|
140
152
|
];
|
|
141
153
|
}),
|
|
142
154
|
_: 1
|
|
@@ -146,7 +158,7 @@ const I = {
|
|
|
146
158
|
];
|
|
147
159
|
}),
|
|
148
160
|
_: 1
|
|
149
|
-
}, 8, ["defaultOpen"])) :
|
|
161
|
+
}, 8, ["defaultOpen"])) : n("", !0);
|
|
150
162
|
}
|
|
151
163
|
});
|
|
152
164
|
export {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
discriminator: string;
|
|
4
|
+
schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
|
|
5
|
+
value: Record<string, any>;
|
|
6
|
+
level: number;
|
|
7
|
+
compact?: boolean;
|
|
8
|
+
hideHeading?: boolean;
|
|
9
|
+
};
|
|
10
|
+
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, {}, HTMLDivElement>;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=SchemaDiscriminator.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"AA+KA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAQ9E,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,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;;AAkQF,wBAOG"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { defineComponent as S, ref as A, openBlock as a, createElementBlock as c, createBlock as n, unref as i, withCtx as l, createVNode as d, createElementVNode as m, toDisplayString as f, Fragment as y, renderList as v, normalizeClass as T, createTextVNode as q } from "vue";
|
|
2
|
+
import { TabGroup as B, TabList as N, Tab as V, TabPanel as j } from "@headlessui/vue";
|
|
3
|
+
import { cva as w, cx as H } from "@scalar/components";
|
|
4
|
+
import { stringify as b } from "flatted";
|
|
5
|
+
import g from "./Schema.vue.js";
|
|
6
|
+
const L = { class: "property-rule" }, z = { class: "flex items-center gap-1.5 overflow-x-auto" }, G = /* @__PURE__ */ S({
|
|
7
|
+
__name: "SchemaDiscriminator",
|
|
8
|
+
props: {
|
|
9
|
+
discriminator: {},
|
|
10
|
+
schemas: {},
|
|
11
|
+
value: {},
|
|
12
|
+
level: {},
|
|
13
|
+
compact: { type: Boolean },
|
|
14
|
+
hideHeading: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
setup(h) {
|
|
17
|
+
const s = h, p = A(0), k = w({
|
|
18
|
+
base: "py-0.75 h-fit rounded-full border px-2 text-sm font-medium transition-colors",
|
|
19
|
+
variants: {
|
|
20
|
+
selected: {
|
|
21
|
+
true: "bg-b-accent text-c-accent hover:text-c-accent",
|
|
22
|
+
false: "bg-transparent text-c-2 hover:text-c-1"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}), u = (e) => {
|
|
26
|
+
if (!Array.isArray(e) || e.length === 0)
|
|
27
|
+
return {};
|
|
28
|
+
if (e.length > 0 && e[0].allOf) {
|
|
29
|
+
const o = e.flatMap((r) => r.allOf || []);
|
|
30
|
+
return u(o);
|
|
31
|
+
}
|
|
32
|
+
return e.reduce((o, r) => {
|
|
33
|
+
if (!r || typeof r != "object")
|
|
34
|
+
return o;
|
|
35
|
+
const t = { ...o };
|
|
36
|
+
return r.properties && (t.properties = {
|
|
37
|
+
...t.properties,
|
|
38
|
+
...r.properties
|
|
39
|
+
}), r.required && Array.isArray(r.required) && (t.required = [
|
|
40
|
+
...t.required || [],
|
|
41
|
+
...r.required
|
|
42
|
+
]), r.type && !t.type && (t.type = r.type), r.description && !t.description && (t.description = r.description), t;
|
|
43
|
+
}, {});
|
|
44
|
+
}, O = (e) => {
|
|
45
|
+
if (!e)
|
|
46
|
+
return null;
|
|
47
|
+
if (s.schemas && typeof s.schemas == "object") {
|
|
48
|
+
for (const [o, r] of Object.entries(s.schemas))
|
|
49
|
+
if (b(r) === b(e))
|
|
50
|
+
return o;
|
|
51
|
+
return Object.keys(e)[0];
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}, C = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (o) => o.toUpperCase()).toLowerCase().replace(/^(\w)/, (o) => o.toUpperCase());
|
|
55
|
+
return (e, o) => (a(), c("div", L, [
|
|
56
|
+
e.discriminator === "oneOf" || e.discriminator === "anyOf" ? (a(), n(i(B), { key: 0 }, {
|
|
57
|
+
default: l(() => [
|
|
58
|
+
d(i(N), { class: "discriminator-tab-list py-1.25 flex items-center gap-2 rounded-t-lg border border-b-0 px-2 pr-3" }, {
|
|
59
|
+
default: l(() => [
|
|
60
|
+
m("span", null, f(C(e.discriminator)), 1),
|
|
61
|
+
m("div", z, [
|
|
62
|
+
(a(!0), c(y, null, v(e.value[e.discriminator], (r, t) => (a(), n(i(V), {
|
|
63
|
+
key: t,
|
|
64
|
+
class: T([
|
|
65
|
+
"cursor-pointer",
|
|
66
|
+
i(H)(i(k)({ selected: p.value === t }))
|
|
67
|
+
]),
|
|
68
|
+
onClick: (D) => p.value = t
|
|
69
|
+
}, {
|
|
70
|
+
default: l(() => [
|
|
71
|
+
q(f(O(r) || "Schema"), 1)
|
|
72
|
+
]),
|
|
73
|
+
_: 2
|
|
74
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
75
|
+
])
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
}),
|
|
79
|
+
(a(!0), c(y, null, v(e.value[e.discriminator], (r, t) => (a(), n(i(j), {
|
|
80
|
+
key: t,
|
|
81
|
+
class: "discriminator-panel"
|
|
82
|
+
}, {
|
|
83
|
+
default: l(() => [
|
|
84
|
+
d(g, {
|
|
85
|
+
compact: e.compact,
|
|
86
|
+
hideHeading: e.hideHeading,
|
|
87
|
+
noncollapsible: !0,
|
|
88
|
+
schemas: e.schemas,
|
|
89
|
+
value: r
|
|
90
|
+
}, null, 8, ["compact", "hideHeading", "schemas", "value"])
|
|
91
|
+
]),
|
|
92
|
+
_: 2
|
|
93
|
+
}, 1024))), 128))
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
})) : (a(), n(g, {
|
|
97
|
+
key: 1,
|
|
98
|
+
compact: e.compact,
|
|
99
|
+
level: e.level,
|
|
100
|
+
noncollapsible: e.level == 0,
|
|
101
|
+
schemas: e.schemas,
|
|
102
|
+
value: u(e.value[e.discriminator])
|
|
103
|
+
}, null, 8, ["compact", "level", "noncollapsible", "schemas", "value"]))
|
|
104
|
+
]));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
export {
|
|
108
|
+
G as default
|
|
109
|
+
};
|
|
@@ -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":"AAqDA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAI9E,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAgFF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaHeading.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const r = /* @__PURE__ */
|
|
3
|
+
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-e45fe752"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,42 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as y, openBlock as t, createElementBlock as a, createElementVNode as l, Fragment as n, createTextVNode as o, createCommentVNode as r, toDisplayString as p } from "vue";
|
|
2
|
+
const s = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "schema-type"
|
|
5
|
-
},
|
|
5
|
+
}, u = ["title"], v = /* @__PURE__ */ y({
|
|
6
6
|
__name: "SchemaHeading",
|
|
7
7
|
props: {
|
|
8
8
|
value: { type: [Object, Boolean] },
|
|
9
9
|
name: {}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
return (e,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
], 64)) : (a(), t(n, { key: 2 }, [
|
|
34
|
-
o(r(e.value.type), 1)
|
|
35
|
-
], 64))
|
|
36
|
-
])) : l("", !0);
|
|
37
|
-
};
|
|
11
|
+
setup(m) {
|
|
12
|
+
return (e, i) => typeof e.value == "object" ? (t(), a("span", s, [
|
|
13
|
+
l("span", {
|
|
14
|
+
class: "schema-type-icon",
|
|
15
|
+
title: typeof e.value.type == "string" ? e.value.type : Array.isArray(e.value.type) ? e.value.type.join(" | ") : "unkown type"
|
|
16
|
+
}, [
|
|
17
|
+
e.value.type === "object" ? (t(), a(n, { key: 0 }, [
|
|
18
|
+
o(" {} ")
|
|
19
|
+
], 64)) : r("", !0),
|
|
20
|
+
e.value.type === "array" ? (t(), a(n, { key: 1 }, [
|
|
21
|
+
o(" [] ")
|
|
22
|
+
], 64)) : r("", !0),
|
|
23
|
+
e.value.enum ? (t(), a(n, { key: 2 }, [
|
|
24
|
+
o(" enum ")
|
|
25
|
+
], 64)) : r("", !0)
|
|
26
|
+
], 8, u),
|
|
27
|
+
e.name ? (t(), a(n, { key: 0 }, [
|
|
28
|
+
o(p(e.name), 1)
|
|
29
|
+
], 64)) : (t(), a(n, { key: 1 }, [
|
|
30
|
+
o(p(e.value.type), 1)
|
|
31
|
+
], 64))
|
|
32
|
+
])) : r("", !0);
|
|
38
33
|
}
|
|
39
34
|
});
|
|
40
35
|
export {
|
|
41
|
-
|
|
36
|
+
v as default
|
|
42
37
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
1
2
|
/**
|
|
2
3
|
* Note: We’re taking in a prop called `value` which should be a JSON Schema.
|
|
3
4
|
*
|
|
@@ -14,6 +15,8 @@ type __VLS_Props = {
|
|
|
14
15
|
additional?: boolean;
|
|
15
16
|
pattern?: boolean;
|
|
16
17
|
withExamples?: boolean;
|
|
18
|
+
schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
|
|
19
|
+
hideHeading?: boolean;
|
|
17
20
|
};
|
|
18
21
|
declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
22
|
required: boolean;
|
|
@@ -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":"AAwhBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAe9E;;;;;GAKG;AAEH,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;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;kBAIF,OAAO;;AAkf1B,0BAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaProperty.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-46e92dc2"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|