@scalar/api-reference 1.32.5 → 1.32.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 +50 -0
- package/dist/browser/standalone.js +9924 -9851
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +8 -8
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +28 -26
- 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 +97 -156
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts +7 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +25 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +73 -90
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +21 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +92 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +4 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -2
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +54 -55
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +0 -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 +81 -97
- package/dist/components/Content/Schema/helpers/{formatExample.d.ts → format-example.d.ts} +1 -1
- package/dist/components/Content/Schema/helpers/format-example.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts +3 -0
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js +17 -0
- package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.d.ts → optimize-value-for-display.d.ts} +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -0
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +4 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +8 -8
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +4 -2
- 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 +30 -30
- package/dist/features/api-client-modal/useApiClient.d.ts +84 -4
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/download-link/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/download-link/DownloadLink.vue.js +1 -1
- package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/example-request/ExampleRequest.vue.js +1 -1
- package/dist/features/example-request/ExampleRequest.vue2.js +126 -124
- package/dist/features/example-responses/ExampleResponse.vue.js +2 -2
- 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 +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue2.js +16 -15
- package/dist/helpers/convert-security-scheme.d.ts +9 -0
- package/dist/helpers/convert-security-scheme.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +0 -13
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +49 -63
- package/dist/stores/useHttpClientStore.js +20 -20
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +84 -75
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +19 -0
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +21 -72
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +4 -2
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +5 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts +1 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +1 -1
- package/dist/v2/events/definitions.d.ts +13 -4
- package/dist/v2/events/definitions.d.ts.map +1 -1
- package/dist/v2/hooks/useStore.d.ts +9 -0
- package/dist/v2/hooks/useStore.d.ts.map +1 -0
- package/package.json +13 -12
- package/dist/components/Content/Schema/helpers/formatExample.d.ts.map +0 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +0 -1
- /package/dist/components/Content/Schema/helpers/{formatExample.js → format-example.js} +0 -0
- /package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.js → optimize-value-for-display.js} +0 -0
|
@@ -1,125 +1,108 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as j, computed as i, createElementBlock as o, createCommentVNode as k, openBlock as l, Fragment as y, renderList as p, createBlock as m, unref as v, withCtx as f, createVNode as D, createTextVNode as H, normalizeClass as O, toDisplayString as P } from "vue";
|
|
2
|
+
import { Disclosure as $, DisclosurePanel as F, DisclosureButton as U } from "@headlessui/vue";
|
|
3
|
+
import { ScalarIcon as w } from "@scalar/components";
|
|
4
|
+
import A from "./SchemaEnumPropertyItem.vue.js";
|
|
5
|
+
const z = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "property-enum"
|
|
7
8
|
}, R = {
|
|
8
9
|
key: 0,
|
|
9
|
-
class: "property-
|
|
10
|
-
},
|
|
10
|
+
class: "property-enum-values"
|
|
11
|
+
}, M = {
|
|
11
12
|
key: 1,
|
|
12
13
|
class: "property-enum-values"
|
|
13
|
-
},
|
|
14
|
+
}, N = 9, W = 5, S = " ", K = /* @__PURE__ */ j({
|
|
14
15
|
__name: "SchemaEnumValues",
|
|
15
16
|
props: {
|
|
16
17
|
value: {},
|
|
17
18
|
isDiscriminator: { type: Boolean }
|
|
18
19
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
var
|
|
22
|
-
return t ? t.enum || ((
|
|
23
|
-
},
|
|
24
|
-
var
|
|
25
|
-
const e = ((
|
|
26
|
-
return e ? `${t}${
|
|
27
|
-
},
|
|
28
|
-
var
|
|
29
|
-
const
|
|
30
|
-
if (Array.isArray(
|
|
31
|
-
return
|
|
32
|
-
const e = (
|
|
20
|
+
setup(s) {
|
|
21
|
+
const I = (t) => {
|
|
22
|
+
var n;
|
|
23
|
+
return t ? t.enum || ((n = t.items) == null ? void 0 : n.enum) || [] : [];
|
|
24
|
+
}, E = (t, n) => {
|
|
25
|
+
var r, u, h, x;
|
|
26
|
+
const e = ((u = (r = s.value) == null ? void 0 : r["x-enum-varnames"]) == null ? void 0 : u[n]) ?? ((x = (h = s.value) == null ? void 0 : h["x-enumNames"]) == null ? void 0 : x[n]);
|
|
27
|
+
return e ? `${t}${S}=${S}${e}` : String(t);
|
|
28
|
+
}, d = (t) => {
|
|
29
|
+
var r, u;
|
|
30
|
+
const n = (r = s.value) == null ? void 0 : r["x-enum-descriptions"];
|
|
31
|
+
if (Array.isArray(n))
|
|
32
|
+
return n[t];
|
|
33
|
+
const e = (u = s.value) == null ? void 0 : u["x-enumDescriptions"];
|
|
33
34
|
if (Array.isArray(e))
|
|
34
35
|
return e[t];
|
|
35
|
-
},
|
|
36
|
-
var
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
40
|
-
const e = (
|
|
36
|
+
}, C = (t) => {
|
|
37
|
+
var r, u;
|
|
38
|
+
const n = (r = s.value) == null ? void 0 : r["x-enumDescriptions"];
|
|
39
|
+
if (n && !Array.isArray(n))
|
|
40
|
+
return n[t];
|
|
41
|
+
const e = (u = s.value) == null ? void 0 : u["x-enum-descriptions"];
|
|
41
42
|
if (e && !Array.isArray(e))
|
|
42
43
|
return e[t];
|
|
43
|
-
},
|
|
44
|
-
() =>
|
|
45
|
-
),
|
|
46
|
-
() =>
|
|
47
|
-
),
|
|
48
|
-
() =>
|
|
49
|
-
),
|
|
50
|
-
() =>
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
}, a = i(() => I(s.value)), L = i(() => a.value.length > 0), b = i(
|
|
45
|
+
() => a.value.length > N
|
|
46
|
+
), c = i(
|
|
47
|
+
() => b.value ? W : N
|
|
48
|
+
), B = i(
|
|
49
|
+
() => a.value.slice(0, c.value)
|
|
50
|
+
), V = i(
|
|
51
|
+
() => a.value.slice(c.value)
|
|
52
|
+
);
|
|
53
|
+
i(() => {
|
|
54
|
+
var n, e;
|
|
55
|
+
const t = ((n = s.value) == null ? void 0 : n["x-enumDescriptions"]) ?? ((e = s.value) == null ? void 0 : e["x-enum-descriptions"]);
|
|
54
56
|
return t && typeof t == "object" && !Array.isArray(t);
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
});
|
|
58
|
+
const g = i(() => {
|
|
59
|
+
var n, e;
|
|
60
|
+
const t = ((n = s.value) == null ? void 0 : n["x-enumDescriptions"]) ?? ((e = s.value) == null ? void 0 : e["x-enum-descriptions"]);
|
|
58
61
|
return t && typeof t == "object" && !Array.isArray(t);
|
|
59
|
-
}),
|
|
60
|
-
return (t,
|
|
61
|
-
|
|
62
|
-
(
|
|
62
|
+
}), T = i(() => L.value && !s.isDiscriminator);
|
|
63
|
+
return (t, n) => T.value ? (l(), o("div", z, [
|
|
64
|
+
g.value ? (l(), o("ul", R, [
|
|
65
|
+
(l(!0), o(y, null, p(a.value, (e, r) => (l(), m(A, {
|
|
63
66
|
key: e,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
i("div", Y, [
|
|
70
|
-
v(c(b), {
|
|
71
|
-
value: T.value ? I(e) : A(n)
|
|
72
|
-
}, null, 8, ["value"])
|
|
73
|
-
])
|
|
74
|
-
]))), 128))
|
|
75
|
-
])) : (u(), l("ul", q, [
|
|
76
|
-
(u(!0), l(y, null, h(C.value, (e, n) => (u(), l("li", {
|
|
67
|
+
label: e,
|
|
68
|
+
description: g.value ? C(e) : d(r)
|
|
69
|
+
}, null, 8, ["label", "description"]))), 128))
|
|
70
|
+
])) : (l(), o("ul", M, [
|
|
71
|
+
(l(!0), o(y, null, p(B.value, (e, r) => (l(), m(A, {
|
|
77
72
|
key: e,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
default: D(({ open: e }) => [
|
|
91
|
-
v(c(P), null, {
|
|
92
|
-
default: D(() => [
|
|
93
|
-
(u(!0), l(y, null, h(L.value, (n, o) => (u(), l("li", {
|
|
94
|
-
key: n,
|
|
95
|
-
class: "property-enum-value"
|
|
96
|
-
}, [
|
|
97
|
-
i("span", X, d(f(
|
|
98
|
-
n,
|
|
99
|
-
p.value + o
|
|
100
|
-
)), 1)
|
|
101
|
-
]))), 128))
|
|
73
|
+
label: E(e, r),
|
|
74
|
+
description: d(r)
|
|
75
|
+
}, null, 8, ["label", "description"]))), 128)),
|
|
76
|
+
b.value ? (l(), m(v($), { key: 0 }, {
|
|
77
|
+
default: f(({ open: e }) => [
|
|
78
|
+
D(v(F), null, {
|
|
79
|
+
default: f(() => [
|
|
80
|
+
(l(!0), o(y, null, p(V.value, (r, u) => (l(), m(A, {
|
|
81
|
+
key: r,
|
|
82
|
+
label: E(r, c.value + u),
|
|
83
|
+
description: d(c.value + u)
|
|
84
|
+
}, null, 8, ["label", "description"]))), 128))
|
|
102
85
|
]),
|
|
103
86
|
_: 1
|
|
104
87
|
}),
|
|
105
|
-
v(
|
|
106
|
-
default:
|
|
107
|
-
v(
|
|
108
|
-
class:
|
|
88
|
+
D(v(U), { class: "enum-toggle-button" }, {
|
|
89
|
+
default: f(() => [
|
|
90
|
+
D(v(w), {
|
|
91
|
+
class: O(["enum-toggle-button-icon", { "enum-toggle-button-icon--open": e }]),
|
|
109
92
|
icon: "Add",
|
|
110
93
|
size: "sm"
|
|
111
94
|
}, null, 8, ["class"]),
|
|
112
|
-
|
|
95
|
+
H(" " + P(e ? "Hide values" : "Show all values"), 1)
|
|
113
96
|
]),
|
|
114
97
|
_: 2
|
|
115
98
|
}, 1024)
|
|
116
99
|
]),
|
|
117
100
|
_: 1
|
|
118
|
-
})) :
|
|
101
|
+
})) : k("", !0)
|
|
119
102
|
]))
|
|
120
|
-
])) :
|
|
103
|
+
])) : k("", !0);
|
|
121
104
|
}
|
|
122
105
|
});
|
|
123
106
|
export {
|
|
124
|
-
|
|
107
|
+
K as default
|
|
125
108
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
import type { Schemas } from '../../../features/Operation/types/schemas';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
schema: OpenAPIV3_1.SchemaObject;
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
hideHeading?: boolean;
|
|
7
|
+
level?: number;
|
|
8
|
+
hideModelNames?: boolean;
|
|
9
|
+
schemas?: Schemas;
|
|
10
|
+
discriminator?: string;
|
|
11
|
+
discriminatorMapping?: Record<string, string>;
|
|
12
|
+
discriminatorPropertyName?: string;
|
|
13
|
+
hasDiscriminator?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
16
|
+
"update:modelValue": (value: string) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=SchemaObjectProperties.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAAA,OAkKO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAMjE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,WAAW,CAAC,YAAY,CAAA;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;;;;;AAkOF,wBAOG"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent as P, createElementBlock as m, openBlock as i, Fragment as o, createCommentVNode as s, createBlock as n, renderList as g } from "vue";
|
|
2
|
+
import t from "./SchemaProperty.vue.js";
|
|
3
|
+
const H = /* @__PURE__ */ P({
|
|
4
|
+
__name: "SchemaObjectProperties",
|
|
5
|
+
props: {
|
|
6
|
+
schema: { type: [Object, Boolean] },
|
|
7
|
+
compact: { type: Boolean },
|
|
8
|
+
hideHeading: { type: Boolean },
|
|
9
|
+
level: { default: 0 },
|
|
10
|
+
hideModelNames: { type: Boolean, default: !1 },
|
|
11
|
+
schemas: {},
|
|
12
|
+
discriminator: {},
|
|
13
|
+
discriminatorMapping: {},
|
|
14
|
+
discriminatorPropertyName: {},
|
|
15
|
+
hasDiscriminator: { type: Boolean }
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:modelValue"],
|
|
18
|
+
setup(f, { emit: y }) {
|
|
19
|
+
const v = y, r = (e) => {
|
|
20
|
+
v("update:modelValue", e);
|
|
21
|
+
}, M = (e) => typeof e == "object" && typeof e["x-additionalPropertiesName"] == "string" && e["x-additionalPropertiesName"].trim().length > 0 ? `${e["x-additionalPropertiesName"].trim()}*` : "propertyName*", d = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
|
|
22
|
+
type: "anything",
|
|
23
|
+
...typeof e == "object" ? e : {}
|
|
24
|
+
} : e;
|
|
25
|
+
return (e, V) => (i(), m(o, null, [
|
|
26
|
+
e.schema.properties ? (i(!0), m(o, { key: 0 }, g(Object.keys(e.schema.properties), (a) => {
|
|
27
|
+
var l, p, c, h, u, N;
|
|
28
|
+
return i(), n(t, {
|
|
29
|
+
key: a,
|
|
30
|
+
compact: e.compact,
|
|
31
|
+
hideHeading: e.hideHeading,
|
|
32
|
+
level: e.level,
|
|
33
|
+
name: a,
|
|
34
|
+
hideModelNames: e.hideModelNames,
|
|
35
|
+
required: ((l = e.schema.required) == null ? void 0 : l.includes(a)) || ((p = e.schema.properties[a]) == null ? void 0 : p.required) === !0,
|
|
36
|
+
schemas: e.schemas,
|
|
37
|
+
resolvedSchema: e.schema.properties[a],
|
|
38
|
+
value: {
|
|
39
|
+
...e.schema.properties[a],
|
|
40
|
+
parent: e.schema,
|
|
41
|
+
isDiscriminator: a === e.discriminatorPropertyName || ((c = e.schema.discriminator) == null ? void 0 : c.propertyName) === a
|
|
42
|
+
},
|
|
43
|
+
discriminatorMapping: ((h = e.schema.discriminator) == null ? void 0 : h.mapping) || e.discriminatorMapping,
|
|
44
|
+
discriminatorPropertyName: ((u = e.schema.discriminator) == null ? void 0 : u.propertyName) || e.discriminatorPropertyName,
|
|
45
|
+
isDiscriminator: a === (((N = e.schema.discriminator) == null ? void 0 : N.propertyName) || e.discriminatorPropertyName),
|
|
46
|
+
modelValue: e.discriminator,
|
|
47
|
+
"onUpdate:modelValue": r
|
|
48
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "required", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "isDiscriminator", "modelValue"]);
|
|
49
|
+
}), 128)) : s("", !0),
|
|
50
|
+
e.schema.patternProperties ? (i(!0), m(o, { key: 1 }, g(Object.keys(e.schema.patternProperties), (a) => (i(), n(t, {
|
|
51
|
+
key: a,
|
|
52
|
+
variant: "patternProperties",
|
|
53
|
+
compact: e.compact,
|
|
54
|
+
hideHeading: e.hideHeading,
|
|
55
|
+
level: e.level,
|
|
56
|
+
name: a,
|
|
57
|
+
hideModelNames: e.hideModelNames,
|
|
58
|
+
schemas: e.schemas,
|
|
59
|
+
resolvedSchema: e.schema.patternProperties[a],
|
|
60
|
+
value: {
|
|
61
|
+
...e.schema.patternProperties[a]
|
|
62
|
+
},
|
|
63
|
+
discriminatorMapping: e.discriminatorMapping,
|
|
64
|
+
discriminatorPropertyName: e.discriminatorPropertyName,
|
|
65
|
+
isDiscriminator: !1,
|
|
66
|
+
modelValue: e.discriminator,
|
|
67
|
+
"onUpdate:modelValue": r
|
|
68
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"]))), 128)) : s("", !0),
|
|
69
|
+
e.schema.additionalProperties ? (i(), n(t, {
|
|
70
|
+
key: 2,
|
|
71
|
+
variant: "additionalProperties",
|
|
72
|
+
compact: e.compact,
|
|
73
|
+
hideHeading: e.hideHeading,
|
|
74
|
+
level: e.level,
|
|
75
|
+
name: M(e.schema.additionalProperties),
|
|
76
|
+
hideModelNames: e.hideModelNames,
|
|
77
|
+
schemas: e.schemas,
|
|
78
|
+
resolvedSchema: d(e.schema.additionalProperties),
|
|
79
|
+
value: d(e.schema.additionalProperties),
|
|
80
|
+
discriminatorMapping: e.discriminatorMapping,
|
|
81
|
+
discriminatorPropertyName: e.discriminatorPropertyName,
|
|
82
|
+
isDiscriminator: !1,
|
|
83
|
+
modelValue: e.discriminator,
|
|
84
|
+
noncollapsible: "",
|
|
85
|
+
"onUpdate:modelValue": r
|
|
86
|
+
}, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : s("", !0)
|
|
87
|
+
], 64));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
H as default
|
|
92
|
+
};
|
|
@@ -15,8 +15,6 @@ type __VLS_Props = {
|
|
|
15
15
|
required?: boolean;
|
|
16
16
|
compact?: boolean;
|
|
17
17
|
description?: string;
|
|
18
|
-
additional?: boolean;
|
|
19
|
-
pattern?: boolean;
|
|
20
18
|
withExamples?: boolean;
|
|
21
19
|
hideModelNames?: boolean;
|
|
22
20
|
schemas?: Schemas;
|
|
@@ -24,6 +22,7 @@ type __VLS_Props = {
|
|
|
24
22
|
discriminatorMapping?: Record<string, string>;
|
|
25
23
|
discriminatorPropertyName?: string;
|
|
26
24
|
isDiscriminator?: boolean;
|
|
25
|
+
variant?: 'additionalProperties' | 'patternProperties';
|
|
27
26
|
};
|
|
28
27
|
declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
28
|
"update:modelValue": (value: string) => any;
|
|
@@ -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":"AAshBA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAOtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAWjE;;;;;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,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;IACzB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;CACvD,CAAC;;;;;;cAXW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;kBADT,OAAO;;AAshB1B,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-7f7d1229"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as $, computed as p, inject as z, createBlock as c, openBlock as
|
|
1
|
+
import { defineComponent as $, computed as p, inject as z, createBlock as c, openBlock as r, resolveDynamicComponent as Z, normalizeClass as L, withCtx as v, createCommentVNode as l, createElementBlock as t, createVNode as d, createSlots as X, toDisplayString as y, Fragment as f, createTextVNode as V, unref as h, renderList as G } from "vue";
|
|
2
2
|
import { ScalarMarkdown as D } from "@scalar/components";
|
|
3
|
-
import { optimizeValueForDisplay as J, compositions as K } from "./helpers/
|
|
3
|
+
import { optimizeValueForDisplay as J, compositions as K } from "./helpers/optimize-value-for-display.js";
|
|
4
4
|
import Q from "./SchemaEnumValues.vue.js";
|
|
5
5
|
import { DISCRIMINATOR_CONTEXT as W } from "../../../hooks/useDiscriminator.js";
|
|
6
6
|
import C from "./Schema.vue.js";
|
|
@@ -9,18 +9,24 @@ import Y from "./SchemaDiscriminator.vue.js";
|
|
|
9
9
|
import _ from "./SchemaPropertyHeading.vue.js";
|
|
10
10
|
import x from "../../../features/specification-extension/SpecificationExtension.vue.js";
|
|
11
11
|
const ee = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "property-name-pattern-properties"
|
|
14
|
+
}, ie = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "property-name-additional-properties"
|
|
17
|
+
}, ne = {
|
|
12
18
|
key: 1,
|
|
13
19
|
class: "property-description"
|
|
14
|
-
},
|
|
20
|
+
}, re = {
|
|
15
21
|
key: 2,
|
|
16
22
|
class: "property-description"
|
|
17
|
-
},
|
|
23
|
+
}, ae = {
|
|
18
24
|
key: 3,
|
|
19
25
|
class: "children"
|
|
20
|
-
},
|
|
26
|
+
}, te = {
|
|
21
27
|
key: 0,
|
|
22
28
|
class: "children"
|
|
23
|
-
},
|
|
29
|
+
}, he = /* @__PURE__ */ $({
|
|
24
30
|
__name: "SchemaProperty",
|
|
25
31
|
props: {
|
|
26
32
|
is: {},
|
|
@@ -31,19 +37,18 @@ const ee = {
|
|
|
31
37
|
required: { type: Boolean, default: !1 },
|
|
32
38
|
compact: { type: Boolean, default: !1 },
|
|
33
39
|
description: {},
|
|
34
|
-
additional: { type: Boolean },
|
|
35
|
-
pattern: { type: Boolean },
|
|
36
40
|
withExamples: { type: Boolean, default: !0 },
|
|
37
41
|
hideModelNames: { type: Boolean, default: !1 },
|
|
38
42
|
schemas: {},
|
|
39
43
|
hideHeading: { type: Boolean },
|
|
40
44
|
discriminatorMapping: {},
|
|
41
45
|
discriminatorPropertyName: {},
|
|
42
|
-
isDiscriminator: { type: Boolean }
|
|
46
|
+
isDiscriminator: { type: Boolean },
|
|
47
|
+
variant: {}
|
|
43
48
|
},
|
|
44
49
|
emits: ["update:modelValue"],
|
|
45
50
|
setup(R, { emit: T }) {
|
|
46
|
-
const u = R, w = T,
|
|
51
|
+
const u = R, w = T, k = {
|
|
47
52
|
integer: {
|
|
48
53
|
_default: "Integer numbers.",
|
|
49
54
|
int32: "Signed 32-bit integers (commonly used integer type).",
|
|
@@ -57,16 +62,16 @@ const ee = {
|
|
|
57
62
|
byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
|
|
58
63
|
binary: "binary data, used to describe files"
|
|
59
64
|
}
|
|
60
|
-
}, g = (e, i) => i != null && i.properties || i != null && i.additionalProperties || i != null && i.patternProperties || i != null && i.allOf ? null : e || (i == null ? void 0 : i.description) || null,
|
|
65
|
+
}, g = (e, i) => i != null && i.properties || i != null && i.additionalProperties || i != null && i.patternProperties || i != null && i.allOf ? null : e || (i == null ? void 0 : i.description) || null, N = (e) => !e || !k[e.type] ? null : k[e.type][e.format || e.contentEncoding || "_default"], E = (e) => {
|
|
61
66
|
var i;
|
|
62
67
|
return (e == null ? void 0 : e.enum) || ((i = e == null ? void 0 : e.items) == null ? void 0 : i.enum) || [];
|
|
63
|
-
}, n = p(() => J(u.value)),
|
|
68
|
+
}, n = p(() => J(u.value)), o = z(W, null), a = p(() => {
|
|
64
69
|
var e;
|
|
65
|
-
return u.level > 0 ? n.value : (e =
|
|
70
|
+
return u.level > 0 ? n.value : (e = o == null ? void 0 : o.value) != null && e.mergedSchema ? o.value.mergedSchema : n.value;
|
|
66
71
|
}), I = p(() => {
|
|
67
72
|
var e;
|
|
68
|
-
return ((e =
|
|
69
|
-
}), A = (e, i, m
|
|
73
|
+
return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.selectedType) || (u.discriminatorMapping ? Object.keys(u.discriminatorMapping)[0] : "");
|
|
74
|
+
}), A = (e, i, m) => i || (e == null ? void 0 : e.deprecated) || (e == null ? void 0 : e.const) !== void 0 || (e == null ? void 0 : e.enum) && e.enum.length === 1 || (e == null ? void 0 : e.type) || (e == null ? void 0 : e.nullable) === !0 || (e == null ? void 0 : e.writeOnly) || (e == null ? void 0 : e.readOnly) || m, b = (e) => {
|
|
70
75
|
w("update:modelValue", e);
|
|
71
76
|
}, P = p(() => {
|
|
72
77
|
const e = n.value;
|
|
@@ -85,7 +90,7 @@ const ee = {
|
|
|
85
90
|
});
|
|
86
91
|
return (e, i) => {
|
|
87
92
|
var m;
|
|
88
|
-
return
|
|
93
|
+
return r(), c(Z(e.is ?? "li"), {
|
|
89
94
|
class: L(["property", [
|
|
90
95
|
(g(e.description, n.value), ""),
|
|
91
96
|
`property--level-${e.level}`,
|
|
@@ -96,19 +101,11 @@ const ee = {
|
|
|
96
101
|
]])
|
|
97
102
|
}, {
|
|
98
103
|
default: v(() => {
|
|
99
|
-
var
|
|
104
|
+
var M, S;
|
|
100
105
|
return [
|
|
101
|
-
A(
|
|
102
|
-
n.value,
|
|
103
|
-
e.name,
|
|
104
|
-
e.additional,
|
|
105
|
-
e.pattern,
|
|
106
|
-
e.required
|
|
107
|
-
) ? (a(), c(_, {
|
|
106
|
+
A(n.value, e.name, e.required) ? (r(), c(_, {
|
|
108
107
|
key: 0,
|
|
109
|
-
additional: e.additional,
|
|
110
108
|
enum: E(n.value).length > 0,
|
|
111
|
-
pattern: e.pattern,
|
|
112
109
|
required: e.required,
|
|
113
110
|
value: n.value,
|
|
114
111
|
schemas: e.schemas,
|
|
@@ -117,90 +114,92 @@ const ee = {
|
|
|
117
114
|
e.name ? {
|
|
118
115
|
name: "name",
|
|
119
116
|
fn: v(() => [
|
|
120
|
-
|
|
117
|
+
e.variant === "patternProperties" ? (r(), t("span", ee, y(e.name), 1)) : e.variant === "additionalProperties" ? (r(), t("span", ie, y(e.name), 1)) : (r(), t(f, { key: 2 }, [
|
|
118
|
+
V(y(e.name), 1)
|
|
119
|
+
], 64))
|
|
121
120
|
]),
|
|
122
121
|
key: "0"
|
|
123
122
|
} : void 0,
|
|
124
|
-
(
|
|
123
|
+
(M = n.value) != null && M.example ? {
|
|
125
124
|
name: "example",
|
|
126
125
|
fn: v(() => [
|
|
127
|
-
|
|
126
|
+
V(" Example: " + y(n.value.example), 1)
|
|
128
127
|
]),
|
|
129
128
|
key: "1"
|
|
130
129
|
} : void 0
|
|
131
|
-
]), 1032, ["
|
|
132
|
-
g(e.description, n.value) ? (
|
|
130
|
+
]), 1032, ["enum", "required", "value", "schemas", "hideModelNames"])) : l("", !0),
|
|
131
|
+
g(e.description, n.value) ? (r(), t("div", ne, [
|
|
133
132
|
d(h(D), {
|
|
134
133
|
value: g(e.description, n.value)
|
|
135
134
|
}, null, 8, ["value"])
|
|
136
|
-
])) :
|
|
135
|
+
])) : N(n.value) ? (r(), t("div", re, [
|
|
137
136
|
d(h(D), {
|
|
138
|
-
value:
|
|
137
|
+
value: N(n.value) || ""
|
|
139
138
|
}, null, 8, ["value"])
|
|
140
|
-
])) :
|
|
139
|
+
])) : l("", !0),
|
|
141
140
|
d(Q, { value: n.value }, null, 8, ["value"]),
|
|
142
|
-
F.value ? (
|
|
141
|
+
F.value ? (r(), t("div", ae, [
|
|
143
142
|
d(C, {
|
|
144
143
|
compact: e.compact,
|
|
145
144
|
level: e.level + 1,
|
|
146
145
|
name: e.name,
|
|
147
146
|
noncollapsible: e.noncollapsible,
|
|
148
|
-
value:
|
|
149
|
-
resolvedSchema:
|
|
147
|
+
value: a.value,
|
|
148
|
+
resolvedSchema: a.value,
|
|
150
149
|
discriminatorMapping: e.discriminatorMapping,
|
|
151
150
|
discriminatorPropertyName: e.discriminatorPropertyName,
|
|
152
151
|
schemas: e.schemas,
|
|
153
152
|
"onUpdate:modelValue": b
|
|
154
153
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "value", "resolvedSchema", "discriminatorMapping", "discriminatorPropertyName", "schemas"])
|
|
155
|
-
])) :
|
|
156
|
-
(
|
|
157
|
-
q.value ? (
|
|
154
|
+
])) : l("", !0),
|
|
155
|
+
(S = n.value) != null && S.items && typeof n.value.items == "object" ? (r(), t(f, { key: 4 }, [
|
|
156
|
+
q.value ? (r(), t("div", te, [
|
|
158
157
|
d(C, {
|
|
159
158
|
compact: e.compact,
|
|
160
159
|
level: e.level + 1,
|
|
161
160
|
name: e.name,
|
|
162
161
|
noncollapsible: e.noncollapsible,
|
|
163
|
-
value:
|
|
164
|
-
resolvedSchema:
|
|
162
|
+
value: a.value && typeof a.value == "object" && "items" in a.value ? a.value.items : n.value.items,
|
|
163
|
+
resolvedSchema: a.value && typeof a.value == "object" && "items" in a.value ? a.value.items : n.value.items,
|
|
165
164
|
discriminatorMapping: e.discriminatorMapping,
|
|
166
165
|
discriminatorPropertyName: e.discriminatorPropertyName,
|
|
167
166
|
schemas: e.schemas,
|
|
168
167
|
"onUpdate:modelValue": b
|
|
169
168
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "value", "resolvedSchema", "discriminatorMapping", "discriminatorPropertyName", "schemas"])
|
|
170
|
-
])) :
|
|
171
|
-
], 64)) :
|
|
172
|
-
(
|
|
173
|
-
var
|
|
174
|
-
return
|
|
175
|
-
(
|
|
169
|
+
])) : l("", !0)
|
|
170
|
+
], 64)) : l("", !0),
|
|
171
|
+
(r(!0), t(f, null, G(h(K), (s) => {
|
|
172
|
+
var j, O, B;
|
|
173
|
+
return r(), t(f, { key: s }, [
|
|
174
|
+
(j = n.value) != null && j[s] && !((O = n.value) != null && O.items && typeof s == "string" && typeof n.value.items == "object" && s in n.value.items) ? (r(), c(H, {
|
|
176
175
|
key: 0,
|
|
177
176
|
compact: e.compact,
|
|
178
|
-
composition:
|
|
177
|
+
composition: s,
|
|
179
178
|
hideHeading: e.hideHeading,
|
|
180
179
|
level: e.level,
|
|
181
180
|
name: e.name,
|
|
182
181
|
noncollapsible: e.noncollapsible,
|
|
183
182
|
schemas: e.schemas,
|
|
184
183
|
value: n.value
|
|
185
|
-
}, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) : U(
|
|
184
|
+
}, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) : U(s) ? (r(), c(H, {
|
|
186
185
|
key: 1,
|
|
187
186
|
compact: e.compact,
|
|
188
|
-
composition:
|
|
187
|
+
composition: s,
|
|
189
188
|
hideHeading: e.hideHeading,
|
|
190
189
|
level: e.level,
|
|
191
190
|
name: e.name,
|
|
192
191
|
noncollapsible: e.noncollapsible,
|
|
193
192
|
schemas: e.schemas,
|
|
194
193
|
value: (B = n.value) == null ? void 0 : B.items
|
|
195
|
-
}, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) :
|
|
194
|
+
}, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) : l("", !0)
|
|
196
195
|
], 64);
|
|
197
196
|
}), 128)),
|
|
198
|
-
e.isDiscriminator && e.discriminatorMapping && e.compact ? (
|
|
197
|
+
e.isDiscriminator && e.discriminatorMapping && e.compact ? (r(), c(Y, {
|
|
199
198
|
key: 5,
|
|
200
199
|
"discriminator-mapping": e.discriminatorMapping,
|
|
201
200
|
discriminator: I.value,
|
|
202
201
|
"onUpdate:modelValue": b
|
|
203
|
-
}, null, 8, ["discriminator-mapping", "discriminator"])) :
|
|
202
|
+
}, null, 8, ["discriminator-mapping", "discriminator"])) : l("", !0),
|
|
204
203
|
d(h(x), { value: n.value }, null, 8, ["value"])
|
|
205
204
|
];
|
|
206
205
|
}),
|
|
@@ -210,5 +209,5 @@ const ee = {
|
|
|
210
209
|
}
|
|
211
210
|
});
|
|
212
211
|
export {
|
|
213
|
-
|
|
212
|
+
he as default
|
|
214
213
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaPropertyExamples.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1c1ebd80"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as y, createElementBlock as l, openBlock as p, Fragment as i, createCommentVNode as u, createElementVNode as e, unref as o, createVNode as c, toDisplayString as n, renderList as b } from "vue";
|
|
2
2
|
import { ScalarIcon as x } from "@scalar/components";
|
|
3
3
|
import { useClipboard as v } from "@scalar/use-hooks/useClipboard";
|
|
4
|
-
import { formatExample as r } from "./helpers/
|
|
4
|
+
import { formatExample as r } from "./helpers/format-example.js";
|
|
5
5
|
const f = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "property-example"
|