@scalar/api-reference 1.32.0 → 1.32.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 +83 -0
- package/README.md +1 -1
- package/dist/browser/standalone.js +15732 -15435
- 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 +163 -158
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Card/CardHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardHeader.vue.js +2 -2
- package/dist/components/Card/CardTab.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTab.vue.js +3 -3
- package/dist/components/Card/CardTabHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTabHeader.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Lazy/Loading.vue.d.ts +1 -3
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +92 -91
- 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 +59 -56
- package/dist/components/Content/Schema/RenderString.vue.d.ts +6 -0
- package/dist/components/Content/Schema/RenderString.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.js +14 -0
- package/dist/components/Content/Schema/RenderString.vue2.js +4 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
- 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 +76 -75
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -66
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +19 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +125 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +2 -2
- 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 +96 -170
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +18 -0
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +1 -0
- 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 +155 -160
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +6 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js +20 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +20 -46
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- 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 +13 -13
- package/dist/features/Search/SearchButton.vue.d.ts +1 -0
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +36 -34
- package/dist/features/Search/SearchModal.vue.d.ts +1 -0
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +1 -1
- package/dist/features/Search/SearchModal.vue2.js +112 -112
- package/dist/features/Search/useSearchIndex.d.ts +4 -3
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +119 -82
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.js +47 -38
- package/dist/features/api-client-modal/useApiClient.d.ts +334 -334
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/base-url/BaseUrl.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
- package/dist/features/example-responses/ExampleResponse.vue2.js +7 -7
- package/dist/features/example-responses/ExampleResponses.vue.d.ts +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue2.js +23 -21
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarHttpBadge.vue2.js +5 -6
- package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
- package/dist/features/traverse-schema/helpers/traverse-tags.js +26 -26
- package/dist/features/traverse-schema/index.d.ts +1 -1
- package/dist/features/traverse-schema/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +15 -1
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +66 -47
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +2 -2
- package/package.json +18 -18
- package/dist/hooks/useOperation.d.ts +0 -16
- package/dist/hooks/useOperation.d.ts.map +0 -1
- package/dist/hooks/useOperation.js +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Q, inject as W, computed as p, createBlock as
|
|
1
|
+
import { defineComponent as Q, inject as W, computed as p, createBlock as s, createCommentVNode as n, openBlock as i, unref as u, withCtx as v, createElementVNode as I, normalizeClass as P, createElementBlock as d, withDirectives as E, createVNode as k, createTextVNode as M, toDisplayString as H, vShow as R, normalizeStyle as Y, Fragment as m, renderList as $ } from "vue";
|
|
2
2
|
import { Disclosure as Z, DisclosureButton as F, DisclosurePanel as _ } from "@headlessui/vue";
|
|
3
3
|
import { ScalarMarkdown as x, ScalarIcon as V } from "@scalar/components";
|
|
4
4
|
import L from "../../ScreenReader.vue.js";
|
|
@@ -30,7 +30,7 @@ const ie = {
|
|
|
30
30
|
},
|
|
31
31
|
emits: ["update:modelValue"],
|
|
32
32
|
setup(X, { emit: G }) {
|
|
33
|
-
const o = X, J = G, r = W(ee, null),
|
|
33
|
+
const o = X, J = G, r = W(ee, null), h = p(
|
|
34
34
|
() => {
|
|
35
35
|
var e;
|
|
36
36
|
return ((e = r == null ? void 0 : r.value) == null ? void 0 : e.discriminatorMapping) || o.discriminatorMapping || {};
|
|
@@ -46,100 +46,100 @@ const ie = {
|
|
|
46
46
|
return ((e = r == null ? void 0 : r.value) == null ? void 0 : e.selectedType) || o.discriminator;
|
|
47
47
|
}
|
|
48
48
|
), O = (e) => e !== null && typeof e == "object" && "type" in e && e.type === "object", a = p(() => {
|
|
49
|
-
var
|
|
50
|
-
const e = (
|
|
49
|
+
var t;
|
|
50
|
+
const e = (t = r == null ? void 0 : r.value) == null ? void 0 : t.mergedSchema, S = o.value;
|
|
51
51
|
return e && o.level === 0 && o.hasDiscriminator && O(S) && O(e) ? e : o.value;
|
|
52
52
|
}), j = p(() => !(o.noncollapsible || o.level === 0)), K = p(() => {
|
|
53
53
|
var e;
|
|
54
|
-
return !(!((e = a.value) != null && e.description) || typeof a.value.description != "string" || a.value.allOf || a.value.oneOf || a.value.anyOf || a.value.enum || o.level === 0);
|
|
55
|
-
}), B = (e) => o.noncollapsible && e.stopPropagation(),
|
|
54
|
+
return !(!((e = a.value) != null && e.description) || typeof a.value.description != "string" || a.value.allOf || a.value.oneOf || a.value.anyOf || a.value.enum || !a.value.properties && !a.value.patternProperties && !a.value.additionalProperties || o.level === 0);
|
|
55
|
+
}), B = (e) => o.noncollapsible && e.stopPropagation(), y = (e) => {
|
|
56
56
|
J("update:modelValue", e);
|
|
57
57
|
};
|
|
58
|
-
return (e, S) => typeof e.value == "object" && Object.keys(e.value).length ? (i(),
|
|
58
|
+
return (e, S) => typeof e.value == "object" && Object.keys(e.value).length ? (i(), s(u(Z), {
|
|
59
59
|
key: 0,
|
|
60
60
|
defaultOpen: e.noncollapsible
|
|
61
61
|
}, {
|
|
62
|
-
default: v(({ open:
|
|
62
|
+
default: v(({ open: t }) => {
|
|
63
63
|
var w, C;
|
|
64
64
|
return [
|
|
65
65
|
I("div", {
|
|
66
|
-
class:
|
|
66
|
+
class: P(["schema-card", [
|
|
67
67
|
`schema-card--level-${e.level}`,
|
|
68
|
-
{ "schema-card--compact": e.compact, "schema-card--open":
|
|
69
|
-
{ "border-t": e.additionalProperties &&
|
|
68
|
+
{ "schema-card--compact": e.compact, "schema-card--open": t },
|
|
69
|
+
{ "border-t": e.additionalProperties && t }
|
|
70
70
|
]])
|
|
71
71
|
}, [
|
|
72
|
-
K.value ? (i(),
|
|
73
|
-
(w = a.value) != null && w.enum ?
|
|
72
|
+
K.value ? (i(), d("div", ie, [
|
|
73
|
+
(w = a.value) != null && w.enum ? n("", !0) : (i(), s(u(x), {
|
|
74
74
|
key: 0,
|
|
75
75
|
value: (C = a.value) == null ? void 0 : C.description
|
|
76
76
|
}, null, 8, ["value"]))
|
|
77
|
-
])) :
|
|
77
|
+
])) : n("", !0),
|
|
78
78
|
I("div", {
|
|
79
|
-
class:
|
|
80
|
-
"schema-properties-open":
|
|
79
|
+
class: P(["schema-properties", {
|
|
80
|
+
"schema-properties-open": t
|
|
81
81
|
}])
|
|
82
82
|
}, [
|
|
83
|
-
e.additionalProperties ? E((i(),
|
|
84
|
-
|
|
83
|
+
e.additionalProperties ? E((i(), d("div", le, [
|
|
84
|
+
k(u(F), {
|
|
85
85
|
as: "button",
|
|
86
86
|
class: "schema-card-title schema-card-title--compact",
|
|
87
87
|
onClickCapture: B
|
|
88
88
|
}, {
|
|
89
89
|
default: v(() => [
|
|
90
|
-
|
|
90
|
+
k(u(V), {
|
|
91
91
|
class: "schema-card-title-icon",
|
|
92
92
|
icon: "Add",
|
|
93
93
|
size: "sm"
|
|
94
94
|
}),
|
|
95
|
-
S[0] || (S[0] =
|
|
96
|
-
e.name ? (i(),
|
|
95
|
+
S[0] || (S[0] = M(" Show additional properties ")),
|
|
96
|
+
e.name ? (i(), s(L, { key: 0 }, {
|
|
97
97
|
default: v(() => [
|
|
98
|
-
|
|
98
|
+
M("for " + H(e.name), 1)
|
|
99
99
|
]),
|
|
100
100
|
_: 1
|
|
101
|
-
})) :
|
|
101
|
+
})) : n("", !0)
|
|
102
102
|
]),
|
|
103
103
|
_: 1
|
|
104
104
|
})
|
|
105
105
|
], 512)), [
|
|
106
|
-
[R, !
|
|
107
|
-
]) : j.value ? E((i(),
|
|
106
|
+
[R, !t]
|
|
107
|
+
]) : j.value ? E((i(), s(u(F), {
|
|
108
108
|
key: 1,
|
|
109
109
|
as: e.noncollapsible ? "div" : "button",
|
|
110
|
-
class:
|
|
110
|
+
class: P(["schema-card-title", { "schema-card-title--compact": e.compact }]),
|
|
111
111
|
style: Y({
|
|
112
112
|
top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
|
|
113
113
|
}),
|
|
114
114
|
onClickCapture: B
|
|
115
115
|
}, {
|
|
116
116
|
default: v(() => {
|
|
117
|
-
var f,
|
|
117
|
+
var f, g, l;
|
|
118
118
|
return [
|
|
119
|
-
e.compact ? (i(),
|
|
120
|
-
|
|
121
|
-
class:
|
|
119
|
+
e.compact ? (i(), d(m, { key: 0 }, [
|
|
120
|
+
k(u(V), {
|
|
121
|
+
class: P(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
122
122
|
icon: "Add",
|
|
123
123
|
size: "sm"
|
|
124
124
|
}, null, 8, ["class"]),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
], 64)) : (i(),
|
|
128
|
-
|
|
125
|
+
t ? (i(), d(m, { key: 0 }, [
|
|
126
|
+
M(" Hide " + H(((f = e.value) == null ? void 0 : f.title) ?? "Child Attributes"), 1)
|
|
127
|
+
], 64)) : (i(), d(m, { key: 1 }, [
|
|
128
|
+
M(" Show " + H(((g = e.value) == null ? void 0 : g.title) ?? "Child Attributes"), 1)
|
|
129
129
|
], 64)),
|
|
130
|
-
e.name ? (i(),
|
|
130
|
+
e.name ? (i(), s(L, { key: 2 }, {
|
|
131
131
|
default: v(() => [
|
|
132
|
-
|
|
132
|
+
M("for " + H(e.name), 1)
|
|
133
133
|
]),
|
|
134
134
|
_: 1
|
|
135
|
-
})) :
|
|
136
|
-
], 64)) : (i(),
|
|
137
|
-
|
|
138
|
-
class:
|
|
135
|
+
})) : n("", !0)
|
|
136
|
+
], 64)) : (i(), d(m, { key: 1 }, [
|
|
137
|
+
k(u(V), {
|
|
138
|
+
class: P(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
139
139
|
icon: "Add",
|
|
140
140
|
size: "sm"
|
|
141
141
|
}, null, 8, ["class"]),
|
|
142
|
-
|
|
142
|
+
k(ae, {
|
|
143
143
|
name: ((l = e.value) == null ? void 0 : l.title) ?? e.name,
|
|
144
144
|
value: e.value
|
|
145
145
|
}, null, 8, ["name", "value"])
|
|
@@ -149,25 +149,26 @@ const ie = {
|
|
|
149
149
|
_: 2
|
|
150
150
|
}, 1032, ["as", "class", "style"])), [
|
|
151
151
|
[R, !e.hideHeading && !(e.noncollapsible && e.compact)]
|
|
152
|
-
]) :
|
|
153
|
-
|
|
152
|
+
]) : n("", !0),
|
|
153
|
+
!e.additionalProperties || t ? (i(), s(u(_), {
|
|
154
|
+
key: 2,
|
|
154
155
|
as: "ul",
|
|
155
156
|
static: !j.value
|
|
156
157
|
}, {
|
|
157
158
|
default: v(() => {
|
|
158
|
-
var f,
|
|
159
|
+
var f, g;
|
|
159
160
|
return [
|
|
160
|
-
a.value && typeof a.value == "object" && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (i(),
|
|
161
|
-
a.value.properties ? (i(!0),
|
|
162
|
-
var
|
|
163
|
-
return i(),
|
|
161
|
+
a.value && typeof a.value == "object" && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (i(), d(m, { key: 0 }, [
|
|
162
|
+
a.value.properties ? (i(!0), d(m, { key: 0 }, $(Object.keys(a.value.properties), (l) => {
|
|
163
|
+
var N, A, T, z, U, q;
|
|
164
|
+
return i(), s(b, {
|
|
164
165
|
key: l,
|
|
165
166
|
compact: e.compact,
|
|
166
167
|
hideHeading: e.hideHeading,
|
|
167
168
|
level: e.level + 1,
|
|
168
169
|
name: l,
|
|
169
170
|
hideModelNames: e.hideModelNames,
|
|
170
|
-
required: ((
|
|
171
|
+
required: ((N = a.value.required) == null ? void 0 : N.includes(l)) || ((A = a.value.properties[l]) == null ? void 0 : A.required) === !0,
|
|
171
172
|
schemas: e.schemas,
|
|
172
173
|
resolvedSchema: a.value.properties[l],
|
|
173
174
|
value: {
|
|
@@ -175,16 +176,16 @@ const ie = {
|
|
|
175
176
|
parent: a.value,
|
|
176
177
|
isDiscriminator: l === c.value || ((T = a.value.discriminator) == null ? void 0 : T.propertyName) === l
|
|
177
178
|
},
|
|
178
|
-
discriminatorMapping: ((z = a.value.discriminator) == null ? void 0 : z.mapping) ||
|
|
179
|
+
discriminatorMapping: ((z = a.value.discriminator) == null ? void 0 : z.mapping) || h.value,
|
|
179
180
|
discriminatorPropertyName: ((U = a.value.discriminator) == null ? void 0 : U.propertyName) || c.value,
|
|
180
181
|
isDiscriminator: l === (((q = a.value.discriminator) == null ? void 0 : q.propertyName) || c.value),
|
|
181
182
|
modelValue: D.value,
|
|
182
|
-
"onUpdate:modelValue":
|
|
183
|
+
"onUpdate:modelValue": y
|
|
183
184
|
}, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "required", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "isDiscriminator", "modelValue"]);
|
|
184
|
-
}), 128)) :
|
|
185
|
-
a.value.patternProperties ? (i(!0),
|
|
186
|
-
var
|
|
187
|
-
return i(),
|
|
185
|
+
}), 128)) : n("", !0),
|
|
186
|
+
a.value.patternProperties ? (i(!0), d(m, { key: 1 }, $(Object.keys(a.value.patternProperties), (l) => {
|
|
187
|
+
var N;
|
|
188
|
+
return i(), s(b, {
|
|
188
189
|
key: l,
|
|
189
190
|
compact: e.compact,
|
|
190
191
|
hideHeading: e.hideHeading,
|
|
@@ -193,14 +194,14 @@ const ie = {
|
|
|
193
194
|
hideModelNames: e.hideModelNames,
|
|
194
195
|
pattern: "",
|
|
195
196
|
schemas: e.schemas,
|
|
196
|
-
value: ((
|
|
197
|
-
discriminatorMapping:
|
|
197
|
+
value: ((N = e.value.discriminator) == null ? void 0 : N.propertyName) === l ? e.value : a.value.patternProperties[l],
|
|
198
|
+
discriminatorMapping: h.value,
|
|
198
199
|
discriminatorPropertyName: c.value,
|
|
199
|
-
"onUpdate:modelValue":
|
|
200
|
+
"onUpdate:modelValue": y
|
|
200
201
|
}, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"]);
|
|
201
|
-
}), 128)) :
|
|
202
|
-
a.value.additionalProperties ? (i(),
|
|
203
|
-
a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (i(),
|
|
202
|
+
}), 128)) : n("", !0),
|
|
203
|
+
a.value.additionalProperties ? (i(), d(m, { key: 2 }, [
|
|
204
|
+
a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (i(), s(b, {
|
|
204
205
|
key: 0,
|
|
205
206
|
additional: "",
|
|
206
207
|
compact: e.compact,
|
|
@@ -213,10 +214,10 @@ const ie = {
|
|
|
213
214
|
type: "anything",
|
|
214
215
|
...typeof a.value.additionalProperties == "object" ? a.value.additionalProperties : {}
|
|
215
216
|
},
|
|
216
|
-
discriminatorMapping:
|
|
217
|
+
discriminatorMapping: h.value,
|
|
217
218
|
discriminatorPropertyName: c.value,
|
|
218
|
-
"onUpdate:modelValue":
|
|
219
|
-
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"])) : (i(),
|
|
219
|
+
"onUpdate:modelValue": y
|
|
220
|
+
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"])) : (i(), s(b, {
|
|
220
221
|
key: 1,
|
|
221
222
|
additional: "",
|
|
222
223
|
compact: e.compact,
|
|
@@ -226,13 +227,13 @@ const ie = {
|
|
|
226
227
|
noncollapsible: "",
|
|
227
228
|
schemas: e.schemas,
|
|
228
229
|
value: ((f = e.value.discriminator) == null ? void 0 : f.propertyName) === e.name ? e.value : a.value.additionalProperties,
|
|
229
|
-
discriminatorMapping:
|
|
230
|
+
discriminatorMapping: h.value,
|
|
230
231
|
discriminatorPropertyName: c.value,
|
|
231
|
-
"onUpdate:modelValue":
|
|
232
|
+
"onUpdate:modelValue": y
|
|
232
233
|
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"]))
|
|
233
|
-
], 64)) :
|
|
234
|
-
], 64)) : (i(),
|
|
235
|
-
a.value ? (i(),
|
|
234
|
+
], 64)) : n("", !0)
|
|
235
|
+
], 64)) : (i(), d(m, { key: 1 }, [
|
|
236
|
+
a.value ? (i(), s(b, {
|
|
236
237
|
key: 0,
|
|
237
238
|
compact: e.compact,
|
|
238
239
|
hideHeading: e.hideHeading,
|
|
@@ -240,23 +241,23 @@ const ie = {
|
|
|
240
241
|
level: e.level,
|
|
241
242
|
name: a.value.name,
|
|
242
243
|
schemas: e.schemas,
|
|
243
|
-
value: ((
|
|
244
|
-
discriminatorMapping:
|
|
244
|
+
value: ((g = e.value.discriminator) == null ? void 0 : g.propertyName) === e.name ? e.value : a.value,
|
|
245
|
+
discriminatorMapping: h.value,
|
|
245
246
|
discriminatorPropertyName: c.value,
|
|
246
247
|
modelValue: D.value,
|
|
247
|
-
"onUpdate:modelValue":
|
|
248
|
-
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "name", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) :
|
|
248
|
+
"onUpdate:modelValue": y
|
|
249
|
+
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "name", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : n("", !0)
|
|
249
250
|
], 64))
|
|
250
251
|
];
|
|
251
252
|
}),
|
|
252
253
|
_: 1
|
|
253
|
-
}, 8, ["static"])
|
|
254
|
+
}, 8, ["static"])) : n("", !0)
|
|
254
255
|
], 2)
|
|
255
256
|
], 2)
|
|
256
257
|
];
|
|
257
258
|
}),
|
|
258
259
|
_: 1
|
|
259
|
-
}, 8, ["defaultOpen"])) :
|
|
260
|
+
}, 8, ["defaultOpen"])) : n("", !0);
|
|
260
261
|
}
|
|
261
262
|
});
|
|
262
263
|
export {
|
|
@@ -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":"AAyQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AAiTF,wBAOG"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as Z
|
|
3
|
-
import { ScalarIconCaretDown as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { hasComposition as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as z, ref as E, computed as t, resolveComponent as j, createElementBlock as d, openBlock as r, createCommentVNode as O, createBlock as c, Fragment as A, renderList as F, createVNode as H, createElementVNode as u, unref as h, withCtx as R, toDisplayString as N } from "vue";
|
|
2
|
+
import { ScalarListbox as Z } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCaretDown as $ } from "@scalar/icons";
|
|
4
|
+
import { getSchemaType as G } from "./helpers/get-schema-type.js";
|
|
5
|
+
import { mergeAllOfSchemas as V } from "./helpers/merge-all-of-schemas.js";
|
|
6
|
+
import { hasComposition as y } from "./helpers/schema-composition.js";
|
|
7
|
+
import b from "./Schema.vue.js";
|
|
8
|
+
const J = { class: "property-rule" }, K = {
|
|
9
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
|
-
},
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "property-description border-x border-t p-2"
|
|
14
|
-
}, te = /* @__PURE__ */ F({
|
|
11
|
+
}, M = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1" }, Q = { class: "composition-panel" }, le = /* @__PURE__ */ z({
|
|
15
12
|
__name: "SchemaComposition",
|
|
16
13
|
props: {
|
|
17
14
|
composition: {},
|
|
@@ -23,32 +20,32 @@ const K = { class: "property-rule" }, P = {
|
|
|
23
20
|
hideHeading: { type: Boolean }
|
|
24
21
|
},
|
|
25
22
|
setup(s) {
|
|
26
|
-
const
|
|
27
|
-
() =>
|
|
23
|
+
const p = E(0), w = t(() => S.value), g = t(
|
|
24
|
+
() => w.value.map(
|
|
28
25
|
(e, o) => ({
|
|
29
26
|
id: String(o),
|
|
30
|
-
label:
|
|
27
|
+
label: G(e) || "Schema"
|
|
31
28
|
})
|
|
32
29
|
)
|
|
33
|
-
),
|
|
34
|
-
get: () =>
|
|
35
|
-
(e) => e.id === String(
|
|
30
|
+
), f = t({
|
|
31
|
+
get: () => g.value.find(
|
|
32
|
+
(e) => e.id === String(p.value)
|
|
36
33
|
),
|
|
37
|
-
set: (e) =>
|
|
38
|
-
}),
|
|
34
|
+
set: (e) => p.value = Number(e.id)
|
|
35
|
+
}), B = t(() => {
|
|
39
36
|
var i;
|
|
40
|
-
const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) =>
|
|
37
|
+
const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) => y(l)));
|
|
41
38
|
return e || o;
|
|
42
|
-
}),
|
|
39
|
+
}), D = (e) => e.find((o) => y(o)), I = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
|
|
43
40
|
(o) => o.oneOf || o.anyOf || o.allOf
|
|
44
|
-
),
|
|
45
|
-
const e = s.value[s.composition], o =
|
|
46
|
-
return !o || s.composition !== "allOf" && o.allOf ? e.map(
|
|
47
|
-
}),
|
|
41
|
+
), C = (e) => e.allOf && Array.isArray(e.allOf) ? I(e) ? e : V(e.allOf) : e, S = t(() => {
|
|
42
|
+
const e = s.value[s.composition], o = D(e);
|
|
43
|
+
return !o || s.composition !== "allOf" && o.allOf ? e.map(C) : (o.oneOf || o.anyOf || o.allOf).map(C);
|
|
44
|
+
}), L = (e) => {
|
|
48
45
|
var o, i;
|
|
49
46
|
if (e === "allOf") {
|
|
50
47
|
const l = (i = (o = s.value) == null ? void 0 : o[e]) == null ? void 0 : i.find(
|
|
51
|
-
(m) =>
|
|
48
|
+
(m) => y(m)
|
|
52
49
|
);
|
|
53
50
|
if (l != null && l.oneOf)
|
|
54
51
|
return "One of";
|
|
@@ -57,99 +54,94 @@ const K = { class: "property-rule" }, P = {
|
|
|
57
54
|
}
|
|
58
55
|
return e.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).toLowerCase().replace(/^(\w)/, (l) => l.toUpperCase());
|
|
59
56
|
}, a = t(
|
|
60
|
-
() =>
|
|
61
|
-
),
|
|
57
|
+
() => S.value[p.value]
|
|
58
|
+
), v = t(() => {
|
|
62
59
|
var e;
|
|
63
60
|
return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
|
|
64
|
-
}),
|
|
61
|
+
}), T = t(() => {
|
|
65
62
|
var o;
|
|
66
|
-
const e =
|
|
63
|
+
const e = v.value;
|
|
67
64
|
return (o = a.value) == null ? void 0 : o[e];
|
|
68
|
-
}),
|
|
65
|
+
}), U = t(() => {
|
|
69
66
|
const e = a.value;
|
|
70
67
|
return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
|
|
71
68
|
});
|
|
72
69
|
return (e, o) => {
|
|
73
|
-
var l, m,
|
|
74
|
-
const i =
|
|
75
|
-
return r(),
|
|
76
|
-
e.composition === "allOf" && e.value[e.composition].some((n) => n.oneOf || n.anyOf) ? (r(!0),
|
|
70
|
+
var l, m, k;
|
|
71
|
+
const i = j("SchemaComposition", !0);
|
|
72
|
+
return r(), d("div", J, [
|
|
73
|
+
e.composition === "allOf" && e.value[e.composition].some((n) => n.oneOf || n.anyOf) ? (r(!0), d(A, { key: 0 }, F(e.value[e.composition].filter(
|
|
77
74
|
(n) => !n.oneOf && !n.anyOf
|
|
78
|
-
), (n,
|
|
79
|
-
key:
|
|
75
|
+
), (n, q) => (r(), c(b, {
|
|
76
|
+
key: q,
|
|
80
77
|
compact: e.compact,
|
|
81
78
|
level: e.level,
|
|
82
79
|
name: e.name,
|
|
83
80
|
noncollapsible: e.level == 0,
|
|
84
81
|
schemas: e.schemas,
|
|
85
82
|
value: n
|
|
86
|
-
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) :
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
modelValue:
|
|
90
|
-
"onUpdate:modelValue": o[0] || (o[0] = (n) =>
|
|
91
|
-
options:
|
|
83
|
+
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : O("", !0),
|
|
84
|
+
B.value ? (r(), d(A, { key: 1 }, [
|
|
85
|
+
H(h(Z), {
|
|
86
|
+
modelValue: f.value,
|
|
87
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => f.value = n),
|
|
88
|
+
options: g.value,
|
|
92
89
|
resize: ""
|
|
93
90
|
}, {
|
|
94
91
|
default: R(() => {
|
|
95
92
|
var n;
|
|
96
93
|
return [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
u("button", K, [
|
|
95
|
+
u("span", M, N(L(e.composition)), 1),
|
|
96
|
+
u("span", P, N(((n = f.value) == null ? void 0 : n.label) || "Schema"), 1),
|
|
97
|
+
H(h($))
|
|
101
98
|
])
|
|
102
99
|
];
|
|
103
100
|
}),
|
|
104
101
|
_: 1
|
|
105
102
|
}, 8, ["modelValue", "options"]),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
value: a.value.description
|
|
110
|
-
}, null, 8, ["value"])
|
|
111
|
-
])) : u("", !0),
|
|
112
|
-
z.value ? (r(), p(g, {
|
|
113
|
-
key: 1,
|
|
103
|
+
u("div", Q, [
|
|
104
|
+
U.value ? (r(), c(b, {
|
|
105
|
+
key: 0,
|
|
114
106
|
compact: e.compact,
|
|
115
107
|
level: e.level + 1,
|
|
116
108
|
hideHeading: e.hideHeading,
|
|
117
109
|
name: e.name,
|
|
118
110
|
noncollapsible: !0,
|
|
119
111
|
schemas: e.schemas,
|
|
120
|
-
value: (
|
|
112
|
+
value: (l = a.value) != null && l.properties ? {
|
|
121
113
|
type: "object",
|
|
122
114
|
properties: a.value.properties,
|
|
123
115
|
required: a.value.required
|
|
124
116
|
} : a.value
|
|
125
|
-
}, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) :
|
|
126
|
-
(
|
|
127
|
-
key:
|
|
117
|
+
}, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : O("", !0),
|
|
118
|
+
(m = a.value) != null && m.oneOf || (k = a.value) != null && k.anyOf ? (r(), c(i, {
|
|
119
|
+
key: 1,
|
|
128
120
|
compact: e.compact,
|
|
129
|
-
composition:
|
|
121
|
+
composition: v.value,
|
|
130
122
|
hideHeading: e.hideHeading,
|
|
131
123
|
level: e.level + 1,
|
|
132
124
|
name: e.name,
|
|
133
125
|
noncollapsible: !0,
|
|
134
126
|
schemas: e.schemas,
|
|
135
127
|
value: {
|
|
136
|
-
[
|
|
128
|
+
[v.value]: T.value
|
|
137
129
|
}
|
|
138
|
-
}, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) :
|
|
130
|
+
}, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : O("", !0)
|
|
139
131
|
])
|
|
140
|
-
], 64)) : (r(),
|
|
132
|
+
], 64)) : (r(), c(b, {
|
|
141
133
|
key: 2,
|
|
142
134
|
compact: e.compact,
|
|
143
135
|
level: e.level,
|
|
144
136
|
name: e.name,
|
|
145
137
|
noncollapsible: e.level == 0,
|
|
146
138
|
schemas: e.schemas,
|
|
147
|
-
value:
|
|
139
|
+
value: h(V)(e.value[e.composition])
|
|
148
140
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
|
|
149
141
|
]);
|
|
150
142
|
};
|
|
151
143
|
}
|
|
152
144
|
});
|
|
153
145
|
export {
|
|
154
|
-
|
|
146
|
+
le as default
|
|
155
147
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type SchemaValue = {
|
|
2
|
+
'enum'?: any[];
|
|
3
|
+
'items'?: {
|
|
4
|
+
enum?: any[];
|
|
5
|
+
};
|
|
6
|
+
'x-enumDescriptions'?: Record<string, string> | string[];
|
|
7
|
+
'x-enum-descriptions'?: Record<string, string> | string[];
|
|
8
|
+
'x-enum-varnames'?: string[];
|
|
9
|
+
'x-enumNames'?: string[];
|
|
10
|
+
} & Record<string, any>;
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
/** The schema object containing enum values and metadata */
|
|
13
|
+
value?: SchemaValue;
|
|
14
|
+
/** Whether this enum is used as a discriminator property */
|
|
15
|
+
isDiscriminator?: boolean;
|
|
16
|
+
};
|
|
17
|
+
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>;
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=SchemaEnumValues.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaEnumValues.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnumValues.vue"],"names":[],"mappings":"AA6TA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAA;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;IACxD,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;IACzD,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAGvB,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;AAkUF,wBAMG"}
|