@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,41 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useScroll as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useActiveEntities as
|
|
8
|
-
import { PathId as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as f, ref as l, computed as u, watch as n, createBlock as p, openBlock as _, withCtx as s, createVNode as e, createElementVNode as d, unref as h } from "vue";
|
|
2
|
+
import { useScroll as x } from "@vueuse/core";
|
|
3
|
+
import { useRouter as v, RouterView as w } from "vue-router";
|
|
4
|
+
import k from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
5
|
+
import y from "../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
|
+
import q from "./CollectionNavigation.vue.js";
|
|
7
|
+
import { useActiveEntities as C } from "../../store/active-entities.js";
|
|
8
|
+
import { PathId as R } from "../../routes.js";
|
|
9
|
+
const S = { class: "w-full md:mx-auto md:max-w-[720px]" }, P = /* @__PURE__ */ f({
|
|
10
10
|
__name: "Collection",
|
|
11
|
-
setup(
|
|
12
|
-
const { activeCollection: i } =
|
|
13
|
-
return
|
|
11
|
+
setup(V) {
|
|
12
|
+
const { activeCollection: i } = C(), m = v(), o = l(null), { y: c } = x(o), a = u(() => c.value > 104);
|
|
13
|
+
return n(
|
|
14
14
|
i,
|
|
15
15
|
(t) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const u = t.requests[0];
|
|
16
|
+
if (t?.info?.title === "Drafts") {
|
|
17
|
+
const r = t.requests[0];
|
|
19
18
|
m.push({
|
|
20
19
|
name: "request",
|
|
21
|
-
params: { [
|
|
20
|
+
params: { [R.Request]: r }
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
25
|
immediate: !0
|
|
27
26
|
}
|
|
28
|
-
), (t,
|
|
27
|
+
), (t, r) => (_(), p(k, {
|
|
29
28
|
ref_key: "el",
|
|
30
29
|
ref: o,
|
|
31
30
|
class: "h-fit overflow-auto pb-6 xl:overflow-auto"
|
|
32
31
|
}, {
|
|
33
32
|
default: s(() => [
|
|
34
|
-
|
|
33
|
+
e(y, { class: "xl:h-fit" }, {
|
|
35
34
|
default: s(() => [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
e(q, { isSticky: a.value }, null, 8, ["isSticky"]),
|
|
36
|
+
d("div", S, [
|
|
37
|
+
e(h(w))
|
|
39
38
|
])
|
|
40
39
|
]),
|
|
41
40
|
_: 1
|
|
@@ -46,5 +45,5 @@ const V = { class: "w-full md:mx-auto md:max-w-[720px]" }, g = /* @__PURE__ */ c
|
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
export {
|
|
49
|
-
|
|
48
|
+
P as default
|
|
50
49
|
};
|
|
@@ -1,60 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarToggle as
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as d, createElementBlock as m, openBlock as c, createElementVNode as o, createBlock as p, createCommentVNode as v, createVNode as f, unref as e, normalizeClass as h } from "vue";
|
|
2
|
+
import { ScalarToggle as y } from "@scalar/components";
|
|
3
|
+
import { useActiveEntities as S } from "../../store/active-entities.js";
|
|
4
|
+
import { useWorkspace as x } from "../../store/store.js";
|
|
5
|
+
import _ from "../Request/RequestSection/RequestAuth/RequestAuth.vue.js";
|
|
6
|
+
const C = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, V = { class: "flex flex-col gap-4" }, g = { class: "flex flex-col gap-2" }, k = { class: "flex h-8 items-center justify-between" }, N = /* @__PURE__ */ d({
|
|
7
7
|
__name: "CollectionAuthentication",
|
|
8
|
-
setup(
|
|
8
|
+
setup(b) {
|
|
9
9
|
const {
|
|
10
10
|
activeCollection: t,
|
|
11
|
-
activeEnvVariables:
|
|
12
|
-
activeEnvironment:
|
|
13
|
-
activeServer:
|
|
14
|
-
activeWorkspace:
|
|
15
|
-
} =
|
|
16
|
-
|
|
17
|
-
(i = t.value) != null && i.uid && p.edit(
|
|
11
|
+
activeEnvVariables: n,
|
|
12
|
+
activeEnvironment: s,
|
|
13
|
+
activeServer: r,
|
|
14
|
+
activeWorkspace: i
|
|
15
|
+
} = S(), { collectionMutators: a } = x(), u = () => {
|
|
16
|
+
t.value?.uid && a.edit(
|
|
18
17
|
t.value.uid,
|
|
19
18
|
"useCollectionSecurity",
|
|
20
19
|
!t.value.useCollectionSecurity
|
|
21
20
|
);
|
|
22
21
|
};
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"onUpdate:modelValue": v
|
|
34
|
-
}, null, 8, ["modelValue"])
|
|
35
|
-
]),
|
|
36
|
-
l[1] || (l[1] = o("p", { class: "pr-6 text-sm" }, " Added authentication will apply to all requests under this collection. You can override this by specifying another one in the request. ", -1))
|
|
22
|
+
return (w, l) => (c(), m("div", C, [
|
|
23
|
+
o("div", V, [
|
|
24
|
+
o("div", g, [
|
|
25
|
+
o("div", k, [
|
|
26
|
+
l[0] || (l[0] = o("h3", { class: "font-bold" }, "Authentication", -1)),
|
|
27
|
+
f(e(y), {
|
|
28
|
+
class: "w-4",
|
|
29
|
+
modelValue: e(t)?.useCollectionSecurity ?? !1,
|
|
30
|
+
"onUpdate:modelValue": u
|
|
31
|
+
}, null, 8, ["modelValue"])
|
|
37
32
|
]),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
l[1] || (l[1] = o("p", { class: "pr-6 text-sm" }, " Added authentication will apply to all requests under this collection. You can override this by specifying another one in the request. ", -1))
|
|
34
|
+
]),
|
|
35
|
+
e(t) && e(i) ? (c(), p(e(_), {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: h([
|
|
38
|
+
"scalar-collection-auth",
|
|
39
|
+
!e(t)?.useCollectionSecurity && "pointer-events-none opacity-50 mix-blend-luminosity"
|
|
40
|
+
]),
|
|
41
|
+
collection: e(t),
|
|
42
|
+
envVariables: e(n),
|
|
43
|
+
environment: e(s),
|
|
44
|
+
layout: "client",
|
|
45
|
+
selectedSecuritySchemeUids: e(t)?.selectedSecuritySchemeUids ?? [],
|
|
46
|
+
server: e(r),
|
|
47
|
+
title: "Authentication",
|
|
48
|
+
workspace: e(i)
|
|
49
|
+
}, null, 8, ["class", "collection", "envVariables", "environment", "selectedSecuritySchemeUids", "server", "workspace"])) : v("", !0)
|
|
50
|
+
])
|
|
51
|
+
]));
|
|
56
52
|
}
|
|
57
53
|
});
|
|
58
54
|
export {
|
|
59
|
-
|
|
55
|
+
N as default
|
|
60
56
|
};
|
|
@@ -1,241 +1,230 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { Draggable as
|
|
4
|
-
import { ScalarIconTrash as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useActiveEntities as
|
|
12
|
-
import { useWorkspace as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as q, ref as k, computed as J, createBlock as F, openBlock as E, withCtx as u, createElementVNode as a, createVNode as r, createElementBlock as L, createTextVNode as M, Fragment as U, renderList as G, unref as e, createCommentVNode as H, normalizeStyle as K, toDisplayString as P } from "vue";
|
|
2
|
+
import { useModal as C, ScalarButton as y, ScalarIcon as Q, ScalarModal as I } from "@scalar/components";
|
|
3
|
+
import { Draggable as X } from "@scalar/draggable";
|
|
4
|
+
import { ScalarIconTrash as Y } from "@scalar/icons";
|
|
5
|
+
import Z from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
6
|
+
import ee from "../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
|
|
7
|
+
import te from "../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
8
|
+
import ne from "../Environment/EnvironmentColorModal.vue.js";
|
|
9
|
+
import oe from "../Environment/EnvironmentModal.vue.js";
|
|
10
|
+
import le from "./components/EnvironmentForm.vue.js";
|
|
11
|
+
import { useActiveEntities as se } from "../../store/active-entities.js";
|
|
12
|
+
import { useWorkspace as ae } from "../../store/store.js";
|
|
13
|
+
const re = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, ie = { class: "flex flex-col gap-4" }, ce = { class: "rounded-lg border" }, de = { class: "bg-b-2 flex cursor-grab items-center justify-between rounded-t-lg px-1 py-1 text-sm" }, ue = { class: "flex items-center" }, ve = ["onClick"], me = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, $e = /* @__PURE__ */ q({
|
|
14
14
|
__name: "CollectionEnvironment",
|
|
15
|
-
setup(
|
|
16
|
-
const { activeCollection:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
s.value = n, h.show();
|
|
34
|
-
}, z = (n) => {
|
|
35
|
-
var e;
|
|
36
|
-
(e = l.value) != null && e.uid && (m.addEnvironment(
|
|
37
|
-
n.name,
|
|
15
|
+
setup(fe) {
|
|
16
|
+
const { activeCollection: n, activeWorkspace: w, activeEnvVariables: S } = se(), { collectionMutators: m } = ae(), x = C(), b = C(), h = C(), g = C(), $ = k(""), l = k(null), _ = k(void 0), D = J(() => n.value?.["x-scalar-environments"] ? Object.entries(n.value["x-scalar-environments"]).map(
|
|
17
|
+
([o, t]) => ({
|
|
18
|
+
uid: o,
|
|
19
|
+
name: o,
|
|
20
|
+
value: JSON.stringify(t.variables || {}),
|
|
21
|
+
color: t.color || "#FFFFFF"
|
|
22
|
+
})
|
|
23
|
+
) : []), V = () => {
|
|
24
|
+
!n.value?.uid || !l.value || (m.removeEnvironment(
|
|
25
|
+
l.value,
|
|
26
|
+
n.value.uid
|
|
27
|
+
), b.hide());
|
|
28
|
+
}, N = (o) => {
|
|
29
|
+
l.value = o, b.show();
|
|
30
|
+
}, j = (o) => {
|
|
31
|
+
n.value?.uid && (m.addEnvironment(
|
|
32
|
+
o.name,
|
|
38
33
|
{
|
|
39
34
|
variables: {},
|
|
40
|
-
color:
|
|
35
|
+
color: o.color
|
|
41
36
|
},
|
|
42
|
-
|
|
43
|
-
),
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
if (!((i = l.value) != null && i.uid) || !s.value)
|
|
37
|
+
n.value.uid
|
|
38
|
+
), h.hide());
|
|
39
|
+
}, z = (o) => {
|
|
40
|
+
l.value = o.name, $.value = o.color || "#FFFFFF", x.show();
|
|
41
|
+
}, O = (o) => {
|
|
42
|
+
if (!n.value?.uid || !l.value)
|
|
49
43
|
return;
|
|
50
|
-
const
|
|
51
|
-
...
|
|
52
|
-
[
|
|
53
|
-
variables:
|
|
54
|
-
color:
|
|
44
|
+
const t = {
|
|
45
|
+
...n.value["x-scalar-environments"],
|
|
46
|
+
[l.value]: {
|
|
47
|
+
variables: n.value["x-scalar-environments"]?.[l.value]?.variables || {},
|
|
48
|
+
color: o
|
|
55
49
|
}
|
|
56
50
|
};
|
|
57
51
|
m.edit(
|
|
58
|
-
|
|
52
|
+
n.value.uid,
|
|
59
53
|
"x-scalar-environments",
|
|
60
|
-
|
|
61
|
-
),
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
if (!((p = l.value) != null && p.uid) || !s.value)
|
|
54
|
+
t
|
|
55
|
+
), x.hide();
|
|
56
|
+
}, A = (o) => {
|
|
57
|
+
l.value = o, _.value = o, g.show();
|
|
58
|
+
}, B = () => {
|
|
59
|
+
l.value = null, _.value = void 0, g.hide();
|
|
60
|
+
}, W = (o) => {
|
|
61
|
+
if (!n.value?.uid || !l.value)
|
|
69
62
|
return;
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
63
|
+
const t = { ...n.value["x-scalar-environments"] };
|
|
64
|
+
if (!t[l.value])
|
|
72
65
|
return;
|
|
73
|
-
const
|
|
74
|
-
([v]) => v ===
|
|
66
|
+
const i = {}, c = Object.entries(t), f = c.findIndex(
|
|
67
|
+
([v]) => v === l.value
|
|
75
68
|
);
|
|
76
|
-
|
|
77
|
-
d === f ? o
|
|
69
|
+
c.forEach(([v, p], d) => {
|
|
70
|
+
d === f ? i[o] = p : i[v] = p;
|
|
78
71
|
}), m.edit(
|
|
79
|
-
|
|
72
|
+
n.value.uid,
|
|
80
73
|
"x-scalar-environments",
|
|
81
|
-
|
|
82
|
-
),
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
if (!((x = l.value) != null && x.uid))
|
|
74
|
+
i
|
|
75
|
+
), l.value = null, _.value = void 0, g.hide();
|
|
76
|
+
}, R = (o, t) => {
|
|
77
|
+
if (!n.value?.uid)
|
|
86
78
|
return;
|
|
87
|
-
const
|
|
88
|
-
if (f === -1 ||
|
|
79
|
+
const s = { ...n.value["x-scalar-environments"] }, i = {}, c = Object.entries(s), f = c.findIndex(([d]) => d === o.id), v = c.findIndex(([d]) => d === t.id);
|
|
80
|
+
if (f === -1 || v === -1)
|
|
89
81
|
return;
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
const p = c[f];
|
|
83
|
+
p && (c.splice(f, 1), c.splice(v, 0, p), c.forEach(([d, T]) => {
|
|
84
|
+
i[d] = T;
|
|
93
85
|
}), m.edit(
|
|
94
|
-
|
|
86
|
+
n.value.uid,
|
|
95
87
|
"x-scalar-environments",
|
|
96
|
-
|
|
88
|
+
i
|
|
97
89
|
));
|
|
98
90
|
};
|
|
99
|
-
return (
|
|
100
|
-
default: u(() =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
r("code", { class: "font-code text-c-2" }, "{{ variable }}"),
|
|
113
|
-
I(" to add / search among the selected environment's variables in your request inputs. ")
|
|
114
|
-
])
|
|
91
|
+
return (o, t) => (E(), F(te, null, {
|
|
92
|
+
default: u(() => [
|
|
93
|
+
a("div", re, [
|
|
94
|
+
a("div", ie, [
|
|
95
|
+
t[5] || (t[5] = a("div", { class: "flex items-start justify-between gap-2" }, [
|
|
96
|
+
a("div", { class: "flex flex-col gap-2" }, [
|
|
97
|
+
a("div", { class: "flex h-8 items-center" }, [
|
|
98
|
+
a("h3", { class: "font-bold" }, "Environment Variables")
|
|
99
|
+
]),
|
|
100
|
+
a("p", { class: "text-sm" }, [
|
|
101
|
+
M(" Set environment variables at your collection level. Use "),
|
|
102
|
+
a("code", { class: "font-code text-c-2" }, "{{ variable }}"),
|
|
103
|
+
M(" to add / search among the selected environment's variables in your request inputs. ")
|
|
115
104
|
])
|
|
116
|
-
]
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
default: u(() => [
|
|
135
|
-
r("span", {
|
|
136
|
-
style: P({ backgroundColor: o.color || "#FFFFFF" }),
|
|
137
|
-
class: "h-2.5 w-2.5 rounded-full"
|
|
138
|
-
}, null, 4)
|
|
139
|
-
]),
|
|
140
|
-
_: 2
|
|
141
|
-
}, 1032, ["onClick"]),
|
|
142
|
-
r("button", {
|
|
143
|
-
class: "hover:bg-b-3 rounded px-1 py-0.5 text-sm",
|
|
144
|
-
onClick: (a) => B(o.name)
|
|
145
|
-
}, Q(o.name), 9, me)
|
|
146
|
-
]),
|
|
147
|
-
c(t(w), {
|
|
148
|
-
class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
|
|
149
|
-
variant: "ghost",
|
|
150
|
-
onClick: (a) => j(o.name)
|
|
105
|
+
])
|
|
106
|
+
], -1)),
|
|
107
|
+
(E(!0), L(U, null, G(D.value, (s) => (E(), F(e(X), {
|
|
108
|
+
key: s.name,
|
|
109
|
+
id: s.name,
|
|
110
|
+
isDraggable: !0,
|
|
111
|
+
isDroppable: !0,
|
|
112
|
+
parentIds: [],
|
|
113
|
+
onOnDragEnd: R
|
|
114
|
+
}, {
|
|
115
|
+
default: u(() => [
|
|
116
|
+
a("div", ce, [
|
|
117
|
+
a("div", de, [
|
|
118
|
+
a("div", ue, [
|
|
119
|
+
r(e(y), {
|
|
120
|
+
class: "hover:bg-b-3 flex h-6 w-6 p-1",
|
|
121
|
+
onClick: (i) => z(s),
|
|
122
|
+
variant: "ghost"
|
|
151
123
|
}, {
|
|
152
124
|
default: u(() => [
|
|
153
|
-
|
|
125
|
+
a("span", {
|
|
126
|
+
style: K({ backgroundColor: s.color || "#FFFFFF" }),
|
|
127
|
+
class: "h-2.5 w-2.5 rounded-full"
|
|
128
|
+
}, null, 4)
|
|
154
129
|
]),
|
|
155
130
|
_: 2
|
|
156
|
-
}, 1032, ["onClick"])
|
|
131
|
+
}, 1032, ["onClick"]),
|
|
132
|
+
a("button", {
|
|
133
|
+
class: "hover:bg-b-3 rounded px-1 py-0.5 text-sm",
|
|
134
|
+
onClick: (i) => A(s.name)
|
|
135
|
+
}, P(s.name), 9, ve)
|
|
157
136
|
]),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, 1032, ["id"]))), 128)),
|
|
169
|
-
r("div", fe, [
|
|
170
|
-
c(t(w), {
|
|
171
|
-
class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
|
|
172
|
-
size: "sm",
|
|
173
|
-
variant: "ghost",
|
|
174
|
-
onClick: e[0] || (e[0] = (o) => t(g).show())
|
|
175
|
-
}, {
|
|
176
|
-
default: u(() => [
|
|
177
|
-
c(t(X), {
|
|
178
|
-
class: "inline-flex",
|
|
179
|
-
icon: "Add",
|
|
180
|
-
size: "sm",
|
|
181
|
-
thickness: "1.5"
|
|
182
|
-
}),
|
|
183
|
-
e[4] || (e[4] = r("span", null, "Add Environment", -1))
|
|
137
|
+
r(e(y), {
|
|
138
|
+
class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
onClick: (i) => N(s.name)
|
|
141
|
+
}, {
|
|
142
|
+
default: u(() => [
|
|
143
|
+
r(e(Y), { class: "size-3.5" })
|
|
144
|
+
]),
|
|
145
|
+
_: 2
|
|
146
|
+
}, 1032, ["onClick"])
|
|
184
147
|
]),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
title: `Delete ${s.value || "Environment"}`
|
|
194
|
-
}, {
|
|
195
|
-
default: u(() => [
|
|
196
|
-
c(ee, {
|
|
197
|
-
variableName: "Environment",
|
|
198
|
-
warningMessage: "Are you sure you want to delete this environment? This action cannot be undone.",
|
|
199
|
-
onClose: e[1] || (e[1] = (o) => t(h).hide()),
|
|
200
|
-
onDelete: N
|
|
201
|
-
})
|
|
202
|
-
]),
|
|
203
|
-
_: 1
|
|
204
|
-
}, 8, ["state", "title"]),
|
|
205
|
-
c(le, {
|
|
206
|
-
activeWorkspaceCollections: t(l) ? [t(l)] : [],
|
|
207
|
-
collectionId: (i = t(l)) == null ? void 0 : i.uid,
|
|
208
|
-
state: t(g),
|
|
209
|
-
onCancel: e[2] || (e[2] = (o) => t(g).hide()),
|
|
210
|
-
onSubmit: z
|
|
211
|
-
}, null, 8, ["activeWorkspaceCollections", "collectionId", "state"]),
|
|
212
|
-
c(oe, {
|
|
213
|
-
selectedColor: M.value,
|
|
214
|
-
state: t(b),
|
|
215
|
-
onCancel: e[3] || (e[3] = (o) => t(b).hide()),
|
|
216
|
-
onSubmit: A
|
|
217
|
-
}, null, 8, ["selectedColor", "state"]),
|
|
218
|
-
c(t(S), {
|
|
219
|
-
size: "xxs",
|
|
220
|
-
state: t(_),
|
|
221
|
-
title: `Edit ${s.value}`
|
|
222
|
-
}, {
|
|
223
|
-
default: u(() => [
|
|
224
|
-
c(te, {
|
|
225
|
-
name: E.value ?? "",
|
|
226
|
-
onClose: W,
|
|
227
|
-
onEdit: R
|
|
228
|
-
}, null, 8, ["name"])
|
|
148
|
+
e(n) && e(w) ? (E(), F(le, {
|
|
149
|
+
key: 0,
|
|
150
|
+
collection: e(n),
|
|
151
|
+
environment: s,
|
|
152
|
+
envVariables: e(S),
|
|
153
|
+
workspace: e(w)
|
|
154
|
+
}, null, 8, ["collection", "environment", "envVariables", "workspace"])) : H("", !0)
|
|
155
|
+
])
|
|
229
156
|
]),
|
|
230
|
-
_:
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
157
|
+
_: 2
|
|
158
|
+
}, 1032, ["id"]))), 128)),
|
|
159
|
+
a("div", me, [
|
|
160
|
+
r(e(y), {
|
|
161
|
+
class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
|
|
162
|
+
size: "sm",
|
|
163
|
+
variant: "ghost",
|
|
164
|
+
onClick: t[0] || (t[0] = (s) => e(h).show())
|
|
165
|
+
}, {
|
|
166
|
+
default: u(() => [
|
|
167
|
+
r(e(Q), {
|
|
168
|
+
class: "inline-flex",
|
|
169
|
+
icon: "Add",
|
|
170
|
+
size: "sm",
|
|
171
|
+
thickness: "1.5"
|
|
172
|
+
}),
|
|
173
|
+
t[4] || (t[4] = a("span", null, "Add Environment", -1))
|
|
174
|
+
]),
|
|
175
|
+
_: 1,
|
|
176
|
+
__: [4]
|
|
177
|
+
})
|
|
178
|
+
])
|
|
179
|
+
]),
|
|
180
|
+
r(e(I), {
|
|
181
|
+
size: "xxs",
|
|
182
|
+
state: e(b),
|
|
183
|
+
title: `Delete ${l.value || "Environment"}`
|
|
184
|
+
}, {
|
|
185
|
+
default: u(() => [
|
|
186
|
+
r(Z, {
|
|
187
|
+
variableName: "Environment",
|
|
188
|
+
warningMessage: "Are you sure you want to delete this environment? This action cannot be undone.",
|
|
189
|
+
onClose: t[1] || (t[1] = (s) => e(b).hide()),
|
|
190
|
+
onDelete: V
|
|
191
|
+
})
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
}, 8, ["state", "title"]),
|
|
195
|
+
r(oe, {
|
|
196
|
+
activeWorkspaceCollections: e(n) ? [e(n)] : [],
|
|
197
|
+
collectionId: e(n)?.uid,
|
|
198
|
+
state: e(h),
|
|
199
|
+
onCancel: t[2] || (t[2] = (s) => e(h).hide()),
|
|
200
|
+
onSubmit: j
|
|
201
|
+
}, null, 8, ["activeWorkspaceCollections", "collectionId", "state"]),
|
|
202
|
+
r(ne, {
|
|
203
|
+
selectedColor: $.value,
|
|
204
|
+
state: e(x),
|
|
205
|
+
onCancel: t[3] || (t[3] = (s) => e(x).hide()),
|
|
206
|
+
onSubmit: O
|
|
207
|
+
}, null, 8, ["selectedColor", "state"]),
|
|
208
|
+
r(e(I), {
|
|
209
|
+
size: "xxs",
|
|
210
|
+
state: e(g),
|
|
211
|
+
title: `Edit ${l.value}`
|
|
212
|
+
}, {
|
|
213
|
+
default: u(() => [
|
|
214
|
+
r(ee, {
|
|
215
|
+
name: _.value ?? "",
|
|
216
|
+
onClose: B,
|
|
217
|
+
onEdit: W
|
|
218
|
+
}, null, 8, ["name"])
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, ["state", "title"])
|
|
222
|
+
])
|
|
223
|
+
]),
|
|
235
224
|
_: 1
|
|
236
225
|
}));
|
|
237
226
|
}
|
|
238
227
|
});
|
|
239
228
|
export {
|
|
240
|
-
|
|
229
|
+
$e as default
|
|
241
230
|
};
|