@scalar/api-reference 1.35.1 → 1.35.3
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 +32 -0
- package/dist/browser/standalone.js +13534 -13691
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts +2 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +14 -11
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +70 -72
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +3 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.d.ts +0 -2
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +80 -80
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts +5 -2
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +2 -2
- package/dist/components/Content/Models/ClassicLayout.vue2.js +43 -45
- package/dist/components/Content/Models/ClassicLayout.vue3.js +2 -2
- package/dist/components/Content/Models/Models.vue.d.ts +2 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +27 -20
- package/dist/components/Content/Models/ModernLayout.vue.d.ts +5 -2
- package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
- package/dist/components/Content/Models/ModernLayout.vue2.js +48 -52
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +3 -2
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +33 -32
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts +2 -2
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +6 -22
- 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 +86 -140
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +15 -4
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +77 -138
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +2 -13
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +66 -92
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue2.js +19 -17
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +5 -14
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +47 -68
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -13
- 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 +116 -144
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +9 -4
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +173 -204
- package/dist/components/Content/Schema/helpers/get-ref-name.d.ts +11 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.js +11 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +13 -3
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-schema-type.js +34 -13
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts +4 -2
- package/dist/components/Content/Schema/helpers/is-type-object.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -4
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +130 -84
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts +5 -5
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +40 -31
- package/dist/components/Content/Schema/helpers/schema-composition.d.ts +0 -8
- package/dist/components/Content/Schema/helpers/schema-composition.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-composition.js +2 -6
- package/dist/components/Content/Schema/helpers/schema-name.d.ts +8 -17
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +24 -33
- package/dist/features/Operation/Operation.vue.d.ts +3 -4
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +54 -73
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +10 -11
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +35 -43
- package/dist/features/Operation/components/{ParameterHeaders.vue.d.ts → Header.vue.d.ts} +4 -5
- package/dist/features/Operation/components/Header.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/Header.vue.js +23 -0
- package/dist/features/Operation/components/Header.vue2.js +4 -0
- package/dist/features/Operation/components/Headers.vue.d.ts +8 -0
- package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/Headers.vue.js +7 -0
- package/dist/features/Operation/components/Headers.vue2.js +61 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +4 -10
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +23 -33
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +3 -6
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +22 -19
- package/dist/features/Operation/components/ParameterList.vue.d.ts +3 -10
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +35 -5
- package/dist/features/Operation/components/ParameterList.vue2.js +2 -38
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +4 -10
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +77 -74
- package/dist/features/Operation/components/RequestBody.vue.d.ts +3 -8
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue2.js +75 -82
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +0 -4
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +35 -36
- package/dist/features/Operation/components/callbacks/Callback.vue3.js +2 -2
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +0 -2
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +13 -15
- package/dist/features/Operation/helpers/combine-params.d.ts +1 -1
- package/dist/features/Operation/helpers/combine-params.d.ts.map +1 -1
- package/dist/features/Operation/helpers/combine-params.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -9
- 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 +75 -82
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -10
- 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 +96 -103
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +1 -13
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +39 -56
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts +10 -4
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +22 -18
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/package.json +14 -14
- package/dist/components/Content/Schema/Schema.preview.d.ts +0 -1078
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +0 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +0 -12
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +0 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +0 -49
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +0 -4
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +0 -13
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +0 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +0 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.js +0 -7
- package/dist/features/Operation/components/ParameterHeaders.vue2.js +0 -64
- package/dist/features/Operation/components/ParameterList.vue3.js +0 -4
- package/dist/features/Operation/hooks/useResponses.d.ts +0 -17
- package/dist/features/Operation/hooks/useResponses.d.ts.map +0 -1
- package/dist/features/Operation/hooks/useResponses.js +0 -19
- package/dist/hooks/useDiscriminator.d.ts +0 -53
- package/dist/hooks/useDiscriminator.d.ts.map +0 -1
- package/dist/hooks/useDiscriminator.js +0 -149
- package/dist/hooks/useOperationDiscriminator.d.ts +0 -8
- package/dist/hooks/useOperationDiscriminator.d.ts.map +0 -1
- package/dist/hooks/useOperationDiscriminator.js +0 -57
- /package/dist/features/Operation/components/{ParameterHeaders.vue3.js → Headers.vue3.js} +0 -0
|
@@ -1,103 +1,77 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarButton as
|
|
3
|
-
import { ScalarIconPlus as
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as C, computed as s, ref as L, createElementBlock as m, createCommentVNode as d, openBlock as n, createElementVNode as V, Fragment as h, renderList as y, createBlock as S, createVNode as E, unref as N, withCtx as D, createTextVNode as B, normalizeClass as T, toDisplayString as H } from "vue";
|
|
2
|
+
import { ScalarButton as P } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as _ } from "@scalar/icons";
|
|
4
|
+
import { getResolvedRef as $ } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
|
+
import { isArraySchema as w } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
6
|
+
import b from "./SchemaEnumPropertyItem.vue.js";
|
|
7
|
+
const R = {
|
|
6
8
|
key: 0,
|
|
7
9
|
class: "property-enum"
|
|
8
|
-
},
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "property-enum-values"
|
|
11
|
-
}, Y = {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: "property-enum-values"
|
|
14
|
-
}, N = 9, q = 5, S = " ", X = /* @__PURE__ */ O({
|
|
10
|
+
}, U = { class: "property-enum-values" }, O = { key: 1 }, j = 9, z = 5, k = " ", J = /* @__PURE__ */ C({
|
|
15
11
|
__name: "SchemaEnumValues",
|
|
16
12
|
props: {
|
|
17
|
-
value: {}
|
|
18
|
-
isDiscriminator: { type: Boolean }
|
|
13
|
+
value: {}
|
|
19
14
|
},
|
|
20
15
|
setup(l) {
|
|
21
|
-
const
|
|
22
|
-
var
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
() => h.value ? q : N
|
|
48
|
-
), V = u(
|
|
49
|
-
() => i.value.slice(0, m.value)
|
|
50
|
-
), B = u(
|
|
51
|
-
() => i.value.slice(m.value)
|
|
52
|
-
), D = u(() => {
|
|
53
|
-
var n, e;
|
|
54
|
-
const t = ((n = l.value) == null ? void 0 : n["x-enumDescriptions"]) ?? ((e = l.value) == null ? void 0 : e["x-enum-descriptions"]);
|
|
55
|
-
return t && typeof t == "object" && !Array.isArray(t);
|
|
56
|
-
}), T = u(() => L.value && !l.isDiscriminator), c = P(!1), H = () => {
|
|
57
|
-
c.value = !c.value;
|
|
16
|
+
const r = s(() => {
|
|
17
|
+
var a;
|
|
18
|
+
return l.value ? l.value.enum || w(l.value) && ((a = $(l.value.items)) == null ? void 0 : a.enum) || [] : [];
|
|
19
|
+
}), v = s(
|
|
20
|
+
() => r.value.length > j
|
|
21
|
+
), i = s(
|
|
22
|
+
() => v.value ? z : r.value.length
|
|
23
|
+
), x = s(
|
|
24
|
+
() => r.value.slice(0, i.value)
|
|
25
|
+
), I = s(
|
|
26
|
+
() => r.value.slice(i.value)
|
|
27
|
+
), f = (a, c) => {
|
|
28
|
+
var t, u;
|
|
29
|
+
const e = ((t = l.value) == null ? void 0 : t["x-enumDescriptions"]) ?? ((u = l.value) == null ? void 0 : u["x-enum-descriptions"]);
|
|
30
|
+
if (e) {
|
|
31
|
+
if (Array.isArray(e))
|
|
32
|
+
return e[c];
|
|
33
|
+
if (typeof e == "object" && e !== null)
|
|
34
|
+
return e[String(a)];
|
|
35
|
+
}
|
|
36
|
+
}, p = (a, c) => {
|
|
37
|
+
var u, g;
|
|
38
|
+
const e = ((u = l.value) == null ? void 0 : u["x-enum-varnames"]) ?? ((g = l.value) == null ? void 0 : g["x-enumNames"]), t = Array.isArray(e) ? e[c] : void 0;
|
|
39
|
+
return t ? `${a}${k}=${k}${t}` : String(a);
|
|
40
|
+
}, o = L(!1), A = () => {
|
|
41
|
+
o.value = !o.value;
|
|
58
42
|
};
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
key: e,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, null, 8, ["
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
label:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
}, null, 8, ["class"]),
|
|
91
|
-
w(" " + U(c.value ? "Hide values" : "Show all values"), 1)
|
|
92
|
-
]),
|
|
93
|
-
_: 1
|
|
94
|
-
})
|
|
95
|
-
])
|
|
96
|
-
], 64)) : p("", !0)
|
|
97
|
-
]))
|
|
98
|
-
])) : p("", !0);
|
|
43
|
+
return (a, c) => r.value.length > 0 ? (n(), m("div", R, [
|
|
44
|
+
V("ul", U, [
|
|
45
|
+
(n(!0), m(h, null, y(x.value, (e, t) => (n(), S(b, {
|
|
46
|
+
key: String(e),
|
|
47
|
+
description: f(e, t),
|
|
48
|
+
label: p(e, t)
|
|
49
|
+
}, null, 8, ["description", "label"]))), 128)),
|
|
50
|
+
v.value && o.value ? (n(!0), m(h, { key: 0 }, y(I.value, (e, t) => (n(), S(b, {
|
|
51
|
+
key: String(e),
|
|
52
|
+
description: f(e, i.value + t),
|
|
53
|
+
label: p(e, i.value + t)
|
|
54
|
+
}, null, 8, ["description", "label"]))), 128)) : d("", !0),
|
|
55
|
+
v.value ? (n(), m("li", O, [
|
|
56
|
+
E(N(P), {
|
|
57
|
+
class: "enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none",
|
|
58
|
+
variant: "ghost",
|
|
59
|
+
onClick: A
|
|
60
|
+
}, {
|
|
61
|
+
default: D(() => [
|
|
62
|
+
E(N(_), {
|
|
63
|
+
class: T({ "rotate-45": o.value }),
|
|
64
|
+
weight: "bold"
|
|
65
|
+
}, null, 8, ["class"]),
|
|
66
|
+
B(" " + H(o.value ? "Hide values" : "Show all values"), 1)
|
|
67
|
+
]),
|
|
68
|
+
_: 1
|
|
69
|
+
})
|
|
70
|
+
])) : d("", !0)
|
|
71
|
+
])
|
|
72
|
+
])) : d("", !0);
|
|
99
73
|
}
|
|
100
74
|
});
|
|
101
75
|
export {
|
|
102
|
-
|
|
76
|
+
J as default
|
|
103
77
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
value:
|
|
3
|
+
value: SchemaObject;
|
|
4
4
|
name?: string;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAwEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAwEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,YAAY,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAwFF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaHeading.vue2.js";
|
|
2
2
|
import "./SchemaHeading.vue3.js";
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0759195c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as v, computed as p, createElementBlock as t, createCommentVNode as l, openBlock as n, createElementVNode as f, unref as i, Fragment as u, createTextVNode as r, toDisplayString as o } from "vue";
|
|
2
|
+
import { isArraySchema as m } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
+
import { isTypeObject as y } from "./helpers/is-type-object.js";
|
|
4
|
+
const c = {
|
|
3
5
|
key: 0,
|
|
4
6
|
class: "schema-type"
|
|
5
|
-
},
|
|
7
|
+
}, d = ["title"], b = /* @__PURE__ */ v({
|
|
6
8
|
__name: "SchemaHeading",
|
|
7
9
|
props: {
|
|
8
|
-
value: {
|
|
10
|
+
value: {},
|
|
9
11
|
name: {}
|
|
10
12
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
return (e,
|
|
14
|
-
|
|
13
|
+
setup(a) {
|
|
14
|
+
const s = p(() => "type" in a.value ? a.value.type : a.value.enum ? "enum" : m(a.value) && a.value.items ? "array" : y(a.value) && (a.value.properties || a.value.additionalProperties) ? "object" : "unknown");
|
|
15
|
+
return (e, k) => typeof e.value == "object" ? (n(), t("span", c, [
|
|
16
|
+
f("span", {
|
|
15
17
|
class: "schema-type-icon",
|
|
16
|
-
title: typeof e.value.type == "string" ? e.value.type : Array.isArray(e.value.type) ? e.value.type.join(" | ") : "
|
|
18
|
+
title: "type" in e.value && typeof e.value.type == "string" ? e.value.type : "type" in e.value && Array.isArray(e.value.type) ? e.value.type.join(" | ") : "unknown type"
|
|
17
19
|
}, [
|
|
18
|
-
e.value
|
|
20
|
+
i(y)(e.value) ? (n(), t(u, { key: 0 }, [
|
|
19
21
|
r(" {} ")
|
|
20
22
|
], 64)) : l("", !0),
|
|
21
|
-
e.value
|
|
23
|
+
i(m)(e.value) ? (n(), t(u, { key: 1 }, [
|
|
22
24
|
r(" [] ")
|
|
23
25
|
], 64)) : l("", !0),
|
|
24
|
-
e.value.enum ? (n(),
|
|
26
|
+
e.value.enum ? (n(), t(u, { key: 2 }, [
|
|
25
27
|
r(" enum ")
|
|
26
28
|
], 64)) : l("", !0)
|
|
27
|
-
], 8,
|
|
28
|
-
e.name ? (n(),
|
|
29
|
+
], 8, d),
|
|
30
|
+
e.name ? (n(), t(u, { key: 0 }, [
|
|
29
31
|
r(o(e.name), 1)
|
|
30
|
-
], 64)) : (n(),
|
|
31
|
-
r(o(
|
|
32
|
+
], 64)) : (n(), t(u, { key: 1 }, [
|
|
33
|
+
r(o(s.value), 1)
|
|
32
34
|
], 64))
|
|
33
35
|
])) : l("", !0);
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
export {
|
|
37
|
-
|
|
39
|
+
b as default
|
|
38
40
|
};
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
1
|
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
3
|
-
import type {
|
|
2
|
+
import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
4
3
|
type __VLS_Props = {
|
|
5
|
-
schema:
|
|
4
|
+
schema: SchemaObject;
|
|
5
|
+
discriminator?: DiscriminatorObject;
|
|
6
6
|
compact?: boolean;
|
|
7
7
|
hideHeading?: boolean;
|
|
8
8
|
level?: number;
|
|
9
9
|
hideModelNames?: boolean;
|
|
10
|
-
|
|
11
|
-
discriminator?: string;
|
|
12
|
-
discriminatorMapping?: Record<string, string>;
|
|
13
|
-
discriminatorPropertyName?: string;
|
|
10
|
+
breadcrumb?: string[];
|
|
14
11
|
orderSchemaPropertiesBy?: ApiReferenceConfiguration['orderSchemaPropertiesBy'];
|
|
15
12
|
orderRequiredPropertiesFirst?: ApiReferenceConfiguration['orderRequiredPropertiesFirst'];
|
|
16
|
-
hasDiscriminator?: boolean;
|
|
17
|
-
breadcrumb?: string[];
|
|
18
13
|
};
|
|
19
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
|
-
"update:modelValue": (value: string) => any;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
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>;
|
|
24
15
|
export default _default;
|
|
25
16
|
//# sourceMappingURL=SchemaObjectProperties.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAoLA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAOrE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,uBAAuB,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;IAC9E,4BAA4B,CAAC,EAAE,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;CACzF,CAAC;;AAkOF,wBAMG"}
|
|
@@ -1,112 +1,91 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as j, computed as q, createElementBlock as d, openBlock as o, Fragment as s, createCommentVNode as l, createBlock as c, unref as m, renderList as g } from "vue";
|
|
2
|
+
import { getResolvedRef as u } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { isTypeObject as n } from "./helpers/is-type-object.js";
|
|
2
4
|
import h from "./SchemaProperty.vue.js";
|
|
3
|
-
const
|
|
5
|
+
const O = /* @__PURE__ */ j({
|
|
4
6
|
__name: "SchemaObjectProperties",
|
|
5
7
|
props: {
|
|
6
|
-
schema: {
|
|
8
|
+
schema: {},
|
|
9
|
+
discriminator: {},
|
|
7
10
|
compact: { type: Boolean },
|
|
8
11
|
hideHeading: { type: Boolean },
|
|
9
12
|
level: {},
|
|
10
13
|
hideModelNames: { type: Boolean },
|
|
11
|
-
|
|
12
|
-
discriminator: {},
|
|
13
|
-
discriminatorMapping: {},
|
|
14
|
-
discriminatorPropertyName: {},
|
|
14
|
+
breadcrumb: {},
|
|
15
15
|
orderSchemaPropertiesBy: { default: "alpha" },
|
|
16
|
-
orderRequiredPropertiesFirst: { default: !0 }
|
|
17
|
-
hasDiscriminator: { type: Boolean },
|
|
18
|
-
breadcrumb: {}
|
|
16
|
+
orderRequiredPropertiesFirst: { default: !0 }
|
|
19
17
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (!i.schema.properties)
|
|
18
|
+
setup(i) {
|
|
19
|
+
const P = q(() => {
|
|
20
|
+
if (!n(i.schema) || !i.schema.properties)
|
|
24
21
|
return [];
|
|
25
|
-
const e = Object.keys(i.schema.properties),
|
|
26
|
-
return e.sort((r,
|
|
27
|
-
|
|
22
|
+
const e = Object.keys(i.schema.properties), a = new Set(i.schema.required || []);
|
|
23
|
+
return e.sort((r, t) => {
|
|
24
|
+
var v, N;
|
|
25
|
+
const p = r === ((v = i.discriminator) == null ? void 0 : v.propertyName), b = t === ((N = i.discriminator) == null ? void 0 : N.propertyName), f = a.has(r), y = a.has(t);
|
|
26
|
+
if (p && !b)
|
|
27
|
+
return -1;
|
|
28
|
+
if (!p && b)
|
|
29
|
+
return 1;
|
|
28
30
|
if (i.orderRequiredPropertiesFirst) {
|
|
29
|
-
if (
|
|
31
|
+
if (f && !y)
|
|
30
32
|
return -1;
|
|
31
|
-
if (!
|
|
33
|
+
if (!f && y)
|
|
32
34
|
return 1;
|
|
33
35
|
}
|
|
34
|
-
return i.orderSchemaPropertiesBy === "alpha" ? r.localeCompare(
|
|
36
|
+
return i.orderSchemaPropertiesBy === "alpha" ? r.localeCompare(t) : 0;
|
|
35
37
|
});
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
}), H = (e) => {
|
|
39
|
+
const a = u(e);
|
|
40
|
+
return typeof a == "object" && typeof a["x-additionalPropertiesName"] == "string" && a["x-additionalPropertiesName"].trim().length > 0 ? `${a["x-additionalPropertiesName"].trim()}*` : "propertyName*";
|
|
41
|
+
}, M = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
|
|
42
|
+
// @ts-expect-error - ask hans
|
|
39
43
|
type: "anything",
|
|
40
44
|
...typeof e == "object" ? e : {}
|
|
41
45
|
} : e;
|
|
42
|
-
return (e,
|
|
43
|
-
e.schema.properties ? (
|
|
44
|
-
var
|
|
45
|
-
return
|
|
46
|
+
return (e, a) => (o(), d(s, null, [
|
|
47
|
+
m(n)(e.schema) && e.schema.properties ? (o(!0), d(s, { key: 0 }, g(P.value, (r) => {
|
|
48
|
+
var t;
|
|
49
|
+
return o(), c(h, {
|
|
46
50
|
key: r,
|
|
47
51
|
breadcrumb: e.breadcrumb,
|
|
48
52
|
compact: e.compact,
|
|
49
|
-
|
|
50
|
-
discriminatorPropertyName: ((o = e.schema.discriminator) == null ? void 0 : o.propertyName) || e.discriminatorPropertyName,
|
|
53
|
+
discriminator: e.discriminator,
|
|
51
54
|
hideHeading: e.hideHeading,
|
|
52
55
|
hideModelNames: e.hideModelNames,
|
|
53
|
-
isDiscriminator: r === (((s = e.schema.discriminator) == null ? void 0 : s.propertyName) || e.discriminatorPropertyName),
|
|
54
56
|
level: e.level,
|
|
55
|
-
modelValue: e.discriminator,
|
|
56
57
|
name: r,
|
|
57
|
-
required: (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
parent: e.schema,
|
|
63
|
-
isDiscriminator: r === e.discriminatorPropertyName || ((y = e.schema.discriminator) == null ? void 0 : y.propertyName) === r
|
|
64
|
-
},
|
|
65
|
-
"onUpdate:modelValue": n
|
|
66
|
-
}, null, 8, ["breadcrumb", "compact", "discriminatorMapping", "discriminatorPropertyName", "hideHeading", "hideModelNames", "isDiscriminator", "level", "modelValue", "name", "required", "resolvedSchema", "schemas", "value"]);
|
|
67
|
-
}), 128)) : c("", !0),
|
|
68
|
-
e.schema.patternProperties ? (a(!0), d(l, { key: 1 }, g(Object.keys(e.schema.patternProperties), (r) => (a(), p(h, {
|
|
58
|
+
required: (t = e.schema.required) == null ? void 0 : t.includes(r),
|
|
59
|
+
value: m(u)(e.schema.properties[r])
|
|
60
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "required", "value"]);
|
|
61
|
+
}), 128)) : l("", !0),
|
|
62
|
+
m(n)(e.schema) && e.schema.patternProperties ? (o(!0), d(s, { key: 1 }, g(Object.entries(e.schema.patternProperties), ([r, t]) => (o(), c(h, {
|
|
69
63
|
key: r,
|
|
70
64
|
breadcrumb: e.breadcrumb,
|
|
71
65
|
compact: e.compact,
|
|
72
|
-
|
|
73
|
-
discriminatorPropertyName: e.discriminatorPropertyName,
|
|
66
|
+
discriminator: e.discriminator,
|
|
74
67
|
hideHeading: e.hideHeading,
|
|
75
68
|
hideModelNames: e.hideModelNames,
|
|
76
|
-
isDiscriminator: !1,
|
|
77
69
|
level: e.level,
|
|
78
|
-
modelValue: e.discriminator,
|
|
79
70
|
name: r,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
...e.schema.patternProperties[r]
|
|
84
|
-
},
|
|
85
|
-
variant: "patternProperties",
|
|
86
|
-
"onUpdate:modelValue": n
|
|
87
|
-
}, null, 8, ["breadcrumb", "compact", "discriminatorMapping", "discriminatorPropertyName", "hideHeading", "hideModelNames", "level", "modelValue", "name", "resolvedSchema", "schemas", "value"]))), 128)) : c("", !0),
|
|
88
|
-
e.schema.additionalProperties ? (a(), p(h, {
|
|
71
|
+
value: m(u)(t)
|
|
72
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "value"]))), 128)) : l("", !0),
|
|
73
|
+
m(n)(e.schema) && e.schema.additionalProperties ? (o(), c(h, {
|
|
89
74
|
key: 2,
|
|
90
75
|
breadcrumb: e.breadcrumb,
|
|
91
76
|
compact: e.compact,
|
|
92
|
-
|
|
93
|
-
discriminatorPropertyName: e.discriminatorPropertyName,
|
|
77
|
+
discriminator: e.discriminator,
|
|
94
78
|
hideHeading: e.hideHeading,
|
|
95
79
|
hideModelNames: e.hideModelNames,
|
|
96
|
-
isDiscriminator: !1,
|
|
97
80
|
level: e.level,
|
|
98
|
-
|
|
99
|
-
name: M(e.schema.additionalProperties),
|
|
81
|
+
name: H(e.schema.additionalProperties),
|
|
100
82
|
noncollapsible: "",
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
variant: "additionalProperties",
|
|
105
|
-
"onUpdate:modelValue": n
|
|
106
|
-
}, null, 8, ["breadcrumb", "compact", "discriminatorMapping", "discriminatorPropertyName", "hideHeading", "hideModelNames", "level", "modelValue", "name", "resolvedSchema", "schemas", "value"])) : c("", !0)
|
|
83
|
+
value: M(e.schema.additionalProperties),
|
|
84
|
+
variant: "additionalProperties"
|
|
85
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "value"])) : l("", !0)
|
|
107
86
|
], 64));
|
|
108
87
|
}
|
|
109
88
|
});
|
|
110
89
|
export {
|
|
111
|
-
|
|
90
|
+
O as default
|
|
112
91
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
1
2
|
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
|
*
|
|
@@ -8,33 +8,24 @@ import type { Schemas } from '../../../features/Operation/types/schemas';
|
|
|
8
8
|
*/
|
|
9
9
|
type __VLS_Props = {
|
|
10
10
|
is?: string | Component;
|
|
11
|
-
value
|
|
11
|
+
value: SchemaObject | undefined;
|
|
12
12
|
noncollapsible?: boolean;
|
|
13
13
|
level?: number;
|
|
14
14
|
name?: string;
|
|
15
15
|
required?: boolean;
|
|
16
16
|
compact?: boolean;
|
|
17
|
+
discriminator?: DiscriminatorObject;
|
|
17
18
|
description?: string;
|
|
18
|
-
withExamples?: boolean;
|
|
19
19
|
hideModelNames?: boolean;
|
|
20
|
-
schemas?: Schemas;
|
|
21
20
|
hideHeading?: boolean;
|
|
22
|
-
discriminatorMapping?: Record<string, string>;
|
|
23
|
-
discriminatorPropertyName?: string;
|
|
24
|
-
isDiscriminator?: boolean;
|
|
25
21
|
variant?: 'additionalProperties' | 'patternProperties';
|
|
26
22
|
breadcrumb?: string[];
|
|
27
23
|
};
|
|
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
|
-
}>, {
|
|
24
|
+
declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
33
25
|
required: boolean;
|
|
34
26
|
level: number;
|
|
35
27
|
compact: boolean;
|
|
36
28
|
hideModelNames: boolean;
|
|
37
|
-
withExamples: boolean;
|
|
38
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
30
|
export default _default_1;
|
|
40
31
|
//# sourceMappingURL=SchemaProperty.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAuiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAuiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAErE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAa9C;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,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,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;cARW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;;AA+iB5B,0BAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaProperty.vue2.js";
|
|
2
2
|
import "./SchemaProperty.vue3.js";
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-88b924d1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|