@scalar/api-reference 1.35.7 → 1.36.1
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 +39 -0
- package/dist/browser/standalone.js +14984 -15007
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +148 -150
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +44 -51
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts +4 -1
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue2.js +49 -40
- 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 +25 -23
- package/dist/components/Content/Models/ModernLayout.vue.d.ts +1 -0
- 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 +54 -51
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -2
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +24 -24
- 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/Operations/get-current-index.d.ts +1 -1
- package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -1
- package/dist/components/Content/Operations/get-current-index.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +3 -4
- 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 +72 -75
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +4 -5
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +46 -49
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +2 -7
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +33 -54
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -6
- 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 +72 -76
- package/dist/components/Content/Schema/helpers/sort-property-names.d.ts +16 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.js +36 -0
- package/dist/components/Content/Schema/types.d.ts +17 -0
- package/dist/components/Content/Schema/types.d.ts.map +1 -0
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.js +2 -2
- package/dist/components/Content/Tags/ClassicLayout.vue2.js +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.js +2 -2
- package/dist/components/Content/Tags/ModernLayout.vue2.js +2 -2
- package/dist/components/Content/Tags/Tag.vue.d.ts +1 -1
- package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/TagSection.vue.d.ts +1 -1
- package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/TagSection.vue.js +4 -4
- package/dist/components/MobileHeader.vue.js +2 -2
- package/dist/components/MobileHeader.vue2.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue2.js +9 -11
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +2 -2
- package/dist/components/OperationsList/OperationsListItem.vue2.js +24 -27
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +2 -2
- package/dist/components/Section/Section.vue2.js +12 -13
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue2.js +36 -37
- package/dist/components/ShowMoreButton.vue.js +2 -2
- package/dist/components/ShowMoreButton.vue2.js +3 -3
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +32 -22
- package/dist/features/Operation/components/Header.vue.d.ts +2 -0
- package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Header.vue.js +15 -10
- package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
- package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/Headers.vue2.js +23 -21
- 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 +55 -48
- 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 +74 -49
- package/dist/features/Operation/helpers/get-first-server.d.ts +9 -0
- package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -0
- package/dist/features/Operation/helpers/get-first-server.js +20 -0
- package/dist/features/Search/components/SearchButton.vue.d.ts +2 -0
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.js +19 -17
- package/dist/features/Search/components/SearchModal.vue.d.ts +2 -1
- package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.js +2 -2
- package/dist/features/Search/components/SearchModal.vue2.js +74 -75
- package/dist/features/Search/helpers/create-search-index.d.ts +2 -2
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
- package/dist/features/Search/helpers/create-search-index.js +68 -66
- package/dist/features/Search/hooks/useSearchIndex.d.ts +3 -2
- package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/hooks/useSearchIndex.js +13 -13
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/Search/types.d.ts.map +1 -1
- package/dist/features/api-client-modal/useApiClient.d.ts +40 -40
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/helpers/convert-security-scheme.d.ts +1 -1
- package/dist/helpers/test-utils.d.ts +367 -5
- package/dist/helpers/test-utils.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts +1 -15
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +29 -53
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -20
- package/dist/style.css +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +5 -6
- package/dist/{features/sidebar/components/Sidebar.vue.d.ts → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts} +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.js +7 -0
- package/dist/{features/sidebar/components/Sidebar.vue2.js → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue2.js} +15 -15
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.js +7 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue2.js +41 -43
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.js +7 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.js +7 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue2.js +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts +385 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.js +35 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts +189 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.js +9 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/hooks/useSidebar.d.ts +4 -8
- package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.js +18 -0
- package/dist/v2/blocks/scalar-sidebar-block/index.d.ts +4 -0
- package/dist/v2/blocks/scalar-sidebar-block/index.d.ts.map +1 -0
- package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/Sidebar.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarGroup.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarGroup.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +0 -7
- package/dist/features/sidebar/helpers/create-sidebar.d.ts +0 -28
- package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +0 -1
- package/dist/features/sidebar/helpers/create-sidebar.js +0 -32
- package/dist/features/sidebar/hooks/useSidebar.d.ts.map +0 -1
- package/dist/features/sidebar/hooks/useSidebar.js +0 -18
- package/dist/features/sidebar/index.d.ts +0 -4
- package/dist/features/sidebar/index.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/get-tag.d.ts +0 -6
- package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/get-tag.js +0 -7
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts +0 -11
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-description.js +0 -32
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts +0 -16
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-document.js +0 -33
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +0 -18
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.js +0 -30
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +0 -8
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +0 -21
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +0 -11
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-tags.js +0 -43
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +0 -10
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-webhooks.js +0 -24
- package/dist/features/traverse-schema/index.d.ts +0 -5
- package/dist/features/traverse-schema/index.d.ts.map +0 -1
- package/dist/features/traverse-schema/types.d.ts +0 -55
- package/dist/features/traverse-schema/types.d.ts.map +0 -1
- package/dist/libs/markdown.js +0 -18
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue.d.ts +0 -0
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue2.js +0 -0
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
1
|
import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
import type { SchemaOptions } from '../../../components/Content/Schema/types';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
schema: SchemaObject;
|
|
5
5
|
discriminator?: DiscriminatorObject;
|
|
@@ -7,13 +7,8 @@ type __VLS_Props = {
|
|
|
7
7
|
hideHeading?: boolean;
|
|
8
8
|
level?: number;
|
|
9
9
|
hideModelNames?: boolean;
|
|
10
|
-
/** Hide readonly properties */
|
|
11
|
-
hideReadOnly?: boolean;
|
|
12
|
-
/** Hide write-only properties */
|
|
13
|
-
hideWriteOnly?: boolean;
|
|
14
10
|
breadcrumb?: string[];
|
|
15
|
-
|
|
16
|
-
orderRequiredPropertiesFirst?: ApiReferenceConfiguration['orderRequiredPropertiesFirst'];
|
|
11
|
+
options: SchemaOptions;
|
|
17
12
|
};
|
|
18
13
|
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>;
|
|
19
14
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AA2IA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,EAAE,aAAa,CAAA;CACvB,CAAC;;AA2LF,wBAMG"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getResolvedRef as
|
|
3
|
-
import { isTypeObject as
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as N, computed as y, createElementBlock as n, openBlock as i, Fragment as t, createCommentVNode as d, createBlock as s, unref as a, renderList as h } from "vue";
|
|
2
|
+
import { getResolvedRef as l } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { isTypeObject as c } from "./helpers/is-type-object.js";
|
|
4
|
+
import { sortPropertyNames as v } from "./helpers/sort-property-names.js";
|
|
5
|
+
import p from "./SchemaProperty.vue.js";
|
|
6
|
+
const B = /* @__PURE__ */ N({
|
|
6
7
|
__name: "SchemaObjectProperties",
|
|
7
8
|
props: {
|
|
8
9
|
schema: {},
|
|
@@ -11,85 +12,63 @@ const j = /* @__PURE__ */ R({
|
|
|
11
12
|
hideHeading: { type: Boolean },
|
|
12
13
|
level: {},
|
|
13
14
|
hideModelNames: { type: Boolean },
|
|
14
|
-
hideReadOnly: { type: Boolean },
|
|
15
|
-
hideWriteOnly: { type: Boolean },
|
|
16
15
|
breadcrumb: {},
|
|
17
|
-
|
|
18
|
-
orderRequiredPropertiesFirst: { default: !0 }
|
|
16
|
+
options: {}
|
|
19
17
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
const y = i === r.discriminator?.propertyName, p = d === r.discriminator?.propertyName, b = a.has(i), O = a.has(d);
|
|
27
|
-
if (y && !p)
|
|
28
|
-
return -1;
|
|
29
|
-
if (!y && p)
|
|
30
|
-
return 1;
|
|
31
|
-
if (r.orderRequiredPropertiesFirst) {
|
|
32
|
-
if (b && !O)
|
|
33
|
-
return -1;
|
|
34
|
-
if (!b && O)
|
|
35
|
-
return 1;
|
|
36
|
-
}
|
|
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) => {
|
|
40
|
-
const a = o(e);
|
|
41
|
-
return typeof a == "object" && typeof a["x-additionalPropertiesName"] == "string" && a["x-additionalPropertiesName"].trim().length > 0 ? `${a["x-additionalPropertiesName"].trim()}*` : "propertyName*";
|
|
18
|
+
setup(m) {
|
|
19
|
+
const u = y(
|
|
20
|
+
() => v(m.schema, m.discriminator, m.options)
|
|
21
|
+
), b = (e) => {
|
|
22
|
+
const o = l(e);
|
|
23
|
+
return typeof o == "object" && typeof o["x-additionalPropertiesName"] == "string" && o["x-additionalPropertiesName"].trim().length > 0 ? `${o["x-additionalPropertiesName"].trim()}` : "propertyName";
|
|
42
24
|
}, g = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
|
|
43
25
|
// @ts-expect-error - ask hans
|
|
44
26
|
type: "anything",
|
|
45
27
|
...typeof e == "object" ? e : {}
|
|
46
28
|
} : e;
|
|
47
|
-
return (e,
|
|
48
|
-
|
|
49
|
-
key:
|
|
29
|
+
return (e, o) => (i(), n(t, null, [
|
|
30
|
+
a(c)(e.schema) && e.schema.properties ? (i(!0), n(t, { key: 0 }, h(u.value, (r) => (i(), s(p, {
|
|
31
|
+
key: r,
|
|
50
32
|
breadcrumb: e.breadcrumb,
|
|
51
33
|
compact: e.compact,
|
|
52
34
|
discriminator: e.discriminator,
|
|
53
35
|
hideHeading: e.hideHeading,
|
|
54
36
|
hideModelNames: e.hideModelNames,
|
|
55
|
-
hideReadOnly: e.hideReadOnly,
|
|
56
|
-
hideWriteOnly: e.hideWriteOnly,
|
|
57
37
|
level: e.level,
|
|
58
|
-
name:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
38
|
+
name: r,
|
|
39
|
+
options: e.options,
|
|
40
|
+
required: e.schema.required?.includes(r),
|
|
41
|
+
schema: a(l)(e.schema.properties[r])
|
|
42
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "options", "required", "schema"]))), 128)) : d("", !0),
|
|
43
|
+
a(c)(e.schema) && e.schema.patternProperties ? (i(!0), n(t, { key: 1 }, h(Object.entries(e.schema.patternProperties), ([r, f]) => (i(), s(p, {
|
|
44
|
+
key: r,
|
|
64
45
|
breadcrumb: e.breadcrumb,
|
|
65
46
|
compact: e.compact,
|
|
66
47
|
discriminator: e.discriminator,
|
|
67
48
|
hideHeading: e.hideHeading,
|
|
68
49
|
hideModelNames: e.hideModelNames,
|
|
69
|
-
hideReadOnly: e.hideReadOnly,
|
|
70
|
-
hideWriteOnly: e.hideWriteOnly,
|
|
71
50
|
level: e.level,
|
|
72
|
-
name:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
51
|
+
name: r,
|
|
52
|
+
options: e.options,
|
|
53
|
+
schema: a(l)(f)
|
|
54
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "options", "schema"]))), 128)) : d("", !0),
|
|
55
|
+
a(c)(e.schema) && e.schema.additionalProperties ? (i(), s(p, {
|
|
76
56
|
key: 2,
|
|
77
57
|
breadcrumb: e.breadcrumb,
|
|
78
58
|
compact: e.compact,
|
|
79
59
|
discriminator: e.discriminator,
|
|
80
60
|
hideHeading: e.hideHeading,
|
|
81
61
|
hideModelNames: e.hideModelNames,
|
|
82
|
-
hideReadOnly: e.hideReadOnly,
|
|
83
|
-
hideWriteOnly: e.hideWriteOnly,
|
|
84
62
|
level: e.level,
|
|
85
|
-
name:
|
|
63
|
+
name: b(e.schema.additionalProperties),
|
|
86
64
|
noncollapsible: "",
|
|
87
|
-
|
|
65
|
+
options: e.options,
|
|
66
|
+
schema: g(e.schema.additionalProperties),
|
|
88
67
|
variant: "additionalProperties"
|
|
89
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "
|
|
68
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "options", "schema"])) : d("", !0)
|
|
90
69
|
], 64));
|
|
91
70
|
}
|
|
92
71
|
});
|
|
93
72
|
export {
|
|
94
|
-
|
|
73
|
+
B as default
|
|
95
74
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
2
|
import { type Component } from 'vue';
|
|
3
|
+
import type { SchemaOptions } from '../../../components/Content/Schema/types';
|
|
3
4
|
/**
|
|
4
5
|
* Note: We're taking in a prop called `value` which should be a JSON Schema.
|
|
5
6
|
*
|
|
@@ -8,7 +9,7 @@ import { type Component } from 'vue';
|
|
|
8
9
|
*/
|
|
9
10
|
type __VLS_Props = {
|
|
10
11
|
is?: string | Component;
|
|
11
|
-
|
|
12
|
+
schema: SchemaObject | undefined;
|
|
12
13
|
noncollapsible?: boolean;
|
|
13
14
|
level?: number;
|
|
14
15
|
name?: string;
|
|
@@ -18,16 +19,13 @@ type __VLS_Props = {
|
|
|
18
19
|
description?: string;
|
|
19
20
|
hideModelNames?: boolean;
|
|
20
21
|
hideHeading?: boolean;
|
|
21
|
-
/** Hide read-only properties */
|
|
22
|
-
hideReadOnly?: boolean;
|
|
23
|
-
/** Hide write-only properties */
|
|
24
|
-
hideWriteOnly?: boolean;
|
|
25
22
|
variant?: 'additionalProperties' | 'patternProperties';
|
|
26
23
|
breadcrumb?: string[];
|
|
24
|
+
options: SchemaOptions;
|
|
27
25
|
};
|
|
28
26
|
declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
29
|
-
required: boolean;
|
|
30
27
|
level: number;
|
|
28
|
+
required: boolean;
|
|
31
29
|
compact: boolean;
|
|
32
30
|
hideModelNames: boolean;
|
|
33
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AA4iBA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAErE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAI9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAUtE;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,EAAE,aAAa,CAAA;CACvB,CAAC;;WAXQ,MAAM;cAEH,OAAO;aACR,OAAO;oBAGA,OAAO;;AAsjB5B,0BAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaProperty.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ad32fbeb"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarMarkdown as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { getResolvedRef as
|
|
1
|
+
import { defineComponent as w, computed as t, createBlock as d, openBlock as n, resolveDynamicComponent as A, normalizeClass as T, withCtx as c, createCommentVNode as s, createElementBlock as o, createVNode as m, createSlots as q, unref as i, toDisplayString as v, Fragment as f, createTextVNode as P, renderList as E } from "vue";
|
|
2
|
+
import { ScalarMarkdown as O } from "@scalar/components";
|
|
3
|
+
import { isDefined as F } from "@scalar/helpers/array/is-defined";
|
|
4
|
+
import { getResolvedRef as y } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
5
|
import { isArraySchema as u } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
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
|
|
6
|
+
import { isTypeObject as M } from "./helpers/is-type-object.js";
|
|
7
|
+
import { optimizeValueForDisplay as $ } from "./helpers/optimize-value-for-display.js";
|
|
8
|
+
import { compositions as I } from "./helpers/schema-composition.js";
|
|
9
|
+
import C from "./Schema.vue.js";
|
|
10
|
+
import z from "./SchemaComposition.vue.js";
|
|
11
|
+
import U from "./SchemaEnumValues.vue.js";
|
|
12
|
+
import Z from "./SchemaPropertyHeading.vue.js";
|
|
13
|
+
import L from "../../Anchor/WithBreadcrumb.vue2.js";
|
|
14
|
+
import G from "../../../features/specification-extension/SpecificationExtension.vue2.js";
|
|
15
|
+
const J = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "property-name-pattern-properties"
|
|
18
|
-
},
|
|
18
|
+
}, K = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "property-name-additional-properties"
|
|
21
|
-
},
|
|
21
|
+
}, Q = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "property-description"
|
|
24
|
-
},
|
|
24
|
+
}, W = {
|
|
25
25
|
key: 2,
|
|
26
26
|
class: "property-description"
|
|
27
27
|
}, X = {
|
|
@@ -30,11 +30,11 @@ const G = {
|
|
|
30
30
|
}, Y = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "children"
|
|
33
|
-
},
|
|
33
|
+
}, de = /* @__PURE__ */ w({
|
|
34
34
|
__name: "SchemaProperty",
|
|
35
35
|
props: {
|
|
36
36
|
is: {},
|
|
37
|
-
|
|
37
|
+
schema: {},
|
|
38
38
|
noncollapsible: { type: Boolean },
|
|
39
39
|
level: { default: 0 },
|
|
40
40
|
name: {},
|
|
@@ -44,13 +44,12 @@ const G = {
|
|
|
44
44
|
description: {},
|
|
45
45
|
hideModelNames: { type: Boolean, default: !1 },
|
|
46
46
|
hideHeading: { type: Boolean },
|
|
47
|
-
hideReadOnly: { type: Boolean },
|
|
48
|
-
hideWriteOnly: { type: Boolean },
|
|
49
47
|
variant: {},
|
|
50
|
-
breadcrumb: {}
|
|
48
|
+
breadcrumb: {},
|
|
49
|
+
options: {}
|
|
51
50
|
},
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
51
|
+
setup(j) {
|
|
52
|
+
const p = j, b = {
|
|
54
53
|
integer: {
|
|
55
54
|
_default: "Integer numbers.",
|
|
56
55
|
int32: "Signed 32-bit integers (commonly used integer type).",
|
|
@@ -64,32 +63,32 @@ const G = {
|
|
|
64
63
|
byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
|
|
65
64
|
binary: "binary data, used to describe files"
|
|
66
65
|
}
|
|
67
|
-
},
|
|
66
|
+
}, h = (e) => !e || !b[e.type] ? null : b[e.type][e.format || e.contentEncoding || "_default"], B = (e) => e?.enum || e?.items?.enum || [], a = t(() => $(p.schema)), g = t(() => {
|
|
68
67
|
const e = a.value;
|
|
69
|
-
return !e || "properties" in e || "additionalProperties" in e || "patternProperties" in e || e?.allOf || e?.allOf ? null :
|
|
70
|
-
}),
|
|
68
|
+
return !e || "properties" in e || "additionalProperties" in e || "patternProperties" in e || e?.allOf || e?.allOf ? null : p.description || e?.description || null;
|
|
69
|
+
}), N = (e, r, l) => r || e?.deprecated || e?.const !== void 0 || e?.enum && e.enum.length === 1 || e?.type || e?.nullable === !0 || e?.writeOnly || e?.readOnly || l, k = t(() => {
|
|
71
70
|
const e = a.value;
|
|
72
71
|
if (!e || !u(e) || typeof e.items != "object")
|
|
73
72
|
return !1;
|
|
74
|
-
const
|
|
75
|
-
return "type" in
|
|
76
|
-
}),
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
},
|
|
73
|
+
const r = e.items;
|
|
74
|
+
return "type" in r && r.type && (Array.isArray(r.type) ? r.type.includes("object") : ["object"].includes(r.type)) || "properties" in r || "$ref" in r || "discriminator" in r || "allOf" in r || "oneOf" in r || "anyOf" in r;
|
|
75
|
+
}), S = (e) => {
|
|
76
|
+
const r = a.value;
|
|
77
|
+
return r && u(r) === !1 || !r?.items || typeof r.items != "object" || !(e in r.items) ? !1 : !k.value;
|
|
78
|
+
}, R = t(() => k.value), D = t(() => {
|
|
80
79
|
if (!a.value)
|
|
81
80
|
return !1;
|
|
82
|
-
const e = a.value,
|
|
83
|
-
return
|
|
84
|
-
}),
|
|
81
|
+
const e = a.value, r = M(e), l = "properties" in e || "additionalProperties" in e;
|
|
82
|
+
return r && l;
|
|
83
|
+
}), H = t(() => p.level <= 1), V = t(() => a.value ? I.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
84
|
composition: e,
|
|
86
85
|
value: a.value
|
|
87
|
-
} :
|
|
86
|
+
} : S(e) && a.value && u(a.value) && a.value.items ? {
|
|
88
87
|
composition: e,
|
|
89
88
|
value: a.value.items
|
|
90
|
-
} : null).filter(
|
|
91
|
-
return (e,
|
|
92
|
-
class:
|
|
89
|
+
} : null).filter(F) : []);
|
|
90
|
+
return (e, r) => (n(), d(A(e.is ?? "li"), {
|
|
91
|
+
class: T(["property", [
|
|
93
92
|
`property--level-${e.level}`,
|
|
94
93
|
{
|
|
95
94
|
"property--compact": e.compact,
|
|
@@ -98,24 +97,24 @@ const G = {
|
|
|
98
97
|
]])
|
|
99
98
|
}, {
|
|
100
99
|
default: c(() => [
|
|
101
|
-
|
|
100
|
+
N(a.value, e.name, e.required) ? (n(), d(Z, {
|
|
102
101
|
key: 0,
|
|
103
102
|
class: "group",
|
|
104
|
-
enum:
|
|
103
|
+
enum: B(a.value).length > 0,
|
|
105
104
|
hideModelNames: e.hideModelNames,
|
|
106
105
|
isDiscriminator: e.discriminator && e.discriminator.propertyName === e.name,
|
|
107
106
|
required: e.required,
|
|
108
107
|
value: a.value
|
|
109
|
-
},
|
|
108
|
+
}, q({ _: 2 }, [
|
|
110
109
|
e.name ? {
|
|
111
110
|
name: "name",
|
|
112
111
|
fn: c(() => [
|
|
113
|
-
|
|
114
|
-
breadcrumb:
|
|
112
|
+
m(i(L), {
|
|
113
|
+
breadcrumb: H.value && e.breadcrumb ? [...e.breadcrumb, e.name] : void 0
|
|
115
114
|
}, {
|
|
116
115
|
default: c(() => [
|
|
117
|
-
e.variant === "patternProperties" ? (
|
|
118
|
-
|
|
116
|
+
e.variant === "patternProperties" ? (n(), o("span", J, v(e.name), 1)) : e.variant === "additionalProperties" ? (n(), o("span", K, v(e.name), 1)) : (n(), o(f, { key: 2 }, [
|
|
117
|
+
P(v(e.name), 1)
|
|
119
118
|
], 64))
|
|
120
119
|
]),
|
|
121
120
|
_: 1
|
|
@@ -126,67 +125,64 @@ const G = {
|
|
|
126
125
|
a.value?.example ? {
|
|
127
126
|
name: "example",
|
|
128
127
|
fn: c(() => [
|
|
129
|
-
|
|
128
|
+
P(" Example: " + v(a.value.example), 1)
|
|
130
129
|
]),
|
|
131
130
|
key: "1"
|
|
132
131
|
} : void 0
|
|
133
132
|
]), 1032, ["enum", "hideModelNames", "isDiscriminator", "required", "value"])) : s("", !0),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
])) :
|
|
137
|
-
|
|
138
|
-
value:
|
|
133
|
+
g.value ? (n(), o("div", Q, [
|
|
134
|
+
m(i(O), { value: g.value }, null, 8, ["value"])
|
|
135
|
+
])) : h(a.value) ? (n(), o("div", W, [
|
|
136
|
+
m(i(O), {
|
|
137
|
+
value: h(a.value) || ""
|
|
139
138
|
}, null, 8, ["value"])
|
|
140
139
|
])) : s("", !0),
|
|
141
|
-
(a.value?.enum || a.value &&
|
|
140
|
+
(a.value?.enum || a.value && i(u)(a.value) && i(y)(a.value?.items)?.enum || []).length ? (n(), d(U, {
|
|
142
141
|
key: 3,
|
|
143
142
|
value: a.value
|
|
144
143
|
}, null, 8, ["value"])) : s("", !0),
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
D.value ? (n(), o("div", X, [
|
|
145
|
+
m(C, {
|
|
147
146
|
breadcrumb: e.breadcrumb && e.name ? [...e.breadcrumb, e.name] : void 0,
|
|
148
147
|
compact: e.compact,
|
|
149
|
-
hideReadOnly: e.hideReadOnly,
|
|
150
|
-
hideWriteOnly: e.hideWriteOnly,
|
|
151
148
|
level: e.level + 1,
|
|
152
149
|
name: e.name,
|
|
153
150
|
noncollapsible: e.noncollapsible,
|
|
151
|
+
options: e.options,
|
|
154
152
|
schema: a.value
|
|
155
|
-
}, null, 8, ["breadcrumb", "compact", "
|
|
153
|
+
}, null, 8, ["breadcrumb", "compact", "level", "name", "noncollapsible", "options", "schema"])
|
|
156
154
|
])) : s("", !0),
|
|
157
|
-
a.value &&
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
a.value && i(u)(a.value) && typeof a.value.items == "object" ? (n(), o(f, { key: 5 }, [
|
|
156
|
+
R.value ? (n(), o("div", Y, [
|
|
157
|
+
m(C, {
|
|
160
158
|
compact: e.compact,
|
|
161
|
-
hideReadOnly: e.hideReadOnly,
|
|
162
|
-
hideWriteOnly: e.hideWriteOnly,
|
|
163
159
|
level: e.level + 1,
|
|
164
160
|
name: e.name,
|
|
165
161
|
noncollapsible: e.noncollapsible,
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
options: e.options,
|
|
163
|
+
schema: i(y)(a.value.items)
|
|
164
|
+
}, null, 8, ["compact", "level", "name", "noncollapsible", "options", "schema"])
|
|
168
165
|
])) : s("", !0)
|
|
169
166
|
], 64)) : s("", !0),
|
|
170
|
-
(
|
|
171
|
-
key:
|
|
167
|
+
(n(!0), o(f, null, E(V.value, (l) => (n(), d(z, {
|
|
168
|
+
key: l.composition,
|
|
172
169
|
breadcrumb: e.breadcrumb,
|
|
173
170
|
compact: e.compact,
|
|
174
|
-
composition:
|
|
175
|
-
discriminator: e.
|
|
171
|
+
composition: l.composition,
|
|
172
|
+
discriminator: e.schema?.discriminator,
|
|
176
173
|
hideHeading: e.hideHeading,
|
|
177
|
-
hideReadOnly: e.hideReadOnly,
|
|
178
|
-
hideWriteOnly: e.hideWriteOnly,
|
|
179
174
|
level: e.level,
|
|
180
175
|
name: e.name,
|
|
181
176
|
noncollapsible: e.noncollapsible,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
options: e.options,
|
|
178
|
+
schema: i(y)(p.schema)
|
|
179
|
+
}, null, 8, ["breadcrumb", "compact", "composition", "discriminator", "hideHeading", "level", "name", "noncollapsible", "options", "schema"]))), 128)),
|
|
180
|
+
m(i(G), { value: a.value }, null, 8, ["value"])
|
|
185
181
|
]),
|
|
186
182
|
_: 1
|
|
187
183
|
}, 8, ["class"]));
|
|
188
184
|
}
|
|
189
185
|
});
|
|
190
186
|
export {
|
|
191
|
-
|
|
187
|
+
de as default
|
|
192
188
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ApiReferenceConfiguration } from '@scalar/types';
|
|
2
|
+
import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
/** Extract the type of properties */
|
|
4
|
+
type Properties = NonNullable<Extract<SchemaObject, {
|
|
5
|
+
type: 'object';
|
|
6
|
+
}>['properties']>;
|
|
7
|
+
type Options = Partial<Pick<ApiReferenceConfiguration, 'orderSchemaPropertiesBy' | 'orderRequiredPropertiesFirst'> & {
|
|
8
|
+
hideReadOnly: boolean;
|
|
9
|
+
hideWriteOnly: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
/** Take a list of property names and reduce it back into an object */
|
|
12
|
+
export declare const reduceNamesToObject: (names: string[], properties: Properties) => Properties;
|
|
13
|
+
/** Sort property names in an object schema */
|
|
14
|
+
export declare const sortPropertyNames: (schema: SchemaObject, discriminator?: DiscriminatorObject, { hideReadOnly, hideWriteOnly, orderSchemaPropertiesBy, orderRequiredPropertiesFirst, }?: Options) => string[];
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=sort-property-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-property-names.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/sort-property-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIrH,qCAAqC;AACrC,KAAK,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAA;AAEtF,KAAK,OAAO,GAAG,OAAO,CACpB,IAAI,CAAC,yBAAyB,EAAE,yBAAyB,GAAG,8BAA8B,CAAC,GAAG;IAC5F,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,OAAO,CAAA;CACvB,CACF,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,EAAE,EAAE,YAAY,UAAU,KAAG,UAOxD,CAAA;AAEtB,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,YAAY,EACpB,gBAAgB,mBAAmB,EACnC,0FAKG,OAAY,KACd,MAAM,EAuDR,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getResolvedRef as y } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { isTypeObject as m } from "./is-type-object.js";
|
|
3
|
+
const q = (r, o) => r.reduce((i, s) => {
|
|
4
|
+
const n = o?.[s];
|
|
5
|
+
return n && (i[s] = n), i;
|
|
6
|
+
}, {}), R = (r, o, {
|
|
7
|
+
hideReadOnly: i = !1,
|
|
8
|
+
hideWriteOnly: s = !1,
|
|
9
|
+
orderSchemaPropertiesBy: n = "alpha",
|
|
10
|
+
orderRequiredPropertiesFirst: c = !0
|
|
11
|
+
} = {}) => {
|
|
12
|
+
if (!m(r) || !r.properties)
|
|
13
|
+
return [];
|
|
14
|
+
const d = Object.keys(r.properties), p = new Set(r.required || []);
|
|
15
|
+
return d.sort((t, e) => {
|
|
16
|
+
const u = t === o?.propertyName, f = e === o?.propertyName, l = p.has(t), a = p.has(e);
|
|
17
|
+
if (u && !f)
|
|
18
|
+
return -1;
|
|
19
|
+
if (!u && f)
|
|
20
|
+
return 1;
|
|
21
|
+
if (c) {
|
|
22
|
+
if (l && !a)
|
|
23
|
+
return -1;
|
|
24
|
+
if (!l && a)
|
|
25
|
+
return 1;
|
|
26
|
+
}
|
|
27
|
+
return n === "alpha" ? t.localeCompare(e) : 0;
|
|
28
|
+
}).filter((t) => {
|
|
29
|
+
const e = r.properties && y(r.properties[t]);
|
|
30
|
+
return !(i && e?.readOnly === !0 || s && e?.writeOnly === !0);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
q as reduceNamesToObject,
|
|
35
|
+
R as sortPropertyNames
|
|
36
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the schema component tree
|
|
4
|
+
*
|
|
5
|
+
* These options should be prop drilled through the Schema component tree and shouldn't be changed
|
|
6
|
+
*/
|
|
7
|
+
export type SchemaOptions = {
|
|
8
|
+
/** Hide read-only properties */
|
|
9
|
+
hideReadOnly?: boolean;
|
|
10
|
+
/** Hide write-only properties */
|
|
11
|
+
hideWriteOnly?: boolean;
|
|
12
|
+
/** Order schema properties, defaults to 'alpha' */
|
|
13
|
+
orderSchemaPropertiesBy?: ApiReferenceConfiguration['orderSchemaPropertiesBy'];
|
|
14
|
+
/** Order required properties first */
|
|
15
|
+
orderRequiredPropertiesFirst?: ApiReferenceConfiguration['orderRequiredPropertiesFirst'];
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,mDAAmD;IACnD,uBAAuB,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;IAC9E,sCAAsC;IACtC,4BAA4B,CAAC,EAAE,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;CACzF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tags/ClassicLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tags/ClassicLayout.vue"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAShG,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,YAAY,CAAA;CAClB,CAAC;AAqFF,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAwBhD,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ClassicLayout.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2414d1d0"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tags/ModernLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tags/ModernLayout.vue"],"names":[],"mappings":"AAiFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAWhG,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,YAAY,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;CACxB,CAAC;AAoHF,QAAA,IAAuB,QAAQ,IAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAgChD,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ModernLayout.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5edb9c26"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|