@scalar/api-reference 1.31.0 → 1.31.1
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 +8 -0
- package/dist/browser/standalone.js +2030 -1927
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +1 -1
- package/dist/components/Content/Models/Models.vue2.js +2 -1
- package/dist/components/Content/Schema/Schema.preview.d.ts +252 -84
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +17 -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 +146 -128
- 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/SchemaDiscriminator.vue.d.ts +2 -3
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +29 -29
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +10 -3
- 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 +129 -101
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +2 -2
- 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 +122 -115
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ClassicLayout.vue.js +11 -11
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +2 -2
- package/dist/components/Section/SectionAccordion.vue2.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +2 -2
- package/dist/components/Section/SectionContainerAccordion.vue2.js +4 -4
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +2 -0
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +178 -127
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +29 -23
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +7 -3
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +28 -24
- package/dist/features/Operation/components/RequestBody.vue.d.ts +5 -1
- 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 +41 -36
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +5 -1
- 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 +79 -74
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +5 -1
- 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 +63 -57
- package/dist/hooks/useDiscriminator.d.ts +53 -0
- package/dist/hooks/useDiscriminator.d.ts.map +1 -0
- package/dist/hooks/useDiscriminator.js +149 -0
- package/dist/hooks/useOperationDiscriminator.d.ts +8 -0
- package/dist/hooks/useOperationDiscriminator.d.ts.map +1 -0
- package/dist/hooks/useOperationDiscriminator.js +57 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +0 -12
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +0 -1
- package/dist/components/Content/Schema/helpers/schema-discriminator.js +0 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.preview.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.preview.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"Schema.preview.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.preview.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWxB,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAA;AAWD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAO3B,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWtB,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBhC,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgChC,CAAA;AAED,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C3C,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+D9B,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCjC,CAAA;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCvC,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyE/B,CAAA;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CnC,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD1C,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDlC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
import type { Schemas } from '../../../features/Operation/types/schemas';
|
|
2
3
|
type __VLS_Props = {
|
|
3
|
-
value?: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject;
|
|
4
|
+
value?: OpenAPIV3_1.OperationObject | OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject | OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject;
|
|
4
5
|
/** Track how deep we’ve gone */
|
|
5
6
|
level?: number;
|
|
6
7
|
name?: string;
|
|
@@ -13,9 +14,22 @@ type __VLS_Props = {
|
|
|
13
14
|
additionalProperties?: boolean;
|
|
14
15
|
/** Hide model names in type display */
|
|
15
16
|
hideModelNames?: boolean;
|
|
16
|
-
schemas
|
|
17
|
+
/** All schemas for model name retrieval */
|
|
18
|
+
schemas?: Schemas;
|
|
19
|
+
/** Selected discriminator */
|
|
20
|
+
discriminator?: string;
|
|
21
|
+
/** Discriminator mapping */
|
|
22
|
+
discriminatorMapping?: Record<string, string>;
|
|
23
|
+
/** Discriminator property name */
|
|
24
|
+
discriminatorPropertyName?: string;
|
|
25
|
+
/** Whether the schema has a discriminator */
|
|
26
|
+
hasDiscriminator?: boolean;
|
|
17
27
|
};
|
|
18
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
28
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
|
+
"update:modelValue": (value: string) => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
32
|
+
}>, {
|
|
19
33
|
level: number;
|
|
20
34
|
noncollapsible: boolean;
|
|
21
35
|
hideModelNames: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AAmfA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAIxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAQjE,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EACF,WAAW,CAAC,eAAe,GAC3B,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,GAChC,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,4BAA4B;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,kCAAkC;IAClC,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;;;;;WAtBQ,MAAM;oBAMG,OAAO;oBAKP,OAAO;;AA6lB5B,wBAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Schema.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-be133070"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
3
|
-
import { ScalarMarkdown as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import _ from "./SchemaHeading.vue.js";
|
|
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 M, createElementBlock as o, withDirectives as E, createVNode as h, createTextVNode as P, toDisplayString as H, vShow as R, normalizeStyle as Y, Fragment as m, renderList as $ } from "vue";
|
|
2
|
+
import { Disclosure as Z, DisclosureButton as F, DisclosurePanel as _ } from "@headlessui/vue";
|
|
3
|
+
import { ScalarMarkdown as x, ScalarIcon as V } from "@scalar/components";
|
|
4
|
+
import L from "../../ScreenReader.vue.js";
|
|
5
|
+
import { DISCRIMINATOR_CONTEXT as ee } from "../../../hooks/useDiscriminator.js";
|
|
6
|
+
import ae from "./SchemaHeading.vue.js";
|
|
8
7
|
import b from "./SchemaProperty.vue.js";
|
|
9
|
-
const
|
|
8
|
+
const ie = {
|
|
10
9
|
key: 0,
|
|
11
10
|
class: "schema-card-description"
|
|
12
|
-
},
|
|
11
|
+
}, le = {
|
|
13
12
|
key: 0,
|
|
14
13
|
class: "schema-properties"
|
|
15
|
-
},
|
|
14
|
+
}, ue = /* @__PURE__ */ Q({
|
|
16
15
|
__name: "Schema",
|
|
17
16
|
props: {
|
|
18
17
|
value: { type: [Object, Boolean] },
|
|
@@ -23,118 +22,125 @@ const x = {
|
|
|
23
22
|
hideHeading: { type: Boolean },
|
|
24
23
|
additionalProperties: { type: Boolean },
|
|
25
24
|
hideModelNames: { type: Boolean, default: !1 },
|
|
26
|
-
schemas: {}
|
|
25
|
+
schemas: {},
|
|
26
|
+
discriminator: {},
|
|
27
|
+
discriminatorMapping: {},
|
|
28
|
+
discriminatorPropertyName: {},
|
|
29
|
+
hasDiscriminator: { type: Boolean }
|
|
27
30
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
emits: ["update:modelValue"],
|
|
32
|
+
setup(X, { emit: G }) {
|
|
33
|
+
const d = X, J = G, r = W(ee, null), y = p(
|
|
34
|
+
() => {
|
|
35
|
+
var e;
|
|
36
|
+
return ((e = r == null ? void 0 : r.value) == null ? void 0 : e.discriminatorMapping) || d.discriminatorMapping || {};
|
|
37
|
+
}
|
|
38
|
+
), c = p(
|
|
39
|
+
() => {
|
|
40
|
+
var e;
|
|
41
|
+
return ((e = r == null ? void 0 : r.value) == null ? void 0 : e.discriminatorPropertyName) || d.discriminatorPropertyName || "";
|
|
42
|
+
}
|
|
43
|
+
), O = p(
|
|
44
|
+
() => {
|
|
45
|
+
var e;
|
|
46
|
+
return ((e = r == null ? void 0 : r.value) == null ? void 0 : e.selectedType) || d.discriminator;
|
|
47
|
+
}
|
|
48
|
+
), j = (e) => e !== null && typeof e == "object" && "type" in e && e.type === "object", a = p(() => {
|
|
49
|
+
var t;
|
|
50
|
+
const e = (t = r == null ? void 0 : r.value) == null ? void 0 : t.mergedSchema, S = d.value;
|
|
51
|
+
return e && j(S) && j(e) ? e : d.value;
|
|
52
|
+
}), D = p(() => !(d.noncollapsible || d.level === 0)), K = p(() => {
|
|
43
53
|
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 ||
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
e && !m.value && (m.value = F.value);
|
|
50
|
-
},
|
|
51
|
-
{ immediate: !0 }
|
|
52
|
-
), (e, M) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), o(n(J), {
|
|
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 || d.level === 0);
|
|
55
|
+
}), B = (e) => d.noncollapsible && e.stopPropagation(), g = (e) => {
|
|
56
|
+
J("update:modelValue", e);
|
|
57
|
+
};
|
|
58
|
+
return (e, S) => typeof e.value == "object" && Object.keys(e.value).length ? (i(), s(u(Z), {
|
|
53
59
|
key: 0,
|
|
54
60
|
defaultOpen: e.noncollapsible
|
|
55
61
|
}, {
|
|
56
|
-
default: v(({ open:
|
|
57
|
-
var
|
|
62
|
+
default: v(({ open: t }) => {
|
|
63
|
+
var w, C;
|
|
58
64
|
return [
|
|
59
|
-
|
|
60
|
-
class:
|
|
65
|
+
I("div", {
|
|
66
|
+
class: M(["schema-card", [
|
|
61
67
|
`schema-card--level-${e.level}`,
|
|
62
|
-
{ "schema-card--compact": e.compact, "schema-card--open":
|
|
63
|
-
{ "border-t": e.additionalProperties &&
|
|
68
|
+
{ "schema-card--compact": e.compact, "schema-card--open": t },
|
|
69
|
+
{ "border-t": e.additionalProperties && t }
|
|
64
70
|
]])
|
|
65
71
|
}, [
|
|
66
|
-
|
|
67
|
-
(
|
|
72
|
+
K.value ? (i(), o("div", ie, [
|
|
73
|
+
(w = a.value) != null && w.enum ? n("", !0) : (i(), s(u(x), {
|
|
68
74
|
key: 0,
|
|
69
|
-
value: (
|
|
75
|
+
value: (C = a.value) == null ? void 0 : C.description
|
|
70
76
|
}, null, 8, ["value"]))
|
|
71
|
-
])) :
|
|
72
|
-
|
|
73
|
-
class:
|
|
74
|
-
"schema-properties-open":
|
|
77
|
+
])) : n("", !0),
|
|
78
|
+
I("div", {
|
|
79
|
+
class: M(["schema-properties", {
|
|
80
|
+
"schema-properties-open": t
|
|
75
81
|
}])
|
|
76
82
|
}, [
|
|
77
|
-
e.additionalProperties ?
|
|
78
|
-
h(
|
|
83
|
+
e.additionalProperties ? E((i(), o("div", le, [
|
|
84
|
+
h(u(F), {
|
|
79
85
|
as: "button",
|
|
80
86
|
class: "schema-card-title schema-card-title--compact",
|
|
81
|
-
onClickCapture:
|
|
87
|
+
onClickCapture: B
|
|
82
88
|
}, {
|
|
83
89
|
default: v(() => [
|
|
84
|
-
h(
|
|
90
|
+
h(u(V), {
|
|
85
91
|
class: "schema-card-title-icon",
|
|
86
92
|
icon: "Add",
|
|
87
93
|
size: "sm"
|
|
88
94
|
}),
|
|
89
|
-
|
|
90
|
-
e.name ? (
|
|
95
|
+
S[0] || (S[0] = P(" Show additional properties ")),
|
|
96
|
+
e.name ? (i(), s(L, { key: 0 }, {
|
|
91
97
|
default: v(() => [
|
|
92
98
|
P("for " + H(e.name), 1)
|
|
93
99
|
]),
|
|
94
100
|
_: 1
|
|
95
|
-
})) :
|
|
101
|
+
})) : n("", !0)
|
|
96
102
|
]),
|
|
97
103
|
_: 1
|
|
98
104
|
})
|
|
99
105
|
], 512)), [
|
|
100
|
-
[
|
|
101
|
-
]) :
|
|
106
|
+
[R, !t]
|
|
107
|
+
]) : D.value ? E((i(), s(u(F), {
|
|
102
108
|
key: 1,
|
|
103
109
|
as: e.noncollapsible ? "div" : "button",
|
|
104
|
-
class:
|
|
105
|
-
style:
|
|
110
|
+
class: M(["schema-card-title", { "schema-card-title--compact": e.compact }]),
|
|
111
|
+
style: Y({
|
|
106
112
|
top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
|
|
107
113
|
}),
|
|
108
|
-
onClickCapture:
|
|
114
|
+
onClickCapture: B
|
|
109
115
|
}, {
|
|
110
116
|
default: v(() => {
|
|
111
|
-
var f,
|
|
117
|
+
var f, N, l;
|
|
112
118
|
return [
|
|
113
|
-
e.compact ? (
|
|
114
|
-
h(
|
|
115
|
-
class:
|
|
119
|
+
e.compact ? (i(), o(m, { key: 0 }, [
|
|
120
|
+
h(u(V), {
|
|
121
|
+
class: M(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
116
122
|
icon: "Add",
|
|
117
123
|
size: "sm"
|
|
118
124
|
}, null, 8, ["class"]),
|
|
119
|
-
|
|
125
|
+
t ? (i(), o(m, { key: 0 }, [
|
|
120
126
|
P(" Hide " + H(((f = e.value) == null ? void 0 : f.title) ?? "Child Attributes"), 1)
|
|
121
|
-
], 64)) : (
|
|
122
|
-
P(" Show " + H(((
|
|
127
|
+
], 64)) : (i(), o(m, { key: 1 }, [
|
|
128
|
+
P(" Show " + H(((N = e.value) == null ? void 0 : N.title) ?? "Child Attributes"), 1)
|
|
123
129
|
], 64)),
|
|
124
|
-
e.name ? (
|
|
130
|
+
e.name ? (i(), s(L, { key: 2 }, {
|
|
125
131
|
default: v(() => [
|
|
126
132
|
P("for " + H(e.name), 1)
|
|
127
133
|
]),
|
|
128
134
|
_: 1
|
|
129
|
-
})) :
|
|
130
|
-
], 64)) : (
|
|
131
|
-
h(
|
|
132
|
-
class:
|
|
135
|
+
})) : n("", !0)
|
|
136
|
+
], 64)) : (i(), o(m, { key: 1 }, [
|
|
137
|
+
h(u(V), {
|
|
138
|
+
class: M(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
|
|
133
139
|
icon: "Add",
|
|
134
140
|
size: "sm"
|
|
135
141
|
}, null, 8, ["class"]),
|
|
136
|
-
h(
|
|
137
|
-
name: ((
|
|
142
|
+
h(ae, {
|
|
143
|
+
name: ((l = e.value) == null ? void 0 : l.title) ?? e.name,
|
|
138
144
|
value: e.value
|
|
139
145
|
}, null, 8, ["name", "value"])
|
|
140
146
|
], 64))
|
|
@@ -142,63 +148,64 @@ const x = {
|
|
|
142
148
|
}),
|
|
143
149
|
_: 2
|
|
144
150
|
}, 1032, ["as", "class", "style"])), [
|
|
145
|
-
[
|
|
146
|
-
]) :
|
|
147
|
-
h(
|
|
151
|
+
[R, !e.hideHeading && !(e.noncollapsible && e.compact)]
|
|
152
|
+
]) : n("", !0),
|
|
153
|
+
h(u(_), {
|
|
148
154
|
as: "ul",
|
|
149
|
-
static: !
|
|
155
|
+
static: !D.value
|
|
150
156
|
}, {
|
|
151
157
|
default: v(() => {
|
|
152
|
-
var f,
|
|
158
|
+
var f, N;
|
|
153
159
|
return [
|
|
154
|
-
|
|
155
|
-
key: 0,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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,
|
|
160
|
+
a.value && typeof a.value == "object" && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (i(), o(m, { key: 0 }, [
|
|
161
|
+
a.value.properties ? (i(!0), o(m, { key: 0 }, $(Object.keys(a.value.properties), (l) => {
|
|
162
|
+
var k, A, T, z, U, q;
|
|
163
|
+
return i(), s(b, {
|
|
164
|
+
key: l,
|
|
166
165
|
compact: e.compact,
|
|
167
166
|
hideHeading: e.hideHeading,
|
|
168
167
|
level: e.level + 1,
|
|
169
|
-
name:
|
|
170
|
-
|
|
168
|
+
name: l,
|
|
169
|
+
hideModelNames: e.hideModelNames,
|
|
170
|
+
required: ((k = a.value.required) == null ? void 0 : k.includes(l)) || ((A = a.value.properties[l]) == null ? void 0 : A.required) === !0,
|
|
171
171
|
schemas: e.schemas,
|
|
172
|
+
resolvedSchema: a.value.properties[l],
|
|
172
173
|
value: {
|
|
173
|
-
...a.value.properties[
|
|
174
|
+
...a.value.properties[l],
|
|
174
175
|
parent: a.value,
|
|
175
|
-
isDiscriminator:
|
|
176
|
+
isDiscriminator: l === c.value || ((T = a.value.discriminator) == null ? void 0 : T.propertyName) === l
|
|
176
177
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
discriminatorMapping: ((z = a.value.discriminator) == null ? void 0 : z.mapping) || y.value,
|
|
179
|
+
discriminatorPropertyName: ((U = a.value.discriminator) == null ? void 0 : U.propertyName) || c.value,
|
|
180
|
+
isDiscriminator: l === (((q = a.value.discriminator) == null ? void 0 : q.propertyName) || c.value),
|
|
181
|
+
modelValue: O.value,
|
|
182
|
+
"onUpdate:modelValue": g
|
|
183
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "required", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "isDiscriminator", "modelValue"]);
|
|
184
|
+
}), 128)) : n("", !0),
|
|
185
|
+
a.value.patternProperties ? (i(!0), o(m, { key: 1 }, $(Object.keys(a.value.patternProperties), (l) => {
|
|
183
186
|
var k;
|
|
184
|
-
return
|
|
185
|
-
key:
|
|
187
|
+
return i(), s(b, {
|
|
188
|
+
key: l,
|
|
186
189
|
compact: e.compact,
|
|
187
190
|
hideHeading: e.hideHeading,
|
|
188
191
|
level: e.level,
|
|
189
|
-
name:
|
|
192
|
+
name: l,
|
|
193
|
+
hideModelNames: e.hideModelNames,
|
|
190
194
|
pattern: "",
|
|
191
195
|
schemas: e.schemas,
|
|
192
|
-
value: ((k = e.value.discriminator) == null ? void 0 : k.propertyName) ===
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
value: ((k = e.value.discriminator) == null ? void 0 : k.propertyName) === l ? e.value : a.value.patternProperties[l],
|
|
197
|
+
discriminatorMapping: y.value,
|
|
198
|
+
discriminatorPropertyName: c.value,
|
|
199
|
+
"onUpdate:modelValue": g
|
|
200
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"]);
|
|
201
|
+
}), 128)) : n("", !0),
|
|
202
|
+
a.value.additionalProperties ? (i(), o(m, { key: 2 }, [
|
|
203
|
+
a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (i(), s(b, {
|
|
198
204
|
key: 0,
|
|
199
205
|
additional: "",
|
|
200
206
|
compact: e.compact,
|
|
201
207
|
hideHeading: e.hideHeading,
|
|
208
|
+
hideModelNames: e.hideModelNames,
|
|
202
209
|
level: e.level,
|
|
203
210
|
noncollapsible: "",
|
|
204
211
|
schemas: e.schemas,
|
|
@@ -206,29 +213,40 @@ const x = {
|
|
|
206
213
|
type: "anything",
|
|
207
214
|
...typeof a.value.additionalProperties == "object" ? a.value.additionalProperties : {}
|
|
208
215
|
},
|
|
209
|
-
|
|
210
|
-
|
|
216
|
+
discriminatorMapping: y.value,
|
|
217
|
+
discriminatorPropertyName: c.value,
|
|
218
|
+
"onUpdate:modelValue": g
|
|
219
|
+
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"])) : (i(), s(b, {
|
|
211
220
|
key: 1,
|
|
212
221
|
additional: "",
|
|
213
222
|
compact: e.compact,
|
|
214
223
|
hideHeading: e.hideHeading,
|
|
224
|
+
hideModelNames: e.hideModelNames,
|
|
215
225
|
level: e.level,
|
|
216
226
|
noncollapsible: "",
|
|
217
227
|
schemas: e.schemas,
|
|
218
|
-
value: ((
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
value: ((f = e.value.discriminator) == null ? void 0 : f.propertyName) === e.name ? e.value : a.value.additionalProperties,
|
|
229
|
+
discriminatorMapping: y.value,
|
|
230
|
+
discriminatorPropertyName: c.value,
|
|
231
|
+
"onUpdate:modelValue": g
|
|
232
|
+
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"]))
|
|
233
|
+
], 64)) : n("", !0)
|
|
234
|
+
], 64)) : (i(), o(m, { key: 1 }, [
|
|
235
|
+
a.value ? (i(), s(b, {
|
|
236
|
+
key: 0,
|
|
237
|
+
compact: e.compact,
|
|
238
|
+
hideHeading: e.hideHeading,
|
|
239
|
+
hideModelNames: e.hideModelNames,
|
|
240
|
+
level: e.level,
|
|
241
|
+
name: a.value.name,
|
|
242
|
+
schemas: e.schemas,
|
|
243
|
+
value: ((N = e.value.discriminator) == null ? void 0 : N.propertyName) === e.name ? e.value : a.value,
|
|
244
|
+
discriminatorMapping: y.value,
|
|
245
|
+
discriminatorPropertyName: c.value,
|
|
246
|
+
modelValue: O.value,
|
|
247
|
+
"onUpdate:modelValue": g
|
|
248
|
+
}, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "name", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : n("", !0)
|
|
249
|
+
], 64))
|
|
232
250
|
];
|
|
233
251
|
}),
|
|
234
252
|
_: 1
|
|
@@ -238,9 +256,9 @@ const x = {
|
|
|
238
256
|
];
|
|
239
257
|
}),
|
|
240
258
|
_: 1
|
|
241
|
-
}, 8, ["defaultOpen"])) :
|
|
259
|
+
}, 8, ["defaultOpen"])) : n("", !0);
|
|
242
260
|
}
|
|
243
261
|
});
|
|
244
262
|
export {
|
|
245
|
-
|
|
263
|
+
ue as default
|
|
246
264
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Schemas } from '../../../features/Operation/types/schemas';
|
|
2
2
|
import { type CompositionKeyword } from './helpers/schema-composition.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
composition: CompositionKeyword;
|
|
5
|
-
schemas?:
|
|
5
|
+
schemas?: Schemas;
|
|
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":"AA2SA,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;;AAgWF,wBAOG"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { DiscriminatorMapping
|
|
1
|
+
import type { DiscriminatorMapping } from '../../../hooks/useDiscriminator.js';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
discriminatorMapping: DiscriminatorMapping;
|
|
4
|
-
|
|
5
|
-
discriminatorPropertyName?: DiscriminatorPropertyName;
|
|
4
|
+
discriminator: string;
|
|
6
5
|
};
|
|
7
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
8
7
|
"update:modelValue": (value: string) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAIpE,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,aAAa,EAAE,MAAM,CAAA;CACtB,CAAC;;;;;;AA+HF,wBAQG"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { ScalarIconCaretDown as
|
|
4
|
-
const
|
|
5
|
-
class: "bg-b-1.5 hover:bg-b-2 flex w-full items-center gap-1 border
|
|
1
|
+
import { defineComponent as p, ref as f, computed as n, createBlock as b, openBlock as g, unref as s, withCtx as v, createElementVNode as l, createVNode as x, toDisplayString as h } from "vue";
|
|
2
|
+
import { ScalarListbox as V } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCaretDown as D } from "@scalar/icons";
|
|
4
|
+
const S = {
|
|
5
|
+
class: "bg-b-1.5 hover:bg-b-2 flex w-full items-center gap-1 rounded border px-2 py-1.25",
|
|
6
6
|
type: "button"
|
|
7
|
-
},
|
|
7
|
+
}, _ = { class: "composition-selector-label text-c-1 relative" }, M = /* @__PURE__ */ p({
|
|
8
8
|
__name: "SchemaDiscriminator",
|
|
9
9
|
props: {
|
|
10
10
|
discriminatorMapping: {},
|
|
11
|
-
|
|
12
|
-
discriminatorPropertyName: {}
|
|
11
|
+
discriminator: {}
|
|
13
12
|
},
|
|
14
13
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(
|
|
16
|
-
const d =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
),
|
|
22
|
-
get: () =>
|
|
23
|
-
(e) => e.id ===
|
|
14
|
+
setup(i, { emit: c }) {
|
|
15
|
+
const m = f(""), d = c, u = (e) => {
|
|
16
|
+
m.value = e, d("update:modelValue", e);
|
|
17
|
+
}, a = n(() => i.discriminatorMapping ? Object.keys(i.discriminatorMapping).map((e) => ({
|
|
18
|
+
id: e,
|
|
19
|
+
label: e
|
|
20
|
+
})) : []), o = n({
|
|
21
|
+
get: () => a.value.find(
|
|
22
|
+
(e) => e.id === i.discriminator
|
|
24
23
|
),
|
|
25
|
-
set: (e) =>
|
|
24
|
+
set: (e) => {
|
|
25
|
+
e != null && e.id && u(e.id);
|
|
26
|
+
}
|
|
26
27
|
});
|
|
27
|
-
return (e,
|
|
28
|
-
modelValue:
|
|
29
|
-
"onUpdate:modelValue":
|
|
30
|
-
options:
|
|
28
|
+
return (e, r) => (g(), b(s(V), {
|
|
29
|
+
modelValue: o.value,
|
|
30
|
+
"onUpdate:modelValue": r[0] || (r[0] = (t) => o.value = t),
|
|
31
|
+
options: a.value,
|
|
31
32
|
resize: ""
|
|
32
33
|
}, {
|
|
33
|
-
default:
|
|
34
|
-
var
|
|
34
|
+
default: v(() => {
|
|
35
|
+
var t;
|
|
35
36
|
return [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
V(s(g))
|
|
37
|
+
l("button", S, [
|
|
38
|
+
l("span", _, h(((t = o.value) == null ? void 0 : t.label) || "Schema"), 1),
|
|
39
|
+
x(s(D), { class: "z-1" })
|
|
40
40
|
])
|
|
41
41
|
];
|
|
42
42
|
}),
|
|
@@ -45,5 +45,5 @@ const v = {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
M as default
|
|
49
49
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
1
|
import { type Component } from 'vue';
|
|
2
|
+
import type { Schemas } from '../../../features/Operation/types/schemas';
|
|
3
3
|
/**
|
|
4
4
|
* Note: We’re taking in a prop called `value` which should be a JSON Schema.
|
|
5
5
|
*
|
|
@@ -19,10 +19,17 @@ type __VLS_Props = {
|
|
|
19
19
|
pattern?: boolean;
|
|
20
20
|
withExamples?: boolean;
|
|
21
21
|
hideModelNames?: boolean;
|
|
22
|
-
schemas?:
|
|
22
|
+
schemas?: Schemas;
|
|
23
23
|
hideHeading?: boolean;
|
|
24
|
+
discriminatorMapping?: Record<string, string>;
|
|
25
|
+
discriminatorPropertyName?: string;
|
|
26
|
+
isDiscriminator?: boolean;
|
|
24
27
|
};
|
|
25
|
-
declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
28
|
+
declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
|
+
"update:modelValue": (value: string) => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
32
|
+
}>, {
|
|
26
33
|
required: boolean;
|
|
27
34
|
level: number;
|
|
28
35
|
compact: 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":"AA0kBA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAOtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAUjE;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;;;;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAKA,OAAO;kBADT,OAAO;;AAmkB1B,0BASG"}
|
|
@@ -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
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9998b466"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|