@scalar/api-client 2.5.31 → 2.5.33
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 +33 -0
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
- package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
- package/dist/components/CodeInput/codeVariableWidget.js +70 -75
- package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +4 -4
- package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
- package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
- package/dist/components/EmptyState.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
- package/dist/components/Form/LabelInput.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
- package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
- package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
- package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
- package/dist/components/ImportCollection/utils/import-collection.js +14 -14
- package/dist/components/OpenApiClientButton.vue.js +1 -1
- package/dist/components/OpenApiClientButton.vue2.js +10 -10
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +19 -22
- package/dist/components/Search/useSearch.js +51 -61
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue2.js +26 -29
- package/dist/components/Server/ServerDropdown.vue.js +70 -96
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
- package/dist/components/Server/ServerSelector.vue.js +44 -55
- package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
- package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
- package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue.js +68 -74
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.js +107 -122
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/hooks/useFileDialog.js +12 -12
- package/dist/hooks/useResponseBody.js +14 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/layouts/App/ApiClientApp.vue.js +50 -56
- package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
- package/dist/layouts/App/create-api-client-app.js +19 -20
- package/dist/layouts/App/index.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
- package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
- package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
- package/dist/layouts/Web/create-api-client-web.js +19 -20
- package/dist/layouts/Web/index.js +1 -1
- package/dist/libs/create-client.js +102 -109
- package/dist/libs/env-helpers.js +3 -3
- package/dist/libs/event-bus.js +15 -15
- package/dist/libs/extractAttachmentFilename.js +5 -6
- package/dist/libs/find-request.js +9 -10
- package/dist/libs/get-request-uid-by-path-method.js +12 -12
- package/dist/libs/getOpenApiDocumentDetails.js +7 -7
- package/dist/libs/importers/curl.js +3 -3
- package/dist/libs/normalize-headers.js +9 -10
- package/dist/libs/postman.js +15 -17
- package/dist/libs/send-request/build-request-security.js +9 -10
- package/dist/libs/send-request/create-fetch-body.js +11 -12
- package/dist/libs/send-request/create-fetch-query-params.js +13 -13
- package/dist/libs/send-request/create-request-operation.js +83 -84
- package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +12 -12
- package/dist/libs/string-template.js +21 -21
- package/dist/libs/validate-parameters.js +5 -8
- package/dist/plugins/plugin-manager.js +11 -17
- package/dist/store/active-entities.js +90 -117
- package/dist/store/collections.js +41 -42
- package/dist/store/import-spec.js +25 -26
- package/dist/store/request-example.js +20 -24
- package/dist/store/requests.js +63 -81
- package/dist/store/router-params.js +7 -7
- package/dist/store/security-schemes.js +35 -36
- package/dist/store/store.js +2 -2
- package/dist/store/tags.js +20 -21
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue2.js +21 -22
- package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
- package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
- package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
- package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
- package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
- package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
- package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
- package/dist/views/Collection/CollectionServers.vue2.js +88 -98
- package/dist/views/Collection/CollectionSettings.vue.js +1 -1
- package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
- package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
- package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
- package/dist/views/Cookies/CookieModal.vue.js +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +90 -93
- package/dist/views/Environment/Environment.vue2.js +267 -295
- package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +60 -67
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +78 -89
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
- package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
- package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +199 -211
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
- package/dist/views/Request/consts/mediaTypes.js +2 -3
- package/dist/views/Request/handle-drag.js +24 -28
- package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
- package/dist/views/Request/libs/auth.js +37 -43
- package/dist/views/Request/libs/oauth2.js +30 -32
- package/dist/views/Request/libs/watch-mode.js +100 -103
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
- package/package.json +22 -22
- package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
- package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
- package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
- package/dist/components/EmptyState.vue3.js +0 -4
- package/dist/components/Form/LabelInput.vue3.js +0 -4
- package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
- package/dist/components/OpenApiClientButton.vue3.js +0 -4
- package/dist/components/ScalarAsciiArt.vue3.js +0 -4
- package/dist/components/SectionFilter.vue3.js +0 -4
- package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
- package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
- package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
- package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
- package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
- package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
- package/dist/style.css.js +0 -4
- package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
- package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
- package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
- package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
- package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
- package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
- package/dist/views/Cookies/CookieModal.vue3.js +0 -4
- package/dist/views/Request/Request.vue3.js +0 -4
- package/dist/views/Request/RequestRoot.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
- package/dist/views/Request/RequestSidebar.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
- package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
|
@@ -1,145 +1,129 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
3
|
-
import { ScalarButton as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as V, computed as f, createBlock as u, openBlock as n, unref as l, withCtx as c, createElementVNode as a, createVNode as i, normalizeClass as $, toDisplayString as d, createCommentVNode as m, withModifiers as w, createTextVNode as p, createElementBlock as x, Fragment as A, renderList as B } from "vue";
|
|
2
|
+
import { Disclosure as O, DisclosureButton as j, DisclosurePanel as z } from "@headlessui/vue";
|
|
3
|
+
import { ScalarButton as v, ScalarIcon as N } from "@scalar/components";
|
|
4
|
+
import g from "../../../../components/DataTable/DataTableCell.vue.js";
|
|
5
|
+
import T from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
6
|
+
import E from "../../../../components/DataTable/DataTableCheckbox.vue.js";
|
|
7
|
+
const F = { class: "flex h-fit w-full" }, I = { class: "flex-1" }, R = { class: "flex items-center gap-1.75" }, L = {
|
|
8
8
|
class: "grid auto-rows-auto",
|
|
9
9
|
style: { gridTemplateColumns: "1fr auto" }
|
|
10
|
-
},
|
|
10
|
+
}, M = { key: 0 }, P = { class: "font-code text-xs" }, Q = /* @__PURE__ */ V({
|
|
11
11
|
__name: "OAuthScopesInput",
|
|
12
12
|
props: {
|
|
13
13
|
flow: {},
|
|
14
14
|
updateScheme: { type: Function }
|
|
15
15
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
() => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
t ? l.updateScheme(`flows.${l.flow.type}.selectedScopes`, [
|
|
32
|
-
...d.value,
|
|
33
|
-
e
|
|
34
|
-
]) : l.updateScheme(
|
|
35
|
-
`flows.${l.flow.type}.selectedScopes`,
|
|
36
|
-
d.value.filter((s) => s !== e)
|
|
16
|
+
setup(e) {
|
|
17
|
+
const y = f(
|
|
18
|
+
() => Object.entries(e.flow?.scopes ?? {}).map(([o, t]) => ({
|
|
19
|
+
id: o,
|
|
20
|
+
label: o,
|
|
21
|
+
description: t
|
|
22
|
+
}))
|
|
23
|
+
), r = f(() => e.flow?.selectedScopes || []);
|
|
24
|
+
function k(o, t) {
|
|
25
|
+
t ? e.updateScheme(`flows.${e.flow.type}.selectedScopes`, [
|
|
26
|
+
...r.value,
|
|
27
|
+
o
|
|
28
|
+
]) : e.updateScheme(
|
|
29
|
+
`flows.${e.flow.type}.selectedScopes`,
|
|
30
|
+
r.value.filter((s) => s !== o)
|
|
37
31
|
);
|
|
38
32
|
}
|
|
39
|
-
const
|
|
40
|
-
() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var e;
|
|
46
|
-
l.updateScheme(
|
|
47
|
-
`flows.${l.flow.type}.selectedScopes`,
|
|
48
|
-
Object.keys(((e = l.flow) == null ? void 0 : e.scopes) ?? {})
|
|
33
|
+
const h = f(
|
|
34
|
+
() => e.flow?.selectedScopes?.length === Object.keys(e.flow?.scopes ?? {}).length
|
|
35
|
+
), C = () => {
|
|
36
|
+
e.updateScheme(
|
|
37
|
+
`flows.${e.flow.type}.selectedScopes`,
|
|
38
|
+
Object.keys(e.flow?.scopes ?? {})
|
|
49
39
|
);
|
|
50
|
-
},
|
|
51
|
-
|
|
40
|
+
}, b = () => {
|
|
41
|
+
e.updateScheme(`flows.${e.flow.type}.selectedScopes`, []);
|
|
52
42
|
};
|
|
53
|
-
return (
|
|
43
|
+
return (o, t) => (n(), u(l(g), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
|
|
54
44
|
default: c(() => [
|
|
55
|
-
|
|
56
|
-
t[2] || (t[2] =
|
|
57
|
-
|
|
45
|
+
a("div", F, [
|
|
46
|
+
t[2] || (t[2] = a("div", { class: "text-c-1 h-full items-center" }, null, -1)),
|
|
47
|
+
i(l(O), {
|
|
58
48
|
as: "div",
|
|
59
49
|
class: "bl flex w-full flex-col"
|
|
60
50
|
}, {
|
|
61
|
-
default: c(() =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
default: c(() => [
|
|
52
|
+
i(l(j), {
|
|
53
|
+
class: $([
|
|
54
|
+
"group/scopes-accordion hover:text-c-1 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pr-2.25 pl-3 text-left",
|
|
55
|
+
(o.flow?.selectedScopes?.length || 0) > 0 ? "text-c-1" : "text-c-3"
|
|
56
|
+
])
|
|
57
|
+
}, {
|
|
58
|
+
default: c(({ open: s }) => [
|
|
59
|
+
a("div", I, " Scopes Selected " + d(o.flow?.selectedScopes?.length || 0) + " / " + d(Object.keys(o.flow?.scopes ?? {}).length || 0), 1),
|
|
60
|
+
a("div", R, [
|
|
61
|
+
h.value ? (n(), u(l(v), {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
64
|
+
size: "sm",
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
onClick: w(b, ["stop"])
|
|
67
|
+
}, {
|
|
68
|
+
default: c(() => t[0] || (t[0] = [
|
|
69
|
+
p(" Deselect All ")
|
|
70
|
+
])),
|
|
71
|
+
_: 1,
|
|
72
|
+
__: [0]
|
|
73
|
+
})) : m("", !0),
|
|
74
|
+
h.value ? m("", !0) : (n(), u(l(v), {
|
|
75
|
+
key: 1,
|
|
76
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
77
|
+
size: "sm",
|
|
78
|
+
variant: "ghost",
|
|
79
|
+
onClick: w(C, ["stop"])
|
|
80
|
+
}, {
|
|
81
|
+
default: c(() => t[1] || (t[1] = [
|
|
82
|
+
p(" Select All ")
|
|
83
|
+
])),
|
|
84
|
+
_: 1,
|
|
85
|
+
__: [1]
|
|
86
|
+
})),
|
|
87
|
+
i(l(N), {
|
|
88
|
+
class: "text-c-3 group-hover/scopes-accordion:text-c-2",
|
|
89
|
+
icon: s ? "ChevronDown" : "ChevronRight",
|
|
90
|
+
size: "md"
|
|
91
|
+
}, null, 8, ["icon"])
|
|
68
92
|
])
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, {
|
|
82
|
-
default: c(() =>
|
|
83
|
-
x("
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
icon: n ? "ChevronDown" : "ChevronRight",
|
|
104
|
-
size: "md"
|
|
105
|
-
}, null, 8, ["icon"])
|
|
106
|
-
])
|
|
107
|
-
];
|
|
108
|
-
}),
|
|
109
|
-
_: 1
|
|
110
|
-
}, 8, ["class"]),
|
|
111
|
-
r(o(E), { as: "template" }, {
|
|
112
|
-
default: c(() => [
|
|
113
|
-
i("table", U, [
|
|
114
|
-
(a(!0), k(j, null, z(D.value, ({ id: n, label: f, description: u }) => (a(), m(o(I), {
|
|
115
|
-
key: n,
|
|
116
|
-
class: "text-c-2",
|
|
117
|
-
onClick: (h) => V(n, !d.value.includes(n))
|
|
118
|
-
}, {
|
|
119
|
-
default: c(() => [
|
|
120
|
-
r(o(b), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
|
|
121
|
-
default: c(() => [
|
|
122
|
-
u ? (a(), k("div", _, [
|
|
123
|
-
i("span", q, p(f), 1),
|
|
124
|
-
x(" – " + p(u), 1)
|
|
125
|
-
])) : w("", !0)
|
|
126
|
-
]),
|
|
127
|
-
_: 2
|
|
128
|
-
}, 1024),
|
|
129
|
-
r(o(R), {
|
|
130
|
-
modelValue: d.value.includes(n),
|
|
131
|
-
"onUpdate:modelValue": () => {
|
|
132
|
-
}
|
|
133
|
-
}, null, 8, ["modelValue"])
|
|
134
|
-
]),
|
|
135
|
-
_: 2
|
|
136
|
-
}, 1032, ["onClick"]))), 128))
|
|
137
|
-
])
|
|
138
|
-
]),
|
|
139
|
-
_: 1
|
|
140
|
-
})
|
|
141
|
-
];
|
|
142
|
-
}),
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["class"]),
|
|
96
|
+
i(l(z), { as: "template" }, {
|
|
97
|
+
default: c(() => [
|
|
98
|
+
a("table", L, [
|
|
99
|
+
(n(!0), x(A, null, B(y.value, ({ id: s, label: D, description: S }) => (n(), u(l(T), {
|
|
100
|
+
key: s,
|
|
101
|
+
class: "text-c-2",
|
|
102
|
+
onClick: (U) => k(s, !r.value.includes(s))
|
|
103
|
+
}, {
|
|
104
|
+
default: c(() => [
|
|
105
|
+
i(l(g), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
|
|
106
|
+
default: c(() => [
|
|
107
|
+
S ? (n(), x("div", M, [
|
|
108
|
+
a("span", P, d(D), 1),
|
|
109
|
+
p(" – " + d(S), 1)
|
|
110
|
+
])) : m("", !0)
|
|
111
|
+
]),
|
|
112
|
+
_: 2
|
|
113
|
+
}, 1024),
|
|
114
|
+
i(l(E), {
|
|
115
|
+
modelValue: r.value.includes(s),
|
|
116
|
+
"onUpdate:modelValue": () => {
|
|
117
|
+
}
|
|
118
|
+
}, null, 8, ["modelValue"])
|
|
119
|
+
]),
|
|
120
|
+
_: 2
|
|
121
|
+
}, 1032, ["onClick"]))), 128))
|
|
122
|
+
])
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
})
|
|
126
|
+
]),
|
|
143
127
|
_: 1
|
|
144
128
|
})
|
|
145
129
|
])
|
|
@@ -149,5 +133,5 @@ const L = { class: "flex h-fit w-full" }, M = { class: "flex-1" }, P = { class:
|
|
|
149
133
|
}
|
|
150
134
|
});
|
|
151
135
|
export {
|
|
152
|
-
|
|
136
|
+
Q as default
|
|
153
137
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { safeLocalStorage as
|
|
4
|
-
import { ScalarIconCaretDown as
|
|
5
|
-
import { isDefined as
|
|
6
|
-
import
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { getSecurityRequirements as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as z, useId as K, ref as g, computed as f, createBlock as V, openBlock as u, withCtx as i, createVNode as m, renderSlot as j, unref as s, createElementVNode as r, createElementBlock as h, Fragment as x, createTextVNode as k, toDisplayString as y, createCommentVNode as D, withModifiers as W, normalizeClass as Y } from "vue";
|
|
2
|
+
import { useModal as F, ScalarComboboxMultiselect as H, ScalarButton as J, ScalarListboxCheckbox as P, ScalarIconButton as G } from "@scalar/components";
|
|
3
|
+
import { safeLocalStorage as Q, CLIENT_LS_KEYS as X } from "@scalar/helpers/object/local-storage";
|
|
4
|
+
import { ScalarIconCaretDown as Z, ScalarIconTrash as _ } from "@scalar/icons";
|
|
5
|
+
import { isDefined as ee } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import te from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
|
+
import { useWorkspace as oe } from "../../../../store/store.js";
|
|
8
|
+
import le from "./DeleteRequestAuthModal.vue.js";
|
|
9
|
+
import ne from "./RequestAuthDataTable.vue.js";
|
|
10
|
+
import { getSecurityRequirements as se, formatComplexScheme as ie, formatScheme as re, getSchemeOptions as ae } from "../../libs/auth.js";
|
|
11
|
+
const ce = ["id"], ue = { class: "flex flex-1" }, me = { class: "min-w-0 flex-1 truncate" }, Ce = /* @__PURE__ */ z({
|
|
12
12
|
__name: "RequestAuth",
|
|
13
13
|
props: {
|
|
14
14
|
collection: {},
|
|
@@ -24,167 +24,151 @@ const ue = ["id"], me = { class: "flex flex-1" }, de = { class: "min-w-0 flex-1
|
|
|
24
24
|
workspace: {}
|
|
25
25
|
},
|
|
26
26
|
emits: ["authorized", "activeSchemes"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
securitySchemes:
|
|
30
|
-
securitySchemeMutators:
|
|
31
|
-
requestMutators:
|
|
32
|
-
collectionMutators:
|
|
33
|
-
} =
|
|
27
|
+
setup(n, { emit: E }) {
|
|
28
|
+
const C = E, {
|
|
29
|
+
securitySchemes: d,
|
|
30
|
+
securitySchemeMutators: $,
|
|
31
|
+
requestMutators: B,
|
|
32
|
+
collectionMutators: I
|
|
33
|
+
} = oe(), A = K(), v = g(null), p = F(), S = g(
|
|
34
34
|
null
|
|
35
|
-
),
|
|
36
|
-
const t =
|
|
35
|
+
), R = g(!1), q = f(() => {
|
|
36
|
+
const t = se(n.operation, n.collection);
|
|
37
37
|
return { filteredRequirements: t.filter((o) => Object.keys(o).length), requirements: t };
|
|
38
|
-
}),
|
|
39
|
-
const { filteredRequirements: t, requirements: e } =
|
|
38
|
+
}), b = f(() => {
|
|
39
|
+
const { filteredRequirements: t, requirements: e } = q.value;
|
|
40
40
|
if (!e.length)
|
|
41
41
|
return null;
|
|
42
42
|
const l = !e.some(
|
|
43
|
-
(
|
|
43
|
+
(N) => Object.keys(N).length > 1
|
|
44
44
|
) && t.length < e.length;
|
|
45
45
|
return { icon: l ? "Unlock" : "Lock", text: l ? "Optional" : "Required" };
|
|
46
|
-
}),
|
|
47
|
-
() =>
|
|
46
|
+
}), a = f(
|
|
47
|
+
() => n.selectedSecuritySchemeUids.map((t) => {
|
|
48
48
|
if (Array.isArray(t))
|
|
49
|
-
return ie(t,
|
|
50
|
-
const e =
|
|
49
|
+
return ie(t, d);
|
|
50
|
+
const e = d[t ?? ""];
|
|
51
51
|
if (e)
|
|
52
|
-
return
|
|
53
|
-
}).filter(
|
|
52
|
+
return re(e);
|
|
53
|
+
}).filter(ee)
|
|
54
54
|
);
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return i.length > 1 ? i : n;
|
|
55
|
+
function M(t) {
|
|
56
|
+
const e = t.find((l) => l.payload), o = t.filter((l) => !l.payload).map(({ id: l }) => {
|
|
57
|
+
const c = l.split(",");
|
|
58
|
+
return c.length > 1 ? c : l;
|
|
60
59
|
});
|
|
61
|
-
if (e
|
|
62
|
-
const
|
|
60
|
+
if (e?.payload) {
|
|
61
|
+
const l = $.add(
|
|
63
62
|
e.payload,
|
|
64
|
-
|
|
63
|
+
n.collection?.uid
|
|
65
64
|
);
|
|
66
|
-
|
|
65
|
+
l && o.push(l.uid);
|
|
67
66
|
}
|
|
68
|
-
|
|
67
|
+
O(o);
|
|
69
68
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (T.edit(s.collection.uid, "selectedSecuritySchemeUids", t), !s.persistAuth)
|
|
69
|
+
const O = (t) => {
|
|
70
|
+
if (n.collection.useCollectionSecurity) {
|
|
71
|
+
if (I.edit(n.collection.uid, "selectedSecuritySchemeUids", t), !n.persistAuth)
|
|
74
72
|
return;
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return (h = f[i]) == null ? void 0 : h.nameKey;
|
|
80
|
-
}) : (n = f[l]) == null ? void 0 : n.nameKey;
|
|
81
|
-
});
|
|
82
|
-
X().setItem(
|
|
83
|
-
Z.SELECTED_SECURITY_SCHEMES,
|
|
84
|
-
JSON.stringify(o)
|
|
73
|
+
const e = t.map((o) => Array.isArray(o) ? o.map((l) => d[l]?.nameKey) : d[o]?.nameKey);
|
|
74
|
+
Q().setItem(
|
|
75
|
+
X.SELECTED_SECURITY_SCHEMES,
|
|
76
|
+
JSON.stringify(e)
|
|
85
77
|
);
|
|
86
|
-
} else
|
|
78
|
+
} else n.operation?.uid && B.edit(n.operation.uid, "selectedSecuritySchemeUids", t);
|
|
87
79
|
};
|
|
88
|
-
function
|
|
89
|
-
|
|
80
|
+
function w({ id: t, label: e }) {
|
|
81
|
+
S.value = { id: t, label: e }, p.show();
|
|
90
82
|
}
|
|
91
|
-
const
|
|
92
|
-
var o;
|
|
83
|
+
const T = (t) => {
|
|
93
84
|
if (!t)
|
|
94
85
|
return;
|
|
95
|
-
const e =
|
|
96
|
-
const
|
|
97
|
-
return
|
|
86
|
+
const e = n.selectedSecuritySchemeUids.filter((o) => {
|
|
87
|
+
const l = t.split(",");
|
|
88
|
+
return l.length > 1 && Array.isArray(o) && l.length === o.length ? o.every((c) => !l.includes(c)) : o !== t;
|
|
98
89
|
});
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
() =>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
), N = (t) => {
|
|
111
|
-
var e;
|
|
112
|
-
O.value && t.stopPropagation(), (e = b.value) == null || e.$el.click();
|
|
90
|
+
O(e), v.value?.$el.focus(), p.hide();
|
|
91
|
+
}, U = f(
|
|
92
|
+
() => ae(
|
|
93
|
+
q.value.filteredRequirements,
|
|
94
|
+
n.collection?.securitySchemes ?? [],
|
|
95
|
+
d,
|
|
96
|
+
n.isReadOnly
|
|
97
|
+
)
|
|
98
|
+
), L = (t) => {
|
|
99
|
+
R.value && t.stopPropagation(), v.value?.$el.click();
|
|
113
100
|
};
|
|
114
|
-
return (t, e) => (
|
|
101
|
+
return (t, e) => (u(), V(te, {
|
|
115
102
|
class: "group/params relative",
|
|
116
|
-
itemCount:
|
|
103
|
+
itemCount: a.value.length,
|
|
117
104
|
layout: t.layout,
|
|
118
|
-
"onUpdate:modelValue": e[4] || (e[4] = (o) =>
|
|
105
|
+
"onUpdate:modelValue": e[4] || (e[4] = (o) => R.value = o)
|
|
119
106
|
}, {
|
|
120
|
-
title:
|
|
121
|
-
|
|
122
|
-
id:
|
|
107
|
+
title: i(() => [
|
|
108
|
+
r("div", {
|
|
109
|
+
id: s(A),
|
|
123
110
|
class: "inline-flex items-center gap-0.5 leading-[20px]"
|
|
124
111
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
r("span", null, y(t.title), 1),
|
|
113
|
+
b.value ? (u(), h("span", {
|
|
127
114
|
key: 0,
|
|
128
|
-
class:
|
|
129
|
-
onClick:
|
|
130
|
-
},
|
|
131
|
-
], 8,
|
|
115
|
+
class: Y(["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": b.value.text === "Required" }]),
|
|
116
|
+
onClick: L
|
|
117
|
+
}, y(b.value.text), 3)) : D("", !0)
|
|
118
|
+
], 8, ce)
|
|
132
119
|
]),
|
|
133
|
-
actions:
|
|
134
|
-
|
|
135
|
-
|
|
120
|
+
actions: i(() => [
|
|
121
|
+
r("div", ue, [
|
|
122
|
+
m(s(H), {
|
|
136
123
|
class: "w-72 text-xs",
|
|
137
|
-
modelValue:
|
|
124
|
+
modelValue: a.value,
|
|
138
125
|
multiple: "",
|
|
139
|
-
options:
|
|
126
|
+
options: U.value,
|
|
140
127
|
placement: "bottom-end",
|
|
141
128
|
teleport: "",
|
|
142
|
-
onDelete:
|
|
143
|
-
"onUpdate:modelValue":
|
|
129
|
+
onDelete: w,
|
|
130
|
+
"onUpdate:modelValue": M
|
|
144
131
|
}, {
|
|
145
|
-
option:
|
|
146
|
-
|
|
132
|
+
option: i(({ option: o, selected: l }) => [
|
|
133
|
+
m(s(P), {
|
|
147
134
|
multiselect: "",
|
|
148
135
|
selected: l
|
|
149
136
|
}, null, 8, ["selected"]),
|
|
150
|
-
|
|
151
|
-
o.isDeletable ?? !t.isReadOnly ? (
|
|
137
|
+
r("div", me, y(o.label), 1),
|
|
138
|
+
o.isDeletable ?? !t.isReadOnly ? (u(), V(s(G), {
|
|
152
139
|
key: 0,
|
|
153
140
|
class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
|
|
154
|
-
icon:
|
|
141
|
+
icon: s(_),
|
|
155
142
|
label: `Delete ${o.label}`,
|
|
156
143
|
size: "xs",
|
|
157
|
-
onClick:
|
|
158
|
-
}, null, 8, ["icon", "label", "onClick"])) :
|
|
144
|
+
onClick: W((c) => w(o), ["stop"])
|
|
145
|
+
}, null, 8, ["icon", "label", "onClick"])) : D("", !0)
|
|
159
146
|
]),
|
|
160
|
-
default:
|
|
161
|
-
|
|
147
|
+
default: i(() => [
|
|
148
|
+
m(s(J), {
|
|
162
149
|
ref_key: "comboboxButtonRef",
|
|
163
|
-
ref:
|
|
164
|
-
"aria-describedby":
|
|
150
|
+
ref: v,
|
|
151
|
+
"aria-describedby": s(A),
|
|
165
152
|
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",
|
|
166
153
|
fullWidth: "",
|
|
167
154
|
variant: "ghost"
|
|
168
155
|
}, {
|
|
169
|
-
default:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
]
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
]
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
})
|
|
186
|
-
];
|
|
187
|
-
}),
|
|
156
|
+
default: i(() => [
|
|
157
|
+
a.value.length === 1 ? (u(), h(x, { key: 0 }, [
|
|
158
|
+
e[5] || (e[5] = r("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
|
|
159
|
+
k(" " + y(a.value[0]?.label), 1)
|
|
160
|
+
], 64)) : a.value.length > 1 ? (u(), h(x, { key: 1 }, [
|
|
161
|
+
e[6] || (e[6] = k(" Multiple ")),
|
|
162
|
+
e[7] || (e[7] = r("span", { class: "sr-only" }, "Auth Types Selected", -1))
|
|
163
|
+
], 64)) : (u(), h(x, { key: 2 }, [
|
|
164
|
+
e[8] || (e[8] = r("span", { class: "sr-only" }, "Select", -1)),
|
|
165
|
+
e[9] || (e[9] = k(" Auth Type "))
|
|
166
|
+
], 64)),
|
|
167
|
+
m(s(Z), {
|
|
168
|
+
class: "size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180",
|
|
169
|
+
weight: "bold"
|
|
170
|
+
})
|
|
171
|
+
]),
|
|
188
172
|
_: 1
|
|
189
173
|
}, 8, ["aria-describedby"])
|
|
190
174
|
]),
|
|
@@ -192,32 +176,29 @@ const ue = ["id"], me = { class: "flex flex-1" }, de = { class: "min-w-0 flex-1
|
|
|
192
176
|
}, 8, ["modelValue", "options"])
|
|
193
177
|
])
|
|
194
178
|
]),
|
|
195
|
-
default:
|
|
196
|
-
|
|
179
|
+
default: i(() => [
|
|
180
|
+
m(ne, {
|
|
197
181
|
collection: t.collection,
|
|
198
182
|
envVariables: t.envVariables,
|
|
199
183
|
environment: t.environment,
|
|
200
184
|
layout: t.layout,
|
|
201
185
|
persistAuth: t.persistAuth,
|
|
202
|
-
selectedSchemeOptions:
|
|
186
|
+
selectedSchemeOptions: a.value,
|
|
203
187
|
server: t.server,
|
|
204
188
|
workspace: t.workspace,
|
|
205
|
-
onActiveSchemes: e[0] || (e[0] = (o) =>
|
|
206
|
-
onAuthorized: e[1] || (e[1] = (o) =>
|
|
189
|
+
onActiveSchemes: e[0] || (e[0] = (o) => C("activeSchemes", o)),
|
|
190
|
+
onAuthorized: e[1] || (e[1] = (o) => C("authorized"))
|
|
207
191
|
}, {
|
|
208
|
-
"oauth-actions":
|
|
209
|
-
|
|
192
|
+
"oauth-actions": i(() => [
|
|
193
|
+
j(t.$slots, "oauth-actions", {}, void 0, !0)
|
|
210
194
|
]),
|
|
211
195
|
_: 3
|
|
212
196
|
}, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "selectedSchemeOptions", "server", "workspace"]),
|
|
213
|
-
|
|
214
|
-
scheme:
|
|
215
|
-
state:
|
|
216
|
-
onClose: e[2] || (e[2] = (o) =>
|
|
217
|
-
onDelete: e[3] || (e[3] = (o) =>
|
|
218
|
-
var l;
|
|
219
|
-
return L((l = g.value) == null ? void 0 : l.id);
|
|
220
|
-
})
|
|
197
|
+
m(le, {
|
|
198
|
+
scheme: S.value,
|
|
199
|
+
state: s(p),
|
|
200
|
+
onClose: e[2] || (e[2] = (o) => s(p).hide()),
|
|
201
|
+
onDelete: e[3] || (e[3] = (o) => T(S.value?.id))
|
|
221
202
|
}, null, 8, ["scheme", "state"])
|
|
222
203
|
]),
|
|
223
204
|
_: 3
|