@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,115 +1,104 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { REGEX as
|
|
4
|
-
import { emitCustomEvent as
|
|
5
|
-
import { useRouter as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useActiveEntities as
|
|
9
|
-
import { PathId as
|
|
10
|
-
import { useWorkspace as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as I, ref as D, computed as B, useTemplateRef as O, createElementBlock as V, openBlock as W, Fragment as L, createElementVNode as r, createVNode as o, withCtx as i, toDisplayString as m, unref as c, normalizeClass as M } from "vue";
|
|
2
|
+
import { ScalarListbox as P, ScalarButton as j, ScalarIcon as z } from "@scalar/components";
|
|
3
|
+
import { REGEX as F } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { emitCustomEvent as N } from "@scalar/workspace-store/events";
|
|
5
|
+
import { useRouter as T } from "vue-router";
|
|
6
|
+
import $ from "./CommandActionForm.vue.js";
|
|
7
|
+
import A from "../HttpMethod/HttpMethod.vue.js";
|
|
8
|
+
import { useActiveEntities as G } from "../../store/active-entities.js";
|
|
9
|
+
import { PathId as p } from "../../routes.js";
|
|
10
|
+
import { useWorkspace as H } from "../../store/store.js";
|
|
11
|
+
const X = { class: "flex h-9 flex-row items-center gap-2 rounded border p-[3px] text-sm" }, J = { class: "flex h-full" }, K = { class: "scroll-timeline-x whitespace-nowrap" }, Q = { class: "flex" }, ie = /* @__PURE__ */ I({
|
|
12
12
|
__name: "CommandPaletteImportCurl",
|
|
13
13
|
props: {
|
|
14
14
|
metaData: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["close", "back"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
() =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(t) => t.id === a.metaData.collectionUid
|
|
29
|
-
) : p.value.find(
|
|
30
|
-
(t) => {
|
|
31
|
-
var e;
|
|
32
|
-
return t.id === ((e = L.value) == null ? void 0 : e.uid);
|
|
33
|
-
}
|
|
17
|
+
setup(e, { emit: x }) {
|
|
18
|
+
const w = x, b = H(), { activeWorkspaceCollections: f, activeCollection: S, activeWorkspace: v } = G(), { requestMutators: k, serverMutators: q, servers: R } = b, d = D(""), U = T(), n = B(
|
|
19
|
+
() => f.value.map((t) => ({
|
|
20
|
+
id: t.uid,
|
|
21
|
+
label: t.info?.title ?? "Unititled Collection"
|
|
22
|
+
}))
|
|
23
|
+
), l = D(
|
|
24
|
+
e.metaData.collectionUid ? n.value.find(
|
|
25
|
+
(t) => t.id === e.metaData.collectionUid
|
|
26
|
+
) : n.value.find(
|
|
27
|
+
(t) => t.id === S.value?.uid
|
|
34
28
|
)
|
|
35
29
|
);
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
if (!a.metaData.parsedCurl)
|
|
30
|
+
function g({ collectionUid: t }) {
|
|
31
|
+
if (!e.metaData.parsedCurl)
|
|
39
32
|
return;
|
|
40
|
-
const
|
|
41
|
-
(
|
|
33
|
+
const a = f.value.find(
|
|
34
|
+
(u) => u.uid === t
|
|
42
35
|
);
|
|
43
|
-
if (!
|
|
36
|
+
if (!a)
|
|
44
37
|
return;
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
48
|
-
(
|
|
49
|
-
var y, I;
|
|
50
|
-
return T.url === ((I = (y = a.metaData.parsedCurl) == null ? void 0 : y.servers) == null ? void 0 : I[0]);
|
|
51
|
-
}
|
|
38
|
+
const s = a?.info?.title === "Drafts";
|
|
39
|
+
if (!s && e.metaData.parsedCurl.servers) {
|
|
40
|
+
const u = Object.values(R).find(
|
|
41
|
+
(y) => y.url === e.metaData.parsedCurl?.servers?.[0]
|
|
52
42
|
);
|
|
53
|
-
|
|
54
|
-
{ url:
|
|
55
|
-
|
|
56
|
-
).uid,
|
|
57
|
-
server: { url:
|
|
43
|
+
u ? d.value = u.uid : (d.value = q.add(
|
|
44
|
+
{ url: e.metaData.parsedCurl.servers[0] ?? "/" },
|
|
45
|
+
a.uid
|
|
46
|
+
).uid, N(E.value?.$el, "scalar-add-server", {
|
|
47
|
+
server: { url: e.metaData.parsedCurl.servers[0] ?? "/" },
|
|
58
48
|
options: {
|
|
59
49
|
disableOldStoreUpdate: !0
|
|
60
50
|
}
|
|
61
51
|
}));
|
|
62
52
|
}
|
|
63
|
-
const
|
|
53
|
+
const h = k.add(
|
|
64
54
|
{
|
|
65
|
-
summary:
|
|
66
|
-
path:
|
|
67
|
-
method:
|
|
68
|
-
parameters:
|
|
69
|
-
selectedServerUid:
|
|
70
|
-
requestBody:
|
|
55
|
+
summary: s ? e.metaData.parsedCurl?.url?.replace(F.PROTOCOL, "") : e.metaData.parsedCurl?.path,
|
|
56
|
+
path: s ? e.metaData.parsedCurl?.url : e.metaData.parsedCurl?.path,
|
|
57
|
+
method: e.metaData.parsedCurl?.method,
|
|
58
|
+
parameters: e.metaData.parsedCurl?.parameters,
|
|
59
|
+
selectedServerUid: s ? void 0 : d.value,
|
|
60
|
+
requestBody: e.metaData.parsedCurl?.requestBody
|
|
71
61
|
},
|
|
72
|
-
|
|
62
|
+
a.uid
|
|
73
63
|
);
|
|
74
|
-
|
|
64
|
+
h && v.value?.uid && U.push({
|
|
75
65
|
name: "request",
|
|
76
66
|
params: {
|
|
77
|
-
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
67
|
+
[p.Workspace]: v.value.uid,
|
|
68
|
+
[p.Collection]: a.uid,
|
|
69
|
+
[p.Request]: h.uid
|
|
80
70
|
}
|
|
81
|
-
}),
|
|
71
|
+
}), w("close");
|
|
82
72
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
collectionUid: ((t = l.value) == null ? void 0 : t.id) ?? ""
|
|
73
|
+
const C = () => {
|
|
74
|
+
g({
|
|
75
|
+
collectionUid: l.value?.id ?? ""
|
|
87
76
|
});
|
|
88
|
-
},
|
|
89
|
-
return (t,
|
|
90
|
-
|
|
91
|
-
|
|
77
|
+
}, E = O("wrapper-ref");
|
|
78
|
+
return (t, a) => (W(), V(L, null, [
|
|
79
|
+
a[1] || (a[1] = r("div", { class: "text-c-2 flex-center py-1.5 text-sm" }, "Import cURL", -1)),
|
|
80
|
+
o($, {
|
|
92
81
|
ref: "wrapper-ref",
|
|
93
82
|
class: "mt-1.5 min-h-fit",
|
|
94
|
-
onSubmit:
|
|
83
|
+
onSubmit: C
|
|
95
84
|
}, {
|
|
96
|
-
options:
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
options: i(() => [
|
|
86
|
+
r("div", Q, [
|
|
87
|
+
o(c(P), {
|
|
99
88
|
modelValue: l.value,
|
|
100
|
-
"onUpdate:modelValue":
|
|
101
|
-
options:
|
|
89
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => l.value = s),
|
|
90
|
+
options: n.value
|
|
102
91
|
}, {
|
|
103
|
-
default:
|
|
104
|
-
|
|
92
|
+
default: i(() => [
|
|
93
|
+
o(c(j), {
|
|
105
94
|
class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
|
|
106
95
|
variant: "outlined"
|
|
107
96
|
}, {
|
|
108
|
-
default:
|
|
109
|
-
|
|
110
|
-
class:
|
|
111
|
-
},
|
|
112
|
-
|
|
97
|
+
default: i(() => [
|
|
98
|
+
r("span", {
|
|
99
|
+
class: M(["whitespace-nowrap", l.value ? "text-c-1" : "text-c-3"])
|
|
100
|
+
}, m(l.value ? l.value.label : "Select Collection"), 3),
|
|
101
|
+
o(c(z), {
|
|
113
102
|
class: "text-c-3",
|
|
114
103
|
icon: "ChevronDown",
|
|
115
104
|
size: "md"
|
|
@@ -122,29 +111,26 @@ const oe = { class: "flex h-9 flex-row items-center gap-2 rounded border p-[3px]
|
|
|
122
111
|
}, 8, ["modelValue", "options"])
|
|
123
112
|
])
|
|
124
113
|
]),
|
|
125
|
-
submit:
|
|
126
|
-
|
|
114
|
+
submit: i(() => [
|
|
115
|
+
r("span", { onClick: C }, "Import Request")
|
|
116
|
+
]),
|
|
117
|
+
default: i(() => [
|
|
118
|
+
r("div", X, [
|
|
119
|
+
r("div", J, [
|
|
120
|
+
o(A, {
|
|
121
|
+
isEditable: !1,
|
|
122
|
+
isSquare: "",
|
|
123
|
+
method: t.metaData.parsedCurl?.method || "get"
|
|
124
|
+
}, null, 8, ["method"])
|
|
125
|
+
]),
|
|
126
|
+
r("span", K, m(t.metaData.parsedCurl?.servers?.[0] || "") + m(t.metaData.parsedCurl?.path || ""), 1)
|
|
127
|
+
])
|
|
127
128
|
]),
|
|
128
|
-
default: n(() => {
|
|
129
|
-
var r, o, i, u;
|
|
130
|
-
return [
|
|
131
|
-
s("div", oe, [
|
|
132
|
-
s("div", ie, [
|
|
133
|
-
d(re, {
|
|
134
|
-
isEditable: !1,
|
|
135
|
-
isSquare: "",
|
|
136
|
-
method: ((r = t.metaData.parsedCurl) == null ? void 0 : r.method) || "get"
|
|
137
|
-
}, null, 8, ["method"])
|
|
138
|
-
]),
|
|
139
|
-
s("span", ue, f(((i = (o = t.metaData.parsedCurl) == null ? void 0 : o.servers) == null ? void 0 : i[0]) || "") + f(((u = t.metaData.parsedCurl) == null ? void 0 : u.path) || ""), 1)
|
|
140
|
-
])
|
|
141
|
-
];
|
|
142
|
-
}),
|
|
143
129
|
_: 1
|
|
144
130
|
}, 512)
|
|
145
131
|
], 64));
|
|
146
132
|
}
|
|
147
133
|
});
|
|
148
134
|
export {
|
|
149
|
-
|
|
135
|
+
ie as default
|
|
150
136
|
};
|
|
@@ -1,110 +1,100 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import { emitCustomEvent as
|
|
5
|
-
import { useRouter as
|
|
6
|
-
import { useActiveEntities as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { PathId as
|
|
10
|
-
import { useWorkspace as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as T, ref as v, computed as h, useTemplateRef as B, createBlock as u, openBlock as m, withCtx as l, createVNode as d, createTextVNode as E, unref as s, createElementVNode as f, normalizeClass as M, toDisplayString as R } from "vue";
|
|
2
|
+
import { ScalarListbox as $, ScalarButton as b, ScalarIcon as j } from "@scalar/components";
|
|
3
|
+
import { useToasts as z } from "@scalar/use-toasts";
|
|
4
|
+
import { emitCustomEvent as I } from "@scalar/workspace-store/events";
|
|
5
|
+
import { useRouter as L } from "vue-router";
|
|
6
|
+
import { useActiveEntities as O } from "../../store/active-entities.js";
|
|
7
|
+
import W from "./CommandActionForm.vue.js";
|
|
8
|
+
import A from "./CommandActionInput.vue.js";
|
|
9
|
+
import { PathId as C } from "../../routes.js";
|
|
10
|
+
import { useWorkspace as q } from "../../store/store.js";
|
|
11
|
+
const te = /* @__PURE__ */ T({
|
|
12
12
|
__name: "CommandPaletteServer",
|
|
13
13
|
props: {
|
|
14
14
|
metaData: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["close", "back"],
|
|
17
|
-
setup(
|
|
18
|
-
const n =
|
|
19
|
-
collectionMutators:
|
|
20
|
-
serverMutators:
|
|
21
|
-
events:
|
|
22
|
-
collections:
|
|
23
|
-
} =
|
|
24
|
-
() =>
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
id: t.uid,
|
|
29
|
-
label: ((o = t.info) == null ? void 0 : o.title) ?? "Unititled Collection"
|
|
30
|
-
};
|
|
17
|
+
setup(x, { emit: S }) {
|
|
18
|
+
const n = x, c = S, k = L(), { toast: p } = z(), { activeCollection: w, activeWorkspaceCollections: V } = O(), {
|
|
19
|
+
collectionMutators: g,
|
|
20
|
+
serverMutators: D,
|
|
21
|
+
events: U,
|
|
22
|
+
collections: _
|
|
23
|
+
} = q(), a = v(""), i = h(
|
|
24
|
+
() => V.value.flatMap(
|
|
25
|
+
(e) => e.info?.title === "Drafts" ? [] : {
|
|
26
|
+
id: e.uid,
|
|
27
|
+
label: e.info?.title ?? "Unititled Collection"
|
|
31
28
|
}
|
|
32
29
|
)
|
|
33
|
-
),
|
|
30
|
+
), o = v(
|
|
34
31
|
n.metaData ? i.value.find(
|
|
35
|
-
(
|
|
36
|
-
var e, o;
|
|
37
|
-
return t.id === ((e = n.metaData) == null ? void 0 : e.itemUid) || t.id === ((o = n.metaData) == null ? void 0 : o.parentUid);
|
|
38
|
-
}
|
|
32
|
+
(e) => e.id === n.metaData?.itemUid || e.id === n.metaData?.parentUid
|
|
39
33
|
) : i.value.find(
|
|
40
|
-
(
|
|
41
|
-
var e;
|
|
42
|
-
return t.id === ((e = V.value) == null ? void 0 : e.uid);
|
|
43
|
-
}
|
|
34
|
+
(e) => e.id === w.value?.uid
|
|
44
35
|
)
|
|
45
|
-
),
|
|
46
|
-
|
|
47
|
-
if (!l.value.trim()) {
|
|
36
|
+
), y = () => {
|
|
37
|
+
if (!a.value.trim()) {
|
|
48
38
|
p("Please enter a valid url before creating a server.", "error");
|
|
49
39
|
return;
|
|
50
40
|
}
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
41
|
+
const e = _[o.value?.id ?? ""];
|
|
42
|
+
if (!e) {
|
|
53
43
|
p("Please select a collection before creating a server.", "error");
|
|
54
44
|
return;
|
|
55
45
|
}
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
server: { url:
|
|
46
|
+
const t = D.add({ url: a.value }, e.uid);
|
|
47
|
+
g.edit(e.uid, "selectedServerUid", t.uid), I(N.value?.$el, "scalar-add-server", {
|
|
48
|
+
server: { url: a.value },
|
|
59
49
|
options: {
|
|
60
50
|
disableOldStoreUpdate: !0
|
|
61
51
|
}
|
|
62
|
-
}),
|
|
52
|
+
}), k.push({
|
|
63
53
|
name: "collection.servers.edit",
|
|
64
54
|
params: {
|
|
65
|
-
[
|
|
66
|
-
[
|
|
55
|
+
[C.Collection]: e.uid,
|
|
56
|
+
[C.Servers]: t.uid
|
|
67
57
|
}
|
|
68
58
|
}), c("close");
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
return (
|
|
59
|
+
}, P = () => {
|
|
60
|
+
U.commandPalette.emit({ commandName: "Create Collection" });
|
|
61
|
+
}, N = B("wrapper-ref");
|
|
62
|
+
return (e, t) => (m(), u(W, {
|
|
73
63
|
ref: "wrapper-ref",
|
|
74
|
-
disabled: !
|
|
75
|
-
onSubmit:
|
|
64
|
+
disabled: !a.value.trim() || !o.value,
|
|
65
|
+
onSubmit: y
|
|
76
66
|
}, {
|
|
77
|
-
options:
|
|
78
|
-
d(s(
|
|
79
|
-
modelValue:
|
|
80
|
-
"onUpdate:modelValue":
|
|
67
|
+
options: l(() => [
|
|
68
|
+
d(s($), {
|
|
69
|
+
modelValue: o.value,
|
|
70
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => o.value = r),
|
|
81
71
|
options: i.value
|
|
82
72
|
}, {
|
|
83
|
-
default:
|
|
84
|
-
i.value.length > 0 ? (m(), u(s(
|
|
73
|
+
default: l(() => [
|
|
74
|
+
i.value.length > 0 ? (m(), u(s(b), {
|
|
85
75
|
key: 0,
|
|
86
76
|
class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
|
|
87
77
|
variant: "outlined"
|
|
88
78
|
}, {
|
|
89
|
-
default:
|
|
90
|
-
|
|
91
|
-
class:
|
|
92
|
-
},
|
|
93
|
-
d(s(
|
|
79
|
+
default: l(() => [
|
|
80
|
+
f("span", {
|
|
81
|
+
class: M(o.value ? "text-c-1" : "text-c-3")
|
|
82
|
+
}, R(o.value ? o.value.label : "Select Collection"), 3),
|
|
83
|
+
d(s(j), {
|
|
94
84
|
class: "text-c-3",
|
|
95
85
|
icon: "ChevronDown",
|
|
96
86
|
size: "md"
|
|
97
87
|
})
|
|
98
88
|
]),
|
|
99
89
|
_: 1
|
|
100
|
-
})) : (m(), u(s(
|
|
90
|
+
})) : (m(), u(s(b), {
|
|
101
91
|
key: 1,
|
|
102
92
|
class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
|
|
103
93
|
variant: "outlined",
|
|
104
|
-
onClick:
|
|
94
|
+
onClick: P
|
|
105
95
|
}, {
|
|
106
|
-
default:
|
|
107
|
-
|
|
96
|
+
default: l(() => t[3] || (t[3] = [
|
|
97
|
+
f("span", { class: "text-c-1" }, "Create Collection", -1)
|
|
108
98
|
])),
|
|
109
99
|
_: 1,
|
|
110
100
|
__: [3]
|
|
@@ -113,16 +103,16 @@ const oe = /* @__PURE__ */ h({
|
|
|
113
103
|
_: 1
|
|
114
104
|
}, 8, ["modelValue", "options"])
|
|
115
105
|
]),
|
|
116
|
-
submit:
|
|
117
|
-
|
|
106
|
+
submit: l(() => t[4] || (t[4] = [
|
|
107
|
+
E(" Create Server ")
|
|
118
108
|
])),
|
|
119
|
-
default:
|
|
120
|
-
d(
|
|
121
|
-
modelValue:
|
|
122
|
-
"onUpdate:modelValue":
|
|
109
|
+
default: l(() => [
|
|
110
|
+
d(A, {
|
|
111
|
+
modelValue: a.value,
|
|
112
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => a.value = r),
|
|
123
113
|
label: "Server URL",
|
|
124
114
|
placeholder: "https://void.scalar.com",
|
|
125
|
-
onOnDelete:
|
|
115
|
+
onOnDelete: t[1] || (t[1] = (r) => c("back", r))
|
|
126
116
|
}, null, 8, ["modelValue"])
|
|
127
117
|
]),
|
|
128
118
|
_: 1
|
|
@@ -130,5 +120,5 @@ const oe = /* @__PURE__ */ h({
|
|
|
130
120
|
}
|
|
131
121
|
});
|
|
132
122
|
export {
|
|
133
|
-
|
|
123
|
+
te as default
|
|
134
124
|
};
|
|
@@ -10,19 +10,13 @@ const O = /* @__PURE__ */ g({
|
|
|
10
10
|
emits: ["close", "back"],
|
|
11
11
|
setup(U, { emit: d }) {
|
|
12
12
|
const r = d, { activeWorkspaceCollections: c, activeCollection: p } = y(), { tagMutators: f } = P(), { toast: v } = D(), u = x(
|
|
13
|
-
() => c.value.map((o) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
label: ((e = o.info) == null ? void 0 : e.title) ?? ""
|
|
18
|
-
};
|
|
19
|
-
})
|
|
13
|
+
() => c.value.map((o) => ({
|
|
14
|
+
id: o.uid,
|
|
15
|
+
label: o.info?.title ?? ""
|
|
16
|
+
}))
|
|
20
17
|
), a = m(""), t = m(
|
|
21
18
|
u.value.find(
|
|
22
|
-
(o) =>
|
|
23
|
-
var e;
|
|
24
|
-
return o.id === ((e = p.value) == null ? void 0 : e.uid);
|
|
25
|
-
}
|
|
19
|
+
(o) => o.id === p.value?.uid
|
|
26
20
|
)
|
|
27
21
|
), b = () => {
|
|
28
22
|
if (!a.value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o from "./TheCommandPalette.vue2.js";
|
|
2
2
|
import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
|
|
3
|
-
|
|
3
|
+
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f2bbd082"]]);
|
|
6
6
|
export {
|