@scalar/api-reference 1.28.33 → 1.29.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 +83 -0
- package/dist/browser/standalone.js +12818 -13331
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/components/Anchor/Anchor.vue.js +2 -2
- package/dist/components/Anchor/Anchor.vue2.js +24 -22
- package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +50 -50
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +5 -5
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts +1 -1
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +31 -32
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +21 -21
- package/dist/components/Content/Lazy/Loading.vue.js +22 -22
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +17 -17
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
- package/dist/components/Content/Models/ModelsAccordion.vue2.js +14 -14
- package/dist/components/Content/Schema/Schema.preview.d.ts +98 -15
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- 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 +2 -1
- package/dist/components/Content/Schema/{SchemaDiscriminator.vue.d.ts → SchemaComposition.vue.d.ts} +3 -2
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.js +187 -0
- package/dist/components/Content/Schema/SchemaComposition.vue2.js +4 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
- 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 +31 -30
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts +0 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +8 -9
- 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 +165 -146
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +50 -40
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts +3 -2
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +13 -13
- package/dist/components/Content/Schema/helpers/schema-composition.d.ts +12 -0
- package/dist/components/Content/Schema/helpers/schema-composition.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/schema-composition.js +8 -0
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +4 -0
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +1 -0
- package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
- package/dist/components/Content/Tag/TagAccordion.vue.js +2 -2
- package/dist/components/Content/Tag/TagAccordion.vue2.js +10 -10
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +8 -8
- package/dist/components/Content/Tag/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagSection.vue.js +2 -2
- package/dist/components/Content/Tag/TagSection.vue2.js +8 -8
- package/dist/components/GettingStarted.vue.d.ts +2 -2
- package/dist/components/Layouts/Layouts.vue.d.ts +3 -0
- package/dist/components/Layouts/Layouts.vue.d.ts.map +1 -1
- package/dist/components/Layouts/Layouts.vue.js +14 -23
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Layouts/ModernLayout.vue2.js +51 -45
- package/dist/components/MobileHeader.vue.js +3 -3
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue2.js +4 -4
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +6 -6
- package/dist/components/SingleApiReference.vue.d.ts +1 -0
- package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
- package/dist/components/SingleApiReference.vue.js +25 -22
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +3 -3
- package/dist/features/ApiClientModal/index.d.ts +1 -1
- package/dist/features/ApiClientModal/index.d.ts.map +1 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts +186 -146
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +11 -10
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue2.js +17 -17
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +12 -12
- package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -1
- package/dist/features/Operation/Webhooks.vue.js +2 -2
- package/dist/features/Operation/Webhooks.vue2.js +13 -13
- 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 +18 -18
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +38 -32
- package/dist/features/Operation/hooks/useResponses.d.ts +1 -0
- package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useResponses.js +13 -12
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +1 -1
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +2 -2
- package/dist/features/Search/SearchModal.vue2.js +1 -1
- package/dist/features/Search/useSearchIndex.d.ts +1 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +20 -21
- package/dist/helpers/{isMacOs.d.ts → is-mac-os.d.ts} +1 -1
- package/dist/helpers/is-mac-os.d.ts.map +1 -0
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +1 -1
- package/dist/helpers/{scrollToId.d.ts → scroll-to-id.d.ts} +1 -1
- package/dist/helpers/scroll-to-id.d.ts.map +1 -0
- package/dist/helpers/sleep.d.ts +0 -2
- package/dist/helpers/sleep.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +28 -28
- package/dist/hooks/useReactiveSpec.js +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +45 -49
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -43
- package/dist/legacy/fixtures/index.d.ts +1 -1
- package/dist/legacy/fixtures/index.d.ts.map +1 -1
- package/dist/legacy/helpers/index.d.ts +1 -1
- package/dist/legacy/helpers/index.d.ts.map +1 -1
- package/dist/libs/download.d.ts +9 -0
- package/dist/libs/download.d.ts.map +1 -0
- package/dist/libs/download.js +19 -0
- package/dist/{helpers/getLowestHeadingLevel.d.ts → libs/markdown.d.ts} +5 -1
- package/dist/libs/markdown.d.ts.map +1 -0
- package/dist/libs/markdown.js +18 -0
- package/dist/libs/openapi.d.ts +56 -0
- package/dist/libs/openapi.d.ts.map +1 -0
- package/dist/libs/openapi.js +102 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -45
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -27
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +0 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +0 -167
- package/dist/esm.js +0 -34
- package/dist/helpers/createEmptySpecification.d.ts +0 -8
- package/dist/helpers/createEmptySpecification.d.ts.map +0 -1
- package/dist/helpers/createEmptySpecification.js +0 -27
- package/dist/helpers/deepMerge.d.ts +0 -5
- package/dist/helpers/deepMerge.d.ts.map +0 -1
- package/dist/helpers/deepMerge.js +0 -8
- package/dist/helpers/generateParameters.d.ts +0 -6
- package/dist/helpers/generateParameters.d.ts.map +0 -1
- package/dist/helpers/get-request.d.ts +0 -59
- package/dist/helpers/get-request.d.ts.map +0 -1
- package/dist/helpers/getHeadingsFromMarkdown.d.ts +0 -6
- package/dist/helpers/getHeadingsFromMarkdown.d.ts.map +0 -1
- package/dist/helpers/getHeadingsFromMarkdown.js +0 -13
- package/dist/helpers/getLowestHeadingLevel.d.ts.map +0 -1
- package/dist/helpers/getLowestHeadingLevel.js +0 -7
- package/dist/helpers/getModels.d.ts +0 -7
- package/dist/helpers/getModels.d.ts.map +0 -1
- package/dist/helpers/getModels.js +0 -22
- package/dist/helpers/getVariableNames.d.ts +0 -5
- package/dist/helpers/getVariableNames.d.ts.map +0 -1
- package/dist/helpers/hasModels.d.ts +0 -3
- package/dist/helpers/hasModels.d.ts.map +0 -1
- package/dist/helpers/hasModels.js +0 -5
- package/dist/helpers/hasSecuritySchemes.d.ts +0 -3
- package/dist/helpers/hasSecuritySchemes.d.ts.map +0 -1
- package/dist/helpers/hasWebhooks.d.ts +0 -3
- package/dist/helpers/hasWebhooks.d.ts.map +0 -1
- package/dist/helpers/hasWebhooks.js +0 -4
- package/dist/helpers/index.d.ts +0 -17
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/isMacOs.d.ts.map +0 -1
- package/dist/helpers/mapFromObject.d.ts +0 -8
- package/dist/helpers/mapFromObject.d.ts.map +0 -1
- package/dist/helpers/mergeAllObjects.d.ts +0 -5
- package/dist/helpers/mergeAllObjects.d.ts.map +0 -1
- package/dist/helpers/scrollToId.d.ts.map +0 -1
- package/dist/helpers/specDownloads.d.ts +0 -7
- package/dist/helpers/specDownloads.d.ts.map +0 -1
- package/dist/helpers/specDownloads.js +0 -19
- package/dist/helpers/specHelpers.d.ts +0 -16
- package/dist/helpers/specHelpers.d.ts.map +0 -1
- package/dist/helpers/specHelpers.js +0 -36
- package/dist/helpers/waitFor.d.ts +0 -5
- package/dist/helpers/waitFor.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -5
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts +0 -5
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts.map +0 -1
- package/dist/legacy/index.d.ts +0 -5
- package/dist/legacy/index.d.ts.map +0 -1
- package/dist/legacy/types.d.ts +0 -94
- package/dist/legacy/types.d.ts.map +0 -1
- package/dist/libs/operation.d.ts +0 -15
- package/dist/libs/operation.d.ts.map +0 -1
- package/dist/libs/operation.js +0 -16
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.d.ts.map +0 -1
- /package/dist/helpers/{isMacOs.js → is-mac-os.js} +0 -0
- /package/dist/helpers/{scrollToId.js → scroll-to-id.js} +0 -0
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import { useConfig as b } from "./useConfig.js";
|
|
2
|
-
import { combineUrlAndPath as
|
|
2
|
+
import { combineUrlAndPath as d } from "@scalar/oas-utils/helpers";
|
|
3
3
|
import { slug as i } from "github-slugger";
|
|
4
4
|
import { inject as y, ref as l } from "vue";
|
|
5
|
-
const
|
|
6
|
-
const { isIntersectionEnabled:
|
|
7
|
-
isIntersectionEnabled:
|
|
5
|
+
const P = Symbol(), U = l(!1), k = l(""), x = l(""), T = (f) => {
|
|
6
|
+
const { isIntersectionEnabled: p, hash: r, hashPrefix: u } = y(P, {
|
|
7
|
+
isIntersectionEnabled: U,
|
|
8
8
|
hash: k,
|
|
9
9
|
hashPrefix: x
|
|
10
|
-
}), t =
|
|
10
|
+
}), t = f ?? b(), g = (e) => {
|
|
11
11
|
var n;
|
|
12
12
|
if (!t.value.pathRouting)
|
|
13
13
|
return "";
|
|
14
14
|
const a = new RegExp("^" + ((n = t.value.pathRouting) == null ? void 0 : n.basePath) + "/?");
|
|
15
15
|
return decodeURIComponent(e.replace(a, ""));
|
|
16
|
-
},
|
|
16
|
+
}, v = (e = r.value) => {
|
|
17
17
|
var h;
|
|
18
|
-
const a = (h = e.match(/(tag\/[^/]+)/)) == null ? void 0 : h[0], n = e.startsWith("model") ? "models" : "",
|
|
19
|
-
return a || n ||
|
|
20
|
-
},
|
|
18
|
+
const a = (h = e.match(/(tag\/[^/]+)/)) == null ? void 0 : h[0], n = e.startsWith("model") ? "models" : "", o = e.startsWith("webhook") ? "webhooks" : "";
|
|
19
|
+
return a || n || o;
|
|
20
|
+
}, c = () => t.value.pathRouting ? g(window.location.pathname) : (
|
|
21
21
|
// Must remove the prefix from the hash as the internal hash value should be pure
|
|
22
|
-
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(
|
|
23
|
-
), m = () =>
|
|
22
|
+
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(u.value.length)
|
|
23
|
+
), m = () => r.value = c(), I = (e, a = window.location.href) => {
|
|
24
24
|
const n = new URL(a);
|
|
25
|
-
t.value.pathRouting ? n.pathname =
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
},
|
|
25
|
+
t.value.pathRouting ? n.pathname = d(t.value.pathRouting.basePath, e) : n.hash = u.value + e, r.value = e, window.history.replaceState({}, "", n);
|
|
26
|
+
}, w = (e, a = window.location.href, n = window.location.search) => {
|
|
27
|
+
const o = new URL(a);
|
|
28
|
+
return t.value.pathRouting ? o.pathname = d(t.value.pathRouting.basePath, e) : o.hash = u.value + e, o.search = n, o.toString();
|
|
29
|
+
}, S = (e = r.value) => `${u.value}${e}`, $ = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", R = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${i(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${i(e.name)}`;
|
|
30
30
|
return {
|
|
31
|
-
hash:
|
|
31
|
+
hash: r,
|
|
32
32
|
/** Sets the prefix for the hash */
|
|
33
33
|
setHashPrefix: (e) => {
|
|
34
|
-
|
|
34
|
+
u.value = e;
|
|
35
35
|
},
|
|
36
36
|
/**
|
|
37
37
|
* Gets the full hash with the prefix
|
|
38
38
|
* @param hashTarget The hash to target with the return
|
|
39
39
|
* @returns The full hash
|
|
40
40
|
*/
|
|
41
|
-
getFullHash:
|
|
41
|
+
getFullHash: S,
|
|
42
42
|
/**
|
|
43
43
|
* Gets the hashed url with the prefix
|
|
44
44
|
* @param replacementHash The hash to replace the current hash with
|
|
45
45
|
* @param url The url to get the hashed url from
|
|
46
46
|
* @returns The hashed url
|
|
47
47
|
*/
|
|
48
|
-
getHashedUrl:
|
|
48
|
+
getHashedUrl: w,
|
|
49
49
|
/**
|
|
50
50
|
* Replaces the URL state with the new url and hash
|
|
51
51
|
* Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
|
|
52
52
|
*/
|
|
53
|
-
replaceUrlState:
|
|
54
|
-
getReferenceId:
|
|
53
|
+
replaceUrlState: I,
|
|
54
|
+
getReferenceId: c,
|
|
55
55
|
getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${i(e.name)}` : "webhooks",
|
|
56
|
-
getModelId:
|
|
57
|
-
getHeadingId:
|
|
56
|
+
getModelId: R,
|
|
57
|
+
getHeadingId: $,
|
|
58
58
|
getOperationId: (e, a) => {
|
|
59
59
|
var n;
|
|
60
60
|
return typeof t.value.generateOperationSlug == "function" ? `${s(a)}/${t.value.generateOperationSlug({
|
|
@@ -64,14 +64,14 @@ const U = Symbol(), P = l(!1), k = l(""), x = l(""), T = (d) => {
|
|
|
64
64
|
summary: (n = e.information) == null ? void 0 : n.summary
|
|
65
65
|
})}` : `${s(a)}/${e.httpVerb}${e.path}`;
|
|
66
66
|
},
|
|
67
|
-
getPathRoutingId:
|
|
68
|
-
getSectionId:
|
|
67
|
+
getPathRoutingId: g,
|
|
68
|
+
getSectionId: v,
|
|
69
69
|
getTagId: s,
|
|
70
|
-
isIntersectionEnabled:
|
|
70
|
+
isIntersectionEnabled: p,
|
|
71
71
|
updateHash: m
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
export {
|
|
75
|
-
|
|
75
|
+
P as NAV_STATE_SYMBOL,
|
|
76
76
|
T as useNavState
|
|
77
77
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchDocument as l, prettyPrintJson as d } from "@scalar/oas-utils/helpers";
|
|
2
2
|
import { ref as s, watch as u, toValue as f } from "vue";
|
|
3
3
|
import { parse as h } from "../helpers/parse.js";
|
|
4
|
-
import { createEmptySpecification as m } from "../
|
|
4
|
+
import { createEmptySpecification as m } from "../libs/openapi.js";
|
|
5
5
|
const v = async ({ url: a, content: e }, r) => {
|
|
6
6
|
if (a) {
|
|
7
7
|
const i = performance.now();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,E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AE,gBAAgB,GAAG,YAAY;;;;;;;;;;;;;qCAtBrB,MAAM,UAAU,OAAO;EA8FrE"}
|
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { hasModels as te } from "../helpers/hasModels.js";
|
|
10
|
-
import { getModels as N } from "../helpers/getModels.js";
|
|
11
|
-
import { hasWebhooks as se } from "../helpers/hasWebhooks.js";
|
|
12
|
-
const re = "introduction", O = w(null), c = w(void 0), g = z({});
|
|
1
|
+
import { lazyBus as Y } from "../components/Content/Lazy/lazyBus.js";
|
|
2
|
+
import { scrollToId as F } from "../helpers/scroll-to-id.js";
|
|
3
|
+
import { useNavState as Z } from "./useNavState.js";
|
|
4
|
+
import { getHeadingsFromMarkdown as $, getLowestHeadingLevel as z } from "../libs/markdown.js";
|
|
5
|
+
import { isOperationDeprecated as U, hasModels as ee, getModels as _, hasWebhooks as te } from "../libs/openapi.js";
|
|
6
|
+
import { ssrState as se } from "@scalar/oas-utils/helpers";
|
|
7
|
+
import { reactive as P, ref as w, watch as N, computed as q } from "vue";
|
|
8
|
+
const re = "introduction", O = w(null), c = w(void 0), g = P({});
|
|
13
9
|
function R(t) {
|
|
14
10
|
var p, s, l;
|
|
15
11
|
g.tagsSorter === "alpha" ? t.tags = (p = t.tags) == null ? void 0 : p.sort((r, n) => r.name.localeCompare(n.name)) : typeof g.tagsSorter == "function" && (t.tags = (s = t.tags) == null ? void 0 : s.sort(g.tagsSorter));
|
|
@@ -23,7 +19,7 @@ function R(t) {
|
|
|
23
19
|
r.operations = (n = r.operations) == null ? void 0 : n.sort(d);
|
|
24
20
|
})), c.value = t;
|
|
25
21
|
}
|
|
26
|
-
const J = w(!1), K = w(!1), y =
|
|
22
|
+
const J = w(!1), K = w(!1), y = P(se["useSidebarContent-collapsedSidebarItems"] ?? {});
|
|
27
23
|
function oe(t) {
|
|
28
24
|
y[t] = !y[t];
|
|
29
25
|
}
|
|
@@ -32,14 +28,14 @@ function I(t, a) {
|
|
|
32
28
|
}
|
|
33
29
|
const x = w([]);
|
|
34
30
|
function ae(t) {
|
|
35
|
-
const a =
|
|
31
|
+
const a = $(t), i = z(a);
|
|
36
32
|
return a.filter((d) => (
|
|
37
33
|
// highest level, eg. # Introduction
|
|
38
34
|
d.depth === i || // second highest level, eg. ## Authentication
|
|
39
35
|
d.depth === i + 1
|
|
40
36
|
));
|
|
41
37
|
}
|
|
42
|
-
const Q =
|
|
38
|
+
const Q = q(() => {
|
|
43
39
|
var M, C, E, B, D, L, j, G, V, W;
|
|
44
40
|
if (!O.value)
|
|
45
41
|
return { entries: [], titles: {} };
|
|
@@ -47,7 +43,7 @@ const Q = P(() => {
|
|
|
47
43
|
let r = null;
|
|
48
44
|
x.value.forEach((e) => {
|
|
49
45
|
var o;
|
|
50
|
-
e.depth ===
|
|
46
|
+
e.depth === z(x.value) ? (r = {
|
|
51
47
|
id: t(e),
|
|
52
48
|
title: e.value,
|
|
53
49
|
show: !0,
|
|
@@ -70,13 +66,13 @@ const Q = P(() => {
|
|
|
70
66
|
show: !0,
|
|
71
67
|
children: (o = e.operations) == null ? void 0 : o.map((u) => {
|
|
72
68
|
var v, b;
|
|
73
|
-
const
|
|
74
|
-
return s[
|
|
75
|
-
id:
|
|
76
|
-
title:
|
|
69
|
+
const f = i(u, e), h = u.name ?? u.path;
|
|
70
|
+
return s[f] = h, {
|
|
71
|
+
id: f,
|
|
72
|
+
title: h,
|
|
77
73
|
httpVerb: u.httpVerb,
|
|
78
74
|
// TODO: Workaround until we’re using the store directly
|
|
79
|
-
deprecated: u.information ?
|
|
75
|
+
deprecated: u.information ? U({
|
|
80
76
|
deprecated: (v = u.information) == null ? void 0 : v.deprecated,
|
|
81
77
|
"x-scalar-stability": (b = u.information) == null ? void 0 : b["x-scalar-stability"]
|
|
82
78
|
}) : !1,
|
|
@@ -87,52 +83,52 @@ const Q = P(() => {
|
|
|
87
83
|
})
|
|
88
84
|
};
|
|
89
85
|
}) : (L = n == null ? void 0 : n.operations) == null ? void 0 : L.map((e) => {
|
|
90
|
-
var
|
|
86
|
+
var f, h;
|
|
91
87
|
const o = i(e, n), u = e.name ?? e.path;
|
|
92
88
|
return s[o] = u, {
|
|
93
89
|
id: o,
|
|
94
90
|
title: u,
|
|
95
91
|
httpVerb: e.httpVerb,
|
|
96
92
|
// TODO: Workaround until we’re using the store directly
|
|
97
|
-
deprecated: e.information ?
|
|
98
|
-
deprecated: (
|
|
99
|
-
"x-scalar-stability": (
|
|
93
|
+
deprecated: e.information ? U({
|
|
94
|
+
deprecated: (f = e.information) == null ? void 0 : f.deprecated,
|
|
95
|
+
"x-scalar-stability": (h = e.information) == null ? void 0 : h["x-scalar-stability"]
|
|
100
96
|
}) : !1,
|
|
101
97
|
show: !0,
|
|
102
98
|
select: () => {
|
|
103
99
|
}
|
|
104
100
|
};
|
|
105
101
|
});
|
|
106
|
-
let S =
|
|
102
|
+
let S = ee(c.value) && !J.value ? [
|
|
107
103
|
{
|
|
108
104
|
id: a(),
|
|
109
105
|
title: "Models",
|
|
110
106
|
show: !0,
|
|
111
|
-
children: Object.keys(
|
|
107
|
+
children: Object.keys(_(c.value) ?? {}).map((e) => {
|
|
112
108
|
var u;
|
|
113
109
|
const o = a({ name: e });
|
|
114
110
|
return s[o] = e, {
|
|
115
111
|
id: o,
|
|
116
|
-
title: ((u =
|
|
112
|
+
title: ((u = _(c.value)) == null ? void 0 : u[e]).title ?? e,
|
|
117
113
|
show: !0
|
|
118
114
|
};
|
|
119
115
|
})
|
|
120
116
|
}
|
|
121
|
-
] : [], k =
|
|
117
|
+
] : [], k = te(c.value) ? [
|
|
122
118
|
{
|
|
123
119
|
id: p(),
|
|
124
120
|
title: "Webhooks",
|
|
125
121
|
show: !0,
|
|
126
122
|
children: Object.keys(((j = c.value) == null ? void 0 : j.webhooks) ?? {}).flatMap((e) => {
|
|
127
|
-
var u,
|
|
123
|
+
var u, f;
|
|
128
124
|
const o = p({ name: e });
|
|
129
|
-
return s[o] = e, Object.keys(((
|
|
130
|
-
(
|
|
125
|
+
return s[o] = e, Object.keys(((f = (u = c.value) == null ? void 0 : u.webhooks) == null ? void 0 : f[e]) ?? {}).map(
|
|
126
|
+
(h) => {
|
|
131
127
|
var v, b, A;
|
|
132
128
|
return {
|
|
133
|
-
id: p({ name: e, method:
|
|
134
|
-
title: (A = (b = (v = c.value) == null ? void 0 : v.webhooks) == null ? void 0 : b[e][
|
|
135
|
-
httpVerb:
|
|
129
|
+
id: p({ name: e, method: h }),
|
|
130
|
+
title: (A = (b = (v = c.value) == null ? void 0 : v.webhooks) == null ? void 0 : b[e][h]) == null ? void 0 : A.name,
|
|
131
|
+
httpVerb: h,
|
|
136
132
|
show: !0
|
|
137
133
|
};
|
|
138
134
|
}
|
|
@@ -141,15 +137,15 @@ const Q = P(() => {
|
|
|
141
137
|
}
|
|
142
138
|
] : [];
|
|
143
139
|
const X = (G = c.value) != null && G["x-tagGroups"] ? (W = (V = c.value) == null ? void 0 : V["x-tagGroups"]) == null ? void 0 : W.map((e) => {
|
|
144
|
-
var
|
|
140
|
+
var f;
|
|
145
141
|
const o = [];
|
|
146
|
-
return (
|
|
147
|
-
if (
|
|
142
|
+
return (f = e.tags) == null || f.map((h) => {
|
|
143
|
+
if (h === "models" && S.length > 0)
|
|
148
144
|
o.push(S[0]), S = [];
|
|
149
|
-
else if (
|
|
145
|
+
else if (h === "webhooks" && k.length > 0)
|
|
150
146
|
o.push(k[0]), k = [];
|
|
151
147
|
else {
|
|
152
|
-
const v = m == null ? void 0 : m.find((b) => b.title ===
|
|
148
|
+
const v = m == null ? void 0 : m.find((b) => b.title === h);
|
|
153
149
|
v && o.push(v);
|
|
154
150
|
}
|
|
155
151
|
}), {
|
|
@@ -171,7 +167,7 @@ const Q = P(() => {
|
|
|
171
167
|
entries: H,
|
|
172
168
|
titles: s
|
|
173
169
|
};
|
|
174
|
-
}), ie = w(!1), le =
|
|
170
|
+
}), ie = w(!1), le = q(() => {
|
|
175
171
|
var t, a, i;
|
|
176
172
|
return ((i = (t = Q.value) == null ? void 0 : t.titles) == null ? void 0 : i[((a = O.value) == null ? void 0 : a.hash) ?? ""]) ?? "";
|
|
177
173
|
}), ne = (t, a) => {
|
|
@@ -179,20 +175,20 @@ const Q = P(() => {
|
|
|
179
175
|
const i = (d = O.value) == null ? void 0 : d.getSectionId(t);
|
|
180
176
|
if (i && i !== t)
|
|
181
177
|
if (y[i])
|
|
182
|
-
|
|
178
|
+
F(t, a);
|
|
183
179
|
else {
|
|
184
|
-
const p =
|
|
185
|
-
s.id === t && (
|
|
180
|
+
const p = Y.on((s) => {
|
|
181
|
+
s.id === t && (F(t, a), p());
|
|
186
182
|
});
|
|
187
183
|
I(i, !0);
|
|
188
184
|
}
|
|
189
185
|
};
|
|
190
|
-
function
|
|
186
|
+
function ve(t) {
|
|
191
187
|
Object.assign(g, t);
|
|
192
|
-
const a =
|
|
188
|
+
const a = Z();
|
|
193
189
|
O.value = a;
|
|
194
190
|
const { hash: i, getSectionId: d, getTagId: p } = a;
|
|
195
|
-
return t != null && t.parsedSpec && (R(t.parsedSpec),
|
|
191
|
+
return t != null && t.parsedSpec && (R(t.parsedSpec), N(
|
|
196
192
|
() => {
|
|
197
193
|
var s, l;
|
|
198
194
|
return (l = (s = c.value) == null ? void 0 : s.tags) == null ? void 0 : l.length;
|
|
@@ -207,7 +203,7 @@ function we(t) {
|
|
|
207
203
|
r && I(p(r), !0);
|
|
208
204
|
}
|
|
209
205
|
}
|
|
210
|
-
),
|
|
206
|
+
), N(
|
|
211
207
|
() => {
|
|
212
208
|
var s, l;
|
|
213
209
|
return (l = (s = c.value) == null ? void 0 : s.info) == null ? void 0 : l.description;
|
|
@@ -247,5 +243,5 @@ function we(t) {
|
|
|
247
243
|
export {
|
|
248
244
|
re as DEFAULT_INTRODUCTION_SLUG,
|
|
249
245
|
ne as scrollToOperation,
|
|
250
|
-
|
|
246
|
+
ve as useSidebar
|
|
251
247
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as ApiReference } from './components/ApiReference.vue.js';
|
|
2
|
+
export { default as SingleApiReference } from './components/SingleApiReference.vue.js';
|
|
2
3
|
export { default as ApiReferenceLayout } from './components/ApiReferenceLayout.vue.js';
|
|
3
4
|
export { default as ModernLayout } from './components/Layouts/ModernLayout.vue.js';
|
|
4
5
|
export { SearchButton, SearchModal } from './features/Search';
|
|
@@ -9,10 +10,9 @@ export { Sidebar } from './components/Sidebar';
|
|
|
9
10
|
export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
|
|
10
11
|
export { Layouts } from './components/Layouts';
|
|
11
12
|
export { parse } from './helpers/parse.js';
|
|
12
|
-
export { createEmptySpecification } from './
|
|
13
|
+
export { createEmptySpecification } from './libs/openapi.js';
|
|
13
14
|
export { useNavState } from './hooks/useNavState.js';
|
|
14
15
|
export { useSidebar } from './hooks/useSidebar.js';
|
|
15
16
|
export { useHttpClientStore } from './stores/useHttpClientStore.js';
|
|
16
|
-
export type { ApiReferenceConfiguration, ReferenceProps,
|
|
17
|
-
export { createScalarReferences } from './esm.js';
|
|
17
|
+
export type { ApiReferenceConfiguration, ReferenceProps, } from './types';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,WA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