@scalar/api-reference 1.48.2 → 1.48.5
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 +90 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +5 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +19 -15
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +2 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +4 -2
- package/dist/browser/standalone.js +3350 -3276
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue2.js +9 -7
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue2.js +1 -16
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +13 -3
- package/dist/components/Content/Schema/{SchemaEnumValues.vue.d.ts → SchemaEnums.vue.d.ts} +3 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.js +7 -0
- package/dist/components/Content/Schema/{SchemaEnumValues.vue2.js → SchemaEnums.vue2.js} +16 -6
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +29 -3
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +14 -6
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +2 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +5 -1
- package/dist/components/Content/Schema/helpers/sort-property-names.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/sort-property-names.js +13 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +19 -3
- package/dist/helpers/storage.d.ts +16 -0
- package/dist/helpers/storage.d.ts.map +1 -1
- package/dist/style.css +207 -150
- package/package.json +15 -15
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +0 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenMCPButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AgentScalar/OpenMCPButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenMCPButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AgentScalar/OpenMCPButton.vue"],"names":[],"mappings":"AA6SA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAMpE,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;IACD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,cAAc,CAAA;CAC1B,CAAC;AAmEF,KAAK,gBAAgB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAiOxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./OpenMCPButton.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const OpenMCPButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const OpenMCPButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d7102814"]]);
|
|
5
5
|
export {
|
|
6
6
|
OpenMCPButton as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, useModel, createElementBlock, openBlock, createElementVNode, unref, createTextVNode, createVNode, nextTick } from "vue";
|
|
2
2
|
import { useLoadingState } from "@scalar/components";
|
|
3
3
|
import { ScalarIconArrowUpRight } from "@scalar/icons";
|
|
4
|
+
import { isValidUrl } from "@scalar/oas-utils/helpers";
|
|
4
5
|
import { useClipboard } from "@scalar/use-hooks/useClipboard";
|
|
5
6
|
import { useToasts } from "@scalar/use-toasts";
|
|
6
7
|
import { DASHBOARD_REGISTER_URL } from "../../consts/urls.js";
|
|
@@ -29,13 +30,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
30
|
const name = encodeURIComponent(props.config?.name ?? "");
|
|
30
31
|
const cursorLink = `cursor://anysphere.cursor-deeplink/mcp/install?name=${name}&config=${encoded}`;
|
|
31
32
|
const vscodeLink = `vscode:mcp/install?${encodeURIComponent(JSON.stringify(props.config ?? {}))}`;
|
|
32
|
-
const
|
|
33
|
+
const docUrl = useModel(__props, "url");
|
|
33
34
|
async function generateRegisterLink() {
|
|
34
35
|
if (loader.isLoading || !props.workspace) {
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
if (
|
|
38
|
-
openRegisterLink(
|
|
38
|
+
if (docUrl.value && isValidUrl(docUrl.value)) {
|
|
39
|
+
openRegisterLink(docUrl.value);
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
42
|
loader.start();
|
|
@@ -46,9 +47,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
try {
|
|
49
|
-
|
|
50
|
+
docUrl.value = await uploadTempDocument(document);
|
|
50
51
|
await loader.validate();
|
|
51
|
-
openRegisterLink(
|
|
52
|
+
openRegisterLink(docUrl.value);
|
|
52
53
|
await nextTick();
|
|
53
54
|
await loader.clear();
|
|
54
55
|
} catch (error) {
|
|
@@ -57,9 +58,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
58
|
await loader.invalidate();
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
function openRegisterLink(
|
|
61
|
+
function openRegisterLink(docUrl2) {
|
|
61
62
|
const url = new URL(DASHBOARD_REGISTER_URL);
|
|
62
|
-
url.searchParams.set("url",
|
|
63
|
+
url.searchParams.set("url", docUrl2);
|
|
64
|
+
url.searchParams.set("createMcp", "true");
|
|
63
65
|
window.open(url.toString(), "_blank");
|
|
64
66
|
}
|
|
65
67
|
return (_ctx, _cache) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAkxCA,OAAO,EAEL,KAAK,4BAA4B,EAGlC,MAAM,6BAA6B,CAAA;AAOpC,OAAO,KAAK,EACV,cAAc,EAEf,MAAM,4CAA4C,CAAA;AAsBnD,OAAO,8BAA8B,CAAA;AAkCrC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,4BAA4B,CAAA;CAC7C,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,oBAAoB,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,MAAM,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC,CAAC;AA+2CF,QAAA,MAAM,UAAU;;;;oPAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -4,7 +4,7 @@ import _sfc_main from "./ApiReference.vue2.js";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
-
const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
7
|
+
const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-148cccbd"]]);
|
|
8
8
|
export {
|
|
9
9
|
ApiReference as default
|
|
10
10
|
};
|
|
@@ -4,7 +4,6 @@ import { OpenApiClientButton } from "@scalar/api-client/components";
|
|
|
4
4
|
import { createApiClientModal } from "@scalar/api-client/v2/features/modal";
|
|
5
5
|
import { getActiveEnvironment, getServers } from "@scalar/api-client/v2/helpers";
|
|
6
6
|
import { addScalarClassesToHeadless, ScalarSidebarFooter, ScalarColorModeToggleButton, ScalarColorModeToggleIcon } from "@scalar/components";
|
|
7
|
-
import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
|
|
8
7
|
import { createSidebarState, scrollSidebarToTop, ScalarSidebar } from "@scalar/sidebar";
|
|
9
8
|
import { hasObtrusiveScrollbars, getThemeStyles } from "@scalar/themes";
|
|
10
9
|
import { apiReferenceConfigurationSchema } from "@scalar/types/api-reference";
|
|
@@ -431,21 +430,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
431
430
|
({ url }) => mergedConfig.value.onServerChange?.(url)
|
|
432
431
|
);
|
|
433
432
|
eventBus.on("ui:download:document", async ({ format }) => {
|
|
434
|
-
|
|
435
|
-
const url = configList.value[activeSlug.value]?.source?.url;
|
|
436
|
-
if (!url) {
|
|
437
|
-
console.error(
|
|
438
|
-
"Direct download is not supported for documents without a URL source"
|
|
439
|
-
);
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
const result = await fetch(
|
|
443
|
-
redirectToProxy(mergedConfig.value.proxyUrl, url)
|
|
444
|
-
).then((r) => r.text());
|
|
445
|
-
downloadDocument(result, activeSlug.value ?? "openapi");
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
const document2 = workspaceStore.exportActiveDocument(format);
|
|
433
|
+
const document2 = await workspaceStore.exportActiveDocument(format);
|
|
449
434
|
if (!document2) {
|
|
450
435
|
console.error("No document found to download");
|
|
451
436
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Content/Content.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Content.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Content/Content.vue"],"names":[],"mappings":"AAoNA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AACtG,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EAClB,MAAM,2CAA2C,CAAA;AAelD,KAAK,WAAW,GAAG;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,gFAAgF;IAChF,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,sBAAsB,GACtB,oBAAoB,GACpB,eAAe,GACf,uBAAuB,GACvB,QAAQ,GACR,8BAA8B,GAC9B,yBAAyB,GACzB,aAAa,GACb,UAAU,GACV,SAAS,GACT,iBAAiB,CACpB,CAAA;IACD,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,SAAS,EAAE,SAAS,CAAA;IACpB,oBAAoB,EAAE,SAAS,CAAC,yBAAyB,CAAC,CAAA;IAC1D,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,iDAAiD;IACjD,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;CACnD,CAAC;AA2VJ,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAClE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC1C;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAG5C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -72,6 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
72
|
id: __props.infoSectionId,
|
|
73
73
|
documentDownloadType: __props.options.documentDownloadType,
|
|
74
74
|
documentExtensions: documentExtensions.value,
|
|
75
|
+
documentUrl: __props.document?.["x-scalar-original-source-url"],
|
|
75
76
|
eventBus: __props.eventBus,
|
|
76
77
|
externalDocs: __props.document?.externalDocs,
|
|
77
78
|
headingSlugGenerator: __props.headingSlugGenerator,
|
|
@@ -143,7 +144,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
143
144
|
})
|
|
144
145
|
]),
|
|
145
146
|
_: 1
|
|
146
|
-
}, 8, ["id", "documentDownloadType", "documentExtensions", "eventBus", "externalDocs", "headingSlugGenerator", "info", "infoExtensions", "layout", "oasVersion"])
|
|
147
|
+
}, 8, ["id", "documentDownloadType", "documentExtensions", "documentUrl", "eventBus", "externalDocs", "headingSlugGenerator", "info", "infoExtensions", "layout", "oasVersion"])
|
|
147
148
|
]),
|
|
148
149
|
_: 3
|
|
149
150
|
}, 8, ["id"]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA+KA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAItE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAA;CACvB,CAAC;AAsQJ,QAAA,MAAM,YAAY;aA/QJ,OAAO;iBAEH,OAAO;6EAgRvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, createElementBlock, openBlock, createBlock, unref, Fragment, createVNode, createElementVNode, withCtx, createCommentVNode, toDisplayString, normalizeClass } from "vue";
|
|
1
|
+
import { defineComponent, computed, ref, createElementBlock, openBlock, createBlock, unref, Fragment, createVNode, createElementVNode, withCtx, createCommentVNode, toDisplayString, normalizeClass, createTextVNode } from "vue";
|
|
2
2
|
import { ScalarListbox } from "@scalar/components";
|
|
3
3
|
import { isDefined } from "@scalar/helpers/array/is-defined";
|
|
4
4
|
import { ScalarIconCaretDown } from "@scalar/icons";
|
|
@@ -51,6 +51,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
51
|
const selectedComposition = computed(
|
|
52
52
|
() => composition.value[Number(selectedOption.value?.id ?? "0")]?.value
|
|
53
53
|
);
|
|
54
|
+
const showNestedSchema = ref(false);
|
|
54
55
|
return (_ctx, _cache) => {
|
|
55
56
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
56
57
|
props.composition === "allOf" ? (openBlock(), createBlock(Schema, {
|
|
@@ -87,7 +88,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
87
88
|
_: 1
|
|
88
89
|
}, 8, ["modelValue", "options"]),
|
|
89
90
|
createElementVNode("div", _hoisted_5, [
|
|
90
|
-
|
|
91
|
+
!showNestedSchema.value && __props.level > 2 ? (openBlock(), createElementBlock("button", {
|
|
92
|
+
key: 0,
|
|
93
|
+
class: "bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors",
|
|
94
|
+
type: "button",
|
|
95
|
+
onClick: _cache[1] || (_cache[1] = ($event) => showNestedSchema.value = true)
|
|
96
|
+
}, [
|
|
97
|
+
_cache[2] || (_cache[2] = createTextVNode(" Show Schema Details ", -1)),
|
|
98
|
+
createVNode(unref(ScalarIconCaretDown), { class: "h-3 w-3" })
|
|
99
|
+
])) : (openBlock(), createBlock(Schema, {
|
|
100
|
+
key: 1,
|
|
91
101
|
breadcrumb: __props.breadcrumb,
|
|
92
102
|
compact: __props.compact,
|
|
93
103
|
discriminator: __props.discriminator,
|
|
@@ -98,7 +108,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
98
108
|
noncollapsible: true,
|
|
99
109
|
options: __props.options,
|
|
100
110
|
schema: selectedComposition.value
|
|
101
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "eventBus", "hideHeading", "level", "name", "options", "schema"])
|
|
111
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "eventBus", "hideHeading", "level", "name", "options", "schema"]))
|
|
102
112
|
])
|
|
103
113
|
], 64))
|
|
104
114
|
]);
|
|
@@ -2,8 +2,10 @@ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/o
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
/** The schema object containing enum values and metadata */
|
|
4
4
|
value: SchemaObject | undefined;
|
|
5
|
+
/** Whether to display the enum for property names */
|
|
6
|
+
propertyNames?: boolean;
|
|
5
7
|
};
|
|
6
8
|
declare const __VLS_export: 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>;
|
|
7
9
|
declare const _default: typeof __VLS_export;
|
|
8
10
|
export default _default;
|
|
9
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=SchemaEnums.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaEnums.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"names":[],"mappings":"AAsMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAC;AAyPF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from "./SchemaEnums.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const SchemaEnums = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-55c01b89"]]);
|
|
5
|
+
export {
|
|
6
|
+
SchemaEnums as default
|
|
7
|
+
};
|
|
@@ -8,15 +8,24 @@ const _hoisted_1 = {
|
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "property-enum"
|
|
10
10
|
};
|
|
11
|
-
const _hoisted_2 = {
|
|
12
|
-
|
|
11
|
+
const _hoisted_2 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "property-enum-property-names"
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_3 = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "property-enum-property-names"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_4 = { class: "property-enum-values" };
|
|
20
|
+
const _hoisted_5 = { key: 1 };
|
|
13
21
|
const ENUM_DISPLAY_THRESHOLD = 9;
|
|
14
22
|
const INITIAL_VISIBLE_COUNT = 5;
|
|
15
23
|
const THIN_SPACE = " ";
|
|
16
24
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
-
__name: "
|
|
25
|
+
__name: "SchemaEnums",
|
|
18
26
|
props: {
|
|
19
|
-
value: {}
|
|
27
|
+
value: {},
|
|
28
|
+
propertyNames: { type: Boolean }
|
|
20
29
|
},
|
|
21
30
|
setup(__props) {
|
|
22
31
|
const enumValues = computed(() => {
|
|
@@ -61,7 +70,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
70
|
};
|
|
62
71
|
return (_ctx, _cache) => {
|
|
63
72
|
return enumValues.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
64
|
-
|
|
73
|
+
__props.propertyNames ? (openBlock(), createElementBlock("div", _hoisted_2, " property names ")) : (openBlock(), createElementBlock("div", _hoisted_3, " values ")),
|
|
74
|
+
createElementVNode("ul", _hoisted_4, [
|
|
65
75
|
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleEnumValues.value, (enumValue, index) => {
|
|
66
76
|
return openBlock(), createBlock(SchemaEnumPropertyItem, {
|
|
67
77
|
key: String(enumValue),
|
|
@@ -76,7 +86,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
76
86
|
label: formatEnumValueWithName(enumValue, initialVisibleCount.value + index)
|
|
77
87
|
}, null, 8, ["description", "label"]);
|
|
78
88
|
}), 128)) : createCommentVNode("", true),
|
|
79
|
-
shouldUseLongListDisplay.value ? (openBlock(), createElementBlock("li",
|
|
89
|
+
shouldUseLongListDisplay.value ? (openBlock(), createElementBlock("li", _hoisted_5, [
|
|
80
90
|
createVNode(unref(ScalarButton), {
|
|
81
91
|
class: "enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none",
|
|
82
92
|
variant: "ghost",
|
|
@@ -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":"AAsMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,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,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;CACvB,CAAC;AA0PF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -20,13 +20,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
const sortedProperties = computed(
|
|
21
21
|
() => sortPropertyNames(__props.schema, __props.discriminator, __props.options)
|
|
22
22
|
);
|
|
23
|
-
const getAdditionalPropertiesName = (_additionalProperties) => {
|
|
23
|
+
const getAdditionalPropertiesName = (_additionalProperties, _propertyNames) => {
|
|
24
24
|
const additionalProperties = typeof _additionalProperties === "boolean" ? _additionalProperties : resolve.schema(_additionalProperties);
|
|
25
25
|
if (typeof additionalProperties === "object" && typeof additionalProperties["x-additionalPropertiesName"] === "string" && additionalProperties["x-additionalPropertiesName"].trim().length > 0) {
|
|
26
26
|
return `${additionalProperties["x-additionalPropertiesName"].trim()}`;
|
|
27
27
|
}
|
|
28
|
+
if (_propertyNames) {
|
|
29
|
+
const resolved = resolve.schema(_propertyNames);
|
|
30
|
+
if (resolved?.title) {
|
|
31
|
+
return resolved.title;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
28
34
|
return "propertyName";
|
|
29
35
|
};
|
|
36
|
+
const getPropertyNamesEnum = (_propertyNames) => {
|
|
37
|
+
if (!_propertyNames) {
|
|
38
|
+
return void 0;
|
|
39
|
+
}
|
|
40
|
+
const resolved = resolve.schema(_propertyNames);
|
|
41
|
+
if (resolved && "enum" in resolved && Array.isArray(resolved.enum) && resolved.enum.length > 0) {
|
|
42
|
+
return resolved.enum;
|
|
43
|
+
}
|
|
44
|
+
return void 0;
|
|
45
|
+
};
|
|
46
|
+
const additionalPropertiesEnum = computed(() => {
|
|
47
|
+
if (!isTypeObject(__props.schema) || !__props.schema.additionalProperties) {
|
|
48
|
+
return void 0;
|
|
49
|
+
}
|
|
50
|
+
return getPropertyNamesEnum(__props.schema.propertyNames);
|
|
51
|
+
});
|
|
30
52
|
const getAdditionalPropertiesValue = (additionalProperties) => {
|
|
31
53
|
if (additionalProperties === true || typeof additionalProperties === "object" && Object.keys(additionalProperties).length === 0 || typeof additionalProperties !== "object" || !("type" in additionalProperties)) {
|
|
32
54
|
return {
|
|
@@ -79,12 +101,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
79
101
|
hideHeading: __props.hideHeading,
|
|
80
102
|
hideModelNames: __props.hideModelNames,
|
|
81
103
|
level: __props.level,
|
|
82
|
-
name: getAdditionalPropertiesName(
|
|
104
|
+
name: getAdditionalPropertiesName(
|
|
105
|
+
__props.schema.additionalProperties,
|
|
106
|
+
__props.schema.propertyNames
|
|
107
|
+
),
|
|
83
108
|
noncollapsible: "",
|
|
84
109
|
options: __props.options,
|
|
110
|
+
propertyNamesEnum: additionalPropertiesEnum.value,
|
|
85
111
|
schema: getAdditionalPropertiesValue(__props.schema.additionalProperties),
|
|
86
112
|
variant: "additionalProperties"
|
|
87
|
-
}, null, 8, ["breadcrumb", "compact", "discriminator", "eventBus", "hideHeading", "hideModelNames", "level", "name", "options", "schema"])) : createCommentVNode("", true)
|
|
113
|
+
}, null, 8, ["breadcrumb", "compact", "discriminator", "eventBus", "hideHeading", "hideModelNames", "level", "name", "options", "propertyNamesEnum", "schema"])) : createCommentVNode("", true)
|
|
88
114
|
], 64);
|
|
89
115
|
};
|
|
90
116
|
}
|
|
@@ -20,10 +20,14 @@ type __VLS_Props = {
|
|
|
20
20
|
description?: string;
|
|
21
21
|
hideModelNames?: boolean;
|
|
22
22
|
hideHeading?: boolean;
|
|
23
|
+
/** When the root schema was resolved from a $ref, pass the ref name for display (e.g. "Data"). */
|
|
24
|
+
modelName?: string | null;
|
|
23
25
|
variant?: 'additionalProperties' | 'patternProperties';
|
|
24
26
|
breadcrumb?: string[];
|
|
25
27
|
eventBus: WorkspaceEventBus | null;
|
|
26
28
|
options: SchemaOptions;
|
|
29
|
+
/** Enum values for property names (from JSON Schema propertyNames keyword). */
|
|
30
|
+
propertyNamesEnum?: string[];
|
|
27
31
|
};
|
|
28
32
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
29
33
|
level: number;
|
|
@@ -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":"AA0bA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,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;AAetE;;;;;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,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC7B,CAAC;AAudJ,QAAA,MAAM,YAAY;WAveN,MAAM;cAEH,OAAO;aACR,OAAO;oBAGA,OAAO;6EAoe1B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./SchemaProperty.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const SchemaProperty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const SchemaProperty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8d72f803"]]);
|
|
5
5
|
export {
|
|
6
6
|
SchemaProperty as default
|
|
7
7
|
};
|
|
@@ -12,7 +12,7 @@ import { shouldDisplayDescription } from "./helpers/should-display-description.j
|
|
|
12
12
|
import { shouldDisplayHeading } from "./helpers/should-display-heading.js";
|
|
13
13
|
import Schema from "./Schema.vue.js";
|
|
14
14
|
import _sfc_main$2 from "./SchemaComposition.vue.js";
|
|
15
|
-
import
|
|
15
|
+
import SchemaEnums from "./SchemaEnums.vue.js";
|
|
16
16
|
import SchemaPropertyHeading from "./SchemaPropertyHeading.vue.js";
|
|
17
17
|
import _sfc_main$1 from "../../Anchor/WithBreadcrumb.vue.js";
|
|
18
18
|
import _sfc_main$3 from "../../../features/specification-extension/SpecificationExtension.vue2.js";
|
|
@@ -29,11 +29,11 @@ const _hoisted_3 = {
|
|
|
29
29
|
class: "property-description"
|
|
30
30
|
};
|
|
31
31
|
const _hoisted_4 = {
|
|
32
|
-
key:
|
|
32
|
+
key: 4,
|
|
33
33
|
class: "children"
|
|
34
34
|
};
|
|
35
35
|
const _hoisted_5 = {
|
|
36
|
-
key:
|
|
36
|
+
key: 5,
|
|
37
37
|
class: "children"
|
|
38
38
|
};
|
|
39
39
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -50,10 +50,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
50
|
description: {},
|
|
51
51
|
hideModelNames: { type: Boolean, default: false },
|
|
52
52
|
hideHeading: { type: Boolean },
|
|
53
|
+
modelName: {},
|
|
53
54
|
variant: {},
|
|
54
55
|
breadcrumb: {},
|
|
55
56
|
eventBus: {},
|
|
56
|
-
options: {}
|
|
57
|
+
options: {},
|
|
58
|
+
propertyNamesEnum: {}
|
|
57
59
|
},
|
|
58
60
|
setup(__props) {
|
|
59
61
|
const props = __props;
|
|
@@ -120,6 +122,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
120
122
|
enum: hasEnum.value,
|
|
121
123
|
hideModelNames: __props.hideModelNames,
|
|
122
124
|
isDiscriminator: isDiscriminatorProperty.value,
|
|
125
|
+
modelName: __props.modelName,
|
|
123
126
|
required: __props.required,
|
|
124
127
|
value: optimizedValue.value
|
|
125
128
|
}, createSlots({ _: 2 }, [
|
|
@@ -159,14 +162,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
159
162
|
]),
|
|
160
163
|
key: "1"
|
|
161
164
|
} : void 0
|
|
162
|
-
]), 1032, ["enum", "hideModelNames", "isDiscriminator", "required", "value"])) : createCommentVNode("", true),
|
|
165
|
+
]), 1032, ["enum", "hideModelNames", "isDiscriminator", "modelName", "required", "value"])) : createCommentVNode("", true),
|
|
163
166
|
displayDescription.value || propertyDescription.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
164
167
|
createVNode(unref(ScalarMarkdown), {
|
|
165
168
|
value: displayDescription.value || propertyDescription.value || ""
|
|
166
169
|
}, null, 8, ["value"])
|
|
167
170
|
])) : createCommentVNode("", true),
|
|
168
|
-
|
|
171
|
+
__props.propertyNamesEnum && __props.propertyNamesEnum.length > 0 ? (openBlock(), createBlock(SchemaEnums, {
|
|
169
172
|
key: 2,
|
|
173
|
+
propertyNames: "",
|
|
174
|
+
value: { enum: __props.propertyNamesEnum }
|
|
175
|
+
}, null, 8, ["value"])) : createCommentVNode("", true),
|
|
176
|
+
enumValues.value.length > 0 ? (openBlock(), createBlock(SchemaEnums, {
|
|
177
|
+
key: 3,
|
|
170
178
|
value: optimizedValue.value
|
|
171
179
|
}, null, 8, ["value"])) : createCommentVNode("", true),
|
|
172
180
|
shouldRenderObjectProperties.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
@@ -7,6 +7,8 @@ type __VLS_Props = {
|
|
|
7
7
|
additional?: boolean;
|
|
8
8
|
withExamples?: boolean;
|
|
9
9
|
hideModelNames?: boolean;
|
|
10
|
+
/** When the schema was resolved from a $ref, pass the ref name so it displays as e.g. "Data" instead of "object". */
|
|
11
|
+
modelName?: string | null;
|
|
10
12
|
};
|
|
11
13
|
declare var __VLS_1: {};
|
|
12
14
|
type __VLS_Slots = {} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"AAwaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAkBhG,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,qHAAqH;IACrH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAC;AAkfJ,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK5C,QAAA,MAAM,UAAU;cA/fD,OAAO;oBAGD,OAAO;qBAJN,OAAO;kBAGV,OAAO;6EAggBxB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./SchemaPropertyHeading.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const SchemaPropertyHeading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const SchemaPropertyHeading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-881aa734"]]);
|
|
5
5
|
export {
|
|
6
6
|
SchemaPropertyHeading as default
|
|
7
7
|
};
|
|
@@ -48,7 +48,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
48
48
|
required: { type: Boolean, default: false },
|
|
49
49
|
additional: { type: Boolean },
|
|
50
50
|
withExamples: { type: Boolean, default: true },
|
|
51
|
-
hideModelNames: { type: Boolean, default: false }
|
|
51
|
+
hideModelNames: { type: Boolean, default: false },
|
|
52
|
+
modelName: {}
|
|
52
53
|
},
|
|
53
54
|
setup(__props) {
|
|
54
55
|
const props = __props;
|
|
@@ -174,6 +175,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
174
175
|
if (props.hideModelNames) {
|
|
175
176
|
return null;
|
|
176
177
|
}
|
|
178
|
+
if (props.modelName) {
|
|
179
|
+
return props.modelName;
|
|
180
|
+
}
|
|
177
181
|
const modelName = getModelNameFromSchema(props.value);
|
|
178
182
|
if (modelName) {
|
|
179
183
|
return modelName;
|
|
@@ -1 +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,6BAA6B,CAAA;AAE5E,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,
|
|
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,6BAA6B,CAAA;AAE5E,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,EA6ER,CAAA"}
|
|
@@ -29,6 +29,19 @@ const sortPropertyNames = (schema, discriminator, {
|
|
|
29
29
|
if (!aDiscriminator && bDiscriminator) {
|
|
30
30
|
return 1;
|
|
31
31
|
}
|
|
32
|
+
const aSchema = schema.properties?.[a];
|
|
33
|
+
const bSchema = schema.properties?.[b];
|
|
34
|
+
const aOrder = aSchema && typeof aSchema === "object" && "x-order" in aSchema ? aSchema["x-order"] : void 0;
|
|
35
|
+
const bOrder = bSchema && typeof bSchema === "object" && "x-order" in bSchema ? bSchema["x-order"] : void 0;
|
|
36
|
+
if (aOrder !== void 0 && bOrder !== void 0) {
|
|
37
|
+
return Number(aOrder) - Number(bOrder);
|
|
38
|
+
}
|
|
39
|
+
if (aOrder !== void 0 && bOrder === void 0) {
|
|
40
|
+
return -1;
|
|
41
|
+
}
|
|
42
|
+
if (aOrder === void 0 && bOrder !== void 0) {
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
32
45
|
if (orderRequiredPropertiesFirst) {
|
|
33
46
|
if (aRequired && !bRequired) {
|
|
34
47
|
return -1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AAmUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEf,MAAM,8DAA8D,CAAA;AAKrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAKxE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,GAAG,cAAc,CAAA;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,EAAE,IAAI,CACX,cAAc,CAAC,SAAS,CAAC,EACzB,8BAA8B,GAAG,yBAAyB,CAC3D,CAAA;CACF,CAAC;AAkYF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./ParameterListItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ParameterListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const ParameterListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d03ca136"]]);
|
|
5
5
|
export {
|
|
6
6
|
ParameterListItem as default
|
|
7
7
|
};
|
|
@@ -3,6 +3,7 @@ import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
|
|
|
3
3
|
import { ScalarWrappingText, ScalarMarkdownSummary, ScalarMarkdown } from "@scalar/components";
|
|
4
4
|
import { ScalarIconCaretRight } from "@scalar/icons";
|
|
5
5
|
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
6
|
+
import { getRefName } from "../../../components/Content/Schema/helpers/get-ref-name.js";
|
|
6
7
|
import SchemaProperty from "../../../components/Content/Schema/SchemaProperty.vue.js";
|
|
7
8
|
import _sfc_main$1 from "./ContentTypeSelect.vue.js";
|
|
8
9
|
import Headers from "./Headers.vue.js";
|
|
@@ -35,8 +36,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
36
|
const headers = computed(
|
|
36
37
|
() => "headers" in __props.parameter && __props.parameter.headers ? __props.parameter.headers : null
|
|
37
38
|
);
|
|
39
|
+
const baseSchema = computed(
|
|
40
|
+
() => content.value ? content.value?.[selectedContentType.value]?.schema : "schema" in __props.parameter && __props.parameter.schema ? __props.parameter.schema : null
|
|
41
|
+
);
|
|
42
|
+
const schemaModelName = computed(() => {
|
|
43
|
+
const raw = baseSchema.value;
|
|
44
|
+
if (!raw) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if ("$ref" in raw) {
|
|
48
|
+
return getRefName(raw.$ref);
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
});
|
|
38
52
|
const value = computed(() => {
|
|
39
|
-
const
|
|
53
|
+
const base = baseSchema.value;
|
|
54
|
+
const resolvedBase = content.value ? getResolvedRef(base) : schema.value;
|
|
40
55
|
const deprecated = "deprecated" in __props.parameter ? __props.parameter.deprecated : schema.value?.deprecated;
|
|
41
56
|
const paramExamples = "examples" in __props.parameter ? __props.parameter.examples : {};
|
|
42
57
|
const recordExamples = Object.values({
|
|
@@ -46,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
61
|
const arrayExamples = schema.value?.examples ?? (recordExamples.length === 0 && "example" in __props.parameter ? [__props.parameter.example] : []);
|
|
47
62
|
const examples = [...recordExamples, ...arrayExamples];
|
|
48
63
|
return {
|
|
49
|
-
...
|
|
64
|
+
...resolvedBase,
|
|
50
65
|
deprecated,
|
|
51
66
|
examples
|
|
52
67
|
};
|
|
@@ -122,6 +137,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
122
137
|
description: shouldCollapse.value ? "" : __props.parameter.description,
|
|
123
138
|
eventBus: __props.eventBus,
|
|
124
139
|
hideWriteOnly: true,
|
|
140
|
+
modelName: schemaModelName.value,
|
|
125
141
|
name: shouldCollapse.value ? "" : __props.name,
|
|
126
142
|
noncollapsible: true,
|
|
127
143
|
options: {
|
|
@@ -131,7 +147,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
131
147
|
},
|
|
132
148
|
required: "required" in __props.parameter && __props.parameter.required,
|
|
133
149
|
schema: value.value
|
|
134
|
-
}, null, 8, ["breadcrumb", "description", "eventBus", "name", "options", "required", "schema"])
|
|
150
|
+
}, null, 8, ["breadcrumb", "description", "eventBus", "modelName", "name", "options", "required", "schema"])
|
|
135
151
|
]),
|
|
136
152
|
_: 1
|
|
137
153
|
}, 8, ["static"])
|