@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,120 +1,109 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { safeJSON as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
7
|
-
import { useAnalytics as
|
|
8
|
-
import { useClientConfig as
|
|
9
|
-
import { useSidebar as
|
|
10
|
-
import { validateParameters as
|
|
11
|
-
import { useActiveEntities as
|
|
12
|
-
import { useOpenApiWatcher as
|
|
13
|
-
import
|
|
14
|
-
import { usePluginManager as
|
|
15
|
-
import { createRequestOperation as
|
|
16
|
-
import { ERRORS as
|
|
17
|
-
import { useWorkspace as
|
|
18
|
-
import { useLayout as
|
|
19
|
-
const
|
|
1
|
+
import { defineComponent as L, ref as c, computed as $, onMounted as H, onBeforeUnmount as Q, watch as F, createElementBlock as G, openBlock as m, normalizeClass as C, unref as r, createBlock as N, createCommentVNode as U, createElementVNode as _, isRef as K, createVNode as X } from "vue";
|
|
2
|
+
import { isDefined as Y } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { safeJSON as Z } from "@scalar/object-utils/parse";
|
|
4
|
+
import { useToasts as ee } from "@scalar/use-toasts";
|
|
5
|
+
import { RouterView as te } from "vue-router";
|
|
6
|
+
import oe from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
7
|
+
import { useAnalytics as re } from "../../hooks/useAnalytics.js";
|
|
8
|
+
import { useClientConfig as se } from "../../hooks/useClientConfig.js";
|
|
9
|
+
import { useSidebar as ae } from "../../hooks/useSidebar.js";
|
|
10
|
+
import { validateParameters as ne } from "../../libs/validate-parameters.js";
|
|
11
|
+
import { useActiveEntities as le } from "../../store/active-entities.js";
|
|
12
|
+
import { useOpenApiWatcher as ue } from "./hooks/useOpenApiWatcher.js";
|
|
13
|
+
import ce from "./RequestSidebar.vue.js";
|
|
14
|
+
import { usePluginManager as ie } from "../../plugins/hooks/usePluginManager.js";
|
|
15
|
+
import { createRequestOperation as me } from "../../libs/send-request/create-request-operation.js";
|
|
16
|
+
import { ERRORS as fe } from "../../libs/errors.js";
|
|
17
|
+
import { useWorkspace as de } from "../../store/store.js";
|
|
18
|
+
import { useLayout as pe } from "../../hooks/useLayout.js";
|
|
19
|
+
const ve = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col" }, Pe = /* @__PURE__ */ L({
|
|
20
20
|
__name: "RequestRoot",
|
|
21
21
|
emits: ["newTab"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
activeCollection:
|
|
25
|
-
activeExample:
|
|
26
|
-
activeEnvironment:
|
|
27
|
-
activeRequest:
|
|
28
|
-
activeWorkspace:
|
|
29
|
-
activeServer:
|
|
30
|
-
} =
|
|
31
|
-
() =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
), g = async () => {
|
|
36
|
-
var _, w, O, V, i, A;
|
|
37
|
-
if (!c.value || !u.value || !l.value)
|
|
22
|
+
setup(Se) {
|
|
23
|
+
const w = de(), { toast: f } = ee(), { layout: d } = pe(), O = se(), { isSidebarOpen: a } = ae(), V = re(), {
|
|
24
|
+
activeCollection: n,
|
|
25
|
+
activeExample: l,
|
|
26
|
+
activeEnvironment: p,
|
|
27
|
+
activeRequest: u,
|
|
28
|
+
activeWorkspace: v,
|
|
29
|
+
activeServer: A
|
|
30
|
+
} = le(), { cookies: B, requestHistory: T, showSidebar: R, securitySchemes: P, events: s } = w, D = ie(), M = c(), S = c(), i = c(/* @__PURE__ */ new Set()), q = c(null), y = $(
|
|
31
|
+
() => (n.value?.useCollectionSecurity ? n.value?.selectedSecuritySchemeUids : u.value?.selectedSecuritySchemeUids) ?? []
|
|
32
|
+
), x = async () => {
|
|
33
|
+
if (!u.value || !l.value || !n.value)
|
|
38
34
|
return;
|
|
39
|
-
|
|
40
|
-
const e = typeof
|
|
35
|
+
i.value = ne(l.value);
|
|
36
|
+
const e = typeof p.value == "object" ? p.value.value : "{}", t = Z.parse(e);
|
|
41
37
|
t.error && console.error("INVALID ENVIRONMENT!");
|
|
42
|
-
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {},
|
|
43
|
-
request:
|
|
44
|
-
example:
|
|
45
|
-
selectedSecuritySchemeUids:
|
|
46
|
-
proxyUrl:
|
|
38
|
+
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, J = v.value?.cookies.map((j) => B[j]).filter(Y) ?? [], W = n.value?.info?.title === "Drafts" ? void 0 : A.value, [h, g] = me({
|
|
39
|
+
request: u.value,
|
|
40
|
+
example: l.value,
|
|
41
|
+
selectedSecuritySchemeUids: y.value,
|
|
42
|
+
proxyUrl: v.value?.proxyUrl ?? "",
|
|
47
43
|
environment: o,
|
|
48
|
-
globalCookies:
|
|
44
|
+
globalCookies: J,
|
|
49
45
|
status: s.requestStatus,
|
|
50
|
-
securitySchemes:
|
|
51
|
-
server:
|
|
52
|
-
pluginManager:
|
|
46
|
+
securitySchemes: P,
|
|
47
|
+
server: W,
|
|
48
|
+
pluginManager: D
|
|
53
49
|
});
|
|
54
|
-
if (
|
|
55
|
-
|
|
50
|
+
if (O.value?.onRequestSent?.(u.value.path ?? ""), h) {
|
|
51
|
+
f(h.message, "error");
|
|
56
52
|
return;
|
|
57
53
|
}
|
|
58
|
-
|
|
59
|
-
const [
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
function k() {
|
|
66
|
-
f == null || f.capture("client-send-request");
|
|
54
|
+
S.value = g.controller;
|
|
55
|
+
const [k, E] = await g.sendRequest();
|
|
56
|
+
q.value = E, k ? f(k.message, "error") : T.push(I(E));
|
|
57
|
+
}, z = async () => S.value?.abort(fe.REQUEST_ABORTED);
|
|
58
|
+
function b() {
|
|
59
|
+
V?.capture("client-send-request");
|
|
67
60
|
}
|
|
68
|
-
|
|
69
|
-
s.executeRequest.on(
|
|
70
|
-
}),
|
|
71
|
-
s.executeRequest.off(
|
|
72
|
-
}),
|
|
73
|
-
() =>
|
|
74
|
-
var e;
|
|
75
|
-
return (e = u.value) == null ? void 0 : e.parameters;
|
|
76
|
-
},
|
|
61
|
+
H(() => {
|
|
62
|
+
s.executeRequest.on(x), s.executeRequest.on(b), s.cancelRequest.on(z);
|
|
63
|
+
}), ue(), Q(() => {
|
|
64
|
+
s.executeRequest.off(x), s.executeRequest.off(b);
|
|
65
|
+
}), F(
|
|
66
|
+
() => l.value?.parameters,
|
|
77
67
|
() => {
|
|
78
|
-
|
|
68
|
+
i.value.clear();
|
|
79
69
|
},
|
|
80
70
|
{ deep: !0 }
|
|
81
71
|
);
|
|
82
|
-
const
|
|
83
|
-
var t;
|
|
72
|
+
const I = (e) => {
|
|
84
73
|
try {
|
|
85
74
|
return structuredClone(e);
|
|
86
75
|
} catch {
|
|
87
|
-
const
|
|
88
|
-
return
|
|
76
|
+
const o = { ...e };
|
|
77
|
+
return e.response?.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? o.response.data = e.response.data : o.response.data = JSON.parse(JSON.stringify(e.response.data))), o;
|
|
89
78
|
}
|
|
90
79
|
};
|
|
91
|
-
return (e, t) => (
|
|
80
|
+
return (e, t) => (m(), G("div", {
|
|
92
81
|
ref_key: "element",
|
|
93
|
-
ref:
|
|
94
|
-
class:
|
|
95
|
-
"!mr-0 !mb-0 !border-0": r(
|
|
82
|
+
ref: M,
|
|
83
|
+
class: C(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
|
|
84
|
+
"!mr-0 !mb-0 !border-0": r(d) === "modal"
|
|
96
85
|
}])
|
|
97
86
|
}, [
|
|
98
|
-
r(
|
|
87
|
+
r(R) ? (m(), N(oe, {
|
|
99
88
|
key: 0,
|
|
100
89
|
modelValue: r(a),
|
|
101
|
-
"onUpdate:modelValue": t[0] || (t[0] = (o) =>
|
|
102
|
-
class:
|
|
90
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => K(a) ? a.value = o : null),
|
|
91
|
+
class: C(["absolute top-2 left-3 z-50", [
|
|
103
92
|
{ hidden: r(a) },
|
|
104
93
|
{ "xl:!flex": !r(a) },
|
|
105
|
-
{ "!flex": r(
|
|
94
|
+
{ "!flex": r(d) === "modal" }
|
|
106
95
|
]])
|
|
107
|
-
}, null, 8, ["modelValue", "class"])) :
|
|
108
|
-
|
|
109
|
-
r(
|
|
96
|
+
}, null, 8, ["modelValue", "class"])) : U("", !0),
|
|
97
|
+
_("div", ve, [
|
|
98
|
+
r(R) ? (m(), N(ce, {
|
|
110
99
|
key: 0,
|
|
111
100
|
onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
|
|
112
|
-
})) :
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
invalidParams:
|
|
116
|
-
requestResult:
|
|
117
|
-
selectedSecuritySchemeUids:
|
|
101
|
+
})) : U("", !0),
|
|
102
|
+
_("div", Re, [
|
|
103
|
+
X(r(te), {
|
|
104
|
+
invalidParams: i.value,
|
|
105
|
+
requestResult: q.value,
|
|
106
|
+
selectedSecuritySchemeUids: y.value
|
|
118
107
|
}, null, 8, ["invalidParams", "requestResult", "selectedSecuritySchemeUids"])
|
|
119
108
|
])
|
|
120
109
|
])
|
|
@@ -122,5 +111,5 @@ const be = { class: "flex h-full" }, he = { class: "flex h-full flex-1 flex-col"
|
|
|
122
111
|
}
|
|
123
112
|
});
|
|
124
113
|
export {
|
|
125
|
-
|
|
114
|
+
Pe as default
|
|
126
115
|
};
|
|
@@ -1,60 +1,53 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarModal as
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as h, createBlock as x, openBlock as b, unref as o, withCtx as s, createElementVNode as c, toDisplayString as a, createVNode as r, createTextVNode as i } from "vue";
|
|
2
|
+
import { ScalarModal as _, ScalarButton as m } from "@scalar/components";
|
|
3
|
+
import { useWorkspace as y } from "../../../../store/store.js";
|
|
4
|
+
const S = { class: "text-c-2 mb-4 text-sm leading-normal" }, g = { class: "flex justify-between gap-2" }, v = /* @__PURE__ */ h({
|
|
5
5
|
__name: "DeleteRequestAuthModal",
|
|
6
6
|
props: {
|
|
7
7
|
state: {},
|
|
8
8
|
scheme: {}
|
|
9
9
|
},
|
|
10
10
|
emits: ["close", "delete"],
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
(e = l.scheme) != null && e.id && h.delete(l.scheme.id), c("delete");
|
|
11
|
+
setup(u, { emit: d }) {
|
|
12
|
+
const n = u, l = d, { securitySchemeMutators: p } = y(), f = () => {
|
|
13
|
+
n.scheme?.id && p.delete(n.scheme.id), l("delete");
|
|
15
14
|
};
|
|
16
|
-
return (
|
|
15
|
+
return (t, e) => (b(), x(o(_), {
|
|
17
16
|
size: "xxs",
|
|
18
|
-
state:
|
|
17
|
+
state: t.state,
|
|
19
18
|
title: "Delete Security Scheme"
|
|
20
19
|
}, {
|
|
21
|
-
default:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
r(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}),
|
|
49
|
-
_: 1
|
|
50
|
-
})
|
|
51
|
-
])
|
|
52
|
-
];
|
|
53
|
-
}),
|
|
20
|
+
default: s(() => [
|
|
21
|
+
c("p", S, " This cannot be undone. You're about to delete the " + a(t.scheme?.label) + " security scheme from the collection. ", 1),
|
|
22
|
+
c("div", g, [
|
|
23
|
+
r(o(m), {
|
|
24
|
+
class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
|
|
25
|
+
type: "button",
|
|
26
|
+
variant: "outlined",
|
|
27
|
+
onClick: e[0] || (e[0] = (k) => l("close"))
|
|
28
|
+
}, {
|
|
29
|
+
default: s(() => e[1] || (e[1] = [
|
|
30
|
+
i(" Cancel ")
|
|
31
|
+
])),
|
|
32
|
+
_: 1,
|
|
33
|
+
__: [1]
|
|
34
|
+
}),
|
|
35
|
+
r(o(m), {
|
|
36
|
+
class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
|
|
37
|
+
type: "submit",
|
|
38
|
+
onClick: f
|
|
39
|
+
}, {
|
|
40
|
+
default: s(() => [
|
|
41
|
+
i(" Delete " + a(t.scheme?.label), 1)
|
|
42
|
+
]),
|
|
43
|
+
_: 1
|
|
44
|
+
})
|
|
45
|
+
])
|
|
46
|
+
]),
|
|
54
47
|
_: 1
|
|
55
48
|
}, 8, ["state"]));
|
|
56
49
|
}
|
|
57
50
|
});
|
|
58
51
|
export {
|
|
59
|
-
|
|
52
|
+
v as default
|
|
60
53
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
import { pkceOptions as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import { useWorkspace as
|
|
6
|
-
import { updateScheme as
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as T, createElementBlock as V, openBlock as d, Fragment as U, createBlock as k, createCommentVNode as w, createVNode as r, unref as a, withCtx as o, mergeProps as m, createTextVNode as u, createElementVNode as $, renderSlot as P } from "vue";
|
|
2
|
+
import { useLoadingState as A, ScalarButton as v } from "@scalar/components";
|
|
3
|
+
import { pkceOptions as B } from "@scalar/oas-utils/entities/spec";
|
|
4
|
+
import { useToasts as L } from "@scalar/use-toasts";
|
|
5
|
+
import { useWorkspace as R } from "../../../../store/store.js";
|
|
6
|
+
import { updateScheme as F } from "../helpers/update-scheme.js";
|
|
7
|
+
import I from "./OAuthScopesInput.vue.js";
|
|
8
8
|
import p from "./RequestAuthDataTableInput.vue.js";
|
|
9
9
|
import i from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
10
|
-
import { authorizeOauth2 as
|
|
11
|
-
const
|
|
10
|
+
import { authorizeOauth2 as N } from "../../libs/oauth2.js";
|
|
11
|
+
const O = { class: "flex h-8 items-center justify-end border-t" }, j = { class: "flex h-8 w-full items-center justify-end border-t" }, q = /* @__PURE__ */ T({
|
|
12
12
|
__name: "OAuth2",
|
|
13
13
|
props: {
|
|
14
14
|
collection: {},
|
|
@@ -21,22 +21,21 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
21
21
|
workspace: {}
|
|
22
22
|
},
|
|
23
23
|
emits: ["authorized"],
|
|
24
|
-
setup(s, { emit:
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
if (y.isLoading || !((t = s.collection) != null && t.uid))
|
|
24
|
+
setup(s, { emit: z }) {
|
|
25
|
+
const S = z, y = A(), { toast: g } = L(), b = R(), n = (l, e) => F(s.scheme.uid, l, e, b, s.persistAuth), C = async () => {
|
|
26
|
+
if (y.isLoading || !s.collection?.uid)
|
|
28
27
|
return;
|
|
29
28
|
if (!s.server) {
|
|
30
29
|
g("No server selected", "error");
|
|
31
30
|
return;
|
|
32
31
|
}
|
|
33
32
|
y.startLoading();
|
|
34
|
-
const [l, e] = await
|
|
33
|
+
const [l, e] = await N(
|
|
35
34
|
s.flow,
|
|
36
35
|
s.server,
|
|
37
|
-
|
|
36
|
+
s.workspace?.proxyUrl
|
|
38
37
|
).finally(() => y.stopLoading());
|
|
39
|
-
e ? (n(`flows.${s.flow.type}.token`, e),
|
|
38
|
+
e ? (n(`flows.${s.flow.type}.token`, e), S("authorized")) : (console.error(l), g(l?.message ?? "Failed to authorize", "error"));
|
|
40
39
|
}, f = {
|
|
41
40
|
environment: s.environment,
|
|
42
41
|
envVariables: s.envVariables,
|
|
@@ -44,9 +43,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
44
43
|
};
|
|
45
44
|
return (l, e) => (d(), V(U, null, [
|
|
46
45
|
l.flow.token ? (d(), V(U, { key: 0 }, [
|
|
47
|
-
a(
|
|
46
|
+
r(a(i), null, {
|
|
48
47
|
default: o(() => [
|
|
49
|
-
|
|
48
|
+
r(p, m(f, {
|
|
50
49
|
class: "border-r-transparent",
|
|
51
50
|
modelValue: l.flow.token,
|
|
52
51
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
@@ -62,12 +61,12 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
62
61
|
]),
|
|
63
62
|
_: 1
|
|
64
63
|
}),
|
|
65
|
-
a(
|
|
64
|
+
r(a(i), { class: "min-w-full" }, {
|
|
66
65
|
default: o(() => [
|
|
67
|
-
|
|
68
|
-
a(
|
|
66
|
+
$("div", O, [
|
|
67
|
+
r(a(v), {
|
|
69
68
|
class: "mr-1 p-0 px-2 py-0.5",
|
|
70
|
-
loading:
|
|
69
|
+
loading: a(y),
|
|
71
70
|
size: "sm",
|
|
72
71
|
variant: "outlined",
|
|
73
72
|
onClick: e[1] || (e[1] = (t) => n(`flows.${l.flow.type}.token`, ""))
|
|
@@ -78,13 +77,13 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
78
77
|
_: 1,
|
|
79
78
|
__: [11]
|
|
80
79
|
}, 8, ["loading"]),
|
|
81
|
-
|
|
80
|
+
P(l.$slots, "oauth-actions")
|
|
82
81
|
])
|
|
83
82
|
]),
|
|
84
83
|
_: 3
|
|
85
84
|
})
|
|
86
85
|
], 64)) : (d(), V(U, { key: 1 }, [
|
|
87
|
-
a(
|
|
86
|
+
r(a(i), null, {
|
|
88
87
|
default: o(() => [
|
|
89
88
|
"authorizationUrl" in l.flow ? (d(), k(p, m({ key: 0 }, f, {
|
|
90
89
|
containerClass: "border-r-0",
|
|
@@ -112,9 +111,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
112
111
|
]),
|
|
113
112
|
_: 1
|
|
114
113
|
}),
|
|
115
|
-
"x-scalar-redirect-uri" in l.flow ? (d(), k(
|
|
114
|
+
"x-scalar-redirect-uri" in l.flow ? (d(), k(a(i), { key: 0 }, {
|
|
116
115
|
default: o(() => [
|
|
117
|
-
|
|
116
|
+
r(p, m(f, {
|
|
118
117
|
modelValue: l.flow["x-scalar-redirect-uri"],
|
|
119
118
|
placeholder: "https://galaxy.scalar.com/callback",
|
|
120
119
|
"onUpdate:modelValue": e[4] || (e[4] = (t) => n(`flows.${l.flow.type}.x-scalar-redirect-uri`, t))
|
|
@@ -129,9 +128,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
129
128
|
_: 1
|
|
130
129
|
})) : w("", !0),
|
|
131
130
|
l.flow.type === "password" ? (d(), V(U, { key: 1 }, [
|
|
132
|
-
a(
|
|
131
|
+
r(a(i), null, {
|
|
133
132
|
default: o(() => [
|
|
134
|
-
|
|
133
|
+
r(p, m(f, {
|
|
135
134
|
class: "text-c-2",
|
|
136
135
|
modelValue: l.flow.username,
|
|
137
136
|
placeholder: "janedoe",
|
|
@@ -146,9 +145,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
146
145
|
]),
|
|
147
146
|
_: 1
|
|
148
147
|
}),
|
|
149
|
-
a(
|
|
148
|
+
r(a(i), null, {
|
|
150
149
|
default: o(() => [
|
|
151
|
-
|
|
150
|
+
r(p, m(f, {
|
|
152
151
|
modelValue: l.flow.password,
|
|
153
152
|
placeholder: "********",
|
|
154
153
|
type: "password",
|
|
@@ -164,9 +163,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
164
163
|
_: 1
|
|
165
164
|
})
|
|
166
165
|
], 64)) : w("", !0),
|
|
167
|
-
a(
|
|
166
|
+
r(a(i), null, {
|
|
168
167
|
default: o(() => [
|
|
169
|
-
|
|
168
|
+
r(p, m(f, {
|
|
170
169
|
modelValue: l.flow["x-scalar-client-id"],
|
|
171
170
|
placeholder: "12345",
|
|
172
171
|
"onUpdate:modelValue": e[7] || (e[7] = (t) => n(`flows.${l.flow.type}.x-scalar-client-id`, t))
|
|
@@ -180,9 +179,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
180
179
|
]),
|
|
181
180
|
_: 1
|
|
182
181
|
}),
|
|
183
|
-
"clientSecret" in l.flow ? (d(), k(
|
|
182
|
+
"clientSecret" in l.flow ? (d(), k(a(i), { key: 2 }, {
|
|
184
183
|
default: o(() => [
|
|
185
|
-
|
|
184
|
+
r(p, m(f, {
|
|
186
185
|
modelValue: l.flow.clientSecret,
|
|
187
186
|
placeholder: "XYZ123",
|
|
188
187
|
type: "password",
|
|
@@ -197,10 +196,10 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
197
196
|
]),
|
|
198
197
|
_: 1
|
|
199
198
|
})) : w("", !0),
|
|
200
|
-
"x-usePkce" in l.flow ? (d(), k(
|
|
199
|
+
"x-usePkce" in l.flow ? (d(), k(a(i), { key: 3 }, {
|
|
201
200
|
default: o(() => [
|
|
202
|
-
|
|
203
|
-
enum:
|
|
201
|
+
r(p, m(f, {
|
|
202
|
+
enum: a(B),
|
|
204
203
|
modelValue: l.flow["x-usePkce"],
|
|
205
204
|
readOnly: "",
|
|
206
205
|
"onUpdate:modelValue": e[9] || (e[9] = (t) => n(
|
|
@@ -217,9 +216,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
217
216
|
]),
|
|
218
217
|
_: 1
|
|
219
218
|
})) : w("", !0),
|
|
220
|
-
Object.keys(l.flow.scopes ?? {}).length ? (d(), k(
|
|
219
|
+
Object.keys(l.flow.scopes ?? {}).length ? (d(), k(a(i), { key: 4 }, {
|
|
221
220
|
default: o(() => [
|
|
222
|
-
|
|
221
|
+
r(I, {
|
|
223
222
|
flow: l.flow,
|
|
224
223
|
updateScheme: n
|
|
225
224
|
}, null, 8, ["flow"])
|
|
@@ -227,18 +226,18 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
227
226
|
_: 1
|
|
228
227
|
})) : w("", !0)
|
|
229
228
|
], 64)),
|
|
230
|
-
l.flow.token ? w("", !0) : (d(), k(
|
|
229
|
+
l.flow.token ? w("", !0) : (d(), k(a(i), {
|
|
231
230
|
key: 2,
|
|
232
231
|
class: "min-w-full"
|
|
233
232
|
}, {
|
|
234
233
|
default: o(() => [
|
|
235
|
-
|
|
236
|
-
a(
|
|
234
|
+
$("div", j, [
|
|
235
|
+
r(a(v), {
|
|
237
236
|
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
238
|
-
loading:
|
|
237
|
+
loading: a(y),
|
|
239
238
|
size: "sm",
|
|
240
239
|
variant: "outlined",
|
|
241
|
-
onClick:
|
|
240
|
+
onClick: C
|
|
242
241
|
}, {
|
|
243
242
|
default: o(() => e[20] || (e[20] = [
|
|
244
243
|
u(" Authorize ")
|
|
@@ -254,5 +253,5 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
|
|
|
254
253
|
}
|
|
255
254
|
});
|
|
256
255
|
export {
|
|
257
|
-
|
|
256
|
+
q as default
|
|
258
257
|
};
|