@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,92 +1,138 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { objectKeys as y } from "@scalar/helpers/object/object-keys";
|
|
2
|
+
import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { isArraySchema as m } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
4
|
+
const a = (e, f) => {
|
|
5
|
+
var i;
|
|
6
|
+
if (!((i = e == null ? void 0 : e.allOf) != null && i.length) || !Array.isArray(e.allOf))
|
|
7
|
+
return f || {};
|
|
8
|
+
const t = {}, { allOf: n, ...r } = e;
|
|
9
|
+
for (const o of e.allOf) {
|
|
10
|
+
if (!o || typeof o != "object")
|
|
11
|
+
continue;
|
|
12
|
+
const p = s(o);
|
|
13
|
+
if (p.allOf) {
|
|
14
|
+
const l = a(p);
|
|
15
|
+
O(t, l);
|
|
16
|
+
continue;
|
|
10
17
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
18
|
+
O(t, p);
|
|
19
|
+
}
|
|
20
|
+
if (Object.keys(r).length > 0 && O(t, r, !0), f && typeof f == "object")
|
|
21
|
+
if (f.allOf) {
|
|
22
|
+
const o = a(f);
|
|
23
|
+
O(t, o, !0);
|
|
24
|
+
} else
|
|
25
|
+
O(t, f, !0);
|
|
26
|
+
return t;
|
|
27
|
+
}, O = (e, f, t = !1) => {
|
|
28
|
+
var r;
|
|
29
|
+
const n = y(f);
|
|
30
|
+
if (n.length !== 0)
|
|
31
|
+
for (const i of n) {
|
|
32
|
+
const o = s(f[i]);
|
|
33
|
+
if (o !== void 0)
|
|
34
|
+
if (i === "required")
|
|
35
|
+
Array.isArray(o) && o.length > 0 && ((r = e.required) != null && r.length ? e.required = [.../* @__PURE__ */ new Set([...e.required, ...o])] : e.required = o.slice());
|
|
36
|
+
else if (i === "properties")
|
|
37
|
+
o && typeof o == "object" && (e.properties || (e.properties = {}), c(e.properties, o));
|
|
38
|
+
else if (i === "items") {
|
|
39
|
+
const p = s(o);
|
|
40
|
+
if (p)
|
|
41
|
+
if (m(f))
|
|
42
|
+
if (e.items || (e.items = {}), p.allOf) {
|
|
43
|
+
const l = a(p);
|
|
44
|
+
Object.assign(e.items, l);
|
|
45
|
+
} else
|
|
46
|
+
d(s(e.items), p);
|
|
47
|
+
else if (p.allOf) {
|
|
48
|
+
const l = a(p);
|
|
49
|
+
"properties" in l && ("properties" in e || (e.properties = {}), "properties" in e && c(e.properties, l.properties));
|
|
50
|
+
} else "items" in e || (e.items = p);
|
|
51
|
+
} else if (i === "enum")
|
|
52
|
+
Array.isArray(o) && o.length > 0 && (e.enum = [.../* @__PURE__ */ new Set([...e.enum || [], ...o])]);
|
|
53
|
+
else if (i === "oneOf" || i === "anyOf") {
|
|
54
|
+
if (Array.isArray(o)) {
|
|
55
|
+
"properties" in e || (e.properties = {});
|
|
56
|
+
for (const p of o) {
|
|
57
|
+
const l = s(p);
|
|
58
|
+
l.properties && "properties" in e && c(e.properties, l.properties);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
if (i === "allOf")
|
|
63
|
+
continue;
|
|
64
|
+
(t || e[i] === void 0) && (e[i] = o);
|
|
65
|
+
}
|
|
44
66
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
e[
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
}, c = (e, f) => {
|
|
68
|
+
var n;
|
|
69
|
+
const t = Object.keys(f ?? {});
|
|
70
|
+
if (!(!f || !e || t.length === 0))
|
|
71
|
+
for (const r of t) {
|
|
72
|
+
const i = s(f[r]);
|
|
73
|
+
if (!i || typeof i != "object") {
|
|
74
|
+
e[r] = i;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (!e[r]) {
|
|
78
|
+
i.allOf ? e[r] = a(i) : "type" in i && i.type === "array" && ((n = s(i.items)) != null && n.allOf) ? e[r] = {
|
|
79
|
+
...i,
|
|
80
|
+
items: a(s(i.items))
|
|
81
|
+
} : e[r] = f[r];
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const o = s(e[r]);
|
|
85
|
+
if (i.allOf)
|
|
86
|
+
e[r] = a({ allOf: [o, ...i.allOf] });
|
|
87
|
+
else if (m(i) && m(o) && i.items) {
|
|
88
|
+
const p = s(o.items);
|
|
89
|
+
e[r] = {
|
|
90
|
+
...o,
|
|
91
|
+
type: "array",
|
|
92
|
+
items: p ? h(p, s(i.items)) : s(i.items)
|
|
93
|
+
};
|
|
94
|
+
} else if ("properties" in o && "properties" in i) {
|
|
95
|
+
const p = { ...o, ...i };
|
|
96
|
+
p.properties = { ...o.properties }, c(p.properties, i.properties), e[r] = p;
|
|
97
|
+
} else
|
|
98
|
+
e[r] = { ...i, ...o };
|
|
59
99
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
100
|
+
}, d = (e, f) => {
|
|
101
|
+
if (f.allOf || e.allOf) {
|
|
102
|
+
const t = [];
|
|
103
|
+
if (e.allOf)
|
|
104
|
+
for (const r of e.allOf)
|
|
105
|
+
t.push(s(r));
|
|
106
|
+
else
|
|
107
|
+
t.push(e);
|
|
108
|
+
if (f.allOf)
|
|
109
|
+
for (const r of f.allOf)
|
|
110
|
+
t.push(s(r));
|
|
111
|
+
else
|
|
112
|
+
t.push(f);
|
|
113
|
+
const n = a({ allOf: t });
|
|
114
|
+
Object.assign(e, n);
|
|
115
|
+
return;
|
|
68
116
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
117
|
+
Object.assign(e, f), "properties" in e && "properties" in f && c(e.properties, f.properties);
|
|
118
|
+
}, h = (e, f) => {
|
|
119
|
+
if (e.allOf || f.allOf) {
|
|
120
|
+
const n = [];
|
|
121
|
+
if (e.allOf)
|
|
122
|
+
for (const r of e.allOf)
|
|
123
|
+
n.push(s(r));
|
|
124
|
+
else
|
|
125
|
+
n.push(e);
|
|
126
|
+
if (f.allOf)
|
|
127
|
+
for (const r of f.allOf)
|
|
128
|
+
n.push(s(r));
|
|
129
|
+
else
|
|
130
|
+
n.push(f);
|
|
131
|
+
return a({ allOf: n });
|
|
82
132
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
r && r.forEach((o) => {
|
|
86
|
-
o.properties && (e.properties = l(e.properties || {}, o.properties, p + 1));
|
|
87
|
-
});
|
|
88
|
-
}), e;
|
|
133
|
+
const t = { ...e, ...f };
|
|
134
|
+
return "properties" in e && "properties" in f && (t.properties = { ...e.properties }, c(t.properties, f.properties)), t;
|
|
89
135
|
};
|
|
90
136
|
export {
|
|
91
|
-
|
|
137
|
+
a as mergeAllOfSchemas
|
|
92
138
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CompositionKeyword } from './schema-composition.js';
|
|
3
|
-
export declare const compositions: CompositionKeyword[];
|
|
1
|
+
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
4
2
|
/**
|
|
5
|
-
* Optimize the value by removing nulls from compositions.
|
|
3
|
+
* Optimize the value by removing nulls from compositions and merging root properties.
|
|
4
|
+
*
|
|
5
|
+
* TODO: figure out what this does
|
|
6
6
|
*/
|
|
7
|
-
export declare function optimizeValueForDisplay(value:
|
|
7
|
+
export declare function optimizeValueForDisplay(value: SchemaObject | undefined): SchemaObject | undefined;
|
|
8
8
|
//# sourceMappingURL=optimize-value-for-display.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimize-value-for-display.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"optimize-value-for-display.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIhG;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAuFjG"}
|
|
@@ -1,34 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { getResolvedRef as h } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { compositions as b } from "./schema-composition.js";
|
|
3
|
+
function P(t) {
|
|
4
|
+
if (!t || typeof t != "object")
|
|
5
|
+
return t;
|
|
6
|
+
const r = b.find((e) => e in t && e !== "not");
|
|
7
|
+
if (!r)
|
|
8
|
+
return { ...t };
|
|
9
|
+
const i = t[r];
|
|
10
|
+
if (!Array.isArray(i))
|
|
11
|
+
return { ...t };
|
|
12
|
+
const { [r]: S, nullable: m, ...n } = t, a = Object.keys(n).length > 0, { filteredSchemas: o, hasNullSchema: p } = i.reduce(
|
|
13
|
+
(e, l) => {
|
|
14
|
+
const s = h(l);
|
|
15
|
+
return "type" in s && s.type === "null" ? e.hasNullSchema = !0 : e.filteredSchemas.push(s), e;
|
|
16
|
+
},
|
|
17
|
+
{ filteredSchemas: [], hasNullSchema: !1 }
|
|
18
|
+
), c = p || m === !0;
|
|
19
|
+
if (o.length === 1) {
|
|
20
|
+
const e = { ...n, ...o[0] };
|
|
21
|
+
return c && (e.nullable = !0), e;
|
|
22
|
+
}
|
|
23
|
+
if ((r === "oneOf" || r === "anyOf") && (a || o.some((e) => e.allOf))) {
|
|
24
|
+
const e = o.map((s) => {
|
|
25
|
+
var u;
|
|
26
|
+
const f = h(s);
|
|
27
|
+
if (((u = f.allOf) == null ? void 0 : u.length) === 1) {
|
|
28
|
+
const { allOf: g, ...d } = f;
|
|
29
|
+
return { ...n, ...d, ...h(g[0]) };
|
|
30
|
+
}
|
|
31
|
+
return { ...n, ...f };
|
|
32
|
+
}), l = { [r]: e };
|
|
33
|
+
return c && (l.nullable = !0), l;
|
|
34
|
+
}
|
|
35
|
+
if (o.length !== i.length) {
|
|
36
|
+
const e = { ...t, [r]: o };
|
|
37
|
+
return c && (e.nullable = !0), e;
|
|
38
|
+
}
|
|
39
|
+
return { ...t };
|
|
30
40
|
}
|
|
31
41
|
export {
|
|
32
|
-
|
|
33
|
-
b as optimizeValueForDisplay
|
|
42
|
+
P as optimizeValueForDisplay
|
|
34
43
|
};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
-
export type CompositionMapping = {
|
|
3
|
-
[key: string]: string;
|
|
4
|
-
};
|
|
5
1
|
/** Composition */
|
|
6
2
|
export type CompositionKeyword = 'oneOf' | 'anyOf' | 'allOf' | 'not';
|
|
7
3
|
export declare const compositions: CompositionKeyword[];
|
|
8
|
-
/** Get composition mapping from schema - used in testing */
|
|
9
|
-
export declare function getCompositionSchemaMapping(schema: OpenAPIV3_1.SchemaObject, composition: CompositionKeyword): CompositionMapping | undefined;
|
|
10
|
-
/** Check if schema has a composition keyword */
|
|
11
|
-
export declare function hasComposition(schema: OpenAPIV3_1.SchemaObject): boolean;
|
|
12
4
|
//# sourceMappingURL=schema-composition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-composition.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-composition.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"schema-composition.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-composition.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAA;AAEpE,eAAO,MAAM,YAAY,EAAE,kBAAkB,EAAuC,CAAA"}
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
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';
|
|
3
3
|
/**
|
|
4
4
|
* Extract schema name from various schema formats
|
|
5
|
+
*
|
|
5
6
|
* Handles $ref, title, name, type, and schema dictionary lookup
|
|
6
7
|
*/
|
|
7
|
-
export declare
|
|
8
|
-
/**
|
|
9
|
-
* Find schema name by matching against component schemas
|
|
10
|
-
*/
|
|
11
|
-
export declare function getSchemaNameFromSchemas(schema: OpenAPIV3_1.SchemaObject, schemas?: Schemas): string | null;
|
|
8
|
+
export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | ReferenceType<SchemaObject>) => string | null;
|
|
12
9
|
/**
|
|
13
10
|
* Format the type and model name for display
|
|
14
11
|
*/
|
|
15
|
-
export declare
|
|
12
|
+
export declare const formatTypeWithModel: (type: Extract<SchemaObject, {
|
|
13
|
+
type: any;
|
|
14
|
+
}>["type"], modelName: string) => string;
|
|
16
15
|
/**
|
|
17
16
|
* Get the model name for a schema property
|
|
18
17
|
* e.g. User | Admin | array of User | array of Admin
|
|
19
18
|
*/
|
|
20
|
-
export declare
|
|
21
|
-
/**
|
|
22
|
-
* Check if a schema has a name (title, name, or custom identifier)
|
|
23
|
-
*/
|
|
24
|
-
export declare function hasName(name: string | null): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Choose the schemas to display in composition panel
|
|
27
|
-
*/
|
|
28
|
-
export declare function getCompositionDisplay(baseSchemas: OpenAPIV3_1.SchemaObject[], compositionSchemas: OpenAPIV3_1.SchemaObject[], _schemas?: Schemas): OpenAPIV3_1.SchemaObject[];
|
|
19
|
+
export declare const getModelName: (value: SchemaObject, hideModelNames?: boolean) => string | null;
|
|
29
20
|
//# sourceMappingURL=schema-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAI1F;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MAAM,GAAG,IAyBzG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,MAAM,KAAG,MACrD,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,YAAY,EAAE,wBAAsB,KAAG,MAAM,GAAG,IA+CnF,CAAA"}
|
|
@@ -1,41 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { getRefName as y } from "./get-ref-name.js";
|
|
3
|
+
const f = (t) => {
|
|
2
4
|
if (!t)
|
|
3
5
|
return null;
|
|
4
|
-
if ("title" in t && t.title)
|
|
5
|
-
return t.title;
|
|
6
|
-
if ("name" in t && t.name)
|
|
7
|
-
return t.name;
|
|
8
6
|
if ("$ref" in t) {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
7
|
+
const e = y(t);
|
|
8
|
+
if (e)
|
|
9
|
+
return e;
|
|
12
10
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
function p(t, n, i = !1, y) {
|
|
19
|
-
if (!(t != null && t.type) || i)
|
|
11
|
+
const r = s(t);
|
|
12
|
+
return r.title ? r.title : r.name ? r.name : null;
|
|
13
|
+
}, o = (t, r) => `${t} ${r}${t === "array" ? "[]" : ""}`, u = (t, r = !1) => {
|
|
14
|
+
if (!("type" in t) || r)
|
|
20
15
|
return null;
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (t.items.title || t.items.name)
|
|
31
|
-
return e(t.type, t.items.title || t.items.name);
|
|
32
|
-
const f = o(t.items);
|
|
33
|
-
return f && f !== t.items.type ? e(t.type, f) : t.items.type ? e(t.type, t.items.type) : e(t.type, "object");
|
|
16
|
+
const e = t.type, i = f(t);
|
|
17
|
+
if (i && t.title)
|
|
18
|
+
return e === "array" ? `array ${i}[]` : i;
|
|
19
|
+
if (e === "array" && t.items) {
|
|
20
|
+
const n = s(t.items), a = n.title;
|
|
21
|
+
if (a)
|
|
22
|
+
return o(e, a);
|
|
23
|
+
const m = f(t.items);
|
|
24
|
+
return m && "type" in n && m !== n.type ? o(e, m) : "type" in n ? o(e, Array.isArray(n.type) ? n.type.join(" | ") : n.type) : o(e, "object");
|
|
34
25
|
}
|
|
35
|
-
return
|
|
36
|
-
}
|
|
26
|
+
return i && i !== e ? i.startsWith("Array of ") ? `array ${i.slice(9)}[]` : i : null;
|
|
27
|
+
};
|
|
37
28
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
o as formatTypeWithModel,
|
|
30
|
+
u as getModelName,
|
|
31
|
+
f as getModelNameFromSchema
|
|
41
32
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { Collection, Server } from '@scalar/oas-utils/entities/spec';
|
|
3
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
4
3
|
import type { ApiReferenceConfiguration } from '@scalar/types';
|
|
5
4
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
5
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
6
6
|
import type { ClientOptionGroup } from '../../v2/blocks/scalar-request-example-block/types';
|
|
7
7
|
type __VLS_Props = {
|
|
8
8
|
path: string;
|
|
9
9
|
method: HttpMethod;
|
|
10
10
|
clientOptions: ClientOptionGroup[];
|
|
11
|
+
config: ApiReferenceConfiguration;
|
|
12
|
+
document: OpenApiDocument;
|
|
11
13
|
isWebhook: boolean;
|
|
12
14
|
id: string;
|
|
13
|
-
config: ApiReferenceConfiguration;
|
|
14
15
|
server: Server | undefined;
|
|
15
16
|
store: WorkspaceStore;
|
|
16
17
|
/** @deprecated Use `document` instead, we just need the selected security scheme uids for now */
|
|
17
18
|
collection: Collection;
|
|
18
|
-
/** @deprecated Use the new workspace store instead*/
|
|
19
|
-
document?: OpenAPIV3_1.Document;
|
|
20
19
|
};
|
|
21
20
|
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>;
|
|
22
21
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AA4GA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AAKvF,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;IAClB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,MAAM,EAAE,yBAAyB,CAAA;IACjC,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,cAAc,CAAA;IACrB,iGAAiG;IACjG,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;AA0IJ,wBAMG"}
|