@scalar/api-reference 1.35.5 → 1.35.7
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 +53 -0
- package/dist/blocks/helpers/getPointer.d.ts.map +1 -1
- package/dist/browser/standalone.js +19316 -19449
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue2.js +8 -11
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +4 -4
- package/dist/components/ApiReferenceLayout.vue2.js +247 -268
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/ClassicHeader.vue.js +1 -1
- package/dist/components/Content/Content.vue.js +145 -169
- package/dist/components/Content/Content.vue3.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue2.js +32 -35
- package/dist/components/Content/Models/Models.vue.js +27 -31
- package/dist/components/Content/Models/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +32 -35
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +26 -27
- package/dist/components/Content/Operations/get-current-index.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue2.js +68 -74
- package/dist/components/Content/Schema/SchemaComposition.vue.js +42 -45
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +45 -50
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +41 -48
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +142 -157
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +160 -164
- package/dist/components/Content/Schema/helpers/get-schema-type.js +15 -17
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +74 -77
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +10 -11
- package/dist/components/Content/Tags/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue2.js +36 -39
- package/dist/components/Content/Tags/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue2.js +31 -35
- package/dist/components/Content/Tags/TagSection.vue.js +86 -92
- package/dist/components/GettingStarted.vue.js +1 -1
- package/dist/components/Lazy/Lazy.vue.d.ts.map +1 -1
- package/dist/components/Lazy/Lazy.vue2.js +2 -2
- 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.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentSource.js +21 -20
- 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 +3 -3
- 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.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +102 -103
- 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.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.js +2 -2
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue2.js +56 -50
- 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.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +2 -2
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +111 -118
- 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.d.ts.map +1 -1
- 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 +24 -23
- 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,49 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarErrorBoundary as
|
|
3
|
-
import { usePluginManager as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as v, computed as u, createElementBlock as m, createCommentVNode as g, openBlock as r, Fragment as E, renderList as _, createBlock as o, unref as k, withCtx as y, resolveDynamicComponent as c, mergeProps as l } from "vue";
|
|
2
|
+
import { ScalarErrorBoundary as C } from "@scalar/components";
|
|
3
|
+
import { usePluginManager as h } from "../../plugins/hooks/usePluginManager.js";
|
|
4
|
+
const B = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-base"
|
|
7
|
-
},
|
|
7
|
+
}, j = /* @__PURE__ */ v({
|
|
8
8
|
__name: "SpecificationExtension",
|
|
9
9
|
props: {
|
|
10
10
|
value: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const { getSpecificationExtensions:
|
|
14
|
-
function
|
|
12
|
+
setup(s) {
|
|
13
|
+
const { getSpecificationExtensions: p } = h();
|
|
14
|
+
function i(t) {
|
|
15
15
|
return Object.keys(t ?? {}).filter(
|
|
16
16
|
(n) => n.startsWith("x-")
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return t.flatMap((n) =>
|
|
19
|
+
function f(t) {
|
|
20
|
+
return t.flatMap((n) => p(n)).filter((n) => n.component);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
() =>
|
|
22
|
+
const d = u(() => i(s.value)), a = u(
|
|
23
|
+
() => f(d.value)
|
|
24
24
|
);
|
|
25
|
-
return (t, n) => typeof t.value == "object" && a.value.length ? (r(),
|
|
26
|
-
(r(!0),
|
|
27
|
-
default:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, { [e.name]: (m = t.value) == null ? void 0 : m[e.name] }), null, 16))
|
|
40
|
-
];
|
|
41
|
-
}),
|
|
25
|
+
return (t, n) => typeof t.value == "object" && a.value.length ? (r(), m("div", B, [
|
|
26
|
+
(r(!0), m(E, null, _(a.value, (e) => (r(), o(k(C), null, {
|
|
27
|
+
default: y(() => [
|
|
28
|
+
e.renderer ? (r(), o(c(e.renderer), l({
|
|
29
|
+
key: 0,
|
|
30
|
+
ref_for: !0
|
|
31
|
+
}, {
|
|
32
|
+
[e.name]: t.value?.[e.name],
|
|
33
|
+
component: e.component
|
|
34
|
+
}), null, 16)) : (r(), o(c(e.component), l({
|
|
35
|
+
key: 1,
|
|
36
|
+
ref_for: !0
|
|
37
|
+
}, { [e.name]: t.value?.[e.name] }), null, 16))
|
|
38
|
+
]),
|
|
42
39
|
_: 2
|
|
43
40
|
}, 1024))), 256))
|
|
44
|
-
])) :
|
|
41
|
+
])) : g("", !0);
|
|
45
42
|
}
|
|
46
43
|
});
|
|
47
44
|
export {
|
|
48
|
-
|
|
45
|
+
j as default
|
|
49
46
|
};
|
|
@@ -13,8 +13,7 @@ const R = ["method"], S = /* @__PURE__ */ c({
|
|
|
13
13
|
const { client: a } = w(), m = b(), u = d(
|
|
14
14
|
() => m.value.hideTestRequestButton !== !0
|
|
15
15
|
), p = () => {
|
|
16
|
-
|
|
17
|
-
(e = a.value) == null || e.open({
|
|
16
|
+
a.value?.open({
|
|
18
17
|
method: t.method,
|
|
19
18
|
path: t.path
|
|
20
19
|
});
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { getHeadingsFromMarkdown as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
if (!(n != null && n.trim()))
|
|
1
|
+
import { getHeadingsFromMarkdown as h, getLowestHeadingLevel as d } from "../../../libs/markdown.js";
|
|
2
|
+
const a = "introduction", g = (n, i, l) => {
|
|
3
|
+
if (!n?.trim())
|
|
5
4
|
return [];
|
|
6
|
-
const
|
|
5
|
+
const c = h(n), o = d(c), r = [];
|
|
7
6
|
let s = null;
|
|
8
7
|
if (n && !n.trim().startsWith("#")) {
|
|
9
8
|
const e = {
|
|
10
9
|
depth: 1,
|
|
11
10
|
value: "Introduction",
|
|
12
|
-
slug:
|
|
13
|
-
}, t =
|
|
11
|
+
slug: a
|
|
12
|
+
}, t = l(e), u = e.value;
|
|
14
13
|
r.push({
|
|
15
14
|
id: t,
|
|
16
|
-
title:
|
|
17
|
-
}),
|
|
15
|
+
title: u
|
|
16
|
+
}), i.set(t, u);
|
|
18
17
|
}
|
|
19
|
-
for (const e of
|
|
18
|
+
for (const e of c) {
|
|
20
19
|
if (e.depth !== o && e.depth !== o + 1)
|
|
21
20
|
continue;
|
|
22
21
|
const t = {
|
|
23
|
-
id:
|
|
22
|
+
id: l(e),
|
|
24
23
|
title: e.value
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
i.set(t.id, t.title), e.depth === o ? (t.children = [], r.push(t), s = t) : s && s.children?.push(t);
|
|
27
26
|
}
|
|
28
27
|
return r;
|
|
29
28
|
};
|
|
30
29
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
a as DEFAULT_INTRODUCTION_SLUG,
|
|
31
|
+
g as traverseDescription
|
|
33
32
|
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { traverseDescription as
|
|
2
|
-
import { traversePaths as
|
|
3
|
-
import { traverseSchemas as
|
|
4
|
-
import { traverseTags as
|
|
5
|
-
import { traverseWebhooks as
|
|
6
|
-
const
|
|
7
|
-
var h, l, m;
|
|
1
|
+
import { traverseDescription as c } from "./traverse-description.js";
|
|
2
|
+
import { traversePaths as f } from "./traverse-paths.js";
|
|
3
|
+
import { traverseSchemas as g } from "./traverse-schemas.js";
|
|
4
|
+
import { traverseTags as S } from "./traverse-tags.js";
|
|
5
|
+
import { traverseWebhooks as u } from "./traverse-webhooks.js";
|
|
6
|
+
const w = (e, { config: a, getHeadingId: h, getOperationId: l, getWebhookId: i, getModelId: n, getTagId: m }) => {
|
|
8
7
|
const r = /* @__PURE__ */ new Map(), t = new Map(
|
|
9
|
-
|
|
8
|
+
e.tags?.map((s) => [s.name ?? "Untitled Tag", { tag: s, entries: [] }]) ?? []
|
|
10
9
|
);
|
|
11
|
-
|
|
12
|
-
const o =
|
|
13
|
-
getTagId:
|
|
10
|
+
f(e, t, r, l);
|
|
11
|
+
const o = c(e.info?.description, r, h), p = u(e, t, r, i), v = S(e, t, r, {
|
|
12
|
+
getTagId: m,
|
|
14
13
|
tagsSorter: a.value.tagsSorter,
|
|
15
14
|
operationsSorter: a.value.operationsSorter
|
|
16
15
|
});
|
|
17
|
-
if (o.push(...
|
|
16
|
+
if (o.push(...v), p.length && o.push({
|
|
18
17
|
id: i(),
|
|
19
18
|
isWebhooks: !0,
|
|
20
19
|
title: "Webhooks",
|
|
21
20
|
children: p
|
|
22
|
-
}), !a.value.hideModels &&
|
|
23
|
-
const s =
|
|
21
|
+
}), !a.value.hideModels && e.components?.schemas) {
|
|
22
|
+
const s = g(e, t, r, n);
|
|
24
23
|
s.length && o.push({
|
|
25
24
|
id: n(),
|
|
26
25
|
title: "Models",
|
|
@@ -30,5 +29,5 @@ const x = (e, { config: a, getHeadingId: v, getOperationId: c, getWebhookId: i,
|
|
|
30
29
|
return { entries: o, titles: r };
|
|
31
30
|
};
|
|
32
31
|
export {
|
|
33
|
-
|
|
32
|
+
w as traverseDocument
|
|
34
33
|
};
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
import { httpMethods as
|
|
2
|
-
import { getTag as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return f.set(i, n), {
|
|
1
|
+
import { httpMethods as m } from "@scalar/helpers/http/http-methods";
|
|
2
|
+
import { getTag as l } from "./get-tag.js";
|
|
3
|
+
const E = (s, t, r = "Unknown", c, f, h) => {
|
|
4
|
+
const i = h({ ...s, method: t, path: r }, c), e = s.summary?.trim() ? s.summary : r;
|
|
5
|
+
return f.set(i, e), {
|
|
7
6
|
id: i,
|
|
8
|
-
title:
|
|
9
|
-
path:
|
|
10
|
-
method:
|
|
11
|
-
operation:
|
|
7
|
+
title: e,
|
|
8
|
+
path: r,
|
|
9
|
+
method: t,
|
|
10
|
+
operation: s
|
|
12
11
|
};
|
|
13
|
-
},
|
|
14
|
-
Object.entries(
|
|
15
|
-
Object.entries(h ?? {}).forEach(([
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const { tag: y } = m(s, u);
|
|
22
|
-
(g = s.get(u)) == null || g.entries.push(x(t, n, f, y, e, c));
|
|
12
|
+
}, a = (s, t, r, c) => {
|
|
13
|
+
Object.entries(s.paths ?? {}).forEach(([f, h]) => {
|
|
14
|
+
Object.entries(h ?? {}).forEach(([e, n]) => {
|
|
15
|
+
if (!(n["x-internal"] || n["x-scalar-ignore"] || !m.has(e)))
|
|
16
|
+
if (n.tags?.length)
|
|
17
|
+
n.tags.forEach((u) => {
|
|
18
|
+
const { tag: g } = l(t, u);
|
|
19
|
+
t.get(u)?.entries.push(E(n, e, f, g, r, c));
|
|
23
20
|
});
|
|
24
21
|
else {
|
|
25
|
-
const { tag: u } =
|
|
26
|
-
|
|
22
|
+
const { tag: u } = l(t, "default");
|
|
23
|
+
t.get("default")?.entries.push(E(n, e, f, u, r, c));
|
|
27
24
|
}
|
|
28
25
|
});
|
|
29
26
|
});
|
|
30
27
|
};
|
|
31
28
|
export {
|
|
32
|
-
|
|
29
|
+
a as traversePaths
|
|
33
30
|
};
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { getTag as
|
|
2
|
-
const
|
|
3
|
-
const o =
|
|
4
|
-
return
|
|
1
|
+
import { getTag as f } from "./get-tag.js";
|
|
2
|
+
const g = (e, s = "Unkown", r, c, n) => {
|
|
3
|
+
const o = c({ name: s }, n), t = "title" in e && typeof e.title == "string" ? e.title : s;
|
|
4
|
+
return r.set(o, t), {
|
|
5
5
|
id: o,
|
|
6
|
-
title:
|
|
6
|
+
title: t,
|
|
7
7
|
name: s,
|
|
8
8
|
schema: e
|
|
9
9
|
};
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
const t
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(f = s.get(a)) == null || f.entries.push(h(t[n], n, c, i, l));
|
|
18
|
-
}) : o.push(h(t[n], n, c, i)));
|
|
10
|
+
}, l = (e, s, r, c) => {
|
|
11
|
+
const n = e.components?.schemas ?? {}, o = [];
|
|
12
|
+
for (const t in n)
|
|
13
|
+
n[t]["x-internal"] || n[t]["x-scalar-ignore"] || !Object.hasOwn(n, t) || (n[t]["x-tags"]?.length ? n[t]["x-tags"].forEach((i) => {
|
|
14
|
+
const { tag: a } = f(s, i);
|
|
15
|
+
s.get(i)?.entries.push(g(n[t], t, r, c, a));
|
|
16
|
+
}) : o.push(g(n[t], t, r, c)));
|
|
19
17
|
return o;
|
|
20
18
|
};
|
|
21
19
|
export {
|
|
22
|
-
|
|
20
|
+
l as traverseSchemas
|
|
23
21
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getTag as
|
|
2
|
-
const
|
|
1
|
+
import { getTag as i } from "./get-tag.js";
|
|
2
|
+
const E = (e, r, t = "Unknown", n, c, h) => {
|
|
3
3
|
const g = e.summary || t, o = c({ name: t, method: r }, h);
|
|
4
4
|
return n.set(o, g), {
|
|
5
5
|
id: o,
|
|
@@ -8,19 +8,17 @@ const i = (e, r, t = "Unknown", n, c, h) => {
|
|
|
8
8
|
webhook: e,
|
|
9
9
|
method: r
|
|
10
10
|
};
|
|
11
|
-
},
|
|
11
|
+
}, l = (e, r, t, n) => {
|
|
12
12
|
const c = [];
|
|
13
13
|
return Object.entries(e.webhooks ?? {}).forEach(([h, g]) => {
|
|
14
14
|
Object.entries(g ?? {}).forEach(([u, s]) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(b = r.get(E)) == null || b.entries.push(i(s, u, h, t, n, k));
|
|
20
|
-
}) : c.push(i(s, u, h, t, n)));
|
|
15
|
+
s["x-internal"] || s["x-scalar-ignore"] || (s.tags?.length ? s.tags.forEach((f) => {
|
|
16
|
+
const { tag: b } = i(r, f);
|
|
17
|
+
r.get(f)?.entries.push(E(s, u, h, t, n, b));
|
|
18
|
+
}) : c.push(E(s, u, h, t, n)));
|
|
21
19
|
});
|
|
22
20
|
}), c;
|
|
23
21
|
};
|
|
24
22
|
export {
|
|
25
|
-
|
|
23
|
+
l as traverseWebhooks
|
|
26
24
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { lazyBus as
|
|
1
|
+
import { lazyBus as m, hasLazyLoaded as a } from "../components/Lazy/lazyBus.js";
|
|
2
2
|
import { useNavState as v } from "./useNavState.js";
|
|
3
|
-
import { freezeAtTop as
|
|
4
|
-
import { ref as
|
|
3
|
+
import { freezeAtTop as z } from "@scalar/helpers/dom/freeze-at-top";
|
|
4
|
+
import { ref as p } from "vue";
|
|
5
5
|
const T = 25, d = 500, I = () => {
|
|
6
|
-
const { hash:
|
|
7
|
-
|
|
6
|
+
const { hash: i, isIntersectionEnabled: c } = v(), e = p(/* @__PURE__ */ new Set()), f = z(i.value), l = () => {
|
|
7
|
+
f?.(), a.value = !0, c.value = !0;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
if (!
|
|
11
|
-
let
|
|
12
|
-
const
|
|
9
|
+
m.on(({ loading: t, loaded: o, save: s }) => {
|
|
10
|
+
if (!a.value && (t && s && e.value.add(t), o && s && e.value.delete(o), e.value.size === 0)) {
|
|
11
|
+
let n = Date.now();
|
|
12
|
+
const r = () => {
|
|
13
13
|
const u = Date.now();
|
|
14
14
|
if (e.value.size === 0) {
|
|
15
|
-
if (u -
|
|
16
|
-
|
|
15
|
+
if (u - n >= d) {
|
|
16
|
+
l();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
} else
|
|
20
|
-
|
|
21
|
-
setTimeout(
|
|
20
|
+
n = u;
|
|
21
|
+
setTimeout(r, T);
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
r();
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
};
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
import { useConfig as b } from "./useConfig.js";
|
|
2
|
-
import { combineUrlAndPath as
|
|
3
|
-
import { slug as
|
|
4
|
-
import { inject as
|
|
5
|
-
const
|
|
6
|
-
const { isIntersectionEnabled:
|
|
7
|
-
isIntersectionEnabled:
|
|
8
|
-
hash:
|
|
9
|
-
hashPrefix:
|
|
10
|
-
}), t =
|
|
11
|
-
var a;
|
|
2
|
+
import { combineUrlAndPath as h } from "@scalar/helpers/url/merge-urls";
|
|
3
|
+
import { slug as s } from "github-slugger";
|
|
4
|
+
import { inject as R, ref as i } from "vue";
|
|
5
|
+
const k = Symbol(), y = i(!1), P = i(""), U = i(""), M = (d) => {
|
|
6
|
+
const { isIntersectionEnabled: f, hash: r, hashPrefix: u } = R(k, {
|
|
7
|
+
isIntersectionEnabled: y,
|
|
8
|
+
hash: P,
|
|
9
|
+
hashPrefix: U
|
|
10
|
+
}), t = d ?? b(), c = (e) => {
|
|
12
11
|
if (!t.value.pathRouting)
|
|
13
12
|
return "";
|
|
14
|
-
const n = new RegExp("^" +
|
|
13
|
+
const n = new RegExp("^" + t.value.pathRouting?.basePath + "/?");
|
|
15
14
|
return decodeURIComponent(e.replace(n, ""));
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return n || a || o;
|
|
15
|
+
}, p = (e = r.value) => {
|
|
16
|
+
const n = e.match(/(tag\/[^/]+)/)?.[0], o = e.startsWith("model") ? "models" : "", a = e.startsWith("webhook") ? "webhooks" : "";
|
|
17
|
+
return n || o || a;
|
|
20
18
|
}, g = () => t.value.pathRouting ? c(window.location.pathname) : (
|
|
21
19
|
// Must remove the prefix from the hash as the internal hash value should be pure
|
|
22
20
|
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(u.value.length)
|
|
23
|
-
), m = () => r.value = g(),
|
|
24
|
-
const a = new URL(n);
|
|
25
|
-
t.value.pathRouting ? a.pathname = d(t.value.pathRouting.basePath, e) : a.hash = u.value + e, r.value = e, window.history.replaceState({}, "", a);
|
|
26
|
-
}, I = (e, n = window.location.href, a = window.location.search) => {
|
|
21
|
+
), m = () => r.value = g(), v = (e, n = window.location.href) => {
|
|
27
22
|
const o = new URL(n);
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
23
|
+
t.value.pathRouting ? o.pathname = h(t.value.pathRouting.basePath, e) : o.hash = u.value + e, r.value = e, window.history.replaceState({}, "", o);
|
|
24
|
+
}, $ = (e, n = window.location.href, o = window.location.search) => {
|
|
25
|
+
const a = new URL(n);
|
|
26
|
+
return t.value.pathRouting ? a.pathname = h(t.value.pathRouting.basePath, e) : a.hash = u.value + e, a.search = o, a.toString();
|
|
27
|
+
}, w = (e = r.value) => `${u.value}${e}`, I = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", S = (e, n) => {
|
|
28
|
+
if (!e?.name)
|
|
31
29
|
return "models";
|
|
32
|
-
const
|
|
33
|
-
return typeof t.value.generateModelSlug == "function" ? `${
|
|
34
|
-
},
|
|
30
|
+
const o = n ? `${l(n)}/` : "";
|
|
31
|
+
return typeof t.value.generateModelSlug == "function" ? `${o}model/${t.value.generateModelSlug(e)}` : `${o}model/${s(e.name)}`;
|
|
32
|
+
}, l = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${s(e.name ?? "")}`;
|
|
35
33
|
return {
|
|
36
34
|
hash: r,
|
|
37
35
|
/** Sets the prefix for the hash */
|
|
@@ -50,35 +48,35 @@ const P = Symbol(), U = l(!1), x = l(""), k = l(""), T = (f) => {
|
|
|
50
48
|
* @param url The url to get the hashed url from
|
|
51
49
|
* @returns The hashed url
|
|
52
50
|
*/
|
|
53
|
-
getHashedUrl:
|
|
51
|
+
getHashedUrl: $,
|
|
54
52
|
/**
|
|
55
53
|
* Replaces the URL state with the new url and hash
|
|
56
54
|
* Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
|
|
57
55
|
*/
|
|
58
|
-
replaceUrlState:
|
|
56
|
+
replaceUrlState: v,
|
|
59
57
|
getReferenceId: g,
|
|
60
58
|
getWebhookId: (e, n) => {
|
|
61
|
-
if (!
|
|
59
|
+
if (!e?.name)
|
|
62
60
|
return "webhooks";
|
|
63
|
-
const
|
|
64
|
-
return typeof t.value.generateWebhookSlug == "function" ? `${
|
|
61
|
+
const o = n ? `${l(n)}/` : "";
|
|
62
|
+
return typeof t.value.generateWebhookSlug == "function" ? `${o}webhook/${t.value.generateWebhookSlug(e)}` : `${o}webhook/${e.method}/${s(e.name)}`;
|
|
65
63
|
},
|
|
66
|
-
getModelId:
|
|
67
|
-
getHeadingId:
|
|
68
|
-
getOperationId: (e, n) => typeof t.value.generateOperationSlug == "function" ? `${
|
|
64
|
+
getModelId: S,
|
|
65
|
+
getHeadingId: I,
|
|
66
|
+
getOperationId: (e, n) => typeof t.value.generateOperationSlug == "function" ? `${l(n)}/${t.value.generateOperationSlug({
|
|
69
67
|
path: e.path,
|
|
70
68
|
operationId: e.operationId,
|
|
71
69
|
method: e.method,
|
|
72
70
|
summary: e.summary
|
|
73
|
-
})}` : `${
|
|
71
|
+
})}` : `${l(n)}/${e.method}${e.path}`,
|
|
74
72
|
getPathRoutingId: c,
|
|
75
|
-
getSectionId:
|
|
76
|
-
getTagId:
|
|
77
|
-
isIntersectionEnabled:
|
|
73
|
+
getSectionId: p,
|
|
74
|
+
getTagId: l,
|
|
75
|
+
isIntersectionEnabled: f,
|
|
78
76
|
updateHash: m
|
|
79
77
|
};
|
|
80
78
|
};
|
|
81
79
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
k as NAV_STATE_SYMBOL,
|
|
81
|
+
M as useNavState
|
|
84
82
|
};
|