@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,34 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { isLocalUrl as
|
|
4
|
-
import { normalize as
|
|
5
|
-
import { getThemeStyles as
|
|
6
|
-
import { useColorMode as
|
|
7
|
-
import { useRouter as
|
|
8
|
-
import
|
|
9
|
-
import { useUrlPrefetcher as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { getOpenApiVersion as
|
|
14
|
-
import { isDocument as
|
|
15
|
-
import { isUrl as
|
|
16
|
-
import
|
|
17
|
-
import { useActiveEntities as
|
|
18
|
-
import { useWorkspace as
|
|
19
|
-
const
|
|
1
|
+
import { defineComponent as F, ref as R, computed as c, watch as y, onMounted as q, onUnmounted as B, createBlock as H, openBlock as l, unref as i, withCtx as W, createElementBlock as a, createCommentVNode as u, createElementVNode as e, normalizeClass as K, Fragment as g, createVNode as d, toDisplayString as G, createTextVNode as k } from "vue";
|
|
2
|
+
import { useModal as J, ScalarModal as Q, ScalarIcon as X } from "@scalar/components";
|
|
3
|
+
import { isLocalUrl as Y } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { normalize as Z } from "@scalar/openapi-parser";
|
|
5
|
+
import { getThemeStyles as ee, themeIds as te } from "@scalar/themes";
|
|
6
|
+
import { useColorMode as oe } from "@scalar/use-hooks/useColorMode";
|
|
7
|
+
import { useRouter as se } from "vue-router";
|
|
8
|
+
import ne from "../CommandPalette/WatchModeToggle.vue.js";
|
|
9
|
+
import { useUrlPrefetcher as re } from "./hooks/useUrlPrefetcher.js";
|
|
10
|
+
import ie from "./ImportNowButton.vue.js";
|
|
11
|
+
import le from "./IntegrationLogo.vue.js";
|
|
12
|
+
import ce from "./PrefetchError.vue.js";
|
|
13
|
+
import { getOpenApiVersion as I } from "./utils/get-openapi-version.js";
|
|
14
|
+
import { isDocument as L } from "./utils/is-document.js";
|
|
15
|
+
import { isUrl as M } from "./utils/is-url.js";
|
|
16
|
+
import ae from "./WorkspaceSelector.vue.js";
|
|
17
|
+
import { useActiveEntities as de } from "../../store/active-entities.js";
|
|
18
|
+
import { useWorkspace as me } from "../../store/store.js";
|
|
19
|
+
const ue = ["innerHTML"], fe = { class: "relative flex h-screen flex-col justify-center overflow-hidden px-6 md:px-0" }, pe = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "mb-2 flex items-center justify-center p-1"
|
|
22
|
-
},
|
|
22
|
+
}, ve = { class: "size-10 rounded-xl" }, he = ["src"], xe = {
|
|
23
23
|
key: 2,
|
|
24
24
|
class: "text-md mb-2 line-clamp-1 text-center font-bold"
|
|
25
|
-
},
|
|
25
|
+
}, ye = { class: "z-10 inline-flex w-full flex-col items-center gap-2" }, ge = { class: "flex justify-center" }, _e = { class: "text-c-3 inline-flex items-center px-4 py-1 text-xs font-medium" }, be = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "mt-5 overflow-hidden border-t pt-4 text-sm"
|
|
28
|
-
},
|
|
28
|
+
}, we = { class: "flex items-center justify-center" }, ke = { class: "flex flex-col items-center justify-center pb-8" }, Ie = { class: "flex flex-col items-center text-center" }, Le = { class: "mb-2 flex h-10 w-10 items-center justify-center rounded-[10px] border" }, Me = {
|
|
29
29
|
href: "https://scalar.com/download",
|
|
30
30
|
target: "_blank"
|
|
31
|
-
},
|
|
31
|
+
}, He = /* @__PURE__ */ F({
|
|
32
32
|
__name: "ImportCollectionModal",
|
|
33
33
|
props: {
|
|
34
34
|
source: {},
|
|
@@ -36,181 +36,173 @@ const he = ["innerHTML"], xe = { class: "relative flex h-screen flex-col justify
|
|
|
36
36
|
eventType: {}
|
|
37
37
|
},
|
|
38
38
|
emits: ["importFinished"],
|
|
39
|
-
setup(
|
|
40
|
-
const s =
|
|
41
|
-
|
|
42
|
-
const
|
|
39
|
+
setup(T, { emit: U }) {
|
|
40
|
+
const s = T, A = U, { activeWorkspace: f } = de(), { workspaceMutators: C, events: P } = me(), { prefetchResult: n, prefetchUrl: _, resetPrefetchResult: V } = re(), r = J(), p = R(!0);
|
|
41
|
+
P.hotKeys.on(() => r.hide());
|
|
42
|
+
const j = c(() => {
|
|
43
43
|
try {
|
|
44
|
-
return
|
|
44
|
+
return Z(
|
|
45
45
|
n.content || s.source || ""
|
|
46
46
|
);
|
|
47
47
|
} catch {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}), k = a(
|
|
54
|
-
() => T(n.content || s.source || "")
|
|
55
|
-
), { darkLightMode: O } = ie(), { currentRoute: $ } = le(), x = a(() => {
|
|
50
|
+
}), D = c(() => j.value?.info?.title), b = c(
|
|
51
|
+
() => I(n.content || s.source || "")
|
|
52
|
+
), { darkLightMode: S } = oe(), { currentRoute: z } = se(), v = c(() => {
|
|
56
53
|
try {
|
|
57
|
-
const o =
|
|
54
|
+
const o = z.value.query, t = S.value === "dark" ? o.dark_logo : o.light_logo;
|
|
58
55
|
if (t)
|
|
59
56
|
return decodeURIComponent(t);
|
|
60
57
|
} catch {
|
|
61
58
|
}
|
|
62
59
|
return null;
|
|
63
60
|
});
|
|
64
|
-
|
|
61
|
+
y(
|
|
65
62
|
() => s.source,
|
|
66
63
|
async (o) => {
|
|
67
|
-
|
|
68
|
-
if (S(), A(o)) {
|
|
64
|
+
if (V(), M(o)) {
|
|
69
65
|
if (s.eventType && ["paste", "drop"].includes(s.eventType)) {
|
|
70
|
-
const { error:
|
|
66
|
+
const { error: m } = await _(
|
|
71
67
|
o,
|
|
72
|
-
|
|
68
|
+
f.value?.proxyUrl
|
|
73
69
|
);
|
|
74
|
-
|
|
70
|
+
m ? r.hide() : r.show();
|
|
75
71
|
return;
|
|
76
72
|
}
|
|
77
|
-
|
|
73
|
+
_(o, f.value?.proxyUrl), r.show();
|
|
78
74
|
return;
|
|
79
75
|
}
|
|
80
|
-
o &&
|
|
76
|
+
o && L(o) && I(o) ? r.show() : r.hide();
|
|
81
77
|
}
|
|
82
78
|
);
|
|
83
|
-
const
|
|
84
|
-
document.body.classList.remove("has-no-import-url"), (
|
|
85
|
-
},
|
|
79
|
+
const N = c(() => !!s.source && M(s.source)), O = c(() => !!s.source && L(s.source)), h = c(() => n.url && Y(n.url)), x = (o) => {
|
|
80
|
+
document.body.classList.remove("has-no-import-url"), (N.value || O.value) && r.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
81
|
+
}, $ = () => {
|
|
86
82
|
document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
|
|
87
83
|
};
|
|
88
|
-
|
|
84
|
+
y(
|
|
89
85
|
() => r.open,
|
|
90
86
|
(o) => {
|
|
91
|
-
o ?
|
|
87
|
+
o ? x() : $();
|
|
92
88
|
}
|
|
93
|
-
),
|
|
89
|
+
), y(
|
|
94
90
|
() => s.source,
|
|
95
91
|
() => {
|
|
96
|
-
|
|
92
|
+
x();
|
|
97
93
|
}
|
|
98
|
-
),
|
|
99
|
-
|
|
100
|
-
}),
|
|
94
|
+
), q(() => {
|
|
95
|
+
x();
|
|
96
|
+
}), B(() => {
|
|
101
97
|
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
102
98
|
});
|
|
103
|
-
const
|
|
104
|
-
() =>
|
|
99
|
+
const w = c(
|
|
100
|
+
() => f.value && h.value && s.integration && `<style>${ee(s.integration)}</style>`
|
|
105
101
|
);
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
(c = p.value) == null ? void 0 : c.uid,
|
|
102
|
+
function E() {
|
|
103
|
+
const o = (m) => te.includes(m), t = s.integration && o(s.integration) ? s.integration : "default";
|
|
104
|
+
h.value && C.edit(
|
|
105
|
+
f.value?.uid,
|
|
111
106
|
"themeId",
|
|
112
107
|
t
|
|
113
|
-
),
|
|
108
|
+
), A("importFinished");
|
|
114
109
|
}
|
|
115
|
-
return (o, t) => (l(),
|
|
110
|
+
return (o, t) => (l(), H(i(Q), {
|
|
116
111
|
size: "full",
|
|
117
112
|
state: i(r)
|
|
118
113
|
}, {
|
|
119
|
-
default:
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
114
|
+
default: W(() => [
|
|
115
|
+
w.value ? (l(), a("div", {
|
|
116
|
+
key: 0,
|
|
117
|
+
innerHTML: w.value
|
|
118
|
+
}, null, 8, ue)) : u("", !0),
|
|
119
|
+
e("div", fe, [
|
|
120
|
+
t[6] || (t[6] = e("div", { class: "section-flare" }, [
|
|
121
|
+
e("div", { class: "section-flare-item" }),
|
|
122
|
+
e("div", { class: "section-flare-item" }),
|
|
123
|
+
e("div", { class: "section-flare-item" }),
|
|
124
|
+
e("div", { class: "section-flare-item" }),
|
|
125
|
+
e("div", { class: "section-flare-item" }),
|
|
126
|
+
e("div", { class: "section-flare-item" }),
|
|
127
|
+
e("div", { class: "section-flare-item" }),
|
|
128
|
+
e("div", { class: "section-flare-item" })
|
|
129
|
+
], -1)),
|
|
130
|
+
e("div", {
|
|
131
|
+
class: K(["m-auto flex w-full max-w-[380px] flex-col items-center rounded-xl border px-8 py-8 transition-opacity", { "opacity-0": i(n).state === "loading" }])
|
|
132
|
+
}, [
|
|
133
|
+
i(n).error && i(n).state === "idle" && !b.value ? (l(), a(g, { key: 0 }, [
|
|
134
|
+
t[1] || (t[1] = e("div", { class: "text-md mb-2 line-clamp-1 text-center font-bold" }, " No OpenAPI document found ", -1)),
|
|
135
|
+
d(ce, {
|
|
136
|
+
url: i(n)?.input || s.source
|
|
137
|
+
}, null, 8, ["url"])
|
|
138
|
+
], 64)) : (l(), a(g, { key: 1 }, [
|
|
139
|
+
h.value ? (l(), a("div", pe, [
|
|
140
|
+
e("div", ve, [
|
|
141
|
+
d(le, { integration: o.integration }, null, 8, ["integration"])
|
|
142
|
+
])
|
|
143
|
+
])) : v.value ? (l(), a("img", {
|
|
144
|
+
key: 1,
|
|
145
|
+
alt: "Logo",
|
|
146
|
+
class: "mb-2 w-full object-contain",
|
|
147
|
+
src: v.value
|
|
148
|
+
}, null, 8, he)) : u("", !0),
|
|
149
|
+
v.value ? u("", !0) : (l(), a("div", xe, G(D.value || "Untitled Collection"), 1)),
|
|
150
|
+
t[4] || (t[4] = e("div", { class: "text-c-1 text-center text-sm font-medium text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
|
|
151
|
+
b.value ? (l(), a(g, { key: 3 }, [
|
|
152
|
+
e("div", ye, [
|
|
153
|
+
d(ie, {
|
|
154
|
+
source: i(n)?.url ?? i(n)?.content ?? o.source,
|
|
155
|
+
variant: "button",
|
|
156
|
+
watchMode: p.value,
|
|
157
|
+
onImportFinished: E
|
|
158
|
+
}, null, 8, ["source", "watchMode"])
|
|
159
|
+
]),
|
|
160
|
+
e("div", ge, [
|
|
161
|
+
e("div", _e, [
|
|
162
|
+
t[2] || (t[2] = k(" Import to: ")),
|
|
163
|
+
d(ae)
|
|
149
164
|
])
|
|
150
|
-
])
|
|
151
|
-
|
|
152
|
-
alt: "Logo",
|
|
153
|
-
class: "mb-2 w-full object-contain",
|
|
154
|
-
src: x.value
|
|
155
|
-
}, null, 8, _e)) : f("", !0),
|
|
156
|
-
x.value ? f("", !0) : (l(), d("div", be, Y(N.value || "Untitled Collection"), 1)),
|
|
157
|
-
t[4] || (t[4] = e("div", { class: "text-c-1 text-center text-sm font-medium text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
|
|
158
|
-
k.value ? (l(), d(b, { key: 3 }, [
|
|
165
|
+
]),
|
|
166
|
+
i(n)?.url ? (l(), a("div", be, [
|
|
159
167
|
e("div", we, [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}, null, 8, ["source", "watchMode"])
|
|
166
|
-
]),
|
|
167
|
-
e("div", ke, [
|
|
168
|
-
e("div", Ie, [
|
|
169
|
-
t[2] || (t[2] = M(" Import to: ")),
|
|
170
|
-
m(fe)
|
|
171
|
-
])
|
|
168
|
+
d(ne, {
|
|
169
|
+
modelValue: p.value,
|
|
170
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => p.value = m),
|
|
171
|
+
disableToolTip: !0
|
|
172
|
+
}, null, 8, ["modelValue"])
|
|
172
173
|
]),
|
|
173
|
-
(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
e("a", {
|
|
198
|
-
class: "hover:text-c-1 mb-1 inline-block underline-offset-2",
|
|
199
|
-
href: "https://scalar.com/download",
|
|
200
|
-
target: "_blank"
|
|
201
|
-
}, " Download Desktop App "),
|
|
202
|
-
e("br"),
|
|
203
|
-
M(" free · open-source · offline first ")
|
|
204
|
-
], -1))
|
|
205
|
-
])
|
|
174
|
+
t[3] || (t[3] = e("div", { class: "text-c-3 pt-0 text-center text-xs font-medium text-balance" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
|
|
175
|
+
])) : u("", !0)
|
|
176
|
+
], 64)) : u("", !0)
|
|
177
|
+
], 64))
|
|
178
|
+
], 2),
|
|
179
|
+
e("div", ke, [
|
|
180
|
+
e("div", Ie, [
|
|
181
|
+
e("div", Le, [
|
|
182
|
+
e("a", Me, [
|
|
183
|
+
d(i(X), {
|
|
184
|
+
icon: "Logo",
|
|
185
|
+
size: "xl"
|
|
186
|
+
})
|
|
187
|
+
])
|
|
188
|
+
]),
|
|
189
|
+
t[5] || (t[5] = e("span", { class: "text-c-2 text-sm leading-snug font-medium" }, [
|
|
190
|
+
e("a", {
|
|
191
|
+
class: "hover:text-c-1 mb-1 inline-block underline-offset-2",
|
|
192
|
+
href: "https://scalar.com/download",
|
|
193
|
+
target: "_blank"
|
|
194
|
+
}, " Download Desktop App "),
|
|
195
|
+
e("br"),
|
|
196
|
+
k(" free · open-source · offline first ")
|
|
197
|
+
], -1))
|
|
206
198
|
])
|
|
207
199
|
])
|
|
208
|
-
]
|
|
209
|
-
|
|
200
|
+
])
|
|
201
|
+
]),
|
|
210
202
|
_: 1
|
|
211
203
|
}, 8, ["state"]));
|
|
212
204
|
}
|
|
213
205
|
});
|
|
214
206
|
export {
|
|
215
|
-
|
|
207
|
+
He as default
|
|
216
208
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as y, createElementBlock as C, createCommentVNode as h, openBlock as o, Fragment as v, createBlock as u, unref as a, withCtx as m, createTextVNode as
|
|
2
|
-
import { ScalarButton as
|
|
1
|
+
import { defineComponent as y, createElementBlock as C, createCommentVNode as h, openBlock as o, Fragment as v, createBlock as u, unref as a, withCtx as m, createTextVNode as c } from "vue";
|
|
2
|
+
import { ScalarButton as p } from "@scalar/components";
|
|
3
3
|
import { useToasts as b } from "@scalar/use-toasts";
|
|
4
4
|
import { useRouter as g } from "vue-router";
|
|
5
5
|
import { useActiveEntities as x } from "../../store/active-entities.js";
|
|
@@ -13,48 +13,47 @@ const z = /* @__PURE__ */ y({
|
|
|
13
13
|
watchMode: { type: Boolean, default: !0 }
|
|
14
14
|
},
|
|
15
15
|
emits: ["importFinished"],
|
|
16
|
-
setup(r, { emit:
|
|
17
|
-
const
|
|
16
|
+
setup(r, { emit: l }) {
|
|
17
|
+
const f = l, d = g(), k = I(), { activeWorkspace: n } = x(), { toast: s } = b();
|
|
18
18
|
async function i() {
|
|
19
19
|
B({
|
|
20
20
|
store: k,
|
|
21
|
-
workspace:
|
|
21
|
+
workspace: n.value,
|
|
22
22
|
source: r.source,
|
|
23
23
|
watchMode: r.watchMode,
|
|
24
|
-
onSuccess(
|
|
25
|
-
|
|
24
|
+
onSuccess(e) {
|
|
25
|
+
e && (w(e), s("Import successful", "info"), f("importFinished"));
|
|
26
26
|
},
|
|
27
|
-
onError(
|
|
28
|
-
console.error("[importCollection]",
|
|
29
|
-
const
|
|
30
|
-
|
|
27
|
+
onError(e) {
|
|
28
|
+
console.error("[importCollection]", e);
|
|
29
|
+
const t = e?.message || "Unknown error";
|
|
30
|
+
s(`Import failed: ${t}`, "error");
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
function w(
|
|
35
|
-
|
|
36
|
-
t && l.push({
|
|
34
|
+
function w(e) {
|
|
35
|
+
e && d.push({
|
|
37
36
|
name: "request",
|
|
38
37
|
params: {
|
|
39
|
-
workspace:
|
|
40
|
-
request:
|
|
38
|
+
workspace: n.value?.uid,
|
|
39
|
+
request: e?.requests[0]
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
|
-
return (
|
|
45
|
-
|
|
43
|
+
return (e, t) => e.source ? (o(), C(v, { key: 0 }, [
|
|
44
|
+
e.variant === "button" ? (o(), u(a(p), {
|
|
46
45
|
key: 0,
|
|
47
46
|
class: "mt-3 h-fit w-full rounded-lg px-6 py-2.5 font-bold",
|
|
48
47
|
size: "md",
|
|
49
48
|
type: "button",
|
|
50
49
|
onClick: i
|
|
51
50
|
}, {
|
|
52
|
-
default: m(() =>
|
|
53
|
-
|
|
51
|
+
default: m(() => t[0] || (t[0] = [
|
|
52
|
+
c(" Import Collection ")
|
|
54
53
|
])),
|
|
55
54
|
_: 1,
|
|
56
55
|
__: [0]
|
|
57
|
-
})) : (o(), u(a(
|
|
56
|
+
})) : (o(), u(a(p), {
|
|
58
57
|
key: 1,
|
|
59
58
|
class: "h-fit rounded-lg px-6 py-2.5 text-[21px] font-bold",
|
|
60
59
|
size: "md",
|
|
@@ -62,8 +61,8 @@ const z = /* @__PURE__ */ y({
|
|
|
62
61
|
variant: "ghost",
|
|
63
62
|
onClick: i
|
|
64
63
|
}, {
|
|
65
|
-
default: m(() =>
|
|
66
|
-
|
|
64
|
+
default: m(() => t[1] || (t[1] = [
|
|
65
|
+
c(" Try it in the browser ")
|
|
67
66
|
])),
|
|
68
67
|
_: 1,
|
|
69
68
|
__: [1]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as c, computed as i, createBlock as l, openBlock as p, unref as u } from "vue";
|
|
2
|
+
import { ScalarIcon as f } from "@scalar/components";
|
|
3
|
+
const m = /* @__PURE__ */ c({
|
|
4
4
|
__name: "IntegrationLogo",
|
|
5
5
|
props: {
|
|
6
6
|
integration: {}
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
8
|
+
setup(e) {
|
|
9
|
+
const n = e, a = [
|
|
10
10
|
"adonisjs",
|
|
11
11
|
"dotnet",
|
|
12
12
|
"elysiajs",
|
|
@@ -25,20 +25,19 @@ const I = /* @__PURE__ */ i({
|
|
|
25
25
|
"react",
|
|
26
26
|
"rust",
|
|
27
27
|
"svelte"
|
|
28
|
-
],
|
|
29
|
-
|
|
30
|
-
const o = "Openapi", t = (e = a.integration) == null ? void 0 : e.toLocaleLowerCase();
|
|
28
|
+
], r = i(() => {
|
|
29
|
+
const o = "Openapi", t = n.integration?.toLocaleLowerCase();
|
|
31
30
|
if (!t)
|
|
32
31
|
return o;
|
|
33
|
-
const
|
|
34
|
-
return
|
|
32
|
+
const s = t.charAt(0).toUpperCase() + t.slice(1);
|
|
33
|
+
return a.includes(t) ? s : o;
|
|
35
34
|
});
|
|
36
|
-
return (o, t) => (
|
|
35
|
+
return (o, t) => (p(), l(u(f), {
|
|
37
36
|
class: "h-full w-full rounded-lg",
|
|
38
|
-
logo:
|
|
37
|
+
logo: r.value
|
|
39
38
|
}, null, 8, ["logo"]));
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
export {
|
|
43
|
-
|
|
42
|
+
m as default
|
|
44
43
|
};
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as r, onMounted as c, onBeforeUnmount as m } from "vue";
|
|
2
|
+
const p = /* @__PURE__ */ r({
|
|
3
3
|
__name: "PasteEventListener",
|
|
4
4
|
emits: ["input"],
|
|
5
|
-
setup(
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
setup(u, { emit: o }) {
|
|
6
|
+
const s = o;
|
|
7
|
+
c(() => {
|
|
8
8
|
document.addEventListener("paste", n);
|
|
9
|
-
}),
|
|
9
|
+
}), m(() => {
|
|
10
10
|
document.removeEventListener("paste", n);
|
|
11
11
|
});
|
|
12
12
|
async function n(e) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
o && i("input", o, null, "paste");
|
|
13
|
+
const t = e.target, i = !!document.activeElement?.classList.contains("cm-content");
|
|
14
|
+
if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable || i)) && e.clipboardData) {
|
|
15
|
+
const a = e.clipboardData.getData("text");
|
|
16
|
+
a && s("input", a, null, "paste");
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
return (e, t) => null;
|
|
21
20
|
}
|
|
22
21
|
});
|
|
23
22
|
export {
|
|
24
|
-
|
|
23
|
+
p as default
|
|
25
24
|
};
|