@scalar/api-client 2.26.2 → 2.29.1
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 +218 -0
- package/dist/components/Server/ServerSelector.vue.js +6 -6
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/libs/local-storage.js +3 -3
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +26 -26
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +88 -103
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +20 -19
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +7 -7
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +52 -54
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +106 -86
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -93
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +4 -3
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +32 -40
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +25 -24
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
- package/dist/v2/features/app/App.vue.d.ts +5 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +80 -78
- package/dist/v2/features/app/app-events.d.ts +2 -1
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +89 -64
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +172 -151
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue2.js +99 -97
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +4 -4
- package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue.js +1 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue2.js +9 -9
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +71 -43
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +11 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +12 -10
- package/dist/v2/features/app/helpers/routes.d.ts +2 -0
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +11 -11
- package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
- package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-theme.js +34 -0
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -6
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +41 -22
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
- package/dist/v2/features/collection/components/Authentication.vue2.js +49 -40
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +27 -15
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts +3 -0
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
- package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -16
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +2 -2
- package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +93 -88
- package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.js +19 -17
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +7 -2
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +70 -71
- package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.d.ts → CommandPaletteOpenApiDocument.vue.d.ts} +3 -3
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.js → CommandPaletteOpenApiDocument.vue.js} +15 -15
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +2 -2
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +10 -10
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +27 -5
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +80 -53
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +34 -9
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +50 -44
- package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
- package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +15 -15
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +30 -33
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
- package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
- package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
- package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/components/Section.vue.js +26 -15
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
- package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +2 -2
- package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
- package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.js +8 -6
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +132 -115
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +17 -16
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +0 -4
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as M, ref as
|
|
1
|
+
import { defineComponent as M, ref as T, computed as x, createElementBlock as v, openBlock as n, Fragment as g, createVNode as a, withCtx as i, createElementVNode as c, renderList as A, createBlock as y, unref as s, toDisplayString as I, createCommentVNode as V, createTextVNode as p } from "vue";
|
|
2
2
|
import { useModal as P, ScalarMarkdown as z, ScalarButton as k, ScalarModal as L } from "@scalar/components";
|
|
3
3
|
import { debounce as O } from "@scalar/helpers/general/debounce";
|
|
4
4
|
import { ScalarIconTrash as R, ScalarIconPlus as j } from "@scalar/icons";
|
|
5
5
|
import E from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
6
|
-
import F from "
|
|
7
|
-
import W from "
|
|
8
|
-
|
|
6
|
+
import F from "../../settings/components/Section.vue.js";
|
|
7
|
+
import W from "./Form.vue.js";
|
|
8
|
+
import Y from "../../../../components/Server/ServerVariablesForm.vue.js";
|
|
9
|
+
const q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm" }, H = {
|
|
9
10
|
key: 1,
|
|
10
11
|
class: "self-center"
|
|
11
|
-
}, J = { class: "divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm" }, K = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" },
|
|
12
|
+
}, J = { class: "divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm" }, K = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, oe = /* @__PURE__ */ M({
|
|
12
13
|
__name: "Servers",
|
|
13
14
|
props: {
|
|
14
15
|
documentSlug: {},
|
|
@@ -23,12 +24,13 @@ const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }
|
|
|
23
24
|
workspaceStore: {},
|
|
24
25
|
activeWorkspace: {},
|
|
25
26
|
plugins: {},
|
|
27
|
+
customThemes: {},
|
|
26
28
|
collectionType: {}
|
|
27
29
|
},
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
30
|
-
() =>
|
|
31
|
-
), $ = x(() =>
|
|
30
|
+
setup(o) {
|
|
31
|
+
const m = P(), l = T(-1), _ = x(
|
|
32
|
+
() => o.document?.servers?.[l.value]
|
|
33
|
+
), $ = x(() => o.document?.servers ?? []), B = [
|
|
32
34
|
{
|
|
33
35
|
label: "URL",
|
|
34
36
|
key: "url",
|
|
@@ -40,98 +42,101 @@ const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }
|
|
|
40
42
|
placeholder: "Production"
|
|
41
43
|
}
|
|
42
44
|
], w = (t) => {
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
45
|
+
l.value = t, m.show();
|
|
46
|
+
}, b = () => {
|
|
47
|
+
m.hide(), l.value = -1;
|
|
46
48
|
}, N = () => {
|
|
47
|
-
|
|
48
|
-
}, { execute: h } = O({ delay: 328, maxWait: 1e3 }), U = (t, e,
|
|
49
|
+
l.value < 0 || (o.eventBus.emit("server:delete:server", { index: l.value }), b());
|
|
50
|
+
}, { execute: h } = O({ delay: 328, maxWait: 1e3 }), U = (t, e, r) => h(
|
|
49
51
|
`${t}-${e}`,
|
|
50
|
-
() =>
|
|
52
|
+
() => o.eventBus.emit("server:update:server", {
|
|
51
53
|
index: t,
|
|
52
|
-
server: { [e]:
|
|
54
|
+
server: { [e]: r }
|
|
53
55
|
})
|
|
54
|
-
), C = (t, e,
|
|
56
|
+
), C = (t, e, r) => h(
|
|
55
57
|
`${t}-${e}`,
|
|
56
|
-
() =>
|
|
58
|
+
() => o.eventBus.emit("server:update:variables", {
|
|
57
59
|
index: t,
|
|
58
60
|
key: e,
|
|
59
|
-
value:
|
|
61
|
+
value: r
|
|
60
62
|
})
|
|
61
|
-
), D = () =>
|
|
62
|
-
return (t, e) => (
|
|
63
|
-
|
|
64
|
-
e[
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
), D = () => o.eventBus.emit("server:add:server"), S = (t, e = 0) => t?.description || `Server ${e + 1}`;
|
|
64
|
+
return (t, e) => (n(), v(g, null, [
|
|
65
|
+
a(F, null, {
|
|
66
|
+
title: i(() => [...e[0] || (e[0] = [
|
|
67
|
+
p("Servers", -1)
|
|
68
|
+
])]),
|
|
69
|
+
description: i(() => [...e[1] || (e[1] = [
|
|
70
|
+
p(" Add different base URLs for your API. You can use ", -1),
|
|
71
|
+
c("code", { class: "font-code text-c-2" }, "{variables}", -1),
|
|
72
|
+
p(" for dynamic parts. ", -1)
|
|
73
|
+
])]),
|
|
74
|
+
default: i(() => [
|
|
75
|
+
c("div", q, [
|
|
76
|
+
(n(!0), v(g, null, A($.value, (r, d) => (n(), v("div", {
|
|
77
|
+
key: d,
|
|
78
|
+
class: "rounded-lg border"
|
|
79
|
+
}, [
|
|
80
|
+
c("div", G, [
|
|
81
|
+
r.description ? (n(), y(s(z), {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: "self-center",
|
|
84
|
+
value: r.description
|
|
85
|
+
}, null, 8, ["value"])) : (n(), v("span", H, I(S(r, d)), 1)),
|
|
86
|
+
a(s(k), {
|
|
87
|
+
class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
|
|
88
|
+
"data-testid": "delete-server-button",
|
|
89
|
+
variant: "ghost",
|
|
90
|
+
onClick: (u) => w(d)
|
|
91
|
+
}, {
|
|
92
|
+
default: i(() => [
|
|
93
|
+
a(s(R), { class: "size-3.5" })
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 8, ["onClick"])
|
|
97
|
+
]),
|
|
98
|
+
c("div", J, [
|
|
99
|
+
a(W, {
|
|
100
|
+
data: r,
|
|
101
|
+
environment: o.environment,
|
|
102
|
+
onUpdate: (u, f) => U(d, u, f),
|
|
103
|
+
options: B
|
|
104
|
+
}, null, 8, ["data", "environment", "onUpdate"]),
|
|
105
|
+
r.variables ? (n(), y(s(Y), {
|
|
106
|
+
key: 0,
|
|
107
|
+
variables: r.variables,
|
|
108
|
+
"onUpdate:variable": (u, f) => C(d, u, f)
|
|
109
|
+
}, null, 8, ["variables", "onUpdate:variable"])) : V("", !0)
|
|
110
|
+
])
|
|
111
|
+
]))), 128))
|
|
112
|
+
]),
|
|
113
|
+
c("div", K, [
|
|
114
|
+
a(s(k), {
|
|
115
|
+
class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
|
|
116
|
+
size: "sm",
|
|
117
|
+
variant: "ghost",
|
|
118
|
+
onClick: D
|
|
119
|
+
}, {
|
|
120
|
+
default: i(() => [
|
|
121
|
+
a(s(j)),
|
|
122
|
+
e[2] || (e[2] = c("span", null, "Add Server", -1))
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
})
|
|
70
126
|
])
|
|
71
|
-
], -1)),
|
|
72
|
-
s("div", q, [
|
|
73
|
-
(c(!0), u(S, null, I($.value, (a, d) => (c(), u("div", {
|
|
74
|
-
key: d,
|
|
75
|
-
class: "rounded-lg border"
|
|
76
|
-
}, [
|
|
77
|
-
s("div", G, [
|
|
78
|
-
a.description ? (c(), y(r(z), {
|
|
79
|
-
key: 0,
|
|
80
|
-
class: "self-center",
|
|
81
|
-
value: a.description
|
|
82
|
-
}, null, 8, ["value"])) : (c(), u("span", H, T(b(a, d)), 1)),
|
|
83
|
-
o(r(k), {
|
|
84
|
-
class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
|
|
85
|
-
"data-testid": "delete-server-button",
|
|
86
|
-
variant: "ghost",
|
|
87
|
-
onClick: (i) => w(d)
|
|
88
|
-
}, {
|
|
89
|
-
default: f(() => [
|
|
90
|
-
o(r(R), { class: "size-3.5" })
|
|
91
|
-
]),
|
|
92
|
-
_: 1
|
|
93
|
-
}, 8, ["onClick"])
|
|
94
|
-
]),
|
|
95
|
-
s("div", J, [
|
|
96
|
-
o(F, {
|
|
97
|
-
data: a,
|
|
98
|
-
environment: l.environment,
|
|
99
|
-
onUpdate: (i, m) => U(d, i, m),
|
|
100
|
-
options: B
|
|
101
|
-
}, null, 8, ["data", "environment", "onUpdate"]),
|
|
102
|
-
a.variables ? (c(), y(r(W), {
|
|
103
|
-
key: 0,
|
|
104
|
-
variables: a.variables,
|
|
105
|
-
"onUpdate:variable": (i, m) => C(d, i, m)
|
|
106
|
-
}, null, 8, ["variables", "onUpdate:variable"])) : V("", !0)
|
|
107
|
-
])
|
|
108
|
-
]))), 128))
|
|
109
127
|
]),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
size: "sm",
|
|
114
|
-
variant: "ghost",
|
|
115
|
-
onClick: D
|
|
116
|
-
}, {
|
|
117
|
-
default: f(() => [
|
|
118
|
-
o(r(j)),
|
|
119
|
-
e[0] || (e[0] = s("span", null, "Add Server", -1))
|
|
120
|
-
]),
|
|
121
|
-
_: 1
|
|
122
|
-
})
|
|
123
|
-
])
|
|
124
|
-
]),
|
|
125
|
-
o(r(L), {
|
|
128
|
+
_: 1
|
|
129
|
+
}),
|
|
130
|
+
a(s(L), {
|
|
126
131
|
size: "xxs",
|
|
127
|
-
state:
|
|
128
|
-
title: `Delete ${
|
|
132
|
+
state: s(m),
|
|
133
|
+
title: `Delete ${S(_.value, l.value)}`
|
|
129
134
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
|
|
135
|
+
default: i(() => [
|
|
136
|
+
a(E, {
|
|
132
137
|
variableName: "Server",
|
|
133
138
|
warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
|
|
134
|
-
onClose:
|
|
139
|
+
onClose: b,
|
|
135
140
|
onDelete: N
|
|
136
141
|
})
|
|
137
142
|
]),
|
|
@@ -141,5 +146,5 @@ const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }
|
|
|
141
146
|
}
|
|
142
147
|
});
|
|
143
148
|
export {
|
|
144
|
-
|
|
149
|
+
oe as default
|
|
145
150
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"AA0LA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as r, createBlock as c, openBlock as a, unref as n } from "vue";
|
|
2
|
+
import s from "../../settings/DocumentSettings.vue.js";
|
|
3
|
+
import i from "../../settings/CollectionSettings.vue.js";
|
|
4
|
+
const x = /* @__PURE__ */ r({
|
|
5
5
|
__name: "Settings",
|
|
6
6
|
props: {
|
|
7
7
|
documentSlug: {},
|
|
@@ -16,37 +16,39 @@ const f = /* @__PURE__ */ u({
|
|
|
16
16
|
workspaceStore: {},
|
|
17
17
|
activeWorkspace: {},
|
|
18
18
|
plugins: {},
|
|
19
|
+
customThemes: {},
|
|
19
20
|
collectionType: {}
|
|
20
21
|
},
|
|
21
22
|
setup(e) {
|
|
22
|
-
const
|
|
23
|
+
const m = (t) => {
|
|
23
24
|
e.eventBus.emit("document:update:watch-mode", t);
|
|
24
|
-
},
|
|
25
|
+
}, u = (t) => {
|
|
25
26
|
e.eventBus.emit("workspace:update:theme", t);
|
|
26
|
-
}, r = (t) => {
|
|
27
|
-
e.eventBus.emit("workspace:update:active-proxy", t);
|
|
28
27
|
}, l = (t) => {
|
|
28
|
+
e.eventBus.emit("workspace:update:active-proxy", t);
|
|
29
|
+
}, d = (t) => {
|
|
29
30
|
e.eventBus.emit("workspace:update:color-mode", t);
|
|
30
31
|
};
|
|
31
|
-
return (t, o) => e.collectionType === "document" ? (a(), c(n(
|
|
32
|
+
return (t, o) => e.collectionType === "document" ? (a(), c(n(s), {
|
|
32
33
|
key: 0,
|
|
33
34
|
documentUrl: e.document?.["x-scalar-original-source-url"],
|
|
34
35
|
isDraftDocument: e.documentSlug === "drafts",
|
|
35
36
|
title: e.document?.info.title ?? "",
|
|
36
37
|
watchMode: e.document?.["x-scalar-watch-mode"],
|
|
37
38
|
"onDelete:document": o[0] || (o[0] = (h) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
|
|
38
|
-
"onUpdate:watchMode":
|
|
39
|
-
}, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), c(n(
|
|
39
|
+
"onUpdate:watchMode": m
|
|
40
|
+
}, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), c(n(i), {
|
|
40
41
|
key: 1,
|
|
41
42
|
activeProxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"],
|
|
42
|
-
|
|
43
|
+
activeThemeSlug: e.workspaceStore.workspace["x-scalar-theme"] ?? "none",
|
|
43
44
|
colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
|
|
44
|
-
|
|
45
|
-
"onUpdate:
|
|
46
|
-
"onUpdate:
|
|
47
|
-
|
|
45
|
+
customThemes: e.customThemes,
|
|
46
|
+
"onUpdate:colorMode": d,
|
|
47
|
+
"onUpdate:proxyUrl": l,
|
|
48
|
+
"onUpdate:themeSlug": u
|
|
49
|
+
}, null, 8, ["activeProxyUrl", "activeThemeSlug", "colorMode", "customThemes"]));
|
|
48
50
|
}
|
|
49
51
|
});
|
|
50
52
|
export {
|
|
51
|
-
|
|
53
|
+
x as default
|
|
52
54
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
3
|
/**
|
|
3
4
|
* Command Palette Example Component
|
|
4
5
|
*
|
|
@@ -18,8 +19,10 @@ export default _default;
|
|
|
18
19
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
19
20
|
/** The workspace store for accessing documents and operations */
|
|
20
21
|
workspaceStore: WorkspaceStore;
|
|
22
|
+
/** Event bus for emitting operation creation events */
|
|
23
|
+
eventBus: WorkspaceEventBus;
|
|
21
24
|
/** Document id to create the example for */
|
|
22
|
-
|
|
25
|
+
documentName?: string;
|
|
23
26
|
/** Preselected path and method to create the example for */
|
|
24
27
|
operationId?: string;
|
|
25
28
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
@@ -28,8 +31,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
28
31
|
}, string, import("vue").PublicProps, Readonly<{
|
|
29
32
|
/** The workspace store for accessing documents and operations */
|
|
30
33
|
workspaceStore: WorkspaceStore;
|
|
34
|
+
/** Event bus for emitting operation creation events */
|
|
35
|
+
eventBus: WorkspaceEventBus;
|
|
31
36
|
/** Document id to create the example for */
|
|
32
|
-
|
|
37
|
+
documentName?: string;
|
|
33
38
|
/** Preselected path and method to create the example for */
|
|
34
39
|
operationId?: string;
|
|
35
40
|
}> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAoSA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAavE;;;;;;;;;;;;;GAaG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;;IAPpB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;kFAyclB,CAAC"}
|
|
@@ -1,103 +1,102 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as T, ScalarButton as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import q from "./
|
|
6
|
-
|
|
7
|
-
const H = { class: "flex flex-1 gap-1" }, J = {
|
|
1
|
+
import { defineComponent as I, ref as h, computed as p, watch as $, createBlock as x, openBlock as u, withCtx as s, createVNode as i, createTextVNode as O, createElementVNode as r, unref as c, normalizeClass as j, toDisplayString as b, createElementBlock as w, createCommentVNode as z, Fragment as U, renderList as L } from "vue";
|
|
2
|
+
import { ScalarListbox as T, ScalarButton as C, ScalarIcon as y, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
|
|
3
|
+
import D from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
|
|
4
|
+
import P from "./CommandActionForm.vue.js";
|
|
5
|
+
import q from "./CommandActionInput.vue.js";
|
|
6
|
+
const G = { class: "flex flex-1 gap-1" }, H = {
|
|
8
7
|
key: 0,
|
|
9
8
|
class: "text-c-1 truncate"
|
|
10
|
-
},
|
|
9
|
+
}, J = {
|
|
11
10
|
key: 1,
|
|
12
11
|
class: "text-c-3"
|
|
13
|
-
},
|
|
12
|
+
}, K = { class: "flex items-center gap-2" }, M = { class: "custom-scroll max-h-40" }, Q = { class: "truncate" }, R = {
|
|
14
13
|
name: "CommandPaletteExample"
|
|
15
|
-
},
|
|
16
|
-
...
|
|
14
|
+
}, te = /* @__PURE__ */ I({
|
|
15
|
+
...R,
|
|
17
16
|
props: {
|
|
18
17
|
workspaceStore: {},
|
|
19
|
-
|
|
18
|
+
eventBus: {},
|
|
19
|
+
documentName: {},
|
|
20
20
|
operationId: {}
|
|
21
21
|
},
|
|
22
22
|
emits: ["close", "back"],
|
|
23
|
-
setup(
|
|
24
|
-
const k =
|
|
25
|
-
() => Object.entries(
|
|
23
|
+
setup(n, { emit: V }) {
|
|
24
|
+
const k = V, v = h(""), g = p(() => v.value.trim()), f = p(
|
|
25
|
+
() => Object.entries(n.workspaceStore.workspace.documents).map(
|
|
26
26
|
([e, a]) => ({
|
|
27
27
|
id: e,
|
|
28
28
|
label: a.info.title || e
|
|
29
29
|
})
|
|
30
30
|
)
|
|
31
31
|
), l = h(
|
|
32
|
-
|
|
33
|
-
),
|
|
32
|
+
n.documentName ? f.value.find((e) => e.id === n.documentName) : f.value[0] ?? void 0
|
|
33
|
+
), N = (e) => {
|
|
34
34
|
const a = [];
|
|
35
35
|
for (const t of e)
|
|
36
|
-
t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...
|
|
36
|
+
t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...N(t.children));
|
|
37
37
|
return a;
|
|
38
|
-
},
|
|
38
|
+
}, m = p(() => {
|
|
39
39
|
if (!l.value)
|
|
40
40
|
return [];
|
|
41
|
-
const e =
|
|
41
|
+
const e = n.workspaceStore.workspace.documents[l.value.id];
|
|
42
42
|
if (!e || !e["x-scalar-navigation"])
|
|
43
43
|
return [];
|
|
44
44
|
const a = e["x-scalar-navigation"];
|
|
45
|
-
return
|
|
45
|
+
return N(a.children ?? []).map((d) => ({
|
|
46
46
|
id: d.id,
|
|
47
47
|
label: `${d.method.toUpperCase()} ${d.path}`,
|
|
48
48
|
path: d.path,
|
|
49
49
|
method: d.method
|
|
50
50
|
}));
|
|
51
51
|
}), o = h(
|
|
52
|
-
|
|
53
|
-
(e) => e.id ===
|
|
52
|
+
n.operationId ? m.value.find(
|
|
53
|
+
(e) => e.id === n.operationId
|
|
54
54
|
) : void 0
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
$(
|
|
57
57
|
l,
|
|
58
58
|
() => {
|
|
59
|
-
o.value =
|
|
60
|
-
(e) => e.id ===
|
|
61
|
-
) :
|
|
59
|
+
o.value = n.operationId ? m.value.find(
|
|
60
|
+
(e) => e.id === n.operationId
|
|
61
|
+
) : m.value[0] ?? void 0;
|
|
62
62
|
},
|
|
63
63
|
{ immediate: !0 }
|
|
64
64
|
);
|
|
65
|
-
const
|
|
65
|
+
const _ = (e) => {
|
|
66
66
|
e && (o.value = e);
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
67
|
+
}, S = p(() => !g.value || !l.value || !o.value), B = () => {
|
|
68
|
+
S.value || !l.value || !o.value || (n.eventBus.emit("operation:create:draft-example", {
|
|
69
|
+
documentName: l.value.id,
|
|
70
|
+
meta: {
|
|
71
|
+
path: o.value.path,
|
|
72
|
+
method: o.value.method
|
|
73
|
+
},
|
|
74
|
+
exampleName: g.value
|
|
76
75
|
}), k("close"));
|
|
77
|
-
},
|
|
76
|
+
}, E = (e) => {
|
|
78
77
|
k("back", e);
|
|
79
78
|
};
|
|
80
|
-
return (e, a) => (u(), x(
|
|
81
|
-
disabled:
|
|
82
|
-
onSubmit:
|
|
79
|
+
return (e, a) => (u(), x(P, {
|
|
80
|
+
disabled: S.value,
|
|
81
|
+
onSubmit: B
|
|
83
82
|
}, {
|
|
84
|
-
options:
|
|
85
|
-
|
|
83
|
+
options: s(() => [
|
|
84
|
+
r("div", G, [
|
|
86
85
|
i(c(T), {
|
|
87
86
|
modelValue: l.value,
|
|
88
87
|
"onUpdate:modelValue": a[1] || (a[1] = (t) => l.value = t),
|
|
89
88
|
options: f.value
|
|
90
89
|
}, {
|
|
91
|
-
default:
|
|
92
|
-
i(c(
|
|
90
|
+
default: s(() => [
|
|
91
|
+
i(c(C), {
|
|
93
92
|
class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
|
|
94
93
|
variant: "outlined"
|
|
95
94
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
|
|
98
|
-
class:
|
|
95
|
+
default: s(() => [
|
|
96
|
+
r("span", {
|
|
97
|
+
class: j(l.value ? "text-c-1 truncate" : "text-c-3")
|
|
99
98
|
}, b(l.value ? l.value.label : "Select Document"), 3),
|
|
100
|
-
i(c(
|
|
99
|
+
i(c(y), {
|
|
101
100
|
class: "text-c-3",
|
|
102
101
|
icon: "ChevronDown",
|
|
103
102
|
size: "md"
|
|
@@ -112,16 +111,16 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
112
111
|
placement: "bottom",
|
|
113
112
|
resize: ""
|
|
114
113
|
}, {
|
|
115
|
-
items:
|
|
116
|
-
|
|
117
|
-
(u(!0), w(
|
|
114
|
+
items: s(() => [
|
|
115
|
+
r("div", M, [
|
|
116
|
+
(u(!0), w(U, null, L(m.value, (t) => (u(), x(c(F), {
|
|
118
117
|
key: t.id,
|
|
119
118
|
class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
|
|
120
|
-
onClick: (d) =>
|
|
119
|
+
onClick: (d) => _(t)
|
|
121
120
|
}, {
|
|
122
|
-
default:
|
|
123
|
-
|
|
124
|
-
i(
|
|
121
|
+
default: s(() => [
|
|
122
|
+
r("span", Q, b(t.path), 1),
|
|
123
|
+
i(D, {
|
|
125
124
|
method: t.method
|
|
126
125
|
}, null, 8, ["method"])
|
|
127
126
|
]),
|
|
@@ -129,20 +128,20 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
129
128
|
}, 1032, ["onClick"]))), 128))
|
|
130
129
|
])
|
|
131
130
|
]),
|
|
132
|
-
default:
|
|
133
|
-
i(c(
|
|
131
|
+
default: s(() => [
|
|
132
|
+
i(c(C), {
|
|
134
133
|
class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
|
|
135
|
-
disabled: !
|
|
134
|
+
disabled: !m.value.length,
|
|
136
135
|
variant: "outlined"
|
|
137
136
|
}, {
|
|
138
|
-
default:
|
|
139
|
-
o.value ? (u(), w("span",
|
|
140
|
-
|
|
141
|
-
o.value ? (u(), x(
|
|
137
|
+
default: s(() => [
|
|
138
|
+
o.value ? (u(), w("span", H, b(o.value.path), 1)) : (u(), w("span", J, " Select Operation ")),
|
|
139
|
+
r("div", K, [
|
|
140
|
+
o.value ? (u(), x(D, {
|
|
142
141
|
key: 0,
|
|
143
142
|
method: o.value.method
|
|
144
|
-
}, null, 8, ["method"])) :
|
|
145
|
-
i(c(
|
|
143
|
+
}, null, 8, ["method"])) : z("", !0),
|
|
144
|
+
i(c(y), {
|
|
146
145
|
class: "text-c-3",
|
|
147
146
|
icon: "ChevronDown",
|
|
148
147
|
size: "md"
|
|
@@ -156,16 +155,16 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
156
155
|
})
|
|
157
156
|
])
|
|
158
157
|
]),
|
|
159
|
-
submit:
|
|
160
|
-
|
|
158
|
+
submit: s(() => [...a[2] || (a[2] = [
|
|
159
|
+
O("Create Example", -1)
|
|
161
160
|
])]),
|
|
162
|
-
default:
|
|
163
|
-
i(
|
|
161
|
+
default: s(() => [
|
|
162
|
+
i(q, {
|
|
164
163
|
modelValue: v.value,
|
|
165
164
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
|
|
166
165
|
label: "Example Name",
|
|
167
166
|
placeholder: "Example Name",
|
|
168
|
-
onDelete:
|
|
167
|
+
onDelete: E
|
|
169
168
|
}, null, 8, ["modelValue"])
|
|
170
169
|
]),
|
|
171
170
|
_: 1
|
|
@@ -173,5 +172,5 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
173
172
|
}
|
|
174
173
|
});
|
|
175
174
|
export {
|
|
176
|
-
|
|
175
|
+
te as default
|
|
177
176
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
2
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
3
|
/**
|
|
4
|
-
* Command Palette Document Component
|
|
4
|
+
* Command Palette OpenAPI Document Component
|
|
5
5
|
*
|
|
6
6
|
* Provides a form for creating a new empty document in the workspace.
|
|
7
7
|
* Users can name the document and select an icon before creation.
|
|
8
8
|
* Validates that the name is not empty and not already in use.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
11
|
+
* <CommandPaletteOpenApiDocument
|
|
12
12
|
* :workspaceStore="workspaceStore"
|
|
13
13
|
* :eventBus="eventBus"
|
|
14
14
|
* @close="handleClose"
|
|
@@ -34,4 +34,4 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
34
34
|
onClose?: (() => any) | undefined;
|
|
35
35
|
onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
|
|
36
36
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
-
//# sourceMappingURL=
|
|
37
|
+
//# sourceMappingURL=CommandPaletteOpenApiDocument.vue.d.ts.map
|
package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandPaletteOpenApiDocument.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue"],"names":[],"mappings":"AAwIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE;;;;;;;;;;;;;;GAcG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEhB,2DAA2D;oBAC3C,cAAc;IAC9B,sDAAsD;cAC5C,iBAAiB;;;;;IAH3B,2DAA2D;oBAC3C,cAAc;IAC9B,sDAAsD;cAC5C,iBAAiB;;;;kFAwMzB,CAAC"}
|