@scalar/api-client 2.2.6 → 2.2.8
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 +25 -0
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +18 -18
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +108 -106
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +20 -20
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +12 -12
- package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue2.js +12 -12
- package/dist/components/HttpMethod/index.d.ts +0 -1
- package/dist/components/HttpMethod/index.d.ts.map +1 -1
- package/dist/components/HttpMethod/index.js +2 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +119 -102
- package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/OpenApiClientButton.vue2.js +23 -17
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +45 -41
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
- package/dist/libs/create-client.d.ts +1 -0
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +31 -30
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +28 -24
- package/dist/libs/postman.d.ts +11 -0
- package/dist/libs/postman.d.ts.map +1 -0
- package/dist/libs/postman.js +39 -0
- package/dist/style.css +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +65 -62
- 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 +82 -84
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +27 -24
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +4 -4
- package/dist/views/Request/RequestSidebar.vue2.js +32 -30
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -32
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +77 -78
- package/package.json +10 -9
- package/dist/components/HttpMethod/helpers.d.ts +0 -4
- package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
- package/dist/components/HttpMethod/helpers.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f2ec59d: feat: add postman import
|
|
8
|
+
|
|
9
|
+
## 2.2.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- a90d827: feat(components): create ScalarTeleport component
|
|
14
|
+
- d0adebf: fix: updates tailwind config content
|
|
15
|
+
- c2be791: fix: watches text input to fuse search
|
|
16
|
+
- 3b4a788: fix: updates default row for request body
|
|
17
|
+
- f4440f5: feat: added logo functionality to the importer
|
|
18
|
+
- 4c5be96: feat: adds isHttpMethod to helpers
|
|
19
|
+
- Updated dependencies [a90d827]
|
|
20
|
+
- Updated dependencies [3b4a788]
|
|
21
|
+
- Updated dependencies [4c5be96]
|
|
22
|
+
- Updated dependencies [4c5be96]
|
|
23
|
+
- @scalar/components@0.13.2
|
|
24
|
+
- @scalar/oas-utils@0.2.85
|
|
25
|
+
- @scalar/use-codemirror@0.11.46
|
|
26
|
+
- @scalar/import@0.2.3
|
|
27
|
+
|
|
3
28
|
## 2.2.6
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AddressBar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-455b0236"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as V, computed as
|
|
1
|
+
import { defineComponent as V, computed as c, watch as E, openBlock as l, createBlock as S, unref as o, withCtx as w, createElementBlock as n, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as a, createTextVNode as O, toDisplayString as b } from "vue";
|
|
2
2
|
import { useActiveEntities as R } from "../../store/active-entities.js";
|
|
3
3
|
import { ScalarDropdown as W, ScalarDropdownDivider as A, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
|
|
4
4
|
import C from "./AddressBarServerItem.vue.js";
|
|
@@ -15,7 +15,7 @@ const j = {
|
|
|
15
15
|
}, K = /* @__PURE__ */ V({
|
|
16
16
|
__name: "AddressBarServer",
|
|
17
17
|
setup(P) {
|
|
18
|
-
const { activeRequest: y, activeCollection: k, activeServer: x } = R(), { isReadOnly: D, servers: _, collectionMutators: N, events: B } = T(),
|
|
18
|
+
const { activeRequest: y, activeCollection: k, activeServer: x } = R(), { isReadOnly: D, servers: _, collectionMutators: N, events: B } = T(), d = c(
|
|
19
19
|
() => {
|
|
20
20
|
var t, e;
|
|
21
21
|
return (e = (t = y.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
|
|
@@ -26,7 +26,7 @@ const j = {
|
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
),
|
|
29
|
+
), u = c(
|
|
30
30
|
() => {
|
|
31
31
|
var t, e;
|
|
32
32
|
return (e = (t = k.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
|
|
@@ -37,10 +37,10 @@ const j = {
|
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
), h =
|
|
40
|
+
), h = c(
|
|
41
41
|
() => {
|
|
42
42
|
var t, e;
|
|
43
|
-
return ((t =
|
|
43
|
+
return ((t = d.value) == null ? void 0 : t.length) && ((e = u.value) == null ? void 0 : e.length);
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
E([k, y], ([t, e]) => {
|
|
@@ -52,43 +52,43 @@ const j = {
|
|
|
52
52
|
});
|
|
53
53
|
const U = () => B.commandPalette.emit({
|
|
54
54
|
commandName: "Add Server"
|
|
55
|
-
}), f =
|
|
55
|
+
}), f = c(() => {
|
|
56
56
|
var t, e, r;
|
|
57
57
|
return (e = (t = x.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? x.value.url.slice(0, -1) : ((r = x.value) == null ? void 0 : r.url) || "";
|
|
58
58
|
});
|
|
59
59
|
return (t, e) => {
|
|
60
60
|
var r, s;
|
|
61
|
-
return
|
|
61
|
+
return d.value && ((r = d.value) == null ? void 0 : r.length) > 1 || u.value && ((s = u.value) == null ? void 0 : s.length) > 1 ? (l(), S(o(W), {
|
|
62
62
|
key: 0,
|
|
63
63
|
class: "w-max",
|
|
64
|
-
teleport: "
|
|
64
|
+
teleport: ""
|
|
65
65
|
}, {
|
|
66
66
|
items: w(() => [
|
|
67
|
-
h.value ? (l(),
|
|
68
|
-
(l(!0),
|
|
67
|
+
h.value ? (l(), n("div", z, " Request Servers ")) : v("", !0),
|
|
68
|
+
(l(!0), n(m, null, g(d.value, (i) => (l(), S(C, {
|
|
69
69
|
key: i.id,
|
|
70
70
|
serverOption: i,
|
|
71
71
|
type: "request"
|
|
72
72
|
}, null, 8, ["serverOption"]))), 128)),
|
|
73
|
-
h.value ? (l(),
|
|
74
|
-
p(
|
|
73
|
+
h.value ? (l(), n(m, { key: 1 }, [
|
|
74
|
+
p(o(A)),
|
|
75
75
|
e[1] || (e[1] = a("div", { class: "text-xxs text-c-2 ml-8" }, "Collection Servers", -1))
|
|
76
76
|
], 64)) : v("", !0),
|
|
77
|
-
(l(!0),
|
|
77
|
+
(l(!0), n(m, null, g(u.value, (i) => (l(), S(C, {
|
|
78
78
|
key: i.id,
|
|
79
79
|
serverOption: i,
|
|
80
80
|
type: "collection"
|
|
81
81
|
}, null, 8, ["serverOption"]))), 128)),
|
|
82
|
-
|
|
83
|
-
p(
|
|
84
|
-
p(
|
|
82
|
+
o(D) ? v("", !0) : (l(), n(m, { key: 2 }, [
|
|
83
|
+
p(o(A)),
|
|
84
|
+
p(o(I), null, {
|
|
85
85
|
default: w(() => [
|
|
86
86
|
a("div", {
|
|
87
87
|
class: "font-code text-xxs flex items-center gap-1.5",
|
|
88
88
|
onClick: U
|
|
89
89
|
}, [
|
|
90
90
|
a("div", F, [
|
|
91
|
-
p(
|
|
91
|
+
p(o(L), {
|
|
92
92
|
icon: "Add",
|
|
93
93
|
size: "sm"
|
|
94
94
|
})
|
|
@@ -107,7 +107,7 @@ const j = {
|
|
|
107
107
|
])
|
|
108
108
|
]),
|
|
109
109
|
_: 1
|
|
110
|
-
})) : f.value ? (l(),
|
|
110
|
+
})) : f.value ? (l(), n("div", M, b(f.value), 1)) : v("", !0);
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
});
|
|
@@ -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":";;;;;;;AA2pBA,wBAOG"}
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import { useLoadingState as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { defineComponent as B, ref as _, computed as k, watch as A, openBlock as a, createBlock as C, unref as s, withCtx as c, createElementVNode as g, createVNode as y, createTextVNode as m, createElementBlock as r, Fragment as p, toDisplayString as O, createCommentVNode as N } from "vue";
|
|
2
|
+
import { useActiveEntities as j } from "../../store/active-entities.js";
|
|
3
|
+
import { useLoadingState as E, ScalarButton as D, ScalarIcon as W, ScalarTooltip as J, ScalarCodeBlock as Y } from "@scalar/components";
|
|
4
|
+
import { useToasts as q } from "@scalar/use-toasts";
|
|
5
|
+
import G from "./CommandActionForm.vue.js";
|
|
6
|
+
import H from "./CommandActionInput.vue.js";
|
|
7
|
+
import K from "./WatchModeToggle.vue.js";
|
|
8
|
+
import { isPostmanCollection as S, getPostmanDocumentDetails as Q, convertPostmanToOpenApi as L } from "../../libs/postman.js";
|
|
9
|
+
import { getOpenApiDocumentDetails as X } from "../../libs/getOpenApiDocumentDetails.js";
|
|
10
|
+
import { isUrl as b } from "../../libs/isUrl.js";
|
|
11
|
+
import { useFileDialog as Z } from "../../hooks/useFileDialog.js";
|
|
12
|
+
import { useWorkspace as ee } from "../../store/store.js";
|
|
13
|
+
const te = { class: "flex justify-between" }, oe = { class: "flex flex-row items-center justify-between gap-3 w-full" }, ae = { class: "grid gap-1.5 pointer-events-none max-w-[320px] w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, le = { class: "flex items-center text-c-2" }, ne = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "text-pretty"
|
|
15
|
-
},
|
|
16
|
+
}, se = {
|
|
16
17
|
key: 1,
|
|
17
18
|
class: "text-pretty"
|
|
18
|
-
},
|
|
19
|
+
}, ke = /* @__PURE__ */ B({
|
|
19
20
|
__name: "CommandPaletteImport",
|
|
20
21
|
emits: ["close", "back"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
() => H(o.value)
|
|
24
|
-
), S = k(
|
|
22
|
+
setup(re, { emit: V }) {
|
|
23
|
+
const h = V, { activeWorkspace: d } = j(), { importSpecFile: x, importSpecFromUrl: R } = ee(), { toast: i } = q(), u = E(), t = _(""), v = _(!0), l = k(() => S(t.value) ? Q(t.value) : X(t.value)), U = k(
|
|
25
24
|
() => l.value ? l.value.type : "json"
|
|
26
|
-
),
|
|
27
|
-
onChange: async (
|
|
28
|
-
const e =
|
|
25
|
+
), f = k(() => b(t.value)), F = k(() => !!l.value), { open: T } = Z({
|
|
26
|
+
onChange: async (o) => {
|
|
27
|
+
const e = o == null ? void 0 : o[0];
|
|
29
28
|
if (e) {
|
|
30
29
|
const n = new FileReader();
|
|
31
|
-
n.onload = async (
|
|
32
|
-
var
|
|
33
|
-
const
|
|
30
|
+
n.onload = async ($) => {
|
|
31
|
+
var P;
|
|
32
|
+
const I = (P = $.target) == null ? void 0 : P.result;
|
|
34
33
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
S(I) ? await x(
|
|
35
|
+
await L(I),
|
|
36
|
+
d.value.uid
|
|
37
|
+
) : await x(I, d.value.uid), i("Import successful", "info"), h("close");
|
|
38
|
+
} catch (w) {
|
|
39
|
+
console.error(w);
|
|
40
|
+
const z = (w == null ? void 0 : w.message) || "Unknown error";
|
|
41
|
+
i(`Import failed: ${z}`, "error");
|
|
40
42
|
}
|
|
41
43
|
}, n.readAsText(e);
|
|
42
44
|
}
|
|
@@ -44,64 +46,64 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
|
|
|
44
46
|
multiple: !1,
|
|
45
47
|
accept: ".json,.yaml,.yml"
|
|
46
48
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
|
|
49
|
+
A(f, (o) => {
|
|
50
|
+
o || (v.value = !1);
|
|
51
|
+
}), A(t, (o) => {
|
|
52
|
+
b(o) || (v.value = !1);
|
|
51
53
|
});
|
|
52
|
-
async function
|
|
53
|
-
if (!(!
|
|
54
|
-
|
|
54
|
+
async function M() {
|
|
55
|
+
if (!(!t.value || u.isLoading)) {
|
|
56
|
+
u.startLoading();
|
|
55
57
|
try {
|
|
56
|
-
if (
|
|
57
|
-
const [
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
if (f.value) {
|
|
59
|
+
const [o] = await R(
|
|
60
|
+
t.value,
|
|
61
|
+
d.value.uid,
|
|
60
62
|
{
|
|
61
|
-
proxyUrl:
|
|
62
|
-
watchMode:
|
|
63
|
+
proxyUrl: d.value.proxyUrl,
|
|
64
|
+
watchMode: v.value
|
|
63
65
|
}
|
|
64
66
|
);
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
+
if (o) {
|
|
68
|
+
i(
|
|
67
69
|
"There was a possible CORS error while importing your spec, please make sure this server is allowed in the CORS policy of your OpenAPI document.",
|
|
68
70
|
"error",
|
|
69
71
|
{ timeout: 5e3 }
|
|
70
|
-
),
|
|
72
|
+
), u.invalidate(2e3, !0);
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
|
-
} else if (
|
|
74
|
-
await
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
);
|
|
75
|
+
} else if (F.value)
|
|
76
|
+
S(t.value) ? (await x(
|
|
77
|
+
await L(t.value),
|
|
78
|
+
d.value.uid
|
|
79
|
+
), i("Successfully converted Postman collection", "info")) : await x(t.value, d.value.uid);
|
|
78
80
|
else {
|
|
79
|
-
|
|
81
|
+
i("Import failed: Invalid URL or OpenAPI document", "error"), u.invalidate(2e3, !0);
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
|
-
|
|
83
|
-
} catch (
|
|
84
|
-
console.error("[importCollection]",
|
|
85
|
-
const e = (
|
|
86
|
-
|
|
84
|
+
u.clear(), h("close"), i("Import successful", "info");
|
|
85
|
+
} catch (o) {
|
|
86
|
+
console.error("[importCollection]", o);
|
|
87
|
+
const e = (o == null ? void 0 : o.message) || "Unknown error";
|
|
88
|
+
u.invalidate(2e3, !0), i(`Import failed: ${e}`, "error");
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
|
-
return (
|
|
91
|
-
disabled: !
|
|
92
|
-
loading:
|
|
93
|
-
onSubmit:
|
|
92
|
+
return (o, e) => (a(), C(G, {
|
|
93
|
+
disabled: !t.value.trim(),
|
|
94
|
+
loading: s(u),
|
|
95
|
+
onSubmit: M
|
|
94
96
|
}, {
|
|
95
|
-
options:
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
options: c(() => [
|
|
98
|
+
g("div", oe, [
|
|
99
|
+
y(s(D), {
|
|
98
100
|
class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
99
101
|
variant: "outlined",
|
|
100
|
-
onClick:
|
|
102
|
+
onClick: s(T)
|
|
101
103
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
e[6] || (e[6] =
|
|
104
|
-
|
|
104
|
+
default: c(() => [
|
|
105
|
+
e[6] || (e[6] = m(" JSON, or YAML File ")),
|
|
106
|
+
y(s(W), {
|
|
105
107
|
class: "text-c-3",
|
|
106
108
|
icon: "UploadSimple",
|
|
107
109
|
size: "md"
|
|
@@ -109,23 +111,23 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
|
|
|
109
111
|
]),
|
|
110
112
|
_: 1
|
|
111
113
|
}, 8, ["onClick"]),
|
|
112
|
-
|
|
114
|
+
y(s(J), {
|
|
113
115
|
as: "div",
|
|
114
116
|
class: "z-[10001]",
|
|
115
117
|
side: "bottom",
|
|
116
118
|
sideOffset: 5
|
|
117
119
|
}, {
|
|
118
|
-
trigger:
|
|
119
|
-
|
|
120
|
-
modelValue:
|
|
121
|
-
"onUpdate:modelValue": e[3] || (e[3] = (n) =>
|
|
122
|
-
disabled: !
|
|
120
|
+
trigger: c(() => [
|
|
121
|
+
y(K, {
|
|
122
|
+
modelValue: v.value,
|
|
123
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => v.value = n),
|
|
124
|
+
disabled: !f.value
|
|
123
125
|
}, null, 8, ["modelValue", "disabled"])
|
|
124
126
|
]),
|
|
125
|
-
content:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
content: c(() => [
|
|
128
|
+
g("div", ae, [
|
|
129
|
+
g("div", le, [
|
|
130
|
+
f.value ? (a(), r("span", ne, " Automatically updates the API client when the OpenAPI URL content changes, ensuring your client remains up-to-date. ")) : (a(), r("span", se, " Watch Mode is only available for URL imports. It automatically updates the API client when the OpenAPI URL content changes. "))
|
|
129
131
|
])
|
|
130
132
|
])
|
|
131
133
|
]),
|
|
@@ -133,48 +135,48 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
|
|
|
133
135
|
})
|
|
134
136
|
])
|
|
135
137
|
]),
|
|
136
|
-
submit:
|
|
137
|
-
e[7] || (e[7] =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
], 64)) : l.value &&
|
|
141
|
-
l.value.title ? (a(),
|
|
142
|
-
|
|
143
|
-
], 64)) : (a(),
|
|
144
|
-
|
|
138
|
+
submit: c(() => [
|
|
139
|
+
e[7] || (e[7] = m(" Import ")),
|
|
140
|
+
f.value ? (a(), r(p, { key: 0 }, [
|
|
141
|
+
m(" from URL ")
|
|
142
|
+
], 64)) : l.value && U.value ? (a(), r(p, { key: 1 }, [
|
|
143
|
+
l.value.title ? (a(), r(p, { key: 0 }, [
|
|
144
|
+
m(' "' + O(l.value.title) + '" ', 1)
|
|
145
|
+
], 64)) : (a(), r(p, { key: 1 }, [
|
|
146
|
+
m(O(l.value.version) + " Spec", 1)
|
|
145
147
|
], 64))
|
|
146
|
-
], 64)) : (a(),
|
|
147
|
-
|
|
148
|
+
], 64)) : (a(), r(p, { key: 2 }, [
|
|
149
|
+
m("Collection")
|
|
148
150
|
], 64))
|
|
149
151
|
]),
|
|
150
|
-
default:
|
|
151
|
-
!l.value ||
|
|
152
|
+
default: c(() => [
|
|
153
|
+
!l.value || s(b)(t.value) ? (a(), C(H, {
|
|
152
154
|
key: 0,
|
|
153
|
-
modelValue:
|
|
154
|
-
"onUpdate:modelValue": e[0] || (e[0] = (n) =>
|
|
155
|
-
placeholder: "OpenAPI/Swagger URL or document",
|
|
156
|
-
onOnDelete: e[1] || (e[1] = (n) =>
|
|
157
|
-
}, null, 8, ["modelValue"])) : (a(),
|
|
158
|
-
|
|
159
|
-
e[5] || (e[5] =
|
|
160
|
-
|
|
155
|
+
modelValue: t.value,
|
|
156
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => t.value = n),
|
|
157
|
+
placeholder: "OpenAPI/Swagger/Postman URL or document",
|
|
158
|
+
onOnDelete: e[1] || (e[1] = (n) => h("back", n))
|
|
159
|
+
}, null, 8, ["modelValue"])) : (a(), r(p, { key: 1 }, [
|
|
160
|
+
g("div", te, [
|
|
161
|
+
e[5] || (e[5] = g("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1)),
|
|
162
|
+
y(s(D), {
|
|
161
163
|
class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
162
164
|
variant: "ghost",
|
|
163
|
-
onClick: e[2] || (e[2] = (n) =>
|
|
165
|
+
onClick: e[2] || (e[2] = (n) => t.value = "")
|
|
164
166
|
}, {
|
|
165
|
-
default:
|
|
166
|
-
|
|
167
|
+
default: c(() => e[4] || (e[4] = [
|
|
168
|
+
m(" Clear ")
|
|
167
169
|
])),
|
|
168
170
|
_: 1
|
|
169
171
|
})
|
|
170
172
|
]),
|
|
171
|
-
l.value && !
|
|
173
|
+
l.value && !s(b)(t.value) ? (a(), C(s(Y), {
|
|
172
174
|
key: 0,
|
|
173
175
|
class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
|
|
174
|
-
content:
|
|
176
|
+
content: t.value,
|
|
175
177
|
copy: !1,
|
|
176
|
-
lang:
|
|
177
|
-
}, null, 8, ["content", "lang"])) :
|
|
178
|
+
lang: U.value
|
|
179
|
+
}, null, 8, ["content", "lang"])) : N("", !0)
|
|
178
180
|
], 64))
|
|
179
181
|
]),
|
|
180
182
|
_: 1
|
|
@@ -182,5 +184,5 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
|
|
|
182
184
|
}
|
|
183
185
|
});
|
|
184
186
|
export {
|
|
185
|
-
|
|
187
|
+
ke as default
|
|
186
188
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
1
|
+
import { defineComponent as W, ref as c, computed as x, openBlock as h, createBlock as C, withCtx as u, createElementVNode as f, createVNode as i, unref as n, normalizeClass as q, toDisplayString as V, createCommentVNode as j, createTextVNode as H } from "vue";
|
|
2
|
+
import I from "../HttpMethod/HttpMethod.vue.js";
|
|
3
|
+
import { useActiveEntities as P } from "../../store/active-entities.js";
|
|
4
4
|
import { ScalarListbox as w, ScalarButton as D, ScalarIcon as k } from "@scalar/components";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import L from "
|
|
8
|
-
import O from "./
|
|
9
|
-
import
|
|
5
|
+
import { isHttpMethod as $ } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import { useToasts as A } from "@scalar/use-toasts";
|
|
7
|
+
import { useRouter as L } from "vue-router";
|
|
8
|
+
import O from "./CommandActionForm.vue.js";
|
|
9
|
+
import F from "./CommandActionInput.vue.js";
|
|
10
10
|
import { useWorkspace as G } from "../../store/store.js";
|
|
11
|
-
const J = { class: "flex" }, se = /* @__PURE__ */
|
|
11
|
+
const J = { class: "flex" }, se = /* @__PURE__ */ W({
|
|
12
12
|
__name: "CommandPaletteRequest",
|
|
13
13
|
props: {
|
|
14
14
|
metaData: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["close", "back"],
|
|
17
17
|
setup(S, { emit: _ }) {
|
|
18
|
-
const r = S, b = _, { push: M } =
|
|
18
|
+
const r = S, b = _, { push: M } = L(), { toast: N } = A(), {
|
|
19
19
|
activeCollection: R,
|
|
20
20
|
activeWorkspace: U,
|
|
21
21
|
activeWorkspaceCollections: g,
|
|
22
|
-
activeRequest:
|
|
23
|
-
} =
|
|
22
|
+
activeRequest: y
|
|
23
|
+
} = P(), { requestMutators: T, tags: z } = G(), o = c(""), m = c("get"), p = x(
|
|
24
24
|
() => g.value.map((t) => {
|
|
25
25
|
var e;
|
|
26
26
|
return {
|
|
@@ -61,7 +61,7 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
|
|
|
61
61
|
return t.id === ((e = r.metaData) == null ? void 0 : e.itemUid);
|
|
62
62
|
}) : d.value.find((t) => {
|
|
63
63
|
var e, a;
|
|
64
|
-
return t.label === ((a = (e =
|
|
64
|
+
return t.label === ((a = (e = y.value) == null ? void 0 : e.tags) == null ? void 0 : a[0]);
|
|
65
65
|
})
|
|
66
66
|
), B = (t) => m.value = t, E = () => {
|
|
67
67
|
var e;
|
|
@@ -69,9 +69,9 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
|
|
|
69
69
|
N("Please enter a name before creating a request.", "error");
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
if (!((e = l.value) != null && e.id) ||
|
|
72
|
+
if (!((e = l.value) != null && e.id) || !$(m.value))
|
|
73
73
|
return;
|
|
74
|
-
const t =
|
|
74
|
+
const t = T.add(
|
|
75
75
|
{
|
|
76
76
|
path: "",
|
|
77
77
|
method: m.value,
|
|
@@ -90,13 +90,13 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
|
|
|
90
90
|
}
|
|
91
91
|
}), b("close");
|
|
92
92
|
};
|
|
93
|
-
return (t, e) => (h(), C(
|
|
93
|
+
return (t, e) => (h(), C(O, {
|
|
94
94
|
disabled: !o.value.trim(),
|
|
95
95
|
onSubmit: E
|
|
96
96
|
}, {
|
|
97
97
|
options: u(() => [
|
|
98
98
|
f("div", J, [
|
|
99
|
-
i(
|
|
99
|
+
i(I, {
|
|
100
100
|
isEditable: !0,
|
|
101
101
|
isSquare: "",
|
|
102
102
|
method: m.value,
|
|
@@ -152,14 +152,14 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
|
|
|
152
152
|
})
|
|
153
153
|
]),
|
|
154
154
|
_: 1
|
|
155
|
-
}, 8, ["modelValue", "options"])) :
|
|
155
|
+
}, 8, ["modelValue", "options"])) : j("", !0)
|
|
156
156
|
])
|
|
157
157
|
]),
|
|
158
158
|
submit: u(() => e[4] || (e[4] = [
|
|
159
|
-
|
|
159
|
+
H("Create Request")
|
|
160
160
|
])),
|
|
161
161
|
default: u(() => [
|
|
162
|
-
i(
|
|
162
|
+
i(F, {
|
|
163
163
|
modelValue: o.value,
|
|
164
164
|
"onUpdate:modelValue": e[0] || (e[0] = (a) => o.value = a),
|
|
165
165
|
label: "Request Name",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
7
|
export default _default;
|
|
8
8
|
export declare const PaletteComponents: {
|
|
9
|
-
readonly 'Import from OpenAPI/Swagger': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
readonly 'Import from OpenAPI/Swagger/Postman': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
10
|
close: () => any;
|
|
11
11
|
back: (e: KeyboardEvent) => any;
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
@@ -2,8 +2,8 @@ import o from "./TheCommandPalette.vue2.js";
|
|
|
2
2
|
import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c09436db"]]);
|
|
6
6
|
export {
|
|
7
7
|
s as PaletteComponents,
|
|
8
|
-
|
|
8
|
+
a as default
|
|
9
9
|
};
|