@scalar/api-client 2.5.32 → 2.5.34
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 +39 -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 +3 -3
- 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,117 +1,108 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarDropdown as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { PathId as
|
|
5
|
-
import { useActiveEntities as
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
import { useLayout as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as B, computed as E, watch as h, onMounted as D, createBlock as v, openBlock as s, unref as n, withCtx as r, createVNode as l, createElementVNode as d, toDisplayString as g, createElementBlock as L, createCommentVNode as M, Fragment as V, renderList as W, withModifiers as w, createTextVNode as _ } from "vue";
|
|
2
|
+
import { ScalarDropdown as j, ScalarButton as T, ScalarDropdownItem as p, ScalarListboxCheckbox as k, ScalarDropdownDivider as $, ScalarIcon as z } from "@scalar/components";
|
|
3
|
+
import { useRouter as A } from "vue-router";
|
|
4
|
+
import { PathId as F } from "../../routes.js";
|
|
5
|
+
import { useActiveEntities as O } from "../../store/active-entities.js";
|
|
6
|
+
import { useWorkspace as P } from "../../store/store.js";
|
|
7
|
+
import { useLayout as R } from "../../hooks/useLayout.js";
|
|
8
|
+
const q = { class: "m-0 flex items-center gap-1.5 font-medium whitespace-nowrap" }, G = { class: "flex h-4 w-4 items-center justify-center" }, ee = /* @__PURE__ */ B({
|
|
9
9
|
__name: "EnvironmentSelector",
|
|
10
|
-
setup(
|
|
11
|
-
const { activeCollection:
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
setup(H) {
|
|
11
|
+
const { activeCollection: o, activeWorkspace: i, activeEnvironment: c } = O(), { collectionMutators: S } = P(), { layout: C } = R(), y = A(), m = (t) => {
|
|
12
|
+
o.value && i.value && (S.edit(
|
|
13
|
+
o.value.uid,
|
|
14
14
|
"x-scalar-active-environment",
|
|
15
|
-
|
|
16
|
-
),
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
const { value:
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
...i,
|
|
32
|
-
uid: o,
|
|
33
|
-
name: o
|
|
15
|
+
t
|
|
16
|
+
), i.value.activeEnvironmentId = t);
|
|
17
|
+
}, I = () => y.push({
|
|
18
|
+
name: "environment.default",
|
|
19
|
+
params: {
|
|
20
|
+
[F.Workspace]: i.value?.uid
|
|
21
|
+
}
|
|
22
|
+
}), N = E(() => {
|
|
23
|
+
const { value: t } = c, { value: e } = o;
|
|
24
|
+
return t?.name || e?.["x-scalar-active-environment"] || "No Environment";
|
|
25
|
+
}), u = E(() => {
|
|
26
|
+
const { value: t } = o, e = t?.["x-scalar-environments"];
|
|
27
|
+
return e ? Object.entries(e).map(([a, x]) => ({
|
|
28
|
+
...x,
|
|
29
|
+
uid: a,
|
|
30
|
+
name: a
|
|
34
31
|
})) : [];
|
|
35
|
-
}),
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
|
|
32
|
+
}), b = () => {
|
|
33
|
+
const t = u.value;
|
|
34
|
+
if (t.length > 0) {
|
|
35
|
+
const e = t[t.length - 1];
|
|
36
|
+
e?.uid && m(e.uid);
|
|
40
37
|
}
|
|
41
38
|
};
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
h(u, (t, e) => {
|
|
40
|
+
t.length > e.length && b();
|
|
44
41
|
});
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
42
|
+
const f = (t) => {
|
|
43
|
+
const e = t["x-scalar-active-environment"];
|
|
44
|
+
e && o.value && i.value ? (o.value["x-scalar-active-environment"] = e, i.value.activeEnvironmentId = e) : i.value && (i.value.activeEnvironmentId = "");
|
|
48
45
|
};
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
(
|
|
52
|
-
),
|
|
53
|
-
|
|
54
|
-
}), (
|
|
55
|
-
items:
|
|
56
|
-
(
|
|
57
|
-
key:
|
|
46
|
+
return h(
|
|
47
|
+
o,
|
|
48
|
+
(t) => t && f(t)
|
|
49
|
+
), D(() => {
|
|
50
|
+
o.value && f(o.value);
|
|
51
|
+
}), (t, e) => (s(), v(n(j), { teleport: "" }, {
|
|
52
|
+
items: r(() => [
|
|
53
|
+
(s(!0), L(V, null, W(u.value, (a) => (s(), v(n(p), {
|
|
54
|
+
key: a.uid,
|
|
58
55
|
class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
59
|
-
onClick:
|
|
56
|
+
onClick: w((x) => m(a.uid), ["stop"])
|
|
60
57
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
k(" " + w(o.name), 1)
|
|
68
|
-
];
|
|
69
|
-
}),
|
|
58
|
+
default: r(() => [
|
|
59
|
+
l(n(k), {
|
|
60
|
+
selected: n(o)?.["x-scalar-active-environment"] === a.uid
|
|
61
|
+
}, null, 8, ["selected"]),
|
|
62
|
+
_(" " + g(a.name), 1)
|
|
63
|
+
]),
|
|
70
64
|
_: 2
|
|
71
65
|
}, 1032, ["onClick"]))), 128)),
|
|
72
|
-
l(n(
|
|
66
|
+
l(n(p), {
|
|
73
67
|
class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
74
|
-
onClick:
|
|
68
|
+
onClick: e[0] || (e[0] = w((a) => m(""), ["stop"]))
|
|
75
69
|
}, {
|
|
76
|
-
default:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
t[1] || (t[1] = k(" No Environment "))
|
|
83
|
-
];
|
|
84
|
-
}),
|
|
70
|
+
default: r(() => [
|
|
71
|
+
l(n(k), {
|
|
72
|
+
selected: n(c)?.uid === "" && n(o)?.["x-scalar-active-environment"] === "" || n(c)?.name === "No Environment"
|
|
73
|
+
}, null, 8, ["selected"]),
|
|
74
|
+
e[1] || (e[1] = _(" No Environment "))
|
|
75
|
+
]),
|
|
85
76
|
_: 1,
|
|
86
77
|
__: [1]
|
|
87
78
|
}),
|
|
88
|
-
l(n(
|
|
89
|
-
n(
|
|
79
|
+
l(n($)),
|
|
80
|
+
n(C) !== "modal" ? (s(), v(n(p), {
|
|
90
81
|
key: 0,
|
|
91
82
|
class: "flex items-center gap-1.5",
|
|
92
|
-
onClick:
|
|
83
|
+
onClick: I
|
|
93
84
|
}, {
|
|
94
|
-
default:
|
|
95
|
-
|
|
96
|
-
l(n(
|
|
85
|
+
default: r(() => [
|
|
86
|
+
d("div", G, [
|
|
87
|
+
l(n(z), {
|
|
97
88
|
icon: "Brackets",
|
|
98
89
|
size: "sm"
|
|
99
90
|
})
|
|
100
91
|
]),
|
|
101
|
-
|
|
92
|
+
e[2] || (e[2] = d("span", { class: "leading-none" }, "Manage Environments", -1))
|
|
102
93
|
]),
|
|
103
94
|
_: 1,
|
|
104
95
|
__: [2]
|
|
105
|
-
})) :
|
|
96
|
+
})) : M("", !0)
|
|
106
97
|
]),
|
|
107
|
-
default:
|
|
108
|
-
l(n(
|
|
98
|
+
default: r(() => [
|
|
99
|
+
l(n(T), {
|
|
109
100
|
class: "text-c-1 hover:bg-b-2 line-clamp-1 h-auto w-fit justify-start px-1.5 py-1.5 font-normal",
|
|
110
101
|
fullWidth: "",
|
|
111
102
|
variant: "ghost"
|
|
112
103
|
}, {
|
|
113
|
-
default:
|
|
114
|
-
|
|
104
|
+
default: r(() => [
|
|
105
|
+
d("h2", q, g(N.value), 1)
|
|
115
106
|
]),
|
|
116
107
|
_: 1
|
|
117
108
|
})
|
|
@@ -121,5 +112,5 @@ const G = { class: "m-0 flex items-center gap-1.5 font-medium whitespace-nowrap"
|
|
|
121
112
|
}
|
|
122
113
|
});
|
|
123
114
|
export {
|
|
124
|
-
|
|
115
|
+
ee as default
|
|
125
116
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as g, computed as
|
|
1
|
+
import { defineComponent as g, computed as a, createBlock as y, createElementBlock as C, openBlock as p, unref as t, withCtx as q, createElementVNode as s, normalizeClass as l, toDisplayString as c } from "vue";
|
|
2
2
|
import { cva as k, ScalarListbox as w, cx as m } from "@scalar/components";
|
|
3
3
|
import { getHttpMethodInfo as f, REQUEST_METHODS as x } from "@scalar/helpers/http/http-info";
|
|
4
4
|
const H = /* @__PURE__ */ g({
|
|
@@ -10,13 +10,13 @@ const H = /* @__PURE__ */ g({
|
|
|
10
10
|
},
|
|
11
11
|
emits: ["change"],
|
|
12
12
|
setup(b, { emit: h }) {
|
|
13
|
-
const r = b, v = h,
|
|
13
|
+
const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(x).map(([e]) => ({
|
|
14
14
|
id: e,
|
|
15
15
|
label: e.toUpperCase(),
|
|
16
16
|
color: f(e).colorClass
|
|
17
|
-
})), i =
|
|
17
|
+
})), i = a({
|
|
18
18
|
get: () => n.find(({ id: e }) => e === r.method),
|
|
19
|
-
set: (e) =>
|
|
19
|
+
set: (e) => e?.id && v("change", e.id)
|
|
20
20
|
}), d = k({
|
|
21
21
|
base: "text-center font-code text-3xs justify-center items-center flex",
|
|
22
22
|
variants: {
|
|
@@ -29,8 +29,8 @@ const H = /* @__PURE__ */ g({
|
|
|
29
29
|
false: "cursor-auto"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
}), E =
|
|
33
|
-
return (e, u) => e.isEditable ? (
|
|
32
|
+
}), E = a(() => o.value.short);
|
|
33
|
+
return (e, u) => e.isEditable ? (p(), y(t(w), {
|
|
34
34
|
key: 0,
|
|
35
35
|
modelValue: i.value,
|
|
36
36
|
"onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
|
|
@@ -42,19 +42,19 @@ const H = /* @__PURE__ */ g({
|
|
|
42
42
|
class: l(["h-full", { "pointer-events-none": !e.isEditable }])
|
|
43
43
|
}, [
|
|
44
44
|
s("button", {
|
|
45
|
-
class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }),
|
|
45
|
+
class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.colorClass)]),
|
|
46
46
|
type: "button"
|
|
47
47
|
}, [
|
|
48
|
-
s("span", null,
|
|
48
|
+
s("span", null, c(E.value), 1)
|
|
49
49
|
], 2)
|
|
50
50
|
], 2)
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
53
|
-
}, 8, ["modelValue", "options"])) : (
|
|
53
|
+
}, 8, ["modelValue", "options"])) : (p(), C("div", {
|
|
54
54
|
key: 1,
|
|
55
|
-
class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }),
|
|
55
|
+
class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.colorClass)]),
|
|
56
56
|
type: "button"
|
|
57
|
-
},
|
|
57
|
+
}, c(o.value.short), 3));
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
export {
|
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as g, ref as y, onMounted as x, onBeforeUnmount as h, createBlock as D, openBlock as p, Transition as E, withCtx as T, createElementBlock as _, createCommentVNode as L, createElementVNode as s, createVNode as C, unref as b } from "vue";
|
|
2
|
+
import { ScalarIcon as k } from "@scalar/components";
|
|
3
|
+
const A = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "bg-b-2 fixed right-1/2 bottom-1/2 z-50 h-64 w-64 translate-x-1/2 translate-y-1/2 rounded-xl border transition-opacity duration-200 md:right-10 md:bottom-10 md:translate-x-0 md:translate-y-0"
|
|
6
|
-
},
|
|
6
|
+
}, w = { class: "flex h-full flex-col items-center justify-center" }, V = /* @__PURE__ */ g({
|
|
7
7
|
__name: "DropEventListener",
|
|
8
8
|
emits: ["input"],
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
document.addEventListener("dragenter",
|
|
14
|
-
}),
|
|
15
|
-
document.removeEventListener("dragenter",
|
|
9
|
+
setup(B, { emit: v }) {
|
|
10
|
+
const l = v, a = y(!1);
|
|
11
|
+
let o = 0;
|
|
12
|
+
x(() => {
|
|
13
|
+
document.addEventListener("dragenter", m), document.addEventListener("dragleave", f), document.addEventListener("dragover", u), document.addEventListener("drop", c);
|
|
14
|
+
}), h(() => {
|
|
15
|
+
document.removeEventListener("dragenter", m), document.removeEventListener("dragover", u), document.removeEventListener("dragleave", f), document.removeEventListener("drop", c);
|
|
16
16
|
});
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
return ((n = e.dataTransfer) == null ? void 0 : n.types.includes("text/html")) ?? !1;
|
|
17
|
+
function d(e) {
|
|
18
|
+
return e.dataTransfer?.types.includes("text/html") ?? !1;
|
|
20
19
|
}
|
|
21
|
-
async function
|
|
22
|
-
if (e.preventDefault(), a.value = !1,
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
|
|
20
|
+
async function c(e) {
|
|
21
|
+
if (e.preventDefault(), a.value = !1, o = 0, !d(e) && e.dataTransfer) {
|
|
22
|
+
const t = e.dataTransfer.getData("text").replace(/^blob:/, "");
|
|
23
|
+
if (t)
|
|
24
|
+
l("input", t, null, "drop");
|
|
26
25
|
else if (e.dataTransfer.files.length > 0) {
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
26
|
+
const r = e.dataTransfer.files[0];
|
|
27
|
+
if (!r)
|
|
29
28
|
return;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
29
|
+
const n = new FileReader();
|
|
30
|
+
n.onload = async (i) => {
|
|
31
|
+
i.target && typeof i.target.result == "string" && l("input", i.target.result, null, "drop");
|
|
32
|
+
}, n.readAsText(r);
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function u(e) {
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
}
|
|
40
|
-
function
|
|
41
|
-
e.preventDefault(),
|
|
39
|
+
function f(e) {
|
|
40
|
+
e.preventDefault(), o--, o === 0 && (a.value = !1);
|
|
42
41
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
if (e.preventDefault(), i++, !u(e)) {
|
|
42
|
+
function m(e) {
|
|
43
|
+
if (e.preventDefault(), o++, !d(e)) {
|
|
46
44
|
if (e.dataTransfer) {
|
|
47
|
-
const
|
|
48
|
-
for (let
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
45
|
+
const t = e.dataTransfer.items;
|
|
46
|
+
for (let r = 0; r < t.length; r++) {
|
|
47
|
+
const n = t[r];
|
|
48
|
+
if (n?.kind === "string" || n?.type?.includes("json") || n?.type?.includes("yml") || n?.type?.includes("yaml")) {
|
|
51
49
|
a.value = !0;
|
|
52
50
|
return;
|
|
53
51
|
}
|
|
@@ -56,30 +54,30 @@ const B = {
|
|
|
56
54
|
a.value = !1;
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
|
-
return (e,
|
|
57
|
+
return (e, t) => (p(), D(E, {
|
|
60
58
|
enterActiveClass: "transition-opacity duration-200",
|
|
61
59
|
enterFromClass: "opacity-0",
|
|
62
60
|
leaveActiveClass: "transition-opacity duration-200",
|
|
63
61
|
leaveToClass: "opacity-0"
|
|
64
62
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
a.value ? (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
default: T(() => [
|
|
64
|
+
a.value ? (p(), _("div", A, [
|
|
65
|
+
s("div", w, [
|
|
66
|
+
s("div", null, [
|
|
67
|
+
C(b(k), {
|
|
70
68
|
icon: "Download",
|
|
71
69
|
size: "xl",
|
|
72
70
|
thickness: "2"
|
|
73
71
|
})
|
|
74
72
|
]),
|
|
75
|
-
|
|
73
|
+
t[0] || (t[0] = s("div", { class: "text-c-1 m-4 text-center" }, " Drop your OpenAPI document here ", -1))
|
|
76
74
|
])
|
|
77
|
-
])) :
|
|
75
|
+
])) : L("", !0)
|
|
78
76
|
]),
|
|
79
77
|
_: 1
|
|
80
78
|
}));
|
|
81
79
|
}
|
|
82
80
|
});
|
|
83
81
|
export {
|
|
84
|
-
|
|
82
|
+
V as default
|
|
85
83
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as I, ref as
|
|
1
|
+
import { defineComponent as I, ref as u, createElementBlock as k, openBlock as y, Fragment as w, createVNode as r, renderSlot as g, nextTick as h } from "vue";
|
|
2
2
|
import { useToasts as C } from "@scalar/use-toasts";
|
|
3
3
|
import { useRouter as T } from "vue-router";
|
|
4
4
|
import { workspaceStoreIsEmpty as $ } from "./utils/workspace-store-is-empty.js";
|
|
5
5
|
import { useActiveEntities as q } from "../../store/active-entities.js";
|
|
6
6
|
import E from "./DropEventListener.vue.js";
|
|
7
7
|
import F from "./ImportCollectionModal.vue.js";
|
|
8
|
-
|
|
8
|
+
/* empty css */
|
|
9
9
|
import W from "./PasteEventListener.vue.js";
|
|
10
10
|
import x from "./UrlQueryParameterChecker.vue.js";
|
|
11
11
|
import { importCollection as B } from "./utils/import-collection.js";
|
|
@@ -13,62 +13,61 @@ import { useWorkspace as M } from "../../store/store.js";
|
|
|
13
13
|
const J = /* @__PURE__ */ I({
|
|
14
14
|
__name: "ImportCollectionListener",
|
|
15
15
|
setup(N) {
|
|
16
|
-
const
|
|
17
|
-
async function
|
|
18
|
-
n.value = null, s.value = null,
|
|
16
|
+
const c = M(), n = u(null), s = u(null), i = u(null);
|
|
17
|
+
async function m() {
|
|
18
|
+
n.value = null, s.value = null, i.value = null, await h();
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
21
|
-
if (await
|
|
20
|
+
async function a(e, t = null, o) {
|
|
21
|
+
if (await m(), $(c)) {
|
|
22
22
|
if (console.info("Workspace store is empty, directly importing:", e), await d(e))
|
|
23
23
|
return;
|
|
24
24
|
console.warn("Failed to import the collection from:", e);
|
|
25
25
|
}
|
|
26
|
-
n.value = e, s.value = t,
|
|
26
|
+
n.value = e, s.value = t, i.value = o;
|
|
27
27
|
}
|
|
28
|
-
const f = T(), { activeWorkspace:
|
|
28
|
+
const f = T(), { activeWorkspace: p } = q(), { toast: l } = C();
|
|
29
29
|
async function d(e) {
|
|
30
30
|
return e ? new Promise((t) => {
|
|
31
31
|
B({
|
|
32
|
-
store:
|
|
33
|
-
workspace:
|
|
32
|
+
store: c,
|
|
33
|
+
workspace: p.value,
|
|
34
34
|
source: e,
|
|
35
35
|
// Use watch mode by default.
|
|
36
36
|
watchMode: !0,
|
|
37
37
|
onSuccess(o) {
|
|
38
38
|
if (o) {
|
|
39
|
-
_(o),
|
|
39
|
+
_(o), l("Import successful", "info"), t(!0);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
l("Import failed: No collection was created", "error"), t(!1);
|
|
43
43
|
},
|
|
44
44
|
onError(o) {
|
|
45
45
|
console.error("[importCollection]", o);
|
|
46
|
-
const v =
|
|
47
|
-
|
|
46
|
+
const v = o?.message || "Unknown error";
|
|
47
|
+
l(`Import failed: ${v}`, "error"), t(!1);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
}) : !1;
|
|
51
51
|
}
|
|
52
52
|
function _(e) {
|
|
53
|
-
var t;
|
|
54
53
|
e && f.push({
|
|
55
54
|
name: "request",
|
|
56
55
|
params: {
|
|
57
|
-
workspace:
|
|
58
|
-
request: e
|
|
56
|
+
workspace: p.value?.uid,
|
|
57
|
+
request: e?.requests[0]
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
61
|
return (e, t) => (y(), k(w, null, [
|
|
63
62
|
r(F, {
|
|
64
|
-
eventType:
|
|
63
|
+
eventType: i.value,
|
|
65
64
|
integration: s.value,
|
|
66
65
|
source: n.value,
|
|
67
|
-
onImportFinished:
|
|
66
|
+
onImportFinished: m
|
|
68
67
|
}, null, 8, ["eventType", "integration", "source"]),
|
|
69
|
-
r(W, { onInput:
|
|
70
|
-
r(E, { onInput:
|
|
71
|
-
r(x, { onInput:
|
|
68
|
+
r(W, { onInput: a }),
|
|
69
|
+
r(E, { onInput: a }),
|
|
70
|
+
r(x, { onInput: a }),
|
|
72
71
|
g(e.$slots, "default")
|
|
73
72
|
], 64));
|
|
74
73
|
}
|