@scalar/api-reference 1.35.4 → 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 +36 -0
- package/dist/browser/standalone.js +18154 -18461
- 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 +30 -34
- 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 +19 -19
- 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,77 +1,72 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarButton as
|
|
3
|
-
import { ScalarIconPlus as
|
|
4
|
-
import { getResolvedRef as
|
|
5
|
-
import { isArraySchema as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as I, computed as u, ref as A, createElementBlock as c, createCommentVNode as v, openBlock as a, createElementVNode as C, Fragment as p, renderList as g, createBlock as h, createVNode as y, unref as S, withCtx as L, createTextVNode as V, normalizeClass as D, toDisplayString as B } from "vue";
|
|
2
|
+
import { ScalarButton as T } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as H } from "@scalar/icons";
|
|
4
|
+
import { getResolvedRef as P } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
|
+
import { isArraySchema as _ } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
6
|
+
import E from "./SchemaEnumPropertyItem.vue.js";
|
|
7
|
+
const $ = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "property-enum"
|
|
10
|
-
},
|
|
10
|
+
}, w = { class: "property-enum-values" }, R = { key: 1 }, U = 9, O = 5, N = " ", q = /* @__PURE__ */ I({
|
|
11
11
|
__name: "SchemaEnumValues",
|
|
12
12
|
props: {
|
|
13
13
|
value: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
() => r.value.slice(i.value)
|
|
27
|
-
), f = (a, c) => {
|
|
28
|
-
var t, u;
|
|
29
|
-
const e = ((t = l.value) == null ? void 0 : t["x-enumDescriptions"]) ?? ((u = l.value) == null ? void 0 : u["x-enum-descriptions"]);
|
|
15
|
+
setup(t) {
|
|
16
|
+
const n = u(() => t.value ? t.value.enum || _(t.value) && P(t.value.items)?.enum || [] : []), m = u(
|
|
17
|
+
() => n.value.length > U
|
|
18
|
+
), s = u(
|
|
19
|
+
() => m.value ? O : n.value.length
|
|
20
|
+
), b = u(
|
|
21
|
+
() => n.value.slice(0, s.value)
|
|
22
|
+
), k = u(
|
|
23
|
+
() => n.value.slice(s.value)
|
|
24
|
+
), d = (o, i) => {
|
|
25
|
+
const e = t.value?.["x-enumDescriptions"] ?? t.value?.["x-enum-descriptions"];
|
|
30
26
|
if (e) {
|
|
31
27
|
if (Array.isArray(e))
|
|
32
|
-
return e[
|
|
28
|
+
return e[i];
|
|
33
29
|
if (typeof e == "object" && e !== null)
|
|
34
|
-
return e[String(
|
|
30
|
+
return e[String(o)];
|
|
35
31
|
}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
o.value = !o.value;
|
|
32
|
+
}, f = (o, i) => {
|
|
33
|
+
const e = t.value?.["x-enum-varnames"] ?? t.value?.["x-enumNames"], l = Array.isArray(e) ? e[i] : void 0;
|
|
34
|
+
return l ? `${o}${N}=${N}${l}` : String(o);
|
|
35
|
+
}, r = A(!1), x = () => {
|
|
36
|
+
r.value = !r.value;
|
|
42
37
|
};
|
|
43
|
-
return (
|
|
44
|
-
|
|
45
|
-
(
|
|
38
|
+
return (o, i) => n.value.length > 0 ? (a(), c("div", $, [
|
|
39
|
+
C("ul", w, [
|
|
40
|
+
(a(!0), c(p, null, g(b.value, (e, l) => (a(), h(E, {
|
|
46
41
|
key: String(e),
|
|
47
|
-
description:
|
|
48
|
-
label:
|
|
42
|
+
description: d(e, l),
|
|
43
|
+
label: f(e, l)
|
|
49
44
|
}, null, 8, ["description", "label"]))), 128)),
|
|
50
|
-
|
|
45
|
+
m.value && r.value ? (a(!0), c(p, { key: 0 }, g(k.value, (e, l) => (a(), h(E, {
|
|
51
46
|
key: String(e),
|
|
52
|
-
description:
|
|
53
|
-
label:
|
|
54
|
-
}, null, 8, ["description", "label"]))), 128)) :
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
description: d(e, s.value + l),
|
|
48
|
+
label: f(e, s.value + l)
|
|
49
|
+
}, null, 8, ["description", "label"]))), 128)) : v("", !0),
|
|
50
|
+
m.value ? (a(), c("li", R, [
|
|
51
|
+
y(S(T), {
|
|
57
52
|
class: "enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none",
|
|
58
53
|
variant: "ghost",
|
|
59
|
-
onClick:
|
|
54
|
+
onClick: x
|
|
60
55
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
|
|
63
|
-
class:
|
|
56
|
+
default: L(() => [
|
|
57
|
+
y(S(H), {
|
|
58
|
+
class: D({ "rotate-45": r.value }),
|
|
64
59
|
weight: "bold"
|
|
65
60
|
}, null, 8, ["class"]),
|
|
66
|
-
|
|
61
|
+
V(" " + B(r.value ? "Hide values" : "Show all values"), 1)
|
|
67
62
|
]),
|
|
68
63
|
_: 1
|
|
69
64
|
})
|
|
70
|
-
])) :
|
|
65
|
+
])) : v("", !0)
|
|
71
66
|
])
|
|
72
|
-
])) :
|
|
67
|
+
])) : v("", !0);
|
|
73
68
|
}
|
|
74
69
|
});
|
|
75
70
|
export {
|
|
76
|
-
|
|
71
|
+
q as default
|
|
77
72
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as R, computed as P, createElementBlock as l, openBlock as t, Fragment as s, createCommentVNode as h, createBlock as c, unref as n, renderList as f } from "vue";
|
|
2
2
|
import { getResolvedRef as o } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { isTypeObject as m } from "./helpers/is-type-object.js";
|
|
4
4
|
import u from "./SchemaProperty.vue.js";
|
|
5
|
-
const
|
|
5
|
+
const j = /* @__PURE__ */ R({
|
|
6
6
|
__name: "SchemaObjectProperties",
|
|
7
7
|
props: {
|
|
8
8
|
schema: {},
|
|
@@ -18,13 +18,12 @@ const k = /* @__PURE__ */ W({
|
|
|
18
18
|
orderRequiredPropertiesFirst: { default: !0 }
|
|
19
19
|
},
|
|
20
20
|
setup(r) {
|
|
21
|
-
const
|
|
21
|
+
const v = P(() => {
|
|
22
22
|
if (!m(r.schema) || !r.schema.properties)
|
|
23
23
|
return [];
|
|
24
24
|
const e = Object.keys(r.schema.properties), a = new Set(r.schema.required || []);
|
|
25
|
-
return e.sort((i,
|
|
26
|
-
|
|
27
|
-
const y = i === ((f = r.discriminator) == null ? void 0 : f.propertyName), p = t === ((v = r.discriminator) == null ? void 0 : v.propertyName), b = a.has(i), O = a.has(t);
|
|
25
|
+
return e.sort((i, d) => {
|
|
26
|
+
const y = i === r.discriminator?.propertyName, p = d === r.discriminator?.propertyName, b = a.has(i), O = a.has(d);
|
|
28
27
|
if (y && !p)
|
|
29
28
|
return -1;
|
|
30
29
|
if (!y && p)
|
|
@@ -35,35 +34,18 @@ const k = /* @__PURE__ */ W({
|
|
|
35
34
|
if (!b && O)
|
|
36
35
|
return 1;
|
|
37
36
|
}
|
|
38
|
-
return r.orderSchemaPropertiesBy === "alpha" ? i.localeCompare(
|
|
39
|
-
}).filter((i) => r.hideReadOnly ? !(r.schema.properties && o(r.schema.properties[i])
|
|
40
|
-
}),
|
|
37
|
+
return r.orderSchemaPropertiesBy === "alpha" ? i.localeCompare(d) : 0;
|
|
38
|
+
}).filter((i) => r.hideReadOnly ? !(r.schema.properties && o(r.schema.properties[i])?.readOnly === !0) : r.hideWriteOnly ? !(r.schema.properties && o(r.schema.properties[i])?.writeOnly === !0) : !0);
|
|
39
|
+
}), N = (e) => {
|
|
41
40
|
const a = o(e);
|
|
42
41
|
return typeof a == "object" && typeof a["x-additionalPropertiesName"] == "string" && a["x-additionalPropertiesName"].trim().length > 0 ? `${a["x-additionalPropertiesName"].trim()}*` : "propertyName*";
|
|
43
|
-
},
|
|
42
|
+
}, g = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
|
|
44
43
|
// @ts-expect-error - ask hans
|
|
45
44
|
type: "anything",
|
|
46
45
|
...typeof e == "object" ? e : {}
|
|
47
46
|
} : e;
|
|
48
|
-
return (e, a) => (
|
|
49
|
-
n(m)(e.schema) && e.schema.properties ? (
|
|
50
|
-
var t;
|
|
51
|
-
return d(), c(u, {
|
|
52
|
-
key: i,
|
|
53
|
-
breadcrumb: e.breadcrumb,
|
|
54
|
-
compact: e.compact,
|
|
55
|
-
discriminator: e.discriminator,
|
|
56
|
-
hideHeading: e.hideHeading,
|
|
57
|
-
hideModelNames: e.hideModelNames,
|
|
58
|
-
hideReadOnly: e.hideReadOnly,
|
|
59
|
-
hideWriteOnly: e.hideWriteOnly,
|
|
60
|
-
level: e.level,
|
|
61
|
-
name: i,
|
|
62
|
-
required: (t = e.schema.required) == null ? void 0 : t.includes(i),
|
|
63
|
-
value: n(o)(e.schema.properties[i])
|
|
64
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "required", "value"]);
|
|
65
|
-
}), 128)) : h("", !0),
|
|
66
|
-
n(m)(e.schema) && e.schema.patternProperties ? (d(!0), l(s, { key: 1 }, N(Object.entries(e.schema.patternProperties), ([i, t]) => (d(), c(u, {
|
|
47
|
+
return (e, a) => (t(), l(s, null, [
|
|
48
|
+
n(m)(e.schema) && e.schema.properties ? (t(!0), l(s, { key: 0 }, f(v.value, (i) => (t(), c(u, {
|
|
67
49
|
key: i,
|
|
68
50
|
breadcrumb: e.breadcrumb,
|
|
69
51
|
compact: e.compact,
|
|
@@ -74,9 +56,23 @@ const k = /* @__PURE__ */ W({
|
|
|
74
56
|
hideWriteOnly: e.hideWriteOnly,
|
|
75
57
|
level: e.level,
|
|
76
58
|
name: i,
|
|
77
|
-
|
|
59
|
+
required: e.schema.required?.includes(i),
|
|
60
|
+
value: n(o)(e.schema.properties[i])
|
|
61
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "required", "value"]))), 128)) : h("", !0),
|
|
62
|
+
n(m)(e.schema) && e.schema.patternProperties ? (t(!0), l(s, { key: 1 }, f(Object.entries(e.schema.patternProperties), ([i, d]) => (t(), c(u, {
|
|
63
|
+
key: i,
|
|
64
|
+
breadcrumb: e.breadcrumb,
|
|
65
|
+
compact: e.compact,
|
|
66
|
+
discriminator: e.discriminator,
|
|
67
|
+
hideHeading: e.hideHeading,
|
|
68
|
+
hideModelNames: e.hideModelNames,
|
|
69
|
+
hideReadOnly: e.hideReadOnly,
|
|
70
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
71
|
+
level: e.level,
|
|
72
|
+
name: i,
|
|
73
|
+
value: n(o)(d)
|
|
78
74
|
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "value"]))), 128)) : h("", !0),
|
|
79
|
-
n(m)(e.schema) && e.schema.additionalProperties ? (
|
|
75
|
+
n(m)(e.schema) && e.schema.additionalProperties ? (t(), c(u, {
|
|
80
76
|
key: 2,
|
|
81
77
|
breadcrumb: e.breadcrumb,
|
|
82
78
|
compact: e.compact,
|
|
@@ -86,14 +82,14 @@ const k = /* @__PURE__ */ W({
|
|
|
86
82
|
hideReadOnly: e.hideReadOnly,
|
|
87
83
|
hideWriteOnly: e.hideWriteOnly,
|
|
88
84
|
level: e.level,
|
|
89
|
-
name:
|
|
85
|
+
name: N(e.schema.additionalProperties),
|
|
90
86
|
noncollapsible: "",
|
|
91
|
-
value:
|
|
87
|
+
value: g(e.schema.additionalProperties),
|
|
92
88
|
variant: "additionalProperties"
|
|
93
89
|
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "value"])) : h("", !0)
|
|
94
90
|
], 64));
|
|
95
91
|
}
|
|
96
92
|
});
|
|
97
93
|
export {
|
|
98
|
-
|
|
94
|
+
j as default
|
|
99
95
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarMarkdown as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { getResolvedRef as
|
|
5
|
-
import { isArraySchema as
|
|
6
|
-
import { isTypeObject as
|
|
7
|
-
import { optimizeValueForDisplay as
|
|
8
|
-
import { compositions as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
1
|
+
import { defineComponent as V, computed as t, createBlock as p, openBlock as r, resolveDynamicComponent as w, normalizeClass as A, withCtx as c, createCommentVNode as s, createElementBlock as i, createVNode as d, createSlots as T, unref as l, toDisplayString as y, Fragment as v, createTextVNode as k, renderList as q } from "vue";
|
|
2
|
+
import { ScalarMarkdown as R } from "@scalar/components";
|
|
3
|
+
import { isDefined as E } from "@scalar/helpers/array/is-defined";
|
|
4
|
+
import { getResolvedRef as f } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
|
+
import { isArraySchema as u } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
6
|
+
import { isTypeObject as F } from "./helpers/is-type-object.js";
|
|
7
|
+
import { optimizeValueForDisplay as M } from "./helpers/optimize-value-for-display.js";
|
|
8
|
+
import { compositions as $ } from "./helpers/schema-composition.js";
|
|
9
|
+
import P from "./Schema.vue.js";
|
|
10
|
+
import I from "./SchemaComposition.vue.js";
|
|
11
|
+
import z from "./SchemaEnumValues.vue.js";
|
|
12
|
+
import U from "./SchemaPropertyHeading.vue.js";
|
|
13
|
+
import Z from "../../Anchor/WithBreadcrumb.vue2.js";
|
|
14
|
+
import L from "../../../features/specification-extension/SpecificationExtension.vue2.js";
|
|
15
|
+
const G = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "property-name-pattern-properties"
|
|
18
|
-
},
|
|
18
|
+
}, J = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "property-name-additional-properties"
|
|
21
|
-
},
|
|
21
|
+
}, K = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "property-description"
|
|
24
|
-
},
|
|
24
|
+
}, Q = {
|
|
25
25
|
key: 2,
|
|
26
26
|
class: "property-description"
|
|
27
|
-
},
|
|
27
|
+
}, X = {
|
|
28
28
|
key: 4,
|
|
29
29
|
class: "children"
|
|
30
|
-
},
|
|
30
|
+
}, Y = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "children"
|
|
33
|
-
},
|
|
33
|
+
}, pe = /* @__PURE__ */ V({
|
|
34
34
|
__name: "SchemaProperty",
|
|
35
35
|
props: {
|
|
36
36
|
is: {},
|
|
@@ -49,8 +49,8 @@ const _ = {
|
|
|
49
49
|
variant: {},
|
|
50
50
|
breadcrumb: {}
|
|
51
51
|
},
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
52
|
+
setup(B) {
|
|
53
|
+
const m = B, h = {
|
|
54
54
|
integer: {
|
|
55
55
|
_default: "Integer numbers.",
|
|
56
56
|
int32: "Signed 32-bit integers (commonly used integer type).",
|
|
@@ -64,144 +64,129 @@ const _ = {
|
|
|
64
64
|
byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
|
|
65
65
|
binary: "binary data, used to describe files"
|
|
66
66
|
}
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
},
|
|
71
|
-
const e =
|
|
72
|
-
|
|
73
|
-
}), V = (e, r, t) => r || (e == null ? void 0 : e.deprecated) || (e == null ? void 0 : e.const) !== void 0 || (e == null ? void 0 : e.enum) && e.enum.length === 1 || (e == null ? void 0 : e.type) || (e == null ? void 0 : e.nullable) === !0 || (e == null ? void 0 : e.writeOnly) || (e == null ? void 0 : e.readOnly) || t, k = l(() => {
|
|
74
|
-
const e = n.value;
|
|
75
|
-
if (!e || !m(e) || typeof e.items != "object")
|
|
67
|
+
}, b = (e) => !e || !h[e.type] ? null : h[e.type][e.format || e.contentEncoding || "_default"], C = (e) => e?.enum || e?.items?.enum || [], a = t(() => M(m.value)), O = t(() => {
|
|
68
|
+
const e = a.value;
|
|
69
|
+
return !e || "properties" in e || "additionalProperties" in e || "patternProperties" in e || e?.allOf || e?.allOf ? null : m.description || e?.description || null;
|
|
70
|
+
}), j = (e, n, o) => n || e?.deprecated || e?.const !== void 0 || e?.enum && e.enum.length === 1 || e?.type || e?.nullable === !0 || e?.writeOnly || e?.readOnly || o, g = t(() => {
|
|
71
|
+
const e = a.value;
|
|
72
|
+
if (!e || !u(e) || typeof e.items != "object")
|
|
76
73
|
return !1;
|
|
77
|
-
const
|
|
78
|
-
return "type" in
|
|
79
|
-
}),
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
},
|
|
83
|
-
if (!
|
|
74
|
+
const n = e.items;
|
|
75
|
+
return "type" in n && n.type && (Array.isArray(n.type) ? n.type.includes("object") : ["object"].includes(n.type)) || "properties" in n || "$ref" in n || "discriminator" in n || "allOf" in n || "oneOf" in n || "anyOf" in n;
|
|
76
|
+
}), N = (e) => {
|
|
77
|
+
const n = a.value;
|
|
78
|
+
return n && u(n) === !1 || !n?.items || typeof n.items != "object" || !(e in n.items) ? !1 : !g.value;
|
|
79
|
+
}, S = t(() => g.value), W = t(() => {
|
|
80
|
+
if (!a.value)
|
|
84
81
|
return !1;
|
|
85
|
-
const e =
|
|
86
|
-
return
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
d(o(X), {
|
|
124
|
-
breadcrumb: q.value && e.breadcrumb ? [...e.breadcrumb, e.name] : void 0
|
|
125
|
-
}, {
|
|
126
|
-
default: y(() => [
|
|
127
|
-
e.variant === "patternProperties" ? (i(), a("span", _, f(e.name), 1)) : e.variant === "additionalProperties" ? (i(), a("span", x, f(e.name), 1)) : (i(), a(h, { key: 2 }, [
|
|
128
|
-
N(f(e.name), 1)
|
|
129
|
-
], 64))
|
|
130
|
-
]),
|
|
131
|
-
_: 1
|
|
132
|
-
}, 8, ["breadcrumb"])
|
|
82
|
+
const e = a.value, n = F(e), o = "properties" in e || "additionalProperties" in e;
|
|
83
|
+
return n && o;
|
|
84
|
+
}), D = t(() => m.level <= 1), H = t(() => a.value ? $.map((e) => a.value?.[e] && !(u(a.value) && a.value?.items && typeof e == "string" && typeof a.value.items == "object" && e in a.value.items) ? {
|
|
85
|
+
composition: e,
|
|
86
|
+
value: a.value
|
|
87
|
+
} : N(e) && a.value && u(a.value) && a.value.items ? {
|
|
88
|
+
composition: e,
|
|
89
|
+
value: a.value.items
|
|
90
|
+
} : null).filter(E) : []);
|
|
91
|
+
return (e, n) => (r(), p(w(e.is ?? "li"), {
|
|
92
|
+
class: A(["property", [
|
|
93
|
+
`property--level-${e.level}`,
|
|
94
|
+
{
|
|
95
|
+
"property--compact": e.compact,
|
|
96
|
+
"property--deprecated": a.value?.deprecated
|
|
97
|
+
}
|
|
98
|
+
]])
|
|
99
|
+
}, {
|
|
100
|
+
default: c(() => [
|
|
101
|
+
j(a.value, e.name, e.required) ? (r(), p(U, {
|
|
102
|
+
key: 0,
|
|
103
|
+
class: "group",
|
|
104
|
+
enum: C(a.value).length > 0,
|
|
105
|
+
hideModelNames: e.hideModelNames,
|
|
106
|
+
isDiscriminator: e.discriminator && e.discriminator.propertyName === e.name,
|
|
107
|
+
required: e.required,
|
|
108
|
+
value: a.value
|
|
109
|
+
}, T({ _: 2 }, [
|
|
110
|
+
e.name ? {
|
|
111
|
+
name: "name",
|
|
112
|
+
fn: c(() => [
|
|
113
|
+
d(l(Z), {
|
|
114
|
+
breadcrumb: D.value && e.breadcrumb ? [...e.breadcrumb, e.name] : void 0
|
|
115
|
+
}, {
|
|
116
|
+
default: c(() => [
|
|
117
|
+
e.variant === "patternProperties" ? (r(), i("span", G, y(e.name), 1)) : e.variant === "additionalProperties" ? (r(), i("span", J, y(e.name), 1)) : (r(), i(v, { key: 2 }, [
|
|
118
|
+
k(y(e.name), 1)
|
|
119
|
+
], 64))
|
|
133
120
|
]),
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
}, 8, ["class"]);
|
|
202
|
-
};
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["breadcrumb"])
|
|
123
|
+
]),
|
|
124
|
+
key: "0"
|
|
125
|
+
} : void 0,
|
|
126
|
+
a.value?.example ? {
|
|
127
|
+
name: "example",
|
|
128
|
+
fn: c(() => [
|
|
129
|
+
k(" Example: " + y(a.value.example), 1)
|
|
130
|
+
]),
|
|
131
|
+
key: "1"
|
|
132
|
+
} : void 0
|
|
133
|
+
]), 1032, ["enum", "hideModelNames", "isDiscriminator", "required", "value"])) : s("", !0),
|
|
134
|
+
O.value ? (r(), i("div", K, [
|
|
135
|
+
d(l(R), { value: O.value }, null, 8, ["value"])
|
|
136
|
+
])) : b(a.value) ? (r(), i("div", Q, [
|
|
137
|
+
d(l(R), {
|
|
138
|
+
value: b(a.value) || ""
|
|
139
|
+
}, null, 8, ["value"])
|
|
140
|
+
])) : s("", !0),
|
|
141
|
+
(a.value?.enum || a.value && l(u)(a.value) && l(f)(a.value?.items)?.enum || []).length ? (r(), p(z, {
|
|
142
|
+
key: 3,
|
|
143
|
+
value: a.value
|
|
144
|
+
}, null, 8, ["value"])) : s("", !0),
|
|
145
|
+
W.value ? (r(), i("div", X, [
|
|
146
|
+
d(P, {
|
|
147
|
+
breadcrumb: e.breadcrumb && e.name ? [...e.breadcrumb, e.name] : void 0,
|
|
148
|
+
compact: e.compact,
|
|
149
|
+
hideReadOnly: e.hideReadOnly,
|
|
150
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
151
|
+
level: e.level + 1,
|
|
152
|
+
name: e.name,
|
|
153
|
+
noncollapsible: e.noncollapsible,
|
|
154
|
+
schema: a.value
|
|
155
|
+
}, null, 8, ["breadcrumb", "compact", "hideReadOnly", "hideWriteOnly", "level", "name", "noncollapsible", "schema"])
|
|
156
|
+
])) : s("", !0),
|
|
157
|
+
a.value && l(u)(a.value) && typeof a.value.items == "object" ? (r(), i(v, { key: 5 }, [
|
|
158
|
+
S.value ? (r(), i("div", Y, [
|
|
159
|
+
d(P, {
|
|
160
|
+
compact: e.compact,
|
|
161
|
+
hideReadOnly: e.hideReadOnly,
|
|
162
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
163
|
+
level: e.level + 1,
|
|
164
|
+
name: e.name,
|
|
165
|
+
noncollapsible: e.noncollapsible,
|
|
166
|
+
schema: l(f)(a.value.items)
|
|
167
|
+
}, null, 8, ["compact", "hideReadOnly", "hideWriteOnly", "level", "name", "noncollapsible", "schema"])
|
|
168
|
+
])) : s("", !0)
|
|
169
|
+
], 64)) : s("", !0),
|
|
170
|
+
(r(!0), i(v, null, q(H.value, (o) => (r(), p(I, {
|
|
171
|
+
key: o.composition,
|
|
172
|
+
breadcrumb: e.breadcrumb,
|
|
173
|
+
compact: e.compact,
|
|
174
|
+
composition: o.composition,
|
|
175
|
+
discriminator: e.value?.discriminator,
|
|
176
|
+
hideHeading: e.hideHeading,
|
|
177
|
+
hideReadOnly: e.hideReadOnly,
|
|
178
|
+
hideWriteOnly: e.hideWriteOnly,
|
|
179
|
+
level: e.level,
|
|
180
|
+
name: e.name,
|
|
181
|
+
noncollapsible: e.noncollapsible,
|
|
182
|
+
value: l(f)(m.value)
|
|
183
|
+
}, null, 8, ["breadcrumb", "compact", "composition", "discriminator", "hideHeading", "hideReadOnly", "hideWriteOnly", "level", "name", "noncollapsible", "value"]))), 128)),
|
|
184
|
+
d(l(L), { value: a.value }, null, 8, ["value"])
|
|
185
|
+
]),
|
|
186
|
+
_: 1
|
|
187
|
+
}, 8, ["class"]));
|
|
203
188
|
}
|
|
204
189
|
});
|
|
205
190
|
export {
|
|
206
|
-
|
|
191
|
+
pe as default
|
|
207
192
|
};
|