@scalar/api-client 2.5.32 → 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 +20 -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,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarModal as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as k, ref as m, computed as y, watch as h, createBlock as u, openBlock as v, unref as i, withCtx as o, createVNode as s, createElementVNode as p, createTextVNode as w, normalizeClass as I, toDisplayString as E } from "vue";
|
|
2
|
+
import { ScalarModal as N, ScalarListbox as T, ScalarButton as C, ScalarIcon as $ } from "@scalar/components";
|
|
3
|
+
import { useToasts as z } from "@scalar/use-toasts";
|
|
4
|
+
import B from "../../components/CommandPalette/CommandActionForm.vue.js";
|
|
5
|
+
import D from "../../components/CommandPalette/CommandActionInput.vue.js";
|
|
6
|
+
import P from "./EnvironmentColors.vue.js";
|
|
7
|
+
import { useWorkspace as U } from "../../store/store.js";
|
|
8
|
+
const W = { class: "flex items-start gap-2" }, J = /* @__PURE__ */ k({
|
|
9
9
|
__name: "EnvironmentModal",
|
|
10
10
|
props: {
|
|
11
11
|
state: {},
|
|
@@ -13,92 +13,85 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
|
|
|
13
13
|
collectionId: {}
|
|
14
14
|
},
|
|
15
15
|
emits: ["cancel", "submit"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
...
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
})
|
|
28
|
-
]), l = m(
|
|
29
|
-
d.value.find((t) => t.id === n.collectionId)
|
|
30
|
-
), { toast: b } = B(), _ = (t) => {
|
|
31
|
-
c.value = t;
|
|
16
|
+
setup(x, { emit: g }) {
|
|
17
|
+
const a = x, f = g, { events: F } = U(), n = m(""), r = m("#FFFFFF"), c = y(() => [
|
|
18
|
+
...a.activeWorkspaceCollections.filter((t) => t.info?.title !== "Drafts").map((t) => ({
|
|
19
|
+
id: t.uid,
|
|
20
|
+
label: t.info?.title ?? "Untitled Collection"
|
|
21
|
+
}))
|
|
22
|
+
]), e = m(
|
|
23
|
+
c.value.find((t) => t.id === a.collectionId)
|
|
24
|
+
), { toast: b } = z(), S = (t) => {
|
|
25
|
+
r.value = t;
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
() =>
|
|
27
|
+
h(
|
|
28
|
+
() => a.state.open,
|
|
35
29
|
(t) => {
|
|
36
|
-
t && (
|
|
37
|
-
(
|
|
38
|
-
) :
|
|
30
|
+
t && (n.value = "", r.value = "#FFFFFF", a.collectionId ? e.value = c.value.find(
|
|
31
|
+
(l) => l.id === a.collectionId
|
|
32
|
+
) : e.value = void 0);
|
|
39
33
|
}
|
|
40
34
|
);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
if (!i.value.trim()) {
|
|
35
|
+
const _ = () => {
|
|
36
|
+
if (!n.value.trim()) {
|
|
44
37
|
b("Please enter a name before adding an environment.", "error");
|
|
45
38
|
return;
|
|
46
39
|
}
|
|
47
|
-
if (!
|
|
40
|
+
if (!e.value?.id) {
|
|
48
41
|
b("Please select a collection before adding an environment.", "error");
|
|
49
42
|
return;
|
|
50
43
|
}
|
|
51
44
|
f("submit", {
|
|
52
|
-
name:
|
|
53
|
-
color:
|
|
54
|
-
type:
|
|
55
|
-
collectionId:
|
|
45
|
+
name: n.value,
|
|
46
|
+
color: r.value,
|
|
47
|
+
type: e.value?.id === "global" ? "global" : "collection",
|
|
48
|
+
collectionId: e.value?.id !== "global" ? e.value?.id : void 0
|
|
56
49
|
});
|
|
57
|
-
},
|
|
58
|
-
|
|
50
|
+
}, V = () => {
|
|
51
|
+
a.state.hide(), F.commandPalette.emit({ commandName: "Create Collection" });
|
|
59
52
|
};
|
|
60
|
-
return (t,
|
|
53
|
+
return (t, l) => (v(), u(i(N), {
|
|
61
54
|
bodyClass: "border-t-0 rounded-t-lg",
|
|
62
55
|
size: "xs",
|
|
63
56
|
state: t.state
|
|
64
57
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
|
|
67
|
-
disabled: !
|
|
68
|
-
onCancel:
|
|
69
|
-
onSubmit:
|
|
58
|
+
default: o(() => [
|
|
59
|
+
s(B, {
|
|
60
|
+
disabled: !e.value || !n.value.trim(),
|
|
61
|
+
onCancel: l[2] || (l[2] = (d) => f("cancel")),
|
|
62
|
+
onSubmit: _
|
|
70
63
|
}, {
|
|
71
|
-
options:
|
|
72
|
-
|
|
73
|
-
modelValue:
|
|
74
|
-
"onUpdate:modelValue":
|
|
75
|
-
options:
|
|
64
|
+
options: o(() => [
|
|
65
|
+
s(i(T), {
|
|
66
|
+
modelValue: e.value,
|
|
67
|
+
"onUpdate:modelValue": l[1] || (l[1] = (d) => e.value = d),
|
|
68
|
+
options: c.value,
|
|
76
69
|
placeholder: "Select Type"
|
|
77
70
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
|
|
71
|
+
default: o(() => [
|
|
72
|
+
c.value.length > 0 ? (v(), u(i(C), {
|
|
80
73
|
key: 0,
|
|
81
74
|
class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
|
|
82
75
|
variant: "outlined"
|
|
83
76
|
}, {
|
|
84
|
-
default:
|
|
77
|
+
default: o(() => [
|
|
85
78
|
p("span", {
|
|
86
|
-
class:
|
|
87
|
-
},
|
|
88
|
-
|
|
79
|
+
class: I(e.value ? "text-c-1" : "text-c-3")
|
|
80
|
+
}, E(e.value ? e.value.label : "Select Collection"), 3),
|
|
81
|
+
s(i($), {
|
|
89
82
|
class: "text-c-3",
|
|
90
83
|
icon: "ChevronDown",
|
|
91
84
|
size: "xs"
|
|
92
85
|
})
|
|
93
86
|
]),
|
|
94
87
|
_: 1
|
|
95
|
-
})) : (v(), u(
|
|
88
|
+
})) : (v(), u(i(C), {
|
|
96
89
|
key: 1,
|
|
97
90
|
class: "hover:bg-b-2 max-h-8 justify-between gap-1 p-2 text-xs",
|
|
98
91
|
variant: "outlined",
|
|
99
|
-
onClick:
|
|
92
|
+
onClick: V
|
|
100
93
|
}, {
|
|
101
|
-
default:
|
|
94
|
+
default: o(() => l[3] || (l[3] = [
|
|
102
95
|
p("span", { class: "text-c-1" }, "Create Collection", -1)
|
|
103
96
|
])),
|
|
104
97
|
_: 1,
|
|
@@ -108,20 +101,20 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
|
|
|
108
101
|
_: 1
|
|
109
102
|
}, 8, ["modelValue", "options"])
|
|
110
103
|
]),
|
|
111
|
-
submit:
|
|
112
|
-
|
|
104
|
+
submit: o(() => l[4] || (l[4] = [
|
|
105
|
+
w(" Add Environment ")
|
|
113
106
|
])),
|
|
114
|
-
default:
|
|
115
|
-
p("div",
|
|
116
|
-
|
|
117
|
-
activeColor:
|
|
107
|
+
default: o(() => [
|
|
108
|
+
p("div", W, [
|
|
109
|
+
s(P, {
|
|
110
|
+
activeColor: r.value,
|
|
118
111
|
class: "peer",
|
|
119
112
|
selector: "",
|
|
120
|
-
onSelect:
|
|
113
|
+
onSelect: S
|
|
121
114
|
}, null, 8, ["activeColor"]),
|
|
122
|
-
|
|
123
|
-
modelValue:
|
|
124
|
-
"onUpdate:modelValue":
|
|
115
|
+
s(D, {
|
|
116
|
+
modelValue: n.value,
|
|
117
|
+
"onUpdate:modelValue": l[0] || (l[0] = (d) => n.value = d),
|
|
125
118
|
class: "-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden",
|
|
126
119
|
placeholder: "Environment name"
|
|
127
120
|
}, null, 8, ["modelValue"])
|
|
@@ -135,5 +128,5 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
|
|
|
135
128
|
}
|
|
136
129
|
});
|
|
137
130
|
export {
|
|
138
|
-
|
|
131
|
+
J as default
|
|
139
132
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, ref as v, computed as w, onMounted as R, createBlock as h, createCommentVNode as y, openBlock as
|
|
1
|
+
import { defineComponent as B, ref as v, computed as w, onMounted as R, createBlock as h, createCommentVNode as y, openBlock as n, unref as l, withCtx as k, createElementVNode as c, normalizeStyle as x, createElementBlock as u, Fragment as D, renderList as T, normalizeClass as j, createTextVNode as g, toDisplayString as V, createVNode as q } from "vue";
|
|
2
2
|
import { ScalarTeleport as F, ScalarButton as G } from "@scalar/components";
|
|
3
3
|
import { ScalarIconGlobe as K, ScalarIconPlus as O } from "@scalar/icons";
|
|
4
4
|
import { onClickOutside as L } from "@vueuse/core";
|
|
@@ -21,15 +21,14 @@ const H = {
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["select"],
|
|
23
23
|
setup(S, { expose: E, emit: z }) {
|
|
24
|
-
const
|
|
25
|
-
var n;
|
|
24
|
+
const s = S, I = z, d = v(!0), p = v(null), r = v(0), f = Q(), { activeCollection: m } = $(), N = () => {
|
|
26
25
|
if (!f)
|
|
27
26
|
return;
|
|
28
|
-
const { currentRoute:
|
|
29
|
-
!m.value ||
|
|
27
|
+
const { currentRoute: t, push: o } = f, e = t.value.params.workspace;
|
|
28
|
+
!m.value || m.value.info?.title === "Drafts" ? o({
|
|
30
29
|
name: "environment.default",
|
|
31
30
|
params: {
|
|
32
|
-
[_.Workspace]:
|
|
31
|
+
[_.Workspace]: e
|
|
33
32
|
}
|
|
34
33
|
}) : o({
|
|
35
34
|
name: "collection.environment",
|
|
@@ -37,46 +36,43 @@ const H = {
|
|
|
37
36
|
[_.Collection]: m.value.uid
|
|
38
37
|
}
|
|
39
38
|
}), d.value = !1;
|
|
40
|
-
}, P = new M(C(
|
|
39
|
+
}, P = new M(C(s.envVariables), {
|
|
41
40
|
keys: ["key", "value"]
|
|
42
41
|
}), i = w(() => {
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
45
|
-
return C(
|
|
46
|
-
const o = P.search(
|
|
47
|
-
return o.length > 0 ? o.map((
|
|
48
|
-
}), b = (
|
|
49
|
-
I("select",
|
|
42
|
+
const t = s.query;
|
|
43
|
+
if (!t)
|
|
44
|
+
return C(s.envVariables).slice(-4).filter(({ key: e, value: a }) => e !== "" || a !== "");
|
|
45
|
+
const o = P.search(t, { limit: 10 });
|
|
46
|
+
return o.length > 0 ? o.map((e) => e.item).filter(({ key: e, value: a }) => e !== "" || a !== "") : [];
|
|
47
|
+
}), b = (t) => {
|
|
48
|
+
I("select", t);
|
|
50
49
|
};
|
|
51
50
|
E({
|
|
52
|
-
handleArrowKey: (
|
|
53
|
-
const o =
|
|
54
|
-
|
|
51
|
+
handleArrowKey: (t) => {
|
|
52
|
+
const o = t === "up" ? -1 : 1, e = i.value.length;
|
|
53
|
+
e !== 0 && (r.value = (r.value + o + e) % e);
|
|
55
54
|
},
|
|
56
55
|
handleSelect: () => {
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
|
|
56
|
+
if (r.value >= 0) {
|
|
57
|
+
const t = i.value[r.value];
|
|
58
|
+
t && b(t.key);
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}), R(() => {
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
const A = w(() => {
|
|
66
|
-
var e, o;
|
|
67
|
-
return {
|
|
68
|
-
left: (((e = a.dropdownPosition) == null ? void 0 : e.left) ?? 0) + "px",
|
|
69
|
-
// Add a 5px offset from the editor
|
|
70
|
-
top: (((o = a.dropdownPosition) == null ? void 0 : o.top) ?? 0) + 5 + "px"
|
|
71
|
-
};
|
|
62
|
+
r.value = 0;
|
|
72
63
|
});
|
|
64
|
+
const A = w(() => ({
|
|
65
|
+
left: (s.dropdownPosition?.left ?? 0) + "px",
|
|
66
|
+
// Add a 5px offset from the editor
|
|
67
|
+
top: (s.dropdownPosition?.top ?? 0) + 5 + "px"
|
|
68
|
+
}));
|
|
73
69
|
return L(
|
|
74
70
|
p,
|
|
75
71
|
() => {
|
|
76
72
|
d.value = !1;
|
|
77
73
|
},
|
|
78
74
|
{ ignore: [p] }
|
|
79
|
-
), (
|
|
75
|
+
), (t, o) => d.value ? (n(), h(l(F), {
|
|
80
76
|
key: 0,
|
|
81
77
|
class: "scalar-client"
|
|
82
78
|
}, {
|
|
@@ -87,36 +83,36 @@ const H = {
|
|
|
87
83
|
class: "custom-scroll fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75",
|
|
88
84
|
style: x(A.value)
|
|
89
85
|
}, [
|
|
90
|
-
i.value.length ? (
|
|
91
|
-
(
|
|
92
|
-
key:
|
|
93
|
-
class: j(["font-code text-xxs hover:bg-b-2 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2":
|
|
94
|
-
onClick: (ee) => b(
|
|
86
|
+
i.value.length ? (n(), u("ul", H, [
|
|
87
|
+
(n(!0), u(D, null, T(i.value, (e, a) => (n(), u("li", {
|
|
88
|
+
key: e.key,
|
|
89
|
+
class: j(["font-code text-xxs hover:bg-b-2 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": a === r.value }]),
|
|
90
|
+
onClick: (ee) => b(e.key)
|
|
95
91
|
}, [
|
|
96
92
|
c("div", U, [
|
|
97
|
-
|
|
93
|
+
e.source === "collection" && t.environment.name !== "No Environment" ? (n(), u("span", {
|
|
98
94
|
key: 0,
|
|
99
95
|
class: "h-2.25 w-2.25 min-w-2.25 rounded-full",
|
|
100
96
|
style: x({
|
|
101
|
-
backgroundColor:
|
|
97
|
+
backgroundColor: l(W)(t.environment)
|
|
102
98
|
})
|
|
103
|
-
}, null, 4)) : (
|
|
99
|
+
}, null, 4)) : (n(), h(l(K), {
|
|
104
100
|
key: 1,
|
|
105
101
|
class: "-ml-0.25 size-2.5",
|
|
106
102
|
icon: "Globe"
|
|
107
103
|
})),
|
|
108
|
-
g(" " + V(
|
|
104
|
+
g(" " + V(e.key), 1)
|
|
109
105
|
]),
|
|
110
|
-
c("span", X, V(
|
|
106
|
+
c("span", X, V(e.value), 1)
|
|
111
107
|
], 10, J))), 128))
|
|
112
|
-
])) :
|
|
108
|
+
])) : l(f) ? (n(), h(l(G), {
|
|
113
109
|
key: 1,
|
|
114
110
|
class: "font-code text-xxs bg-b-inherit hover:bg-b-2 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150",
|
|
115
111
|
variant: "outlined",
|
|
116
112
|
onClick: N
|
|
117
113
|
}, {
|
|
118
114
|
default: k(() => [
|
|
119
|
-
q(
|
|
115
|
+
q(l(O), { class: "size-3" }),
|
|
120
116
|
o[0] || (o[0] = g(" Add Variable "))
|
|
121
117
|
]),
|
|
122
118
|
_: 1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as E, computed as U, createElementBlock as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as E, computed as U, createElementBlock as v, createBlock as m, unref as e, openBlock as r, normalizeClass as f, createElementVNode as P, createVNode as n, isRef as W, withCtx as k, createCommentVNode as H } from "vue";
|
|
2
|
+
import y from "../../components/EmptyState.vue.js";
|
|
3
3
|
import N from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
4
4
|
import g from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
5
5
|
import { useSidebar as B } from "../../hooks/useSidebar.js";
|
|
@@ -8,7 +8,7 @@ import { useActiveEntities as L } from "../../store/active-entities.js";
|
|
|
8
8
|
import z from "./RequestSection/RequestSection.vue.js";
|
|
9
9
|
import A from "./RequestSubpageHeader.vue.js";
|
|
10
10
|
import D from "./ResponseSection/ResponseSection.vue.js";
|
|
11
|
-
import { useWorkspace as
|
|
11
|
+
import { useWorkspace as S } from "../../store/store.js";
|
|
12
12
|
import { useLayout as M } from "../../hooks/useLayout.js";
|
|
13
13
|
const O = { class: "flex h-full" }, T = {
|
|
14
14
|
key: 0,
|
|
@@ -22,89 +22,82 @@ const O = { class: "flex h-full" }, T = {
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["newTab"],
|
|
24
24
|
setup($) {
|
|
25
|
-
const { events:
|
|
26
|
-
activeCollection:
|
|
27
|
-
activeExample:
|
|
28
|
-
activeRequest:
|
|
29
|
-
activeWorkspace:
|
|
30
|
-
activeServer:
|
|
31
|
-
activeEnvVariables:
|
|
32
|
-
activeEnvironment:
|
|
33
|
-
activeWorkspaceRequests:
|
|
34
|
-
} = L(), { modalState:
|
|
35
|
-
() => [...
|
|
36
|
-
var o;
|
|
37
|
-
return t.request.uid === ((o = m.value) == null ? void 0 : o.uid);
|
|
38
|
-
})
|
|
25
|
+
const { events: b } = S(), { isSidebarOpen: s } = B(), R = S(), { layout: q } = M(), {
|
|
26
|
+
activeCollection: t,
|
|
27
|
+
activeExample: c,
|
|
28
|
+
activeRequest: a,
|
|
29
|
+
activeWorkspace: l,
|
|
30
|
+
activeServer: u,
|
|
31
|
+
activeEnvVariables: p,
|
|
32
|
+
activeEnvironment: d,
|
|
33
|
+
activeWorkspaceRequests: h
|
|
34
|
+
} = L(), { modalState: x, requestHistory: C } = R, V = U(
|
|
35
|
+
() => [...C].reverse().find((o) => o.request.uid === c.value?.uid)
|
|
39
36
|
);
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
R.commandPalette.emit({
|
|
37
|
+
function w(o) {
|
|
38
|
+
b.commandPalette.emit({
|
|
43
39
|
commandName: "Import from cURL",
|
|
44
40
|
metaData: {
|
|
45
|
-
parsedCurl: I(
|
|
46
|
-
collectionUid:
|
|
41
|
+
parsedCurl: I(o),
|
|
42
|
+
collectionUid: t.value?.uid
|
|
47
43
|
}
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
|
-
return (
|
|
46
|
+
return (o, i) => e(t) && e(l) ? (r(), v("div", {
|
|
51
47
|
key: 0,
|
|
52
|
-
class:
|
|
53
|
-
"!mr-0 !mb-0 !border-0": e(
|
|
48
|
+
class: f(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
|
|
49
|
+
"!mr-0 !mb-0 !border-0": e(q) === "modal"
|
|
54
50
|
}])
|
|
55
51
|
}, [
|
|
56
52
|
P("div", O, [
|
|
57
|
-
e(
|
|
58
|
-
|
|
59
|
-
modelValue: e(
|
|
60
|
-
"onUpdate:modelValue":
|
|
61
|
-
collection: e(
|
|
62
|
-
envVariables: e(
|
|
63
|
-
environment: e(
|
|
64
|
-
operation: e(
|
|
65
|
-
server: e(
|
|
66
|
-
workspace: e(
|
|
67
|
-
onHideModal:
|
|
68
|
-
onImportCurl:
|
|
53
|
+
e(a) ? (r(), v("div", T, [
|
|
54
|
+
n(A, {
|
|
55
|
+
modelValue: e(s),
|
|
56
|
+
"onUpdate:modelValue": i[0] || (i[0] = (_) => W(s) ? s.value = _ : null),
|
|
57
|
+
collection: e(t),
|
|
58
|
+
envVariables: e(p),
|
|
59
|
+
environment: e(d),
|
|
60
|
+
operation: e(a),
|
|
61
|
+
server: e(u),
|
|
62
|
+
workspace: e(l),
|
|
63
|
+
onHideModal: i[1] || (i[1] = () => e(x).hide()),
|
|
64
|
+
onImportCurl: w
|
|
69
65
|
}, null, 8, ["modelValue", "collection", "envVariables", "environment", "operation", "server", "workspace"]),
|
|
70
|
-
|
|
71
|
-
default:
|
|
72
|
-
e(
|
|
66
|
+
n(N, null, {
|
|
67
|
+
default: k(() => [
|
|
68
|
+
e(c) ? (r(), m(g, {
|
|
73
69
|
key: 0,
|
|
74
|
-
class:
|
|
70
|
+
class: f(["flex-1", [e(s) ? "sidebar-active-hide-layout" : ""]])
|
|
75
71
|
}, {
|
|
76
|
-
default:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, null, 8, ["collection", "operation", "workspace", "requestResult", "numWorkspaceRequests", "response"])
|
|
98
|
-
];
|
|
99
|
-
}),
|
|
72
|
+
default: k(() => [
|
|
73
|
+
n(z, {
|
|
74
|
+
collection: e(t),
|
|
75
|
+
envVariables: e(p),
|
|
76
|
+
environment: e(d),
|
|
77
|
+
example: e(c),
|
|
78
|
+
invalidParams: o.invalidParams,
|
|
79
|
+
operation: e(a),
|
|
80
|
+
selectedSecuritySchemeUids: o.selectedSecuritySchemeUids,
|
|
81
|
+
server: e(u),
|
|
82
|
+
workspace: e(l)
|
|
83
|
+
}, null, 8, ["collection", "envVariables", "environment", "example", "invalidParams", "operation", "selectedSecuritySchemeUids", "server", "workspace"]),
|
|
84
|
+
n(D, {
|
|
85
|
+
collection: e(t),
|
|
86
|
+
operation: e(a),
|
|
87
|
+
workspace: e(l),
|
|
88
|
+
requestResult: o.requestResult,
|
|
89
|
+
numWorkspaceRequests: e(h).length,
|
|
90
|
+
response: V.value?.response
|
|
91
|
+
}, null, 8, ["collection", "operation", "workspace", "requestResult", "numWorkspaceRequests", "response"])
|
|
92
|
+
]),
|
|
100
93
|
_: 1
|
|
101
94
|
}, 8, ["class"])) : H("", !0)
|
|
102
95
|
]),
|
|
103
96
|
_: 1
|
|
104
97
|
})
|
|
105
|
-
])) : (
|
|
98
|
+
])) : (r(), m(y, { key: 1 }))
|
|
106
99
|
])
|
|
107
|
-
], 2)) : (
|
|
100
|
+
], 2)) : (r(), m(y, { key: 1 }));
|
|
108
101
|
}
|
|
109
102
|
});
|
|
110
103
|
export {
|