@scalar/api-reference 1.35.2 → 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 +20 -0
- package/dist/browser/standalone.js +9896 -10062
- 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 +12 -12
- 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,270 +1,239 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
1
|
+
import { defineComponent as E, toRef as J, computed as f, createElementBlock as a, openBlock as i, createCommentVNode as l, createBlock as m, normalizeClass as F, renderSlot as j, Fragment as c, withCtx as n, createVNode as k, createTextVNode as u, toDisplayString as v, renderList as z, createSlots as H, unref as _ } from "vue";
|
|
2
|
+
import { isDefined as d } from "@scalar/helpers/array/is-defined";
|
|
3
|
+
import { getResolvedRef as I } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
|
+
import { isArraySchema as g, isStringSchema as L, isNumberSchema as R } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
5
|
import S from "../../ScreenReader.vue.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
const R = { class: "property-heading" }, j = {
|
|
6
|
+
import { getSchemaType as G } from "./helpers/get-schema-type.js";
|
|
7
|
+
import { getModelName as K } from "./helpers/schema-name.js";
|
|
8
|
+
import Q from "./RenderString.vue.js";
|
|
9
|
+
import p from "./SchemaPropertyDetail.vue.js";
|
|
10
|
+
import U from "./SchemaPropertyExamples.vue.js";
|
|
11
|
+
import W from "../../Badge/Badge.vue.js";
|
|
12
|
+
const X = { class: "property-heading" }, Y = {
|
|
12
13
|
key: 1,
|
|
13
14
|
class: "property-discriminator"
|
|
14
|
-
},
|
|
15
|
+
}, Z = {
|
|
15
16
|
key: 3,
|
|
16
17
|
class: "property-additional"
|
|
17
|
-
},
|
|
18
|
+
}, ee = {
|
|
18
19
|
key: 4,
|
|
19
20
|
class: "property-deprecated"
|
|
20
|
-
},
|
|
21
|
+
}, te = {
|
|
21
22
|
key: 5,
|
|
22
23
|
class: "property-const"
|
|
23
|
-
},
|
|
24
|
+
}, re = {
|
|
24
25
|
key: 7,
|
|
25
26
|
class: "property-write-only"
|
|
26
|
-
},
|
|
27
|
+
}, ie = {
|
|
27
28
|
key: 8,
|
|
28
29
|
class: "property-read-only"
|
|
29
|
-
},
|
|
30
|
+
}, ae = {
|
|
30
31
|
key: 9,
|
|
31
32
|
class: "property-required"
|
|
32
|
-
},
|
|
33
|
+
}, ve = /* @__PURE__ */ E({
|
|
33
34
|
__name: "SchemaPropertyHeading",
|
|
34
35
|
props: {
|
|
35
36
|
value: {},
|
|
36
37
|
enum: { type: Boolean },
|
|
38
|
+
isDiscriminator: { type: Boolean, default: !1 },
|
|
37
39
|
required: { type: Boolean, default: !1 },
|
|
38
40
|
additional: { type: Boolean },
|
|
39
41
|
withExamples: { type: Boolean, default: !0 },
|
|
40
|
-
hideModelNames: { type: Boolean, default: !1 }
|
|
41
|
-
schemas: {}
|
|
42
|
+
hideModelNames: { type: Boolean, default: !1 }
|
|
42
43
|
},
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
45
|
-
var
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
setup(T) {
|
|
45
|
+
const r = T, x = J(r, "value"), h = f(() => {
|
|
46
|
+
var t, y;
|
|
47
|
+
if (!x.value)
|
|
48
|
+
return;
|
|
49
|
+
const e = x.value;
|
|
50
|
+
if (e.const !== void 0)
|
|
51
|
+
return e.const;
|
|
52
|
+
if (((t = e.enum) == null ? void 0 : t.length) === 1)
|
|
53
|
+
return e.enum[0];
|
|
54
|
+
if (g(e) && e.items) {
|
|
55
|
+
const s = I(e.items);
|
|
56
|
+
if (d(s.const))
|
|
57
|
+
return s.const;
|
|
58
|
+
if (((y = s.enum) == null ? void 0 : y.length) === 1)
|
|
59
|
+
return s.enum[0];
|
|
55
60
|
}
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
}), V = f(() => {
|
|
62
|
+
if (!x.value)
|
|
63
|
+
return [];
|
|
64
|
+
const e = x.value, t = [];
|
|
65
|
+
return g(e) && ((e.minItems || e.maxItems) && t.push({
|
|
66
|
+
key: "array-range",
|
|
67
|
+
value: `${e.minItems || ""}…${e.maxItems || ""}`
|
|
68
|
+
}), e.uniqueItems && t.push({
|
|
69
|
+
key: "unique-items",
|
|
70
|
+
value: "unique!"
|
|
71
|
+
})), L(e) && (e.minLength && t.push({
|
|
72
|
+
key: "min-length",
|
|
73
|
+
prefix: "min length: ",
|
|
74
|
+
value: e.minLength
|
|
75
|
+
}), e.maxLength && t.push({
|
|
76
|
+
key: "max-length",
|
|
77
|
+
prefix: "max length: ",
|
|
78
|
+
value: e.maxLength
|
|
79
|
+
}), e.pattern && t.push({
|
|
80
|
+
key: "pattern",
|
|
81
|
+
value: e.pattern,
|
|
82
|
+
code: !0,
|
|
83
|
+
truncate: !0
|
|
84
|
+
})), (L(e) || R(e)) && e.format && t.push({
|
|
85
|
+
key: "format",
|
|
86
|
+
value: e.format,
|
|
87
|
+
truncate: !0
|
|
88
|
+
}), R(e) && (d(e.exclusiveMinimum) && t.push({
|
|
89
|
+
key: "exclusive-minimum",
|
|
90
|
+
prefix: "greater than: ",
|
|
91
|
+
value: e.exclusiveMinimum
|
|
92
|
+
}), d(e.minimum) && t.push({
|
|
93
|
+
key: "minimum",
|
|
94
|
+
prefix: "min: ",
|
|
95
|
+
value: e.minimum
|
|
96
|
+
}), d(e.exclusiveMaximum) && t.push({
|
|
97
|
+
key: "exclusive-maximum",
|
|
98
|
+
prefix: "less than: ",
|
|
99
|
+
value: e.exclusiveMaximum
|
|
100
|
+
}), d(e.maximum) && t.push({
|
|
101
|
+
key: "maximum",
|
|
102
|
+
prefix: "max: ",
|
|
103
|
+
value: e.maximum
|
|
104
|
+
}), d(e.multipleOf) && t.push({
|
|
105
|
+
key: "multiple-of",
|
|
106
|
+
prefix: "multiple of: ",
|
|
107
|
+
value: e.multipleOf
|
|
108
|
+
})), t;
|
|
109
|
+
}), $ = f(() => r.value ? K(r.value, r.hideModelNames) : null), b = f(() => !r.value || !("type" in r.value) ? !1 : r.value.type === "array" ? !0 : !h.value), C = f(() => r.value ? $.value || G(r.value) : ""), N = f(() => {
|
|
110
|
+
const e = r.value;
|
|
111
|
+
return (e == null ? void 0 : e.default) === null ? "null" : Array.isArray(e == null ? void 0 : e.default) && (e == null ? void 0 : e.default.length) === 1 ? String(e == null ? void 0 : e.default[0]) : typeof (e == null ? void 0 : e.default) == "string" ? JSON.stringify(e.default) : Array.isArray(e == null ? void 0 : e.default) || typeof (e == null ? void 0 : e.default) == "object" ? JSON.stringify(e == null ? void 0 : e.default) : e == null ? void 0 : e.default;
|
|
112
|
+
});
|
|
62
113
|
return (e, t) => {
|
|
63
|
-
var
|
|
64
|
-
return
|
|
65
|
-
e.$slots.name ? (
|
|
114
|
+
var y, s, B, q, w, D, M, O, P, A;
|
|
115
|
+
return i(), a("div", X, [
|
|
116
|
+
e.$slots.name ? (i(), a("div", {
|
|
66
117
|
key: 0,
|
|
67
|
-
class:
|
|
118
|
+
class: F(["property-name", { deprecated: (y = r.value) == null ? void 0 : y.deprecated }])
|
|
68
119
|
}, [
|
|
69
|
-
|
|
70
|
-
], 2)) :
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
120
|
+
j(e.$slots, "name", {}, void 0, !0)
|
|
121
|
+
], 2)) : l("", !0),
|
|
122
|
+
r.isDiscriminator ? (i(), a("div", Y, " Discriminator ")) : l("", !0),
|
|
123
|
+
r.value ? (i(), a(c, { key: 2 }, [
|
|
124
|
+
b.value ? (i(), m(p, {
|
|
74
125
|
key: 0,
|
|
75
126
|
truncate: ""
|
|
76
127
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
79
|
-
default:
|
|
80
|
-
|
|
128
|
+
default: n(() => [
|
|
129
|
+
k(S, null, {
|
|
130
|
+
default: n(() => t[0] || (t[0] = [
|
|
131
|
+
u("Type: ")
|
|
81
132
|
])),
|
|
82
133
|
_: 1,
|
|
83
134
|
__: [0]
|
|
84
135
|
}),
|
|
85
|
-
|
|
86
|
-
l(o(D.value), 1)
|
|
87
|
-
], 64)) : (r(), m(f, { key: 1 }, [
|
|
88
|
-
l(o(s(F)(e.value)), 1)
|
|
89
|
-
], 64))
|
|
136
|
+
u(v(C.value), 1)
|
|
90
137
|
]),
|
|
91
138
|
_: 1
|
|
92
|
-
})) :
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
])),
|
|
103
|
-
default: u(() => [
|
|
104
|
-
l(" " + o(e.value.minLength), 1)
|
|
105
|
-
]),
|
|
106
|
-
_: 1
|
|
107
|
-
})) : a("", !0),
|
|
108
|
-
e.value.maxLength ? (r(), i(n, { key: 3 }, {
|
|
109
|
-
prefix: u(() => t[2] || (t[2] = [
|
|
110
|
-
l("max length: ")
|
|
111
|
-
])),
|
|
112
|
-
default: u(() => [
|
|
113
|
-
l(" " + o(e.value.maxLength), 1)
|
|
114
|
-
]),
|
|
115
|
-
_: 1
|
|
116
|
-
})) : a("", !0),
|
|
117
|
-
e.value.uniqueItems ? (r(), i(n, { key: 4 }, {
|
|
118
|
-
default: u(() => t[3] || (t[3] = [
|
|
119
|
-
l(" unique! ")
|
|
120
|
-
])),
|
|
121
|
-
_: 1,
|
|
122
|
-
__: [3]
|
|
123
|
-
})) : a("", !0),
|
|
124
|
-
e.value.format ? (r(), i(n, {
|
|
125
|
-
key: 5,
|
|
126
|
-
truncate: ""
|
|
127
|
-
}, {
|
|
128
|
-
default: u(() => [
|
|
129
|
-
y(S, null, {
|
|
130
|
-
default: u(() => t[4] || (t[4] = [
|
|
131
|
-
l("Format:")
|
|
139
|
+
})) : l("", !0),
|
|
140
|
+
(i(!0), a(c, null, z(V.value, (o) => (i(), m(p, {
|
|
141
|
+
key: o.key,
|
|
142
|
+
code: o.code,
|
|
143
|
+
truncate: o.truncate
|
|
144
|
+
}, H({
|
|
145
|
+
default: n(() => [
|
|
146
|
+
o.key === "format" ? (i(), m(S, { key: 0 }, {
|
|
147
|
+
default: n(() => t[1] || (t[1] = [
|
|
148
|
+
u("Format:")
|
|
132
149
|
])),
|
|
133
150
|
_: 1,
|
|
134
|
-
__: [
|
|
135
|
-
}),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
_: 1
|
|
139
|
-
})) : a("", !0),
|
|
140
|
-
s(p)(e.value.exclusiveMinimum) ? (r(), i(n, { key: 6 }, {
|
|
141
|
-
prefix: u(() => t[5] || (t[5] = [
|
|
142
|
-
l("greater than: ")
|
|
143
|
-
])),
|
|
144
|
-
default: u(() => [
|
|
145
|
-
l(" " + o(e.value.exclusiveMinimum), 1)
|
|
146
|
-
]),
|
|
147
|
-
_: 1
|
|
148
|
-
})) : a("", !0),
|
|
149
|
-
s(p)(e.value.minimum) ? (r(), i(n, { key: 7 }, {
|
|
150
|
-
prefix: u(() => t[6] || (t[6] = [
|
|
151
|
-
l("min: ")
|
|
152
|
-
])),
|
|
153
|
-
default: u(() => [
|
|
154
|
-
l(" " + o(e.value.minimum), 1)
|
|
155
|
-
]),
|
|
156
|
-
_: 1
|
|
157
|
-
})) : a("", !0),
|
|
158
|
-
s(p)(e.value.exclusiveMaximum) ? (r(), i(n, { key: 8 }, {
|
|
159
|
-
prefix: u(() => t[7] || (t[7] = [
|
|
160
|
-
l("less than: ")
|
|
161
|
-
])),
|
|
162
|
-
default: u(() => [
|
|
163
|
-
l(" " + o(e.value.exclusiveMaximum), 1)
|
|
164
|
-
]),
|
|
165
|
-
_: 1
|
|
166
|
-
})) : a("", !0),
|
|
167
|
-
s(p)(e.value.maximum) ? (r(), i(n, { key: 9 }, {
|
|
168
|
-
prefix: u(() => t[8] || (t[8] = [
|
|
169
|
-
l("max: ")
|
|
170
|
-
])),
|
|
171
|
-
default: u(() => [
|
|
172
|
-
l(" " + o(e.value.maximum), 1)
|
|
173
|
-
]),
|
|
174
|
-
_: 1
|
|
175
|
-
})) : a("", !0),
|
|
176
|
-
s(p)(e.value.multipleOf) ? (r(), i(n, { key: 10 }, {
|
|
177
|
-
prefix: u(() => t[9] || (t[9] = [
|
|
178
|
-
l("multiple of: ")
|
|
179
|
-
])),
|
|
180
|
-
default: u(() => [
|
|
181
|
-
l(" " + o(e.value.multipleOf), 1)
|
|
182
|
-
]),
|
|
183
|
-
_: 1
|
|
184
|
-
})) : a("", !0),
|
|
185
|
-
e.value.pattern ? (r(), i(n, {
|
|
186
|
-
key: 11,
|
|
187
|
-
code: "",
|
|
188
|
-
truncate: ""
|
|
189
|
-
}, {
|
|
190
|
-
default: u(() => [
|
|
191
|
-
y(S, null, {
|
|
192
|
-
default: u(() => t[10] || (t[10] = [
|
|
193
|
-
l("Pattern:")
|
|
151
|
+
__: [1]
|
|
152
|
+
})) : o.key === "pattern" ? (i(), m(S, { key: 1 }, {
|
|
153
|
+
default: n(() => t[2] || (t[2] = [
|
|
154
|
+
u(" Pattern: ")
|
|
194
155
|
])),
|
|
195
156
|
_: 1,
|
|
196
|
-
__: [
|
|
197
|
-
}),
|
|
198
|
-
|
|
157
|
+
__: [2]
|
|
158
|
+
})) : l("", !0),
|
|
159
|
+
u(" " + v(o.value), 1)
|
|
199
160
|
]),
|
|
200
|
-
_:
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
161
|
+
_: 2
|
|
162
|
+
}, [
|
|
163
|
+
o.prefix ? {
|
|
164
|
+
name: "prefix",
|
|
165
|
+
fn: n(() => [
|
|
166
|
+
u(v(o.prefix), 1)
|
|
167
|
+
]),
|
|
168
|
+
key: "0"
|
|
169
|
+
} : void 0
|
|
170
|
+
]), 1032, ["code", "truncate"]))), 128)),
|
|
171
|
+
r.enum ? (i(), m(p, { key: 1 }, {
|
|
172
|
+
default: n(() => t[3] || (t[3] = [
|
|
173
|
+
u("enum")
|
|
205
174
|
])),
|
|
206
175
|
_: 1,
|
|
207
|
-
__: [
|
|
208
|
-
})) :
|
|
209
|
-
|
|
210
|
-
key:
|
|
176
|
+
__: [3]
|
|
177
|
+
})) : l("", !0),
|
|
178
|
+
N.value !== void 0 ? (i(), m(p, {
|
|
179
|
+
key: 2,
|
|
211
180
|
truncate: ""
|
|
212
181
|
}, {
|
|
213
|
-
prefix:
|
|
214
|
-
|
|
182
|
+
prefix: n(() => t[4] || (t[4] = [
|
|
183
|
+
u("default:")
|
|
215
184
|
])),
|
|
216
|
-
default:
|
|
217
|
-
|
|
185
|
+
default: n(() => [
|
|
186
|
+
u(v(N.value), 1)
|
|
218
187
|
]),
|
|
219
188
|
_: 1
|
|
220
|
-
})) :
|
|
221
|
-
], 64)) :
|
|
222
|
-
|
|
223
|
-
(
|
|
224
|
-
|
|
225
|
-
], 64)) : (
|
|
226
|
-
|
|
189
|
+
})) : l("", !0)
|
|
190
|
+
], 64)) : l("", !0),
|
|
191
|
+
r.additional ? (i(), a("div", Z, [
|
|
192
|
+
(s = r.value) != null && s["x-additionalPropertiesName"] ? (i(), a(c, { key: 0 }, [
|
|
193
|
+
u(v(r.value["x-additionalPropertiesName"]), 1)
|
|
194
|
+
], 64)) : (i(), a(c, { key: 1 }, [
|
|
195
|
+
u("additional properties")
|
|
227
196
|
], 64))
|
|
228
|
-
])) :
|
|
229
|
-
(
|
|
230
|
-
|
|
231
|
-
default:
|
|
232
|
-
|
|
197
|
+
])) : l("", !0),
|
|
198
|
+
(B = r.value) != null && B.deprecated ? (i(), a("div", ee, [
|
|
199
|
+
k(_(W), null, {
|
|
200
|
+
default: n(() => t[5] || (t[5] = [
|
|
201
|
+
u("deprecated")
|
|
233
202
|
])),
|
|
234
203
|
_: 1,
|
|
235
|
-
__: [
|
|
204
|
+
__: [5]
|
|
236
205
|
})
|
|
237
|
-
])) :
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
prefix:
|
|
241
|
-
|
|
206
|
+
])) : l("", !0),
|
|
207
|
+
h.value !== void 0 ? (i(), a("div", te, [
|
|
208
|
+
k(p, { truncate: "" }, {
|
|
209
|
+
prefix: n(() => t[6] || (t[6] = [
|
|
210
|
+
u("const: ")
|
|
242
211
|
])),
|
|
243
|
-
default:
|
|
244
|
-
|
|
212
|
+
default: n(() => [
|
|
213
|
+
k(Q, { value: h.value }, null, 8, ["value"])
|
|
245
214
|
]),
|
|
246
215
|
_: 1
|
|
247
216
|
})
|
|
248
|
-
])) : (
|
|
249
|
-
((q =
|
|
250
|
-
default:
|
|
251
|
-
|
|
217
|
+
])) : (i(), a(c, { key: 6 }, [
|
|
218
|
+
((q = r.value) == null ? void 0 : q.nullable) === !0 ? (i(), m(p, { key: 0 }, {
|
|
219
|
+
default: n(() => t[7] || (t[7] = [
|
|
220
|
+
u(" nullable ")
|
|
252
221
|
])),
|
|
253
222
|
_: 1,
|
|
254
|
-
__: [
|
|
255
|
-
})) :
|
|
223
|
+
__: [7]
|
|
224
|
+
})) : l("", !0)
|
|
256
225
|
], 64)),
|
|
257
|
-
(w =
|
|
258
|
-
|
|
259
|
-
|
|
226
|
+
(w = r.value) != null && w.writeOnly ? (i(), a("div", re, " write-only ")) : (D = r.value) != null && D.readOnly ? (i(), a("div", ie, " read-only ")) : l("", !0),
|
|
227
|
+
r.required ? (i(), a("div", ae, " required ")) : l("", !0),
|
|
228
|
+
r.withExamples ? (i(), m(U, {
|
|
260
229
|
key: 10,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}, null, 8, ["
|
|
230
|
+
example: ((M = r.value) == null ? void 0 : M.example) || r.value && _(g)(r.value) && ((P = _(I)((O = r.value) == null ? void 0 : O.items)) == null ? void 0 : P.example),
|
|
231
|
+
examples: (A = r.value) == null ? void 0 : A.examples
|
|
232
|
+
}, null, 8, ["example", "examples"])) : l("", !0)
|
|
264
233
|
]);
|
|
265
234
|
};
|
|
266
235
|
}
|
|
267
236
|
});
|
|
268
237
|
export {
|
|
269
|
-
|
|
238
|
+
ve as default
|
|
270
239
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
|
|
3
|
+
/**
|
|
4
|
+
* Gets the "name" of the schema from the ref path
|
|
5
|
+
* TODO: this will change so fix it when the new refs are out
|
|
6
|
+
* Then add tests
|
|
7
|
+
*
|
|
8
|
+
* @example SchemaName from #/components/schemas/SchemaName
|
|
9
|
+
*/
|
|
10
|
+
export declare const getRefName: (schema: ReferenceType<SchemaObject>) => string | null;
|
|
11
|
+
//# sourceMappingURL=get-ref-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-ref-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,aAAa,CAAC,YAAY,CAAC,kBAa7D,CAAA"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
|
|
2
3
|
/**
|
|
3
4
|
* Computes the human-readable type for a schema.
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
*
|
|
6
|
+
* Priority order:
|
|
7
|
+
* 1. const values
|
|
8
|
+
* 2. Array types (with special handling for items)
|
|
9
|
+
* 3. title property
|
|
10
|
+
* 4. xml.name property
|
|
11
|
+
* 5. type with contentEncoding
|
|
12
|
+
* 6. $ref names
|
|
13
|
+
* 7. raw type
|
|
14
|
+
*/
|
|
15
|
+
export declare const getSchemaType: (valueOrRef: SchemaObject | ReferenceType<SchemaObject>) => string;
|
|
6
16
|
//# sourceMappingURL=get-schema-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAoC1F;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MA0DtF,CAAA"}
|
|
@@ -1,20 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getResolvedRef as y } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { isArraySchema as s } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
+
import { getRefName as p } from "./get-ref-name.js";
|
|
4
|
+
const c = (t) => t ? `array ${t.includes(" | ") ? `(${t})` : t}[]` : "array", o = (t, r = !1) => {
|
|
5
|
+
var n;
|
|
6
|
+
if (!t.items)
|
|
7
|
+
return r ? "array" : t.title || ((n = t.xml) == null ? void 0 : n.name) || "array";
|
|
8
|
+
const i = f(t.items), e = c(i);
|
|
9
|
+
return r ? e : t.nullable ? `${e} | null` : e;
|
|
10
|
+
}, f = (t) => {
|
|
11
|
+
var i;
|
|
12
|
+
if (!t)
|
|
13
|
+
return "";
|
|
14
|
+
const r = y(t);
|
|
15
|
+
if (r.const !== void 0)
|
|
4
16
|
return "const";
|
|
5
|
-
if (
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
return
|
|
17
|
+
if ("type" in r && Array.isArray(r.type)) {
|
|
18
|
+
if (r.type.includes("array") && r.items) {
|
|
19
|
+
const e = o(r, !0), n = r.type.filter((a) => a !== "array");
|
|
20
|
+
return n.length > 0 ? `${e} | ${n.join(" | ")}` : e;
|
|
9
21
|
}
|
|
10
|
-
return
|
|
22
|
+
return r.type.join(" | ");
|
|
11
23
|
}
|
|
12
|
-
if ((
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
if (s(r))
|
|
25
|
+
return o(r, !1);
|
|
26
|
+
if (r.title)
|
|
27
|
+
return r.title;
|
|
28
|
+
if ((i = r.xml) != null && i.name)
|
|
29
|
+
return r.xml.name;
|
|
30
|
+
if ("type" in r && r.type && r.contentEncoding)
|
|
31
|
+
return `${r.type} • ${r.contentEncoding}`;
|
|
32
|
+
if ("$ref" in t) {
|
|
33
|
+
const e = p(t);
|
|
34
|
+
if (e)
|
|
35
|
+
return e;
|
|
15
36
|
}
|
|
16
|
-
return
|
|
37
|
+
return "type" in r ? r.type : "";
|
|
17
38
|
};
|
|
18
39
|
export {
|
|
19
|
-
|
|
40
|
+
f as getSchemaType
|
|
20
41
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const isTypeObject: (schema: unknown) => schema is
|
|
1
|
+
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
export declare const isTypeObject: (schema: unknown) => schema is Extract<SchemaObject, {
|
|
3
|
+
type: "object";
|
|
4
|
+
}>;
|
|
3
5
|
//# sourceMappingURL=is-type-object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-type-object.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/is-type-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"is-type-object.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/is-type-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAsChG,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type SchemaObject = OpenAPIV3_1.SchemaObject;
|
|
1
|
+
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
2
|
/**
|
|
4
3
|
* Merges multiple OpenAPI schema objects into a single schema object.
|
|
5
4
|
* Handles nested allOf compositions and merges properties recursively.
|
|
@@ -8,6 +7,5 @@ type SchemaObject = OpenAPIV3_1.SchemaObject;
|
|
|
8
7
|
* @param rootSchema - Optional root schema to merge with the result
|
|
9
8
|
* @returns Merged schema object
|
|
10
9
|
*/
|
|
11
|
-
export declare
|
|
12
|
-
export {};
|
|
10
|
+
export declare const mergeAllOfSchemas: (schemas: SchemaObject | undefined, rootSchema?: SchemaObject) => SchemaObject;
|
|
13
11
|
//# sourceMappingURL=merge-all-of-schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-all-of-schemas.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge-all-of-schemas.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,YAAY,GAAG,SAAS,EAAE,aAAa,YAAY,KAAG,YA+ChG,CAAA"}
|