@scalar/api-client 2.2.21 → 2.2.23
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 +16 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +70 -71
- package/dist/components/AddressBar/AddressBarServer.vue.js +26 -26
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
- package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +42 -38
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
- package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +22 -19
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +57 -49
- package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
- package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +16 -16
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.js +3 -3
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +71 -64
- package/dist/layouts/App/ApiClientApp.vue.js +4 -1
- package/dist/layouts/App/create-api-client-app.d.ts +2 -1
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
- package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -2
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +2 -1
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +12 -11
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +54 -47
- package/dist/libs/extractAttachmentFilename.d.ts +3 -0
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
- package/dist/libs/extractAttachmentFilename.js +7 -7
- package/dist/libs/importers/curl.d.ts.map +1 -1
- package/dist/libs/importers/curl.js +18 -18
- package/dist/libs/normalize-headers.d.ts.map +1 -1
- package/dist/libs/normalize-headers.js +2 -2
- package/dist/libs/parse-curl.js +39 -36
- package/dist/store/active-entities.d.ts +4 -4
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +88 -86
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +29 -29
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +27 -23
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +94 -77
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +27 -27
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +18 -18
- package/dist/store/store.d.ts +5 -5
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +53 -48
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +35 -33
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +14 -9
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +39 -37
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +94 -89
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +118 -119
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
- package/dist/views/Request/RequestSidebar.vue.d.ts +3 -4
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +166 -164
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +0 -1
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +44 -49
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +37 -31
- package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +147 -130
- package/dist/views/Request/types/sidebar-item.d.ts +4 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +38 -35
- package/dist/views/Servers/Servers.vue2.js +38 -35
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/dist/views/Settings/Settings.vue2.js +15 -15
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
- package/package.json +6 -6
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var h = Object.defineProperty;
|
|
2
|
-
var u = (
|
|
3
|
-
var
|
|
2
|
+
var u = (n, t, e) => t in n ? h(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var l = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { getEnvColor as f } from "../../libs/env-helpers.js";
|
|
5
5
|
import { ScalarButton as b, ScalarIcon as v, ScalarTooltip as g } from "@scalar/components";
|
|
6
6
|
import { REGEX as w } from "@scalar/oas-utils/helpers";
|
|
7
7
|
import { ViewPlugin as y, RangeSetBuilder as x, Decoration as E, EditorView as N, WidgetType as k } from "@scalar/use-codemirror";
|
|
8
|
-
import { defineComponent as C, h as s, createApp as
|
|
9
|
-
import { parseEnvVariables as
|
|
8
|
+
import { defineComponent as C, h as s, createApp as V } from "vue";
|
|
9
|
+
import { parseEnvVariables as R } from "../../libs/environment-parser.js";
|
|
10
10
|
class d extends k {
|
|
11
|
-
constructor(e, o,
|
|
11
|
+
constructor(e, o, i, c, a) {
|
|
12
12
|
super();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.variableName = e, this.variableName = e, this.environment = o, this.envVariables =
|
|
13
|
+
l(this, "app");
|
|
14
|
+
l(this, "environment");
|
|
15
|
+
l(this, "envVariables");
|
|
16
|
+
l(this, "workspace");
|
|
17
|
+
l(this, "isReadOnly");
|
|
18
|
+
this.variableName = e, this.variableName = e, this.environment = o, this.envVariables = i, this.workspace = c, this.isReadOnly = a;
|
|
19
19
|
}
|
|
20
20
|
toDOM() {
|
|
21
21
|
const e = document.createElement("span");
|
|
@@ -23,11 +23,11 @@ class d extends k {
|
|
|
23
23
|
const o = C({
|
|
24
24
|
props: { variableName: { type: String, default: null } },
|
|
25
25
|
render: () => {
|
|
26
|
-
const
|
|
27
|
-
(
|
|
28
|
-
),
|
|
29
|
-
e.style.setProperty("--tw-bg-base",
|
|
30
|
-
const a =
|
|
26
|
+
const i = this.envVariables ? R(this.envVariables).find(
|
|
27
|
+
(r) => r.key === this.variableName
|
|
28
|
+
) : void 0, c = i && this.environment ? f(this.environment) : "#8E8E8E";
|
|
29
|
+
e.style.setProperty("--tw-bg-base", c || "#8E8E8E"), e.style.opacity = i != null && i.value ? "1" : "0.5";
|
|
30
|
+
const a = i != null && i.value ? s("div", { class: "p-2" }, i.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
|
|
31
31
|
s("span", { class: "p-2 opacity-25" }, "No value"),
|
|
32
32
|
!this.isReadOnly && s("div", { class: "p-1" }, [
|
|
33
33
|
s(
|
|
@@ -35,7 +35,11 @@ class d extends k {
|
|
|
35
35
|
{
|
|
36
36
|
class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
|
|
37
37
|
variant: "ghost",
|
|
38
|
-
|
|
38
|
+
// TODO: Use router instead
|
|
39
|
+
onClick: () => {
|
|
40
|
+
var r;
|
|
41
|
+
return window.location.href = `/workspace/${(r = this.workspace) == null ? void 0 : r.uid}/environment`;
|
|
42
|
+
}
|
|
39
43
|
},
|
|
40
44
|
{
|
|
41
45
|
default: () => [
|
|
@@ -66,7 +70,7 @@ class d extends k {
|
|
|
66
70
|
{
|
|
67
71
|
class: [
|
|
68
72
|
"border w-content rounded bg-b-1 brightness-lifted text-xxs leading-5 text-c-1",
|
|
69
|
-
|
|
73
|
+
i != null && i.value ? "border-solid" : "border-dashed"
|
|
70
74
|
]
|
|
71
75
|
},
|
|
72
76
|
a
|
|
@@ -75,7 +79,7 @@ class d extends k {
|
|
|
75
79
|
);
|
|
76
80
|
}
|
|
77
81
|
});
|
|
78
|
-
return this.app =
|
|
82
|
+
return this.app = V(o, { variableName: this.variableName }), this.app.mount(e), e;
|
|
79
83
|
}
|
|
80
84
|
destroy() {
|
|
81
85
|
this.app && this.app.unmount();
|
|
@@ -87,10 +91,10 @@ class d extends k {
|
|
|
87
91
|
return !1;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
|
-
const q = (
|
|
94
|
+
const q = (n) => y.fromClass(
|
|
91
95
|
class {
|
|
92
96
|
constructor(t) {
|
|
93
|
-
|
|
97
|
+
l(this, "decorations");
|
|
94
98
|
this.decorations = this.buildDecorations(t);
|
|
95
99
|
}
|
|
96
100
|
update(t) {
|
|
@@ -100,21 +104,21 @@ const q = (i) => y.fromClass(
|
|
|
100
104
|
}
|
|
101
105
|
buildDecorations(t) {
|
|
102
106
|
const e = new x();
|
|
103
|
-
for (const { from: o, to:
|
|
104
|
-
const
|
|
107
|
+
for (const { from: o, to: i } of t.visibleRanges) {
|
|
108
|
+
const c = t.state.doc.sliceString(o, i);
|
|
105
109
|
let a;
|
|
106
|
-
for (; (a = w.VARIABLES.exec(
|
|
107
|
-
const
|
|
110
|
+
for (; (a = w.VARIABLES.exec(c)) !== null; ) {
|
|
111
|
+
const r = o + a.index, p = r + a[0].length, m = a[1] ?? "";
|
|
108
112
|
e.add(
|
|
109
|
-
|
|
113
|
+
r,
|
|
110
114
|
p,
|
|
111
115
|
E.widget({
|
|
112
116
|
widget: new d(
|
|
113
117
|
m,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
n.environment,
|
|
119
|
+
n.envVariables,
|
|
120
|
+
n.workspace,
|
|
121
|
+
n.isReadOnly
|
|
118
122
|
),
|
|
119
123
|
side: 1
|
|
120
124
|
})
|
|
@@ -128,19 +132,19 @@ const q = (i) => y.fromClass(
|
|
|
128
132
|
decorations: (t) => t.decorations
|
|
129
133
|
}
|
|
130
134
|
), I = N.domEventHandlers({
|
|
131
|
-
keydown(
|
|
132
|
-
if (
|
|
133
|
-
const { state: e } = t, { from: o, to:
|
|
134
|
-
if (o === 0 &&
|
|
135
|
+
keydown(n, t) {
|
|
136
|
+
if (n.key === "Backspace") {
|
|
137
|
+
const { state: e } = t, { from: o, to: i } = e.selection.main;
|
|
138
|
+
if (o === 0 && i === e.doc.length)
|
|
135
139
|
return t.dispatch({
|
|
136
140
|
changes: { from: 0, to: e.doc.length },
|
|
137
141
|
selection: { anchor: 0 }
|
|
138
|
-
}),
|
|
139
|
-
if (o ===
|
|
142
|
+
}), n.preventDefault(), !0;
|
|
143
|
+
if (o === i && o > 0 && e.doc.sliceString(o - 2, o) === "}}")
|
|
140
144
|
return t.dispatch({
|
|
141
|
-
changes: { from: o - 2, to:
|
|
145
|
+
changes: { from: o - 2, to: i },
|
|
142
146
|
selection: { anchor: o - 2 }
|
|
143
|
-
}),
|
|
147
|
+
}), n.preventDefault(), !0;
|
|
144
148
|
}
|
|
145
149
|
return !1;
|
|
146
150
|
}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import { ScalarButton as
|
|
5
|
-
import { LibraryIcon as
|
|
6
|
-
import { useToasts as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useWorkspace as
|
|
10
|
-
const D = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as v, ref as s, openBlock as b, createBlock as _, withCtx as l, createVNode as n, unref as m, createTextVNode as C } from "vue";
|
|
2
|
+
import V from "../IconSelector.vue.js";
|
|
3
|
+
import { useActiveEntities as k } from "../../store/active-entities.js";
|
|
4
|
+
import { ScalarButton as x } from "@scalar/components";
|
|
5
|
+
import { LibraryIcon as N } from "@scalar/icons";
|
|
6
|
+
import { useToasts as B } from "@scalar/use-toasts";
|
|
7
|
+
import S from "./CommandActionForm.vue.js";
|
|
8
|
+
import $ from "./CommandActionInput.vue.js";
|
|
9
|
+
import { useWorkspace as I } from "../../store/store.js";
|
|
10
|
+
const D = /* @__PURE__ */ v({
|
|
11
11
|
__name: "CommandPaletteCollection",
|
|
12
12
|
emits: ["close", "back"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
13
|
+
setup(P, { emit: c }) {
|
|
14
|
+
const i = c, { activeWorkspace: u } = k(), { collectionMutators: d } = I(), o = s(""), a = s("interface-content-folder"), { toast: p } = B(), f = () => {
|
|
15
|
+
var r;
|
|
15
16
|
if (!o.value) {
|
|
16
|
-
|
|
17
|
+
p("Please enter a name before creating a collection.", "error");
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
d.add(
|
|
20
21
|
{
|
|
21
22
|
openapi: "3.1.0",
|
|
22
23
|
info: {
|
|
@@ -25,26 +26,26 @@ const D = /* @__PURE__ */ f({
|
|
|
25
26
|
},
|
|
26
27
|
"x-scalar-icon": a.value
|
|
27
28
|
},
|
|
28
|
-
|
|
29
|
-
),
|
|
29
|
+
((r = u.value) == null ? void 0 : r.uid) ?? ""
|
|
30
|
+
), i("close");
|
|
30
31
|
};
|
|
31
|
-
return (
|
|
32
|
+
return (r, e) => (b(), _(S, {
|
|
32
33
|
disabled: !o.value.trim(),
|
|
33
|
-
onSubmit:
|
|
34
|
+
onSubmit: f
|
|
34
35
|
}, {
|
|
35
36
|
options: l(() => [
|
|
36
|
-
n(
|
|
37
|
+
n(V, {
|
|
37
38
|
modelValue: a.value,
|
|
38
39
|
"onUpdate:modelValue": e[2] || (e[2] = (t) => a.value = t),
|
|
39
40
|
placement: "bottom-start"
|
|
40
41
|
}, {
|
|
41
42
|
default: l(() => [
|
|
42
|
-
n(
|
|
43
|
+
n(m(x), {
|
|
43
44
|
class: "aspect-square px-0 h-auto",
|
|
44
45
|
variant: "outlined"
|
|
45
46
|
}, {
|
|
46
47
|
default: l(() => [
|
|
47
|
-
n(
|
|
48
|
+
n(m(N), {
|
|
48
49
|
class: "size-4 text-c-2 stroke-[1.75]",
|
|
49
50
|
src: a.value
|
|
50
51
|
}, null, 8, ["src"])
|
|
@@ -56,15 +57,15 @@ const D = /* @__PURE__ */ f({
|
|
|
56
57
|
}, 8, ["modelValue"])
|
|
57
58
|
]),
|
|
58
59
|
submit: l(() => e[3] || (e[3] = [
|
|
59
|
-
|
|
60
|
+
C("Create Collection")
|
|
60
61
|
])),
|
|
61
62
|
default: l(() => [
|
|
62
|
-
n(
|
|
63
|
+
n($, {
|
|
63
64
|
modelValue: o.value,
|
|
64
65
|
"onUpdate:modelValue": e[0] || (e[0] = (t) => o.value = t),
|
|
65
66
|
label: "Collection Name",
|
|
66
67
|
placeholder: "Collection Name",
|
|
67
|
-
onOnDelete: e[1] || (e[1] = (t) =>
|
|
68
|
+
onOnDelete: e[1] || (e[1] = (t) => i("back", t))
|
|
68
69
|
}, null, 8, ["modelValue"])
|
|
69
70
|
]),
|
|
70
71
|
_: 1
|
|
@@ -10,6 +10,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
11
|
onClose?: (() => any) | undefined;
|
|
12
12
|
onBack?: ((e: KeyboardEvent) => any) | undefined;
|
|
13
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {},
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
export default _default;
|
|
15
15
|
//# sourceMappingURL=CommandPaletteExample.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":"AA4IA,KAAK,WAAW,GAAG;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/B,CAAC;;;;;;;;AAqRF,wBAOG"}
|
|
@@ -1,75 +1,84 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import { ScalarDropdown as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { defineComponent as $, ref as v, computed as R, openBlock as i, createBlock as x, withCtx as l, createVNode as r, unref as n, createElementVNode as b, createElementBlock as B, Fragment as q, renderList as P, createTextVNode as u, toDisplayString as k, createCommentVNode as W } from "vue";
|
|
2
|
+
import h from "../HttpMethod/HttpMethod.vue.js";
|
|
3
|
+
import { useActiveEntities as j } from "../../store/active-entities.js";
|
|
4
|
+
import { ScalarDropdown as z, ScalarDropdownItem as I, ScalarButton as M, ScalarIcon as T } from "@scalar/components";
|
|
5
|
+
import { isDefined as U } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import { useToasts as A } from "@scalar/use-toasts";
|
|
7
|
+
import { useRouter as F } from "vue-router";
|
|
8
|
+
import H from "./CommandActionForm.vue.js";
|
|
9
|
+
import L from "./CommandActionInput.vue.js";
|
|
10
|
+
import { useWorkspace as O } from "../../store/store.js";
|
|
11
|
+
const G = { class: "flex items-center gap-2" }, J = { class: "max-h-40 custom-scroll" }, me = /* @__PURE__ */ $({
|
|
11
12
|
__name: "CommandPaletteExample",
|
|
12
13
|
props: {
|
|
13
14
|
metaData: {}
|
|
14
15
|
},
|
|
15
16
|
emits: ["close", "back"],
|
|
16
|
-
setup(
|
|
17
|
-
var
|
|
18
|
-
const
|
|
17
|
+
setup(_, { emit: w }) {
|
|
18
|
+
var f;
|
|
19
|
+
const C = _, c = w, { push: D } = F(), { activeRequest: E, activeWorkspace: S, activeWorkspaceRequests: g } = j(), { requests: s, requestExampleMutators: y } = O(), { toast: p } = A(), m = v(""), a = v(
|
|
19
20
|
// Ensure we pre-select the correct request
|
|
20
|
-
|
|
21
|
-
),
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
s[((f = C.metaData) == null ? void 0 : f.itemUid) ?? ""] ?? E.value
|
|
22
|
+
), d = (o) => a.value = o, N = () => {
|
|
23
|
+
var e;
|
|
24
|
+
if (!m.value) {
|
|
25
|
+
p("Please enter a name before creating an example.", "error");
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
if (!a.value) {
|
|
29
|
+
p("Please select a request before creating an example.", "error");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const o = y.add(
|
|
33
|
+
a.value,
|
|
34
|
+
m.value
|
|
29
35
|
);
|
|
30
|
-
|
|
31
|
-
`/workspace/${S.value.uid}/request/${
|
|
36
|
+
o && (D(
|
|
37
|
+
`/workspace/${(e = S.value) == null ? void 0 : e.uid}/request/${a.value.uid}/examples/${o.uid}`
|
|
32
38
|
), c("close"));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
}, V = R(
|
|
40
|
+
() => g.value.map((o) => s == null ? void 0 : s[o]).filter(U)
|
|
41
|
+
);
|
|
42
|
+
return (o, e) => a.value ? (i(), x(H, {
|
|
43
|
+
key: 0,
|
|
44
|
+
disabled: !m.value.trim(),
|
|
45
|
+
onSubmit: N
|
|
37
46
|
}, {
|
|
38
|
-
options:
|
|
39
|
-
|
|
47
|
+
options: l(() => [
|
|
48
|
+
r(n(z), {
|
|
40
49
|
placement: "bottom",
|
|
41
50
|
resize: ""
|
|
42
51
|
}, {
|
|
43
|
-
items:
|
|
44
|
-
|
|
45
|
-
(
|
|
46
|
-
key:
|
|
52
|
+
items: l(() => [
|
|
53
|
+
b("div", J, [
|
|
54
|
+
(i(!0), B(q, null, P(V.value, (t) => (i(), x(n(I), {
|
|
55
|
+
key: t.uid,
|
|
47
56
|
class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
|
|
48
|
-
onClick: (
|
|
57
|
+
onClick: (K) => d(t)
|
|
49
58
|
}, {
|
|
50
|
-
default:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
method:
|
|
59
|
+
default: l(() => [
|
|
60
|
+
u(k(t.summary) + " ", 1),
|
|
61
|
+
r(h, {
|
|
62
|
+
method: t.method
|
|
54
63
|
}, null, 8, ["method"])
|
|
55
64
|
]),
|
|
56
65
|
_: 2
|
|
57
66
|
}, 1032, ["onClick"]))), 128))
|
|
58
67
|
])
|
|
59
68
|
]),
|
|
60
|
-
default:
|
|
61
|
-
|
|
69
|
+
default: l(() => [
|
|
70
|
+
r(n(M), {
|
|
62
71
|
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
63
72
|
variant: "outlined",
|
|
64
|
-
onClick:
|
|
73
|
+
onClick: e[2] || (e[2] = (t) => d(a.value))
|
|
65
74
|
}, {
|
|
66
|
-
default:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
method:
|
|
75
|
+
default: l(() => [
|
|
76
|
+
u(k(a.value.summary) + " ", 1),
|
|
77
|
+
b("div", G, [
|
|
78
|
+
r(h, {
|
|
79
|
+
method: a.value.method
|
|
71
80
|
}, null, 8, ["method"]),
|
|
72
|
-
|
|
81
|
+
r(n(T), {
|
|
73
82
|
class: "text-c-3",
|
|
74
83
|
icon: "ChevronDown",
|
|
75
84
|
size: "md"
|
|
@@ -82,22 +91,22 @@ const F = { class: "flex items-center gap-2" }, H = { class: "max-h-40 custom-sc
|
|
|
82
91
|
_: 1
|
|
83
92
|
})
|
|
84
93
|
]),
|
|
85
|
-
submit:
|
|
86
|
-
|
|
94
|
+
submit: l(() => e[3] || (e[3] = [
|
|
95
|
+
u("Create Example")
|
|
87
96
|
])),
|
|
88
|
-
default:
|
|
89
|
-
|
|
90
|
-
modelValue:
|
|
91
|
-
"onUpdate:modelValue":
|
|
97
|
+
default: l(() => [
|
|
98
|
+
r(L, {
|
|
99
|
+
modelValue: m.value,
|
|
100
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => m.value = t),
|
|
92
101
|
label: "Example Name",
|
|
93
102
|
placeholder: "Example Name",
|
|
94
|
-
onOnDelete:
|
|
103
|
+
onOnDelete: e[1] || (e[1] = (t) => c("back", t))
|
|
95
104
|
}, null, 8, ["modelValue"])
|
|
96
105
|
]),
|
|
97
106
|
_: 1
|
|
98
|
-
}, 8, ["disabled"]));
|
|
107
|
+
}, 8, ["disabled"])) : W("", !0);
|
|
99
108
|
}
|
|
100
109
|
});
|
|
101
110
|
export {
|
|
102
|
-
|
|
111
|
+
me as default
|
|
103
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AAiqBA,wBAOG"}
|