@scalar/api-client 2.5.31 → 2.5.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
- package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
- package/dist/components/CodeInput/codeVariableWidget.js +70 -75
- package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +4 -4
- package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
- package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
- package/dist/components/EmptyState.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
- package/dist/components/Form/LabelInput.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
- package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
- package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
- package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
- package/dist/components/ImportCollection/utils/import-collection.js +14 -14
- package/dist/components/OpenApiClientButton.vue.js +1 -1
- package/dist/components/OpenApiClientButton.vue2.js +10 -10
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +19 -22
- package/dist/components/Search/useSearch.js +51 -61
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue2.js +26 -29
- package/dist/components/Server/ServerDropdown.vue.js +70 -96
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
- package/dist/components/Server/ServerSelector.vue.js +44 -55
- package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
- package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
- package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue.js +68 -74
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.js +107 -122
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/hooks/useFileDialog.js +12 -12
- package/dist/hooks/useResponseBody.js +14 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/layouts/App/ApiClientApp.vue.js +50 -56
- package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
- package/dist/layouts/App/create-api-client-app.js +19 -20
- package/dist/layouts/App/index.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
- package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
- package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
- package/dist/layouts/Web/create-api-client-web.js +19 -20
- package/dist/layouts/Web/index.js +1 -1
- package/dist/libs/create-client.js +102 -109
- package/dist/libs/env-helpers.js +3 -3
- package/dist/libs/event-bus.js +15 -15
- package/dist/libs/extractAttachmentFilename.js +5 -6
- package/dist/libs/find-request.js +9 -10
- package/dist/libs/get-request-uid-by-path-method.js +12 -12
- package/dist/libs/getOpenApiDocumentDetails.js +7 -7
- package/dist/libs/importers/curl.js +3 -3
- package/dist/libs/normalize-headers.js +9 -10
- package/dist/libs/postman.js +15 -17
- package/dist/libs/send-request/build-request-security.js +9 -10
- package/dist/libs/send-request/create-fetch-body.js +11 -12
- package/dist/libs/send-request/create-fetch-query-params.js +13 -13
- package/dist/libs/send-request/create-request-operation.js +83 -84
- package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +12 -12
- package/dist/libs/string-template.js +21 -21
- package/dist/libs/validate-parameters.js +5 -8
- package/dist/plugins/plugin-manager.js +11 -17
- package/dist/store/active-entities.js +90 -117
- package/dist/store/collections.js +41 -42
- package/dist/store/import-spec.js +25 -26
- package/dist/store/request-example.js +20 -24
- package/dist/store/requests.js +63 -81
- package/dist/store/router-params.js +7 -7
- package/dist/store/security-schemes.js +35 -36
- package/dist/store/store.js +2 -2
- package/dist/store/tags.js +20 -21
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue2.js +21 -22
- package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
- package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
- package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
- package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
- package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
- package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
- package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
- package/dist/views/Collection/CollectionServers.vue2.js +88 -98
- package/dist/views/Collection/CollectionSettings.vue.js +1 -1
- package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
- package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
- package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
- package/dist/views/Cookies/CookieModal.vue.js +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +90 -93
- package/dist/views/Environment/Environment.vue2.js +267 -295
- package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +60 -67
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +78 -89
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
- package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
- package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +199 -211
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
- package/dist/views/Request/consts/mediaTypes.js +2 -3
- package/dist/views/Request/handle-drag.js +24 -28
- package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
- package/dist/views/Request/libs/auth.js +37 -43
- package/dist/views/Request/libs/oauth2.js +30 -32
- package/dist/views/Request/libs/watch-mode.js +100 -103
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
- package/package.json +22 -22
- package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
- package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
- package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
- package/dist/components/EmptyState.vue3.js +0 -4
- package/dist/components/Form/LabelInput.vue3.js +0 -4
- package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
- package/dist/components/OpenApiClientButton.vue3.js +0 -4
- package/dist/components/ScalarAsciiArt.vue3.js +0 -4
- package/dist/components/SectionFilter.vue3.js +0 -4
- package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
- package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
- package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
- package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
- package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
- package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
- package/dist/style.css.js +0 -4
- package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
- package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
- package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
- package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
- package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
- package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
- package/dist/views/Cookies/CookieModal.vue3.js +0 -4
- package/dist/views/Request/Request.vue3.js +0 -4
- package/dist/views/Request/RequestRoot.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
- package/dist/views/Request/RequestSidebar.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
- package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
|
@@ -1,111 +1,101 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { ScalarIconTrash as
|
|
4
|
-
import { emitCustomEvent as
|
|
5
|
-
import
|
|
6
|
-
import { useActiveEntities as
|
|
7
|
-
import
|
|
8
|
-
import { useWorkspace as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as y, ref as w, computed as C, useTemplateRef as A, createElementBlock as u, openBlock as o, createElementVNode as n, createVNode as a, createStaticVNode as M, Fragment as N, renderList as D, createBlock as f, createCommentVNode as I, unref as e, toDisplayString as $, withCtx as v } from "vue";
|
|
2
|
+
import { useModal as j, ScalarMarkdown as z, ScalarButton as m, ScalarIcon as B, ScalarModal as E } from "@scalar/components";
|
|
3
|
+
import { ScalarIconTrash as U } from "@scalar/icons";
|
|
4
|
+
import { emitCustomEvent as V } from "@scalar/workspace-store/events";
|
|
5
|
+
import T from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
6
|
+
import { useActiveEntities as L } from "../../store/active-entities.js";
|
|
7
|
+
import P from "./CollectionServerForm.vue.js";
|
|
8
|
+
import { useWorkspace as R } from "../../store/store.js";
|
|
9
|
+
const F = {
|
|
10
10
|
ref: "wrapper-ref",
|
|
11
11
|
class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8"
|
|
12
|
-
},
|
|
12
|
+
}, O = { class: "flex flex-col gap-4" }, W = { class: "rounded-lg border" }, Y = { class: "bg-b-2 flex items-start justify-between rounded-t-lg py-1 pr-1 pl-3 text-sm" }, q = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "self-center"
|
|
15
|
-
},
|
|
15
|
+
}, G = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, le = /* @__PURE__ */ y({
|
|
16
16
|
__name: "CollectionServers",
|
|
17
|
-
setup(
|
|
18
|
-
const { activeCollection:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(e) => {
|
|
22
|
-
var i;
|
|
23
|
-
return (i = s.value) == null ? void 0 : i.servers.includes(e.uid);
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
}), S = () => x.commandPalette.emit({
|
|
17
|
+
setup(H) {
|
|
18
|
+
const { activeCollection: t } = L(), { servers: i, events: p, serverMutators: x } = R(), c = j(), r = w(null), h = C(() => !i || !t.value?.servers ? [] : Object.values(i).filter(
|
|
19
|
+
(d) => t.value?.servers.includes(d.uid)
|
|
20
|
+
)), _ = () => p.commandPalette.emit({
|
|
27
21
|
commandName: "Add Server"
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
c("div", Y, [
|
|
45
|
-
c("div", q, [
|
|
46
|
-
o.description ? (a(), m(t(B), {
|
|
47
|
-
key: 0,
|
|
48
|
-
class: "self-center",
|
|
49
|
-
value: o.description
|
|
50
|
-
}, null, 8, ["value"])) : (a(), v("span", G, "Server " + j(y + 1), 1)),
|
|
51
|
-
n(t(p), {
|
|
52
|
-
class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
|
|
53
|
-
variant: "ghost",
|
|
54
|
-
onClick: (K) => b(o.uid)
|
|
55
|
-
}, {
|
|
56
|
-
default: f(() => [
|
|
57
|
-
n(t(V), { class: "size-3.5" })
|
|
58
|
-
]),
|
|
59
|
-
_: 2
|
|
60
|
-
}, 1032, ["onClick"])
|
|
61
|
-
]),
|
|
62
|
-
t(s) ? (a(), m(R, {
|
|
22
|
+
}), S = () => {
|
|
23
|
+
!t.value?.uid || !r.value || (x.delete(r.value, t.value.uid), V(b.value, "scalar-delete-server", {
|
|
24
|
+
url: i[r.value]?.url ?? ""
|
|
25
|
+
}), c.hide());
|
|
26
|
+
}, g = (d) => {
|
|
27
|
+
r.value = d, c.show();
|
|
28
|
+
}, b = A("wrapper-ref");
|
|
29
|
+
return (d, s) => (o(), u("div", F, [
|
|
30
|
+
n("div", O, [
|
|
31
|
+
s[2] || (s[2] = M('<div class="flex items-start justify-between gap-2"><div class="flex flex-col gap-2"><div class="flex h-8 items-center"><h3 class="font-bold">Servers</h3></div><p class="text-sm"> Add different base URLs for your API. You can use <code class="font-code text-c-2">{variables}</code> for dynamic parts. </p></div></div>', 1)),
|
|
32
|
+
(o(!0), u(N, null, D(h.value, (l, k) => (o(), u("div", {
|
|
33
|
+
key: l.uid
|
|
34
|
+
}, [
|
|
35
|
+
n("div", W, [
|
|
36
|
+
n("div", Y, [
|
|
37
|
+
l.description ? (o(), f(e(z), {
|
|
63
38
|
key: 0,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, null, 8, ["
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
e[1] || (e[1] = c("span", null, "Add Server", -1))
|
|
84
|
-
]),
|
|
85
|
-
_: 1,
|
|
86
|
-
__: [1]
|
|
87
|
-
})
|
|
39
|
+
class: "self-center",
|
|
40
|
+
value: l.description
|
|
41
|
+
}, null, 8, ["value"])) : (o(), u("span", q, "Server " + $(k + 1), 1)),
|
|
42
|
+
a(e(m), {
|
|
43
|
+
class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
|
|
44
|
+
variant: "ghost",
|
|
45
|
+
onClick: (J) => g(l.uid)
|
|
46
|
+
}, {
|
|
47
|
+
default: v(() => [
|
|
48
|
+
a(e(U), { class: "size-3.5" })
|
|
49
|
+
]),
|
|
50
|
+
_: 2
|
|
51
|
+
}, 1032, ["onClick"])
|
|
52
|
+
]),
|
|
53
|
+
e(t) ? (o(), f(P, {
|
|
54
|
+
key: 0,
|
|
55
|
+
collectionId: e(t).uid,
|
|
56
|
+
serverUid: l.uid
|
|
57
|
+
}, null, 8, ["collectionId", "serverUid"])) : I("", !0)
|
|
88
58
|
])
|
|
59
|
+
]))), 128)),
|
|
60
|
+
n("div", G, [
|
|
61
|
+
a(e(m), {
|
|
62
|
+
class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
|
|
63
|
+
size: "sm",
|
|
64
|
+
variant: "ghost",
|
|
65
|
+
onClick: _
|
|
66
|
+
}, {
|
|
67
|
+
default: v(() => [
|
|
68
|
+
a(e(B), {
|
|
69
|
+
class: "inline-flex",
|
|
70
|
+
icon: "Add",
|
|
71
|
+
size: "sm",
|
|
72
|
+
thickness: "1.5"
|
|
73
|
+
}),
|
|
74
|
+
s[1] || (s[1] = n("span", null, "Add Server", -1))
|
|
75
|
+
]),
|
|
76
|
+
_: 1,
|
|
77
|
+
__: [1]
|
|
78
|
+
})
|
|
79
|
+
])
|
|
80
|
+
]),
|
|
81
|
+
a(e(E), {
|
|
82
|
+
size: "xxs",
|
|
83
|
+
state: e(c),
|
|
84
|
+
title: `Delete ${r.value ? e(i)[r.value]?.url : "Server"}`
|
|
85
|
+
}, {
|
|
86
|
+
default: v(() => [
|
|
87
|
+
a(T, {
|
|
88
|
+
variableName: "Server",
|
|
89
|
+
warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
|
|
90
|
+
onClose: s[0] || (s[0] = (l) => e(c).hide()),
|
|
91
|
+
onDelete: S
|
|
92
|
+
})
|
|
89
93
|
]),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
title: `Delete ${l.value ? (i = t(d)[l.value]) == null ? void 0 : i.url : "Server"}`
|
|
94
|
-
}, {
|
|
95
|
-
default: f(() => [
|
|
96
|
-
n(L, {
|
|
97
|
-
variableName: "Server",
|
|
98
|
-
warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
|
|
99
|
-
onClose: e[0] || (e[0] = (o) => t(u).hide()),
|
|
100
|
-
onDelete: g
|
|
101
|
-
})
|
|
102
|
-
]),
|
|
103
|
-
_: 1
|
|
104
|
-
}, 8, ["state", "title"])
|
|
105
|
-
], 512);
|
|
106
|
-
};
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["state", "title"])
|
|
96
|
+
], 512));
|
|
107
97
|
}
|
|
108
98
|
});
|
|
109
99
|
export {
|
|
110
|
-
|
|
100
|
+
le as default
|
|
111
101
|
};
|
|
@@ -1,126 +1,119 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import
|
|
5
|
-
import { useActiveEntities as
|
|
6
|
-
import { PathId as
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as _, createElementBlock as r, openBlock as d, Fragment as c, createElementVNode as e, createVNode as n, unref as l, createTextVNode as m, toDisplayString as k, withCtx as f } from "vue";
|
|
2
|
+
import { useModal as C, ScalarToggle as y, ScalarIcon as p, ScalarButton as M, ScalarModal as U } from "@scalar/components";
|
|
3
|
+
import { useRouter as D } from "vue-router";
|
|
4
|
+
import N from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
5
|
+
import { useActiveEntities as S } from "../../store/active-entities.js";
|
|
6
|
+
import { PathId as v } from "../../routes.js";
|
|
7
|
+
import { useWorkspace as W } from "../../store/store.js";
|
|
8
|
+
const T = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, V = { class: "flex flex-col gap-2" }, A = { class: "bg-b-2 rounded-lg border text-sm" }, B = { class: "bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3" }, E = { class: "text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap" }, I = { class: "flex items-center" }, $ = ["href"], L = { class: "flex flex-col gap-4" }, O = { class: "flex items-center justify-between rounded-lg border p-3 text-sm" }, H = /* @__PURE__ */ _({
|
|
9
9
|
__name: "CollectionSettings",
|
|
10
|
-
setup(
|
|
11
|
-
const { activeCollection: o, activeWorkspace:
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
o.value && (n = o.value) != null && n.documentUrl && m.edit(
|
|
10
|
+
setup(P) {
|
|
11
|
+
const { activeCollection: o, activeWorkspace: i, activeWorkspaceCollections: x } = S(), { collectionMutators: u } = W(), { replace: g } = D(), s = C();
|
|
12
|
+
function h() {
|
|
13
|
+
o.value && o.value?.documentUrl && u.edit(
|
|
15
14
|
o.value.uid,
|
|
16
15
|
"watchMode",
|
|
17
|
-
!
|
|
16
|
+
!o.value?.watchMode
|
|
18
17
|
);
|
|
19
18
|
}
|
|
20
|
-
function
|
|
21
|
-
if (!o.value || !
|
|
19
|
+
function b() {
|
|
20
|
+
if (!o.value || !i.value)
|
|
22
21
|
return;
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
22
|
+
u.delete(o.value, i.value);
|
|
23
|
+
const a = x.value[0];
|
|
24
|
+
a && g({
|
|
26
25
|
name: "collection",
|
|
27
26
|
params: {
|
|
28
|
-
[
|
|
29
|
-
[
|
|
27
|
+
[v.Workspace]: i.value.uid,
|
|
28
|
+
[v.Collection]: a.uid
|
|
30
29
|
}
|
|
31
|
-
}),
|
|
30
|
+
}), s.hide();
|
|
32
31
|
}
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
e
|
|
44
|
-
t("h4", null, "Watch Mode"),
|
|
45
|
-
t("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
|
|
46
|
-
], -1)),
|
|
47
|
-
s(l(W), {
|
|
48
|
-
class: "w-4",
|
|
49
|
-
disabled: !((f = l(o)) != null && f.documentUrl),
|
|
50
|
-
modelValue: ((p = l(o)) == null ? void 0 : p.watchMode) ?? !1,
|
|
51
|
-
"onUpdate:modelValue": M
|
|
52
|
-
}, null, 8, ["disabled", "modelValue"])
|
|
53
|
-
]),
|
|
54
|
-
t("div", R, [
|
|
55
|
-
t("div", j, [
|
|
56
|
-
(v = l(o)) != null && v.documentUrl ? (c(), d(u, { key: 0 }, [
|
|
57
|
-
e[3] || (e[3] = t("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
|
|
58
|
-
t("a", {
|
|
59
|
-
class: "text-c-2 group rounded pr-3 no-underline hover:underline",
|
|
60
|
-
href: l(o).documentUrl,
|
|
61
|
-
target: "_blank"
|
|
62
|
-
}, [
|
|
63
|
-
b(N(l(o).documentUrl) + " ", 1),
|
|
64
|
-
s(l(_), {
|
|
65
|
-
class: "ml-1 hidden w-2.5 group-hover:inline",
|
|
66
|
-
icon: "ExternalLink"
|
|
67
|
-
})
|
|
68
|
-
], 8, z)
|
|
69
|
-
], 64)) : (c(), d(u, { key: 1 }, [
|
|
70
|
-
s(l(_), {
|
|
71
|
-
class: "text-c-2 mr-2 ml-3 w-4",
|
|
72
|
-
icon: "NotAllowed",
|
|
73
|
-
size: "sm"
|
|
74
|
-
}),
|
|
75
|
-
e[4] || (e[4] = t("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
|
|
76
|
-
], 64))
|
|
77
|
-
])
|
|
78
|
-
])
|
|
79
|
-
])
|
|
80
|
-
]),
|
|
81
|
-
t("div", F, [
|
|
82
|
-
e[8] || (e[8] = t("h3", { class: "font-bold" }, "Danger Zone", -1)),
|
|
83
|
-
t("div", Z, [
|
|
84
|
-
e[7] || (e[7] = t("div", null, [
|
|
85
|
-
t("h4", null, "Delete Collection"),
|
|
86
|
-
t("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
|
|
32
|
+
return (a, t) => (d(), r(c, null, [
|
|
33
|
+
e("div", T, [
|
|
34
|
+
e("div", V, [
|
|
35
|
+
t[5] || (t[5] = e("div", { class: "flex h-8 items-center" }, [
|
|
36
|
+
e("h3", { class: "font-bold" }, "Features")
|
|
37
|
+
], -1)),
|
|
38
|
+
e("div", A, [
|
|
39
|
+
e("div", B, [
|
|
40
|
+
t[2] || (t[2] = e("div", null, [
|
|
41
|
+
e("h4", null, "Watch Mode"),
|
|
42
|
+
e("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
|
|
87
43
|
], -1)),
|
|
88
|
-
|
|
89
|
-
class: "
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
44
|
+
n(l(y), {
|
|
45
|
+
class: "w-4",
|
|
46
|
+
disabled: !l(o)?.documentUrl,
|
|
47
|
+
modelValue: l(o)?.watchMode ?? !1,
|
|
48
|
+
"onUpdate:modelValue": h
|
|
49
|
+
}, null, 8, ["disabled", "modelValue"])
|
|
50
|
+
]),
|
|
51
|
+
e("div", E, [
|
|
52
|
+
e("div", I, [
|
|
53
|
+
l(o)?.documentUrl ? (d(), r(c, { key: 0 }, [
|
|
54
|
+
t[3] || (t[3] = e("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
|
|
55
|
+
e("a", {
|
|
56
|
+
class: "text-c-2 group rounded pr-3 no-underline hover:underline",
|
|
57
|
+
href: l(o).documentUrl,
|
|
58
|
+
target: "_blank"
|
|
59
|
+
}, [
|
|
60
|
+
m(k(l(o).documentUrl) + " ", 1),
|
|
61
|
+
n(l(p), {
|
|
62
|
+
class: "ml-1 hidden w-2.5 group-hover:inline",
|
|
63
|
+
icon: "ExternalLink"
|
|
64
|
+
})
|
|
65
|
+
], 8, $)
|
|
66
|
+
], 64)) : (d(), r(c, { key: 1 }, [
|
|
67
|
+
n(l(p), {
|
|
68
|
+
class: "text-c-2 mr-2 ml-3 w-4",
|
|
69
|
+
icon: "NotAllowed",
|
|
70
|
+
size: "sm"
|
|
71
|
+
}),
|
|
72
|
+
t[4] || (t[4] = e("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
|
|
73
|
+
], 64))
|
|
74
|
+
])
|
|
99
75
|
])
|
|
100
76
|
])
|
|
101
77
|
]),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
78
|
+
e("div", L, [
|
|
79
|
+
t[8] || (t[8] = e("h3", { class: "font-bold" }, "Danger Zone", -1)),
|
|
80
|
+
e("div", O, [
|
|
81
|
+
t[7] || (t[7] = e("div", null, [
|
|
82
|
+
e("h4", null, "Delete Collection"),
|
|
83
|
+
e("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
|
|
84
|
+
], -1)),
|
|
85
|
+
n(l(M), {
|
|
86
|
+
class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
|
|
87
|
+
variant: "danger",
|
|
88
|
+
onClick: t[0] || (t[0] = (w) => l(s).show())
|
|
89
|
+
}, {
|
|
90
|
+
default: f(() => t[6] || (t[6] = [
|
|
91
|
+
m(" Delete Collection ")
|
|
92
|
+
])),
|
|
93
|
+
_: 1,
|
|
94
|
+
__: [6]
|
|
95
|
+
})
|
|
96
|
+
])
|
|
97
|
+
])
|
|
98
|
+
]),
|
|
99
|
+
n(l(U), {
|
|
100
|
+
size: "xxs",
|
|
101
|
+
state: l(s),
|
|
102
|
+
title: `Delete ${l(o)?.info?.title}`
|
|
103
|
+
}, {
|
|
104
|
+
default: f(() => [
|
|
105
|
+
n(N, {
|
|
106
|
+
variableName: l(o)?.info?.title ?? "",
|
|
107
|
+
warningMessage: "This action cannot be undone.",
|
|
108
|
+
onClose: t[1] || (t[1] = (w) => l(s).hide()),
|
|
109
|
+
onDelete: b
|
|
110
|
+
}, null, 8, ["variableName"])
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 8, ["state", "title"])
|
|
114
|
+
], 64));
|
|
122
115
|
}
|
|
123
116
|
});
|
|
124
117
|
export {
|
|
125
|
-
|
|
118
|
+
H as default
|
|
126
119
|
};
|