@scalar/api-reference 1.35.5 → 1.35.6
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 +21 -0
- package/dist/browser/standalone.js +18150 -18465
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue2.js +8 -11
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +4 -4
- package/dist/components/ApiReferenceLayout.vue2.js +247 -268
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/ClassicHeader.vue.js +1 -1
- package/dist/components/Content/Content.vue.js +145 -169
- package/dist/components/Content/Content.vue3.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue2.js +32 -35
- package/dist/components/Content/Models/Models.vue.js +27 -31
- package/dist/components/Content/Models/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +32 -35
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +26 -27
- package/dist/components/Content/Operations/get-current-index.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue2.js +68 -74
- package/dist/components/Content/Schema/SchemaComposition.vue.js +42 -45
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +45 -50
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +41 -48
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +142 -157
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +160 -164
- package/dist/components/Content/Schema/helpers/get-schema-type.js +15 -17
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +74 -77
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +10 -11
- package/dist/components/Content/Tags/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue2.js +36 -39
- package/dist/components/Content/Tags/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue2.js +31 -35
- package/dist/components/Content/Tags/TagSection.vue.js +86 -92
- package/dist/components/GettingStarted.vue.js +1 -1
- package/dist/components/LinkList/LinkList.vue.js +1 -1
- package/dist/components/LoadingSkeleton.vue.js +1 -1
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.js +3 -3
- package/dist/components/MobileHeader.vue2.js +13 -12
- package/dist/components/OperationPath.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue2.js +45 -51
- package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
- package/dist/components/ScreenReader.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue.js +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/Section.vue2.js +13 -14
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue2.js +29 -30
- package/dist/components/Section/SectionColumn.vue.js +1 -1
- package/dist/components/Section/SectionColumns.vue.js +1 -1
- package/dist/components/Section/SectionContainer.vue.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +1 -1
- package/dist/components/Section/SectionContent.vue.js +1 -1
- package/dist/components/Section/SectionHeader.vue.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
- package/dist/components/SectionFlare/SectionFlare.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue2.js +12 -13
- package/dist/features/Operation/Operation.vue.js +31 -36
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +8 -11
- package/dist/features/Operation/components/ParameterList.vue.js +21 -24
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +36 -37
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue2.js +45 -52
- package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +32 -35
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +4 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +114 -119
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +3 -3
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +87 -89
- package/dist/features/Search/components/SearchButton.vue.js +23 -25
- package/dist/features/Search/components/SearchModal.vue.js +1 -1
- package/dist/features/Search/components/SearchModal.vue2.js +53 -54
- package/dist/features/api-client-modal/ApiClientModal.vue.js +31 -38
- package/dist/features/document-source/hooks/useDocumentFetcher.js +17 -18
- package/dist/features/document-source/hooks/useDocumentSource.js +16 -16
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue2.js +23 -26
- package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue2.js +128 -153
- package/dist/features/info-object/Contact.vue.js +24 -27
- package/dist/features/info-object/License.vue.js +26 -29
- package/dist/features/multiple-documents/DocumentSelector.vue.js +22 -31
- package/dist/features/multiple-documents/useMultipleDocuments.js +52 -56
- package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/Sidebar.vue.js +3 -3
- package/dist/features/sidebar/components/Sidebar.vue2.js +74 -79
- package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue2.js +52 -53
- package/dist/features/sidebar/components/SidebarGroup.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue2.js +28 -31
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue2.js +1 -2
- package/dist/features/traverse-schema/helpers/traverse-description.js +13 -14
- package/dist/features/traverse-schema/helpers/traverse-document.js +14 -15
- package/dist/features/traverse-schema/helpers/traverse-paths.js +20 -23
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +13 -15
- package/dist/features/traverse-schema/helpers/traverse-webhooks.js +8 -10
- package/dist/hooks/useFreezing.js +14 -14
- package/dist/hooks/useNavState.js +37 -39
- package/dist/index.js +2 -2
- package/dist/libs/openapi.js +28 -31
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +68 -75
- package/dist/v2/ApiReferenceWorkspace.vue3.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +116 -135
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +40 -47
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +45 -46
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +109 -125
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +84 -84
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/update-scheme.js +12 -13
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +1 -4
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +77 -82
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue2.js +46 -49
- package/dist/v2/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +74 -89
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +24 -27
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +106 -119
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +11 -12
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +3 -3
- package/dist/v2/blocks/scalar-server-selector-block/components/Selector.vue.js +11 -14
- package/dist/v2/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +45 -48
- package/dist/v2/helpers/get-document-name.js +10 -10
- package/dist/v2/helpers/map-configuration.js +48 -51
- package/dist/v2/hooks/use-legacy-store-events.js +44 -48
- package/dist/v2/hooks/use-workspace-store-events.js +23 -26
- package/package.json +22 -22
- package/dist/components/ApiReferenceLayout.vue3.js +0 -4
- package/dist/components/ApiReferenceLayout.vue4.js +0 -4
- package/dist/components/ApiReferenceLayout.vue5.js +0 -4
- package/dist/components/ApiReferenceLayout.vue6.js +0 -4
- package/dist/components/Badge/Badge.vue3.js +0 -4
- package/dist/components/ClassicHeader.vue2.js +0 -4
- package/dist/components/Content/Content.vue2.js +0 -4
- package/dist/components/Content/Models/ClassicLayout.vue3.js +0 -4
- package/dist/components/Content/Models/ModernLayout.vue3.js +0 -4
- package/dist/components/Content/Schema/Schema.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaEnumValues.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaHeading.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaProperty.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue3.js +0 -4
- package/dist/components/Content/Tags/ClassicLayout.vue3.js +0 -4
- package/dist/components/Content/Tags/ModernLayout.vue3.js +0 -4
- package/dist/components/GettingStarted.vue3.js +0 -4
- package/dist/components/LinkList/LinkList.vue3.js +0 -4
- package/dist/components/LoadingSkeleton.vue3.js +0 -4
- package/dist/components/MobileHeader.vue3.js +0 -4
- package/dist/components/OperationPath.vue3.js +0 -4
- package/dist/components/OperationsList/OperationsList.vue3.js +0 -4
- package/dist/components/OperationsList/OperationsListItem.vue3.js +0 -4
- package/dist/components/ScreenReader.vue3.js +0 -4
- package/dist/components/Section/CompactSection.vue3.js +0 -4
- package/dist/components/Section/Section.vue3.js +0 -4
- package/dist/components/Section/SectionAccordion.vue3.js +0 -4
- package/dist/components/Section/SectionColumn.vue2.js +0 -4
- package/dist/components/Section/SectionColumns.vue2.js +0 -4
- package/dist/components/Section/SectionContainer.vue3.js +0 -4
- package/dist/components/Section/SectionContainerAccordion.vue3.js +0 -4
- package/dist/components/Section/SectionContent.vue3.js +0 -4
- package/dist/components/Section/SectionHeader.vue3.js +0 -4
- package/dist/components/Section/SectionHeaderTag.vue3.js +0 -4
- package/dist/components/SectionFlare/SectionFlare.vue2.js +0 -4
- package/dist/components/ShowMoreButton.vue3.js +0 -4
- package/dist/features/Operation/components/Headers.vue3.js +0 -4
- package/dist/features/Operation/components/ParameterListItem.vue3.js +0 -4
- package/dist/features/Operation/components/RequestBody.vue3.js +0 -4
- package/dist/features/Operation/components/callbacks/Callback.vue3.js +0 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue3.js +0 -4
- package/dist/features/Operation/layouts/ModernLayout.vue3.js +0 -4
- package/dist/features/Search/components/SearchModal.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponse.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponseTab.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponseTabList.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponses.vue3.js +0 -4
- package/dist/features/sidebar/components/Sidebar.vue3.js +0 -4
- package/dist/features/sidebar/components/SidebarElement.vue3.js +0 -4
- package/dist/features/sidebar/components/SidebarGroup.vue3.js +0 -4
- package/dist/features/sidebar/components/SidebarHttpBadge.vue3.js +0 -4
- package/dist/features/test-request-button/TestRequestButton.vue3.js +0 -4
- package/dist/v2/ApiReferenceWorkspace.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue3.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue3.js +0 -4
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue3.js +0 -4
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/InfoDescription.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCard.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCardItem.vue2.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue3.js +0 -4
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue3.js +0 -4
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { getResolvedRef as
|
|
4
|
-
import { isArraySchema as
|
|
5
|
-
import
|
|
6
|
-
import { getSchemaType as
|
|
7
|
-
import { getModelName as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as P, toRef as A, computed as s, createElementBlock as u, openBlock as a, createCommentVNode as l, createBlock as m, normalizeClass as I, renderSlot as L, Fragment as p, withCtx as n, createVNode as c, createTextVNode as i, toDisplayString as v, renderList as R, createSlots as T, unref as k } from "vue";
|
|
2
|
+
import { isDefined as f } from "@scalar/helpers/array/is-defined";
|
|
3
|
+
import { getResolvedRef as S } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
|
+
import { isArraySchema as h, isStringSchema as N, isNumberSchema as B } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
5
|
+
import _ from "../../ScreenReader.vue.js";
|
|
6
|
+
import { getSchemaType as V } from "./helpers/get-schema-type.js";
|
|
7
|
+
import { getModelName as $ } from "./helpers/schema-name.js";
|
|
8
|
+
import b from "./RenderString.vue.js";
|
|
9
|
+
import d from "./SchemaPropertyDetail.vue.js";
|
|
10
|
+
import C from "./SchemaPropertyExamples.vue.js";
|
|
11
|
+
import E from "../../Badge/Badge.vue.js";
|
|
12
|
+
const J = { class: "property-heading" }, F = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "property-discriminator"
|
|
15
|
-
},
|
|
15
|
+
}, j = {
|
|
16
16
|
key: 3,
|
|
17
17
|
class: "property-additional"
|
|
18
|
-
},
|
|
18
|
+
}, z = {
|
|
19
19
|
key: 4,
|
|
20
20
|
class: "property-deprecated"
|
|
21
|
-
},
|
|
21
|
+
}, H = {
|
|
22
22
|
key: 5,
|
|
23
23
|
class: "property-const"
|
|
24
|
-
},
|
|
24
|
+
}, G = {
|
|
25
25
|
key: 7,
|
|
26
26
|
class: "property-write-only"
|
|
27
|
-
},
|
|
27
|
+
}, K = {
|
|
28
28
|
key: 8,
|
|
29
29
|
class: "property-read-only"
|
|
30
|
-
},
|
|
30
|
+
}, Q = {
|
|
31
31
|
key: 9,
|
|
32
32
|
class: "property-required"
|
|
33
|
-
},
|
|
33
|
+
}, le = /* @__PURE__ */ P({
|
|
34
34
|
__name: "SchemaPropertyHeading",
|
|
35
35
|
props: {
|
|
36
36
|
value: {},
|
|
@@ -41,34 +41,33 @@ const X = { class: "property-heading" }, Y = {
|
|
|
41
41
|
withExamples: { type: Boolean, default: !0 },
|
|
42
42
|
hideModelNames: { type: Boolean, default: !1 }
|
|
43
43
|
},
|
|
44
|
-
setup(
|
|
45
|
-
const r =
|
|
46
|
-
|
|
47
|
-
if (!x.value)
|
|
44
|
+
setup(q) {
|
|
45
|
+
const r = q, y = A(r, "value"), x = s(() => {
|
|
46
|
+
if (!y.value)
|
|
48
47
|
return;
|
|
49
|
-
const e =
|
|
48
|
+
const e = y.value;
|
|
50
49
|
if (e.const !== void 0)
|
|
51
50
|
return e.const;
|
|
52
|
-
if (
|
|
51
|
+
if (e.enum?.length === 1)
|
|
53
52
|
return e.enum[0];
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
58
|
-
if (
|
|
59
|
-
return
|
|
53
|
+
if (h(e) && e.items) {
|
|
54
|
+
const t = S(e.items);
|
|
55
|
+
if (f(t.const))
|
|
56
|
+
return t.const;
|
|
57
|
+
if (t.enum?.length === 1)
|
|
58
|
+
return t.enum[0];
|
|
60
59
|
}
|
|
61
|
-
}),
|
|
62
|
-
if (!
|
|
60
|
+
}), w = s(() => {
|
|
61
|
+
if (!y.value)
|
|
63
62
|
return [];
|
|
64
|
-
const e =
|
|
65
|
-
return
|
|
63
|
+
const e = y.value, t = [];
|
|
64
|
+
return h(e) && ((e.minItems || e.maxItems) && t.push({
|
|
66
65
|
key: "array-range",
|
|
67
66
|
value: `${e.minItems || ""}…${e.maxItems || ""}`
|
|
68
67
|
}), e.uniqueItems && t.push({
|
|
69
68
|
key: "unique-items",
|
|
70
69
|
value: "unique!"
|
|
71
|
-
})),
|
|
70
|
+
})), N(e) && (e.minLength && t.push({
|
|
72
71
|
key: "min-length",
|
|
73
72
|
prefix: "min length: ",
|
|
74
73
|
value: e.minLength
|
|
@@ -81,159 +80,156 @@ const X = { class: "property-heading" }, Y = {
|
|
|
81
80
|
value: e.pattern,
|
|
82
81
|
code: !0,
|
|
83
82
|
truncate: !0
|
|
84
|
-
})), (
|
|
83
|
+
})), (N(e) || B(e)) && e.format && t.push({
|
|
85
84
|
key: "format",
|
|
86
85
|
value: e.format,
|
|
87
86
|
truncate: !0
|
|
88
|
-
}),
|
|
87
|
+
}), B(e) && (f(e.exclusiveMinimum) && t.push({
|
|
89
88
|
key: "exclusive-minimum",
|
|
90
89
|
prefix: "greater than: ",
|
|
91
90
|
value: e.exclusiveMinimum
|
|
92
|
-
}),
|
|
91
|
+
}), f(e.minimum) && t.push({
|
|
93
92
|
key: "minimum",
|
|
94
93
|
prefix: "min: ",
|
|
95
94
|
value: e.minimum
|
|
96
|
-
}),
|
|
95
|
+
}), f(e.exclusiveMaximum) && t.push({
|
|
97
96
|
key: "exclusive-maximum",
|
|
98
97
|
prefix: "less than: ",
|
|
99
98
|
value: e.exclusiveMaximum
|
|
100
|
-
}),
|
|
99
|
+
}), f(e.maximum) && t.push({
|
|
101
100
|
key: "maximum",
|
|
102
101
|
prefix: "max: ",
|
|
103
102
|
value: e.maximum
|
|
104
|
-
}),
|
|
103
|
+
}), f(e.multipleOf) && t.push({
|
|
105
104
|
key: "multiple-of",
|
|
106
105
|
prefix: "multiple of: ",
|
|
107
106
|
value: e.multipleOf
|
|
108
107
|
})), t;
|
|
109
|
-
}),
|
|
108
|
+
}), D = s(() => r.value ? $(r.value, r.hideModelNames) : null), M = s(() => !r.value || !("type" in r.value) ? !1 : r.value.type === "array" ? !0 : !x.value), O = s(() => r.value ? D.value || V(r.value) : ""), g = s(() => {
|
|
110
109
|
const e = r.value;
|
|
111
|
-
return
|
|
110
|
+
return e?.default === null ? "null" : Array.isArray(e?.default) && e?.default.length === 1 ? String(e?.default[0]) : typeof e?.default == "string" ? JSON.stringify(e.default) : Array.isArray(e?.default) || typeof e?.default == "object" ? JSON.stringify(e?.default) : e?.default;
|
|
112
111
|
});
|
|
113
|
-
return (e, t) =>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
return (e, t) => (a(), u("div", J, [
|
|
113
|
+
e.$slots.name ? (a(), u("div", {
|
|
114
|
+
key: 0,
|
|
115
|
+
class: I(["property-name", { deprecated: r.value?.deprecated }])
|
|
116
|
+
}, [
|
|
117
|
+
L(e.$slots, "name", {}, void 0, !0)
|
|
118
|
+
], 2)) : l("", !0),
|
|
119
|
+
r.isDiscriminator ? (a(), u("div", F, " Discriminator ")) : l("", !0),
|
|
120
|
+
r.value ? (a(), u(p, { key: 2 }, [
|
|
121
|
+
M.value ? (a(), m(d, {
|
|
117
122
|
key: 0,
|
|
118
|
-
|
|
123
|
+
truncate: ""
|
|
124
|
+
}, {
|
|
125
|
+
default: n(() => [
|
|
126
|
+
c(_, null, {
|
|
127
|
+
default: n(() => t[0] || (t[0] = [
|
|
128
|
+
i("Type: ")
|
|
129
|
+
])),
|
|
130
|
+
_: 1,
|
|
131
|
+
__: [0]
|
|
132
|
+
}),
|
|
133
|
+
i(v(O.value), 1)
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
})) : l("", !0),
|
|
137
|
+
(a(!0), u(p, null, R(w.value, (o) => (a(), m(d, {
|
|
138
|
+
key: o.key,
|
|
139
|
+
code: o.code,
|
|
140
|
+
truncate: o.truncate
|
|
141
|
+
}, T({
|
|
142
|
+
default: n(() => [
|
|
143
|
+
o.key === "format" ? (a(), m(_, { key: 0 }, {
|
|
144
|
+
default: n(() => t[1] || (t[1] = [
|
|
145
|
+
i("Format:")
|
|
146
|
+
])),
|
|
147
|
+
_: 1,
|
|
148
|
+
__: [1]
|
|
149
|
+
})) : o.key === "pattern" ? (a(), m(_, { key: 1 }, {
|
|
150
|
+
default: n(() => t[2] || (t[2] = [
|
|
151
|
+
i(" Pattern: ")
|
|
152
|
+
])),
|
|
153
|
+
_: 1,
|
|
154
|
+
__: [2]
|
|
155
|
+
})) : l("", !0),
|
|
156
|
+
i(" " + v(o.value), 1)
|
|
157
|
+
]),
|
|
158
|
+
_: 2
|
|
119
159
|
}, [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
b.value ? (i(), m(p, {
|
|
125
|
-
key: 0,
|
|
126
|
-
truncate: ""
|
|
127
|
-
}, {
|
|
128
|
-
default: n(() => [
|
|
129
|
-
k(S, null, {
|
|
130
|
-
default: n(() => t[0] || (t[0] = [
|
|
131
|
-
u("Type: ")
|
|
132
|
-
])),
|
|
133
|
-
_: 1,
|
|
134
|
-
__: [0]
|
|
135
|
-
}),
|
|
136
|
-
u(v(C.value), 1)
|
|
160
|
+
o.prefix ? {
|
|
161
|
+
name: "prefix",
|
|
162
|
+
fn: n(() => [
|
|
163
|
+
i(v(o.prefix), 1)
|
|
137
164
|
]),
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
__: [5]
|
|
205
|
-
})
|
|
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: ")
|
|
211
|
-
])),
|
|
212
|
-
default: n(() => [
|
|
213
|
-
k(Q, { value: h.value }, null, 8, ["value"])
|
|
214
|
-
]),
|
|
215
|
-
_: 1
|
|
216
|
-
})
|
|
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 ")
|
|
221
|
-
])),
|
|
222
|
-
_: 1,
|
|
223
|
-
__: [7]
|
|
224
|
-
})) : l("", !0)
|
|
225
|
-
], 64)),
|
|
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, {
|
|
229
|
-
key: 10,
|
|
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)
|
|
233
|
-
]);
|
|
234
|
-
};
|
|
165
|
+
key: "0"
|
|
166
|
+
} : void 0
|
|
167
|
+
]), 1032, ["code", "truncate"]))), 128)),
|
|
168
|
+
r.enum ? (a(), m(d, { key: 1 }, {
|
|
169
|
+
default: n(() => t[3] || (t[3] = [
|
|
170
|
+
i("enum")
|
|
171
|
+
])),
|
|
172
|
+
_: 1,
|
|
173
|
+
__: [3]
|
|
174
|
+
})) : l("", !0),
|
|
175
|
+
g.value !== void 0 ? (a(), m(d, {
|
|
176
|
+
key: 2,
|
|
177
|
+
truncate: ""
|
|
178
|
+
}, {
|
|
179
|
+
prefix: n(() => t[4] || (t[4] = [
|
|
180
|
+
i("default:")
|
|
181
|
+
])),
|
|
182
|
+
default: n(() => [
|
|
183
|
+
i(v(g.value), 1)
|
|
184
|
+
]),
|
|
185
|
+
_: 1
|
|
186
|
+
})) : l("", !0)
|
|
187
|
+
], 64)) : l("", !0),
|
|
188
|
+
r.additional ? (a(), u("div", j, [
|
|
189
|
+
r.value?.["x-additionalPropertiesName"] ? (a(), u(p, { key: 0 }, [
|
|
190
|
+
i(v(r.value["x-additionalPropertiesName"]), 1)
|
|
191
|
+
], 64)) : (a(), u(p, { key: 1 }, [
|
|
192
|
+
i("additional properties")
|
|
193
|
+
], 64))
|
|
194
|
+
])) : l("", !0),
|
|
195
|
+
r.value?.deprecated ? (a(), u("div", z, [
|
|
196
|
+
c(k(E), null, {
|
|
197
|
+
default: n(() => t[5] || (t[5] = [
|
|
198
|
+
i("deprecated")
|
|
199
|
+
])),
|
|
200
|
+
_: 1,
|
|
201
|
+
__: [5]
|
|
202
|
+
})
|
|
203
|
+
])) : l("", !0),
|
|
204
|
+
x.value !== void 0 ? (a(), u("div", H, [
|
|
205
|
+
c(d, { truncate: "" }, {
|
|
206
|
+
prefix: n(() => t[6] || (t[6] = [
|
|
207
|
+
i("const: ")
|
|
208
|
+
])),
|
|
209
|
+
default: n(() => [
|
|
210
|
+
c(b, { value: x.value }, null, 8, ["value"])
|
|
211
|
+
]),
|
|
212
|
+
_: 1
|
|
213
|
+
})
|
|
214
|
+
])) : (a(), u(p, { key: 6 }, [
|
|
215
|
+
r.value?.nullable === !0 ? (a(), m(d, { key: 0 }, {
|
|
216
|
+
default: n(() => t[7] || (t[7] = [
|
|
217
|
+
i(" nullable ")
|
|
218
|
+
])),
|
|
219
|
+
_: 1,
|
|
220
|
+
__: [7]
|
|
221
|
+
})) : l("", !0)
|
|
222
|
+
], 64)),
|
|
223
|
+
r.value?.writeOnly ? (a(), u("div", G, " write-only ")) : r.value?.readOnly ? (a(), u("div", K, " read-only ")) : l("", !0),
|
|
224
|
+
r.required ? (a(), u("div", Q, " required ")) : l("", !0),
|
|
225
|
+
r.withExamples ? (a(), m(C, {
|
|
226
|
+
key: 10,
|
|
227
|
+
example: r.value?.example || r.value && k(h)(r.value) && k(S)(r.value?.items)?.example,
|
|
228
|
+
examples: r.value?.examples
|
|
229
|
+
}, null, 8, ["example", "examples"])) : l("", !0)
|
|
230
|
+
]));
|
|
235
231
|
}
|
|
236
232
|
});
|
|
237
233
|
export {
|
|
238
|
-
|
|
234
|
+
le as default
|
|
239
235
|
};
|
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import { getResolvedRef as
|
|
2
|
-
import { isArraySchema as
|
|
3
|
-
import { getRefName as
|
|
4
|
-
const
|
|
5
|
-
var n;
|
|
1
|
+
import { getResolvedRef as a } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { isArraySchema as y } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
+
import { getRefName as s } from "./get-ref-name.js";
|
|
4
|
+
const p = (t) => t ? `array ${t.includes(" | ") ? `(${t})` : t}[]` : "array", i = (t, r = !1) => {
|
|
6
5
|
if (!t.items)
|
|
7
|
-
return r ? "array" : t.title ||
|
|
8
|
-
const
|
|
9
|
-
return r ?
|
|
10
|
-
},
|
|
11
|
-
var i;
|
|
6
|
+
return r ? "array" : t.title || t.xml?.name || "array";
|
|
7
|
+
const e = c(t.items), n = p(e);
|
|
8
|
+
return r ? n : t.nullable ? `${n} | null` : n;
|
|
9
|
+
}, c = (t) => {
|
|
12
10
|
if (!t)
|
|
13
11
|
return "";
|
|
14
|
-
const r =
|
|
12
|
+
const r = a(t);
|
|
15
13
|
if (r.const !== void 0)
|
|
16
14
|
return "const";
|
|
17
15
|
if ("type" in r && Array.isArray(r.type)) {
|
|
18
16
|
if (r.type.includes("array") && r.items) {
|
|
19
|
-
const e =
|
|
17
|
+
const e = i(r, !0), n = r.type.filter((o) => o !== "array");
|
|
20
18
|
return n.length > 0 ? `${e} | ${n.join(" | ")}` : e;
|
|
21
19
|
}
|
|
22
20
|
return r.type.join(" | ");
|
|
23
21
|
}
|
|
24
|
-
if (
|
|
25
|
-
return
|
|
22
|
+
if (y(r))
|
|
23
|
+
return i(r, !1);
|
|
26
24
|
if (r.title)
|
|
27
25
|
return r.title;
|
|
28
|
-
if (
|
|
26
|
+
if (r.xml?.name)
|
|
29
27
|
return r.xml.name;
|
|
30
28
|
if ("type" in r && r.type && r.contentEncoding)
|
|
31
29
|
return `${r.type} • ${r.contentEncoding}`;
|
|
32
30
|
if ("$ref" in t) {
|
|
33
|
-
const e =
|
|
31
|
+
const e = s(t);
|
|
34
32
|
if (e)
|
|
35
33
|
return e;
|
|
36
34
|
}
|
|
37
35
|
return "type" in r ? r.type : "";
|
|
38
36
|
};
|
|
39
37
|
export {
|
|
40
|
-
|
|
38
|
+
c as getSchemaType
|
|
41
39
|
};
|