@scalar/api-reference 1.35.5 → 1.35.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/browser/standalone.js +18150 -18465
- 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/LinkList/LinkList.vue.js +1 -1
- package/dist/components/LoadingSkeleton.vue.js +1 -1
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.js +3 -3
- package/dist/components/MobileHeader.vue2.js +13 -12
- package/dist/components/OperationPath.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue2.js +45 -51
- package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
- package/dist/components/ScreenReader.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue.js +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/Section.vue2.js +13 -14
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue2.js +29 -30
- package/dist/components/Section/SectionColumn.vue.js +1 -1
- package/dist/components/Section/SectionColumns.vue.js +1 -1
- package/dist/components/Section/SectionContainer.vue.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +1 -1
- package/dist/components/Section/SectionContent.vue.js +1 -1
- package/dist/components/Section/SectionHeader.vue.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
- package/dist/components/SectionFlare/SectionFlare.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue2.js +12 -13
- package/dist/features/Operation/Operation.vue.js +31 -36
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +8 -11
- package/dist/features/Operation/components/ParameterList.vue.js +21 -24
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +36 -37
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue2.js +45 -52
- package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +32 -35
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +4 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +114 -119
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +3 -3
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +87 -89
- package/dist/features/Search/components/SearchButton.vue.js +23 -25
- package/dist/features/Search/components/SearchModal.vue.js +1 -1
- package/dist/features/Search/components/SearchModal.vue2.js +53 -54
- package/dist/features/api-client-modal/ApiClientModal.vue.js +31 -38
- package/dist/features/document-source/hooks/useDocumentFetcher.js +17 -18
- package/dist/features/document-source/hooks/useDocumentSource.js +16 -16
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue2.js +23 -26
- package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue2.js +128 -153
- package/dist/features/info-object/Contact.vue.js +24 -27
- package/dist/features/info-object/License.vue.js +26 -29
- package/dist/features/multiple-documents/DocumentSelector.vue.js +22 -31
- package/dist/features/multiple-documents/useMultipleDocuments.js +52 -56
- package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/Sidebar.vue.js +3 -3
- package/dist/features/sidebar/components/Sidebar.vue2.js +74 -79
- package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue2.js +52 -53
- package/dist/features/sidebar/components/SidebarGroup.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue2.js +28 -31
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue2.js +1 -2
- package/dist/features/traverse-schema/helpers/traverse-description.js +13 -14
- package/dist/features/traverse-schema/helpers/traverse-document.js +14 -15
- package/dist/features/traverse-schema/helpers/traverse-paths.js +20 -23
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +13 -15
- package/dist/features/traverse-schema/helpers/traverse-webhooks.js +8 -10
- package/dist/hooks/useFreezing.js +14 -14
- package/dist/hooks/useNavState.js +37 -39
- package/dist/index.js +2 -2
- package/dist/libs/openapi.js +28 -31
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +68 -75
- package/dist/v2/ApiReferenceWorkspace.vue3.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +116 -135
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +40 -47
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +45 -46
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +109 -125
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +84 -84
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/update-scheme.js +12 -13
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +1 -4
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +77 -82
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue2.js +46 -49
- package/dist/v2/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +74 -89
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +24 -27
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +106 -119
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +11 -12
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +3 -3
- package/dist/v2/blocks/scalar-server-selector-block/components/Selector.vue.js +11 -14
- package/dist/v2/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +45 -48
- package/dist/v2/helpers/get-document-name.js +10 -10
- package/dist/v2/helpers/map-configuration.js +48 -51
- package/dist/v2/hooks/use-legacy-store-events.js +44 -48
- package/dist/v2/hooks/use-workspace-store-events.js +23 -26
- package/package.json +22 -22
- 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,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as $, ref as
|
|
1
|
+
import { defineComponent as $, ref as d, toRef as R, provide as N, useTemplateRef as w, onBeforeMount as I, watch as l, computed as L, createElementBlock as V, openBlock as k, createBlock as A, createCommentVNode as B, createVNode as C, unref as n, resolveDynamicComponent as P, withCtx as s, createTextVNode as U, toDisplayString as _, renderSlot as i, isRef as K } from "vue";
|
|
2
2
|
import { safeLocalStorage as F, REFERENCE_LS_KEYS as O } from "@scalar/helpers/object/local-storage";
|
|
3
3
|
import { makeUrlAbsolute as W } from "@scalar/helpers/url/make-url-absolute";
|
|
4
4
|
import { redirectToProxy as Y } from "@scalar/oas-utils/helpers";
|
|
@@ -22,24 +22,24 @@ const Ce = /* @__PURE__ */ $({
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["updateContent"],
|
|
24
24
|
setup(E) {
|
|
25
|
-
const
|
|
26
|
-
availableDocuments:
|
|
25
|
+
const c = E, {
|
|
26
|
+
availableDocuments: f,
|
|
27
27
|
selectedConfiguration: o,
|
|
28
|
-
selectedDocumentIndex:
|
|
29
|
-
isIntersectionEnabled:
|
|
28
|
+
selectedDocumentIndex: u,
|
|
29
|
+
isIntersectionEnabled: m,
|
|
30
30
|
hash: M,
|
|
31
31
|
hashPrefix: x
|
|
32
32
|
} = Z({
|
|
33
|
-
configuration: R(
|
|
34
|
-
isIntersectionEnabled:
|
|
35
|
-
hash:
|
|
36
|
-
hashPrefix:
|
|
33
|
+
configuration: R(c, "configuration"),
|
|
34
|
+
isIntersectionEnabled: d(!1),
|
|
35
|
+
hash: d(""),
|
|
36
|
+
hashPrefix: d("")
|
|
37
37
|
}), y = (e, t) => fetch(
|
|
38
38
|
Y(o.value.proxyUrl, e.toString()),
|
|
39
39
|
t
|
|
40
40
|
);
|
|
41
|
-
N(G, { isIntersectionEnabled:
|
|
42
|
-
const
|
|
41
|
+
N(G, { isIntersectionEnabled: m, hash: M, hashPrefix: x });
|
|
42
|
+
const p = w("root"), r = c.store;
|
|
43
43
|
I(() => {
|
|
44
44
|
const e = F().getItem(
|
|
45
45
|
O.SELECTED_CLIENT
|
|
@@ -47,15 +47,14 @@ const Ce = /* @__PURE__ */ $({
|
|
|
47
47
|
D(e) && !r.workspace["x-scalar-default-client"] && r.update("x-scalar-default-client", e);
|
|
48
48
|
});
|
|
49
49
|
const S = async (e) => {
|
|
50
|
-
var n;
|
|
51
50
|
const t = Q(e.content), a = J({
|
|
52
51
|
name: e.slug || e.title,
|
|
53
52
|
url: e.url,
|
|
54
53
|
document: t
|
|
55
54
|
});
|
|
56
55
|
if (r.workspace.documents[a]) {
|
|
57
|
-
t && (
|
|
58
|
-
|
|
56
|
+
t && (m.value = !1, r.replaceDocument(a, t), r.update("x-scalar-active-document", a), setTimeout(() => {
|
|
57
|
+
m.value = !0;
|
|
59
58
|
}, 300));
|
|
60
59
|
return;
|
|
61
60
|
}
|
|
@@ -69,13 +68,13 @@ const Ce = /* @__PURE__ */ $({
|
|
|
69
68
|
return await r.addDocument({
|
|
70
69
|
name: e.slug ?? "default",
|
|
71
70
|
url: W(e.url, {
|
|
72
|
-
basePath:
|
|
71
|
+
basePath: o.value.pathRouting?.basePath
|
|
73
72
|
}),
|
|
74
73
|
fetch: e.fetch ?? y,
|
|
75
74
|
config: g(e)
|
|
76
75
|
});
|
|
77
76
|
};
|
|
78
|
-
|
|
77
|
+
l(
|
|
79
78
|
[
|
|
80
79
|
() => o.value.slug,
|
|
81
80
|
() => o.value.url,
|
|
@@ -85,12 +84,12 @@ const Ce = /* @__PURE__ */ $({
|
|
|
85
84
|
(e || t || a) && S(o.value);
|
|
86
85
|
},
|
|
87
86
|
{ immediate: !0 }
|
|
88
|
-
), X(r,
|
|
87
|
+
), X(r, p), l(
|
|
89
88
|
() => o.value.defaultHttpClient,
|
|
90
89
|
(e) => {
|
|
91
90
|
if (e) {
|
|
92
|
-
const { targetKey: t, clientKey: a } = e,
|
|
93
|
-
D(
|
|
91
|
+
const { targetKey: t, clientKey: a } = e, v = `${t}/${a}`;
|
|
92
|
+
D(v) && r.update("x-scalar-default-client", v);
|
|
94
93
|
}
|
|
95
94
|
},
|
|
96
95
|
{ immediate: !0 }
|
|
@@ -99,70 +98,64 @@ const Ce = /* @__PURE__ */ $({
|
|
|
99
98
|
initialColorMode: o.value.darkMode ? "dark" : void 0,
|
|
100
99
|
overrideColorMode: o.value.forceDarkModeState
|
|
101
100
|
});
|
|
102
|
-
|
|
101
|
+
l(
|
|
103
102
|
() => o.value.darkMode,
|
|
104
103
|
(e) => r.update("x-scalar-dark-mode", !!e)
|
|
105
|
-
),
|
|
104
|
+
), l(
|
|
106
105
|
() => b.value,
|
|
107
106
|
(e) => r.update("x-scalar-dark-mode", e),
|
|
108
107
|
{ immediate: !0 }
|
|
109
|
-
),
|
|
110
|
-
() =>
|
|
111
|
-
(e) =>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(t = p.value[e]) == null ? void 0 : t.slug
|
|
116
|
-
);
|
|
117
|
-
},
|
|
108
|
+
), l(
|
|
109
|
+
() => u.value,
|
|
110
|
+
(e) => r.update(
|
|
111
|
+
"x-scalar-active-document",
|
|
112
|
+
f.value[e]?.slug
|
|
113
|
+
),
|
|
118
114
|
{ immediate: !0 }
|
|
119
115
|
), o.value.metaData && H(o.value.metaData);
|
|
120
116
|
const T = L(() => o.value.favicon);
|
|
121
|
-
return j(T), (e, t) => {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, 8, ["configuration", "isDark", "store"])
|
|
164
|
-
], 512);
|
|
165
|
-
};
|
|
117
|
+
return j(T), (e, t) => (k(), V("div", {
|
|
118
|
+
ref_key: "root",
|
|
119
|
+
ref: p
|
|
120
|
+
}, [
|
|
121
|
+
n(o)?.customCss ? (k(), A(P("style"), { key: 0 }, {
|
|
122
|
+
default: s(() => [
|
|
123
|
+
U(_(n(o).customCss), 1)
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
})) : B("", !0),
|
|
127
|
+
C(q, {
|
|
128
|
+
configuration: n(o),
|
|
129
|
+
isDark: !!n(r).workspace["x-scalar-dark-mode"],
|
|
130
|
+
store: n(r),
|
|
131
|
+
onToggleDarkMode: t[1] || (t[1] = () => n(h)()),
|
|
132
|
+
onUpdateContent: t[2] || (t[2] = (a) => e.$emit("updateContent", a))
|
|
133
|
+
}, {
|
|
134
|
+
"document-selector": s(() => [
|
|
135
|
+
C(n(ee), {
|
|
136
|
+
modelValue: n(u),
|
|
137
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => K(u) ? u.value = a : null),
|
|
138
|
+
options: n(f)
|
|
139
|
+
}, null, 8, ["modelValue", "options"])
|
|
140
|
+
]),
|
|
141
|
+
"content-start": s(() => [
|
|
142
|
+
i(e.$slots, "content-start")
|
|
143
|
+
]),
|
|
144
|
+
"content-end": s(() => [
|
|
145
|
+
i(e.$slots, "content-end")
|
|
146
|
+
]),
|
|
147
|
+
"sidebar-start": s(() => [
|
|
148
|
+
i(e.$slots, "sidebar-start")
|
|
149
|
+
]),
|
|
150
|
+
"sidebar-end": s(() => [
|
|
151
|
+
i(e.$slots, "sidebar-end")
|
|
152
|
+
]),
|
|
153
|
+
footer: s(() => [
|
|
154
|
+
i(e.$slots, "footer")
|
|
155
|
+
]),
|
|
156
|
+
_: 3
|
|
157
|
+
}, 8, ["configuration", "isDark", "store"])
|
|
158
|
+
], 512));
|
|
166
159
|
}
|
|
167
160
|
});
|
|
168
161
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ViewLayoutCollapse as
|
|
3
|
-
import { useLayout as
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import { getSecurityRequirements as
|
|
6
|
-
import { useModal as
|
|
7
|
-
import { safeLocalStorage as
|
|
8
|
-
import { ScalarIconCaretDown as
|
|
9
|
-
import { isDefined as
|
|
10
|
-
import { emitCustomEvent as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as N, useId as M, ref as x, computed as y, useTemplateRef as K, createBlock as D, openBlock as u, unref as n, withCtx as c, createVNode as m, createElementVNode as a, createElementBlock as h, Fragment as k, createTextVNode as C, toDisplayString as v, createCommentVNode as L, withModifiers as z, normalizeClass as j } from "vue";
|
|
2
|
+
import { ViewLayoutCollapse as W } from "@scalar/api-client/components/ViewLayout";
|
|
3
|
+
import { useLayout as Y } from "@scalar/api-client/hooks";
|
|
4
|
+
import { useWorkspace as F } from "@scalar/api-client/store";
|
|
5
|
+
import { getSecurityRequirements as H, formatComplexScheme as J, formatScheme as P, getSchemeOptions as G } from "@scalar/api-client/views/Request/libs";
|
|
6
|
+
import { useModal as Q, ScalarComboboxMultiselect as X, ScalarButton as Z, ScalarListboxCheckbox as _, ScalarIconButton as ee } from "@scalar/components";
|
|
7
|
+
import { safeLocalStorage as te, CLIENT_LS_KEYS as oe } from "@scalar/helpers/object/local-storage";
|
|
8
|
+
import { ScalarIconCaretDown as le, ScalarIconTrash as ne } from "@scalar/icons";
|
|
9
|
+
import { isDefined as re } from "@scalar/oas-utils/helpers";
|
|
10
|
+
import { emitCustomEvent as A } from "@scalar/workspace-store/events";
|
|
11
|
+
import ae from "./DeleteRequestAuthModal.vue.js";
|
|
12
|
+
import se from "./RequestAuthDataTable.vue.js";
|
|
13
|
+
const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1 truncate" }, Ae = /* @__PURE__ */ N({
|
|
14
14
|
__name: "AuthSelector",
|
|
15
15
|
props: {
|
|
16
16
|
collection: {},
|
|
@@ -24,168 +24,152 @@ const me = ["id"], pe = { class: "flex flex-1" }, de = { class: "min-w-0 flex-1
|
|
|
24
24
|
title: {},
|
|
25
25
|
workspace: {}
|
|
26
26
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const { layout:
|
|
27
|
+
setup(r) {
|
|
28
|
+
const { layout: w } = Y(), { securitySchemes: p } = F(), R = M(), S = x(null), d = Q(), b = x(
|
|
29
29
|
null
|
|
30
|
-
),
|
|
31
|
-
const t =
|
|
30
|
+
), V = x(!1), q = y(() => {
|
|
31
|
+
const t = H(r.operation, r.collection);
|
|
32
32
|
return { filteredRequirements: t.filter((o) => Object.keys(o).length), requirements: t };
|
|
33
|
-
}),
|
|
34
|
-
const { filteredRequirements: t, requirements: e } =
|
|
33
|
+
}), g = y(() => {
|
|
34
|
+
const { filteredRequirements: t, requirements: e } = q.value;
|
|
35
35
|
if (!e.length)
|
|
36
36
|
return null;
|
|
37
37
|
const l = !e.some(
|
|
38
|
-
(
|
|
38
|
+
(U) => Object.keys(U).length > 1
|
|
39
39
|
) && t.length < e.length;
|
|
40
40
|
return { icon: l ? "Unlock" : "Lock", text: l ? "Optional" : "Required" };
|
|
41
|
-
}),
|
|
42
|
-
() =>
|
|
41
|
+
}), s = y(
|
|
42
|
+
() => r.selectedSecuritySchemeUids.map((t) => {
|
|
43
43
|
if (Array.isArray(t))
|
|
44
|
-
return
|
|
45
|
-
const e =
|
|
44
|
+
return J(t, p);
|
|
45
|
+
const e = p[t ?? ""];
|
|
46
46
|
if (e)
|
|
47
|
-
return
|
|
48
|
-
}).filter(
|
|
47
|
+
return P(e);
|
|
48
|
+
}).filter(re)
|
|
49
49
|
);
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return s.length > 1 ? s : r;
|
|
50
|
+
function T(t) {
|
|
51
|
+
const e = t.find((l) => l.payload), o = t.filter((l) => !l.payload).map(({ id: l }) => {
|
|
52
|
+
const i = l.split(",");
|
|
53
|
+
return i.length > 1 ? i : l;
|
|
55
54
|
});
|
|
56
|
-
e
|
|
55
|
+
e?.payload && (A(f.value?.$el, "scalar-add-auth-option", {
|
|
57
56
|
payload: e.payload
|
|
58
|
-
}), e.payload.uid && o.push(e.payload.uid)),
|
|
57
|
+
}), e.payload.uid && o.push(e.payload.uid)), O(o);
|
|
59
58
|
}
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (w((e = y.value) == null ? void 0 : e.$el, "scalar-select-security-schemes", {
|
|
59
|
+
const O = (t) => {
|
|
60
|
+
if (r.collection.useCollectionSecurity) {
|
|
61
|
+
if (A(f.value?.$el, "scalar-select-security-schemes", {
|
|
64
62
|
uids: t
|
|
65
|
-
}), !
|
|
63
|
+
}), !r.persistAuth)
|
|
66
64
|
return;
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return (T = d[K]) == null ? void 0 : T.nameKey;
|
|
72
|
-
}) : (h = d[s]) == null ? void 0 : h.nameKey;
|
|
73
|
-
});
|
|
74
|
-
re().setItem(
|
|
75
|
-
ne.SELECTED_SECURITY_SCHEMES,
|
|
76
|
-
JSON.stringify(r)
|
|
65
|
+
const e = t.map((o) => Array.isArray(o) ? o.map((l) => p[l]?.nameKey) : p[o]?.nameKey);
|
|
66
|
+
te().setItem(
|
|
67
|
+
oe.SELECTED_SECURITY_SCHEMES,
|
|
68
|
+
JSON.stringify(e)
|
|
77
69
|
);
|
|
78
|
-
} else
|
|
79
|
-
|
|
70
|
+
} else r.operation?.uid && A(
|
|
71
|
+
f.value?.$el,
|
|
80
72
|
"scalar-select-operation-security-schemes",
|
|
81
73
|
{
|
|
82
|
-
operationUid:
|
|
74
|
+
operationUid: r.operation.uid,
|
|
83
75
|
uids: t
|
|
84
76
|
}
|
|
85
77
|
);
|
|
86
78
|
};
|
|
87
|
-
function
|
|
88
|
-
|
|
79
|
+
function E({ id: t, label: e }) {
|
|
80
|
+
b.value = { id: t, label: e }, d.show();
|
|
89
81
|
}
|
|
90
|
-
const
|
|
91
|
-
var o;
|
|
82
|
+
const $ = (t) => {
|
|
92
83
|
if (!t)
|
|
93
84
|
return;
|
|
94
|
-
const e =
|
|
95
|
-
const
|
|
96
|
-
return
|
|
85
|
+
const e = r.selectedSecuritySchemeUids.filter((o) => {
|
|
86
|
+
const l = t.split(",");
|
|
87
|
+
return l.length > 1 && Array.isArray(o) && l.length === o.length ? o.every((i) => !l.includes(i)) : o !== t;
|
|
97
88
|
});
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
() =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var e;
|
|
111
|
-
E.value && t.stopPropagation(), (e = g.value) == null || e.$el.click();
|
|
112
|
-
}, y = W("wrapperRef");
|
|
113
|
-
return (t, e) => (c(), $(n(H), {
|
|
89
|
+
O(e), S.value?.$el.focus(), d.hide();
|
|
90
|
+
}, I = y(
|
|
91
|
+
() => G(
|
|
92
|
+
q.value.filteredRequirements,
|
|
93
|
+
r.collection?.securitySchemes ?? [],
|
|
94
|
+
p,
|
|
95
|
+
w === "modal" || r.layout === "reference"
|
|
96
|
+
)
|
|
97
|
+
), B = (t) => {
|
|
98
|
+
V.value && t.stopPropagation(), S.value?.$el.click();
|
|
99
|
+
}, f = K("wrapperRef");
|
|
100
|
+
return (t, e) => (u(), D(n(W), {
|
|
114
101
|
ref_key: "wrapperRef",
|
|
115
|
-
ref:
|
|
102
|
+
ref: f,
|
|
116
103
|
class: "group/params relative",
|
|
117
|
-
itemCount:
|
|
104
|
+
itemCount: s.value.length,
|
|
118
105
|
layout: t.layout,
|
|
119
|
-
"onUpdate:modelValue": e[2] || (e[2] = (o) =>
|
|
106
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => V.value = o)
|
|
120
107
|
}, {
|
|
121
|
-
title:
|
|
122
|
-
|
|
123
|
-
id: n(
|
|
108
|
+
title: c(() => [
|
|
109
|
+
a("div", {
|
|
110
|
+
id: n(R),
|
|
124
111
|
class: "inline-flex items-center gap-0.5 leading-[20px]"
|
|
125
112
|
}, [
|
|
126
|
-
|
|
127
|
-
|
|
113
|
+
a("span", null, v(t.title), 1),
|
|
114
|
+
g.value ? (u(), h("span", {
|
|
128
115
|
key: 0,
|
|
129
|
-
class:
|
|
130
|
-
onClick:
|
|
131
|
-
},
|
|
132
|
-
], 8,
|
|
116
|
+
class: j(["text-c-3 hover:bg-b-3 hover:text-c-1 -mr-1 cursor-pointer rounded px-1 py-0.5 text-xs leading-[normal]", { "text-c-1": g.value.text === "Required" }]),
|
|
117
|
+
onClick: B
|
|
118
|
+
}, v(g.value.text), 3)) : L("", !0)
|
|
119
|
+
], 8, ie)
|
|
133
120
|
]),
|
|
134
|
-
actions:
|
|
135
|
-
|
|
136
|
-
|
|
121
|
+
actions: c(() => [
|
|
122
|
+
a("div", ue, [
|
|
123
|
+
m(n(X), {
|
|
137
124
|
class: "w-72 text-xs",
|
|
138
|
-
modelValue:
|
|
125
|
+
modelValue: s.value,
|
|
139
126
|
multiple: "",
|
|
140
|
-
options:
|
|
127
|
+
options: I.value,
|
|
141
128
|
placement: "bottom-end",
|
|
142
129
|
teleport: "",
|
|
143
|
-
onDelete:
|
|
144
|
-
"onUpdate:modelValue":
|
|
130
|
+
onDelete: E,
|
|
131
|
+
"onUpdate:modelValue": T
|
|
145
132
|
}, {
|
|
146
|
-
option:
|
|
147
|
-
|
|
133
|
+
option: c(({ option: o, selected: l }) => [
|
|
134
|
+
m(n(_), {
|
|
148
135
|
multiselect: "",
|
|
149
136
|
selected: l
|
|
150
137
|
}, null, 8, ["selected"]),
|
|
151
|
-
|
|
152
|
-
o.isDeletable ?? (n(
|
|
138
|
+
a("div", ce, v(o.label), 1),
|
|
139
|
+
o.isDeletable ?? (n(w) !== "modal" && t.layout !== "reference") ? (u(), D(n(ee), {
|
|
153
140
|
key: 0,
|
|
154
141
|
class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
|
|
155
|
-
icon: n(
|
|
142
|
+
icon: n(ne),
|
|
156
143
|
label: `Delete ${o.label}`,
|
|
157
144
|
size: "xs",
|
|
158
|
-
onClick:
|
|
159
|
-
}, null, 8, ["icon", "label", "onClick"])) :
|
|
145
|
+
onClick: z((i) => E(o), ["stop"])
|
|
146
|
+
}, null, 8, ["icon", "label", "onClick"])) : L("", !0)
|
|
160
147
|
]),
|
|
161
|
-
default:
|
|
162
|
-
|
|
148
|
+
default: c(() => [
|
|
149
|
+
m(n(Z), {
|
|
163
150
|
ref_key: "comboboxButtonRef",
|
|
164
|
-
ref:
|
|
165
|
-
"aria-describedby": n(
|
|
151
|
+
ref: S,
|
|
152
|
+
"aria-describedby": n(R),
|
|
166
153
|
class: "group/combobox-button hover:text-c-1 text-c-2 flex h-fit items-center gap-1 px-0.75 py-0.25 text-base font-normal transition-transform",
|
|
167
154
|
fullWidth: "",
|
|
168
155
|
variant: "ghost"
|
|
169
156
|
}, {
|
|
170
|
-
default:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
]
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
]
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
})
|
|
187
|
-
];
|
|
188
|
-
}),
|
|
157
|
+
default: c(() => [
|
|
158
|
+
s.value.length === 1 ? (u(), h(k, { key: 0 }, [
|
|
159
|
+
e[3] || (e[3] = a("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
|
|
160
|
+
C(" " + v(s.value[0]?.label), 1)
|
|
161
|
+
], 64)) : s.value.length > 1 ? (u(), h(k, { key: 1 }, [
|
|
162
|
+
e[4] || (e[4] = C(" Multiple ")),
|
|
163
|
+
e[5] || (e[5] = a("span", { class: "sr-only" }, "Auth Types Selected", -1))
|
|
164
|
+
], 64)) : (u(), h(k, { key: 2 }, [
|
|
165
|
+
e[6] || (e[6] = a("span", { class: "sr-only" }, "Select", -1)),
|
|
166
|
+
e[7] || (e[7] = C(" Auth Type "))
|
|
167
|
+
], 64)),
|
|
168
|
+
m(n(le), {
|
|
169
|
+
class: "size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180",
|
|
170
|
+
weight: "bold"
|
|
171
|
+
})
|
|
172
|
+
]),
|
|
189
173
|
_: 1
|
|
190
174
|
}, 8, ["aria-describedby"])
|
|
191
175
|
]),
|
|
@@ -193,25 +177,22 @@ const me = ["id"], pe = { class: "flex flex-1" }, de = { class: "min-w-0 flex-1
|
|
|
193
177
|
}, 8, ["modelValue", "options"])
|
|
194
178
|
])
|
|
195
179
|
]),
|
|
196
|
-
default:
|
|
197
|
-
|
|
180
|
+
default: c(() => [
|
|
181
|
+
m(se, {
|
|
198
182
|
collection: t.collection,
|
|
199
183
|
envVariables: t.envVariables,
|
|
200
184
|
environment: t.environment,
|
|
201
185
|
layout: t.layout,
|
|
202
186
|
persistAuth: t.persistAuth,
|
|
203
|
-
selectedSchemeOptions:
|
|
187
|
+
selectedSchemeOptions: s.value,
|
|
204
188
|
server: t.server,
|
|
205
189
|
workspace: t.workspace
|
|
206
190
|
}, null, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "selectedSchemeOptions", "server", "workspace"]),
|
|
207
|
-
|
|
208
|
-
scheme:
|
|
209
|
-
state: n(
|
|
210
|
-
onClose: e[0] || (e[0] = (o) => n(
|
|
211
|
-
onDelete: e[1] || (e[1] = (o) =>
|
|
212
|
-
var l;
|
|
213
|
-
return U((l = x.value) == null ? void 0 : l.id);
|
|
214
|
-
})
|
|
191
|
+
m(ae, {
|
|
192
|
+
scheme: b.value,
|
|
193
|
+
state: n(d),
|
|
194
|
+
onClose: e[0] || (e[0] = (o) => n(d).hide()),
|
|
195
|
+
onDelete: e[1] || (e[1] = (o) => $(b.value?.id))
|
|
215
196
|
}, null, 8, ["scheme", "state"])
|
|
216
197
|
]),
|
|
217
198
|
_: 1
|
|
@@ -219,5 +200,5 @@ const me = ["id"], pe = { class: "flex flex-1" }, de = { class: "min-w-0 flex-1
|
|
|
219
200
|
}
|
|
220
201
|
});
|
|
221
202
|
export {
|
|
222
|
-
|
|
203
|
+
Ae as default
|
|
223
204
|
};
|