@scalar/api-client 2.2.7 → 2.2.9
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 +27 -0
- 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 +65 -65
- package/dist/components/CodeInput/codeVariableWidget.d.ts +6 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +72 -68
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +108 -106
- 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/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.vue.js +20 -15
- package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.js +16 -11
- package/dist/components/DataTable/DataTableHeader.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableHeader.vue.js +11 -12
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +9 -9
- package/dist/components/DataTable/index.js +14 -14
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +87 -67
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +2 -2
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +4 -4
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +8 -4
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +52 -32
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +3 -0
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +43 -31
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +32 -31
- package/dist/layouts/App/create-api-client-app.d.ts +49 -42
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +103 -89
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +31 -19
- package/dist/layouts/Web/create-api-client-web.d.ts +49 -42
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +50 -44
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/env-helpers.d.ts +9 -0
- package/dist/libs/env-helpers.d.ts.map +1 -0
- package/dist/libs/env-helpers.js +4 -0
- package/dist/libs/environment-parser.d.ts +3 -4
- package/dist/libs/environment-parser.d.ts.map +1 -1
- package/dist/libs/environment-parser.js +5 -4
- package/dist/libs/index.d.ts +2 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +28 -22
- 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/libs/send-request/send-request.d.ts +5 -2
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +106 -104
- package/dist/routes.d.ts +11 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +13 -7
- package/dist/store/active-entities.d.ts +18 -11
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +108 -69
- package/dist/store/collections.d.ts +17 -15
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +62 -41
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +7 -3
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/router-params.d.ts +1 -1
- package/dist/store/router-params.d.ts.map +1 -1
- package/dist/store/router-params.js +7 -7
- package/dist/store/store.d.ts +49 -42
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +76 -72
- package/dist/store/workspace.d.ts +12 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/vue.d.ts +10 -0
- package/dist/types/vue.d.ts.map +1 -0
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +75 -70
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +308 -152
- package/dist/views/Environment/EnvironmentColorModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColorModal.vue.js +20 -18
- package/dist/views/Environment/EnvironmentColors.vue.d.ts +4 -1
- package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColors.vue.js +83 -58
- package/dist/views/Environment/EnvironmentModal.vue.d.ts +7 -0
- package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentModal.vue.js +119 -37
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +4 -5
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +73 -63
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +60 -61
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +185 -187
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +27 -24
- 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 +35 -187
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +207 -0
- package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue.d.ts → RequestAuth/RequestAuthDataTableInput.vue.d.ts} +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +43 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +5 -134
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +176 -2
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +2 -0
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/index.js +4 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +139 -117
- 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 +32 -38
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/auth.js +3 -3
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +9 -8
- package/package.json +19 -8
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +0 -1
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.js +0 -46
- /package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue2.js → RequestAuth/RequestAuthDataTableInput.vue2.js} +0 -0
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
const
|
|
4
|
-
key: 1,
|
|
5
|
-
class: "!py-0 flex flex-1 gap-2 items-center rounded"
|
|
6
|
-
}, j = ["placeholder"], T = /* @__PURE__ */ h({
|
|
1
|
+
import { defineComponent as F, ref as v, computed as I, watch as S, openBlock as t, createElementBlock as d, Fragment as w, normalizeClass as s, normalizeStyle as f, createBlock as h, unref as m, createCommentVNode as c, renderList as j, createElementVNode as n, withDirectives as D, vModelText as V, createVNode as $, nextTick as N } from "vue";
|
|
2
|
+
import { ScalarIcon as p } from "@scalar/components";
|
|
3
|
+
const R = ["onClick"], T = ["placeholder"], U = /* @__PURE__ */ F({
|
|
7
4
|
__name: "EnvironmentColors",
|
|
8
5
|
props: {
|
|
9
|
-
activeColor: {}
|
|
6
|
+
activeColor: {},
|
|
7
|
+
selector: { type: Boolean, default: !1 }
|
|
10
8
|
},
|
|
11
9
|
emits: ["select"],
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
10
|
+
setup(x, { emit: E }) {
|
|
11
|
+
const e = x, z = E, o = v(""), C = v(null), a = v(!1), u = v(!1), k = [
|
|
14
12
|
{ color: "#8E8E8E" },
|
|
15
13
|
{ color: "#EF0006" },
|
|
16
14
|
{ color: "#EDBE20" },
|
|
@@ -19,75 +17,102 @@ const D = ["onClick"], V = {
|
|
|
19
17
|
{ color: "#0082D0" },
|
|
20
18
|
{ color: "#5203D1" },
|
|
21
19
|
{ color: "#FFC0CB" }
|
|
22
|
-
],
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
], b = I(() => e.activeColor && !k.some((l) => l.color === e.activeColor) || o.value ? `background-color: ${e.activeColor || o.value};` : "background: linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122));"), y = () => {
|
|
21
|
+
a.value = !a.value, e.selector && (u.value = !1), N(() => {
|
|
22
|
+
C.value && C.value.focus();
|
|
25
23
|
});
|
|
26
24
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
S(o, (l) => {
|
|
26
|
+
l && !l.startsWith("#") && (o.value = `#${l}`), a.value = !0;
|
|
27
|
+
});
|
|
28
|
+
const B = () => {
|
|
29
|
+
e.selector && (u.value = !u.value);
|
|
30
|
+
}, g = (l) => {
|
|
31
|
+
z("select", l), e.selector && (u.value = !1);
|
|
32
|
+
};
|
|
33
|
+
return (l, i) => (t(), d("div", null, [
|
|
34
|
+
a.value ? c("", !0) : (t(), d(w, { key: 0 }, [
|
|
35
|
+
e.selector && !u.value ? (t(), d("div", {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: s(["flex cursor-pointer items-center justify-center rounded-full", e.selector ? "h-4 w-4" : "h-5 w-5"]),
|
|
38
|
+
style: f({ backgroundColor: l.activeColor }),
|
|
39
|
+
onClick: B
|
|
38
40
|
}, [
|
|
39
|
-
|
|
41
|
+
l.activeColor ? (t(), h(m(p), {
|
|
40
42
|
key: 0,
|
|
41
|
-
class: "text-c-btn",
|
|
43
|
+
class: s(["text-c-btn", e.selector && "p-0.5"]),
|
|
42
44
|
icon: "Checkmark",
|
|
43
45
|
size: "xs"
|
|
44
|
-
})) :
|
|
45
|
-
],
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class: "
|
|
49
|
-
style: m(C.value),
|
|
50
|
-
onClick: k
|
|
46
|
+
}, null, 8, ["class"])) : c("", !0)
|
|
47
|
+
], 6)) : c("", !0),
|
|
48
|
+
u.value || !e.selector ? (t(), d("div", {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: s(["color-selector flex flex-row gap-1.5 items-center justify-between space-x-1", e.selector ? "h-4" : "min-h-10 min-w-[296px]"])
|
|
51
51
|
}, [
|
|
52
|
-
|
|
53
|
-
key:
|
|
54
|
-
class: "
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
52
|
+
(t(), d(w, null, j(k, (r) => n("div", {
|
|
53
|
+
key: r.color,
|
|
54
|
+
class: s(["flex cursor-pointer items-center justify-center rounded-full", e.selector ? "h-4 w-4" : "h-5 w-5"]),
|
|
55
|
+
style: f({ backgroundColor: r.color }),
|
|
56
|
+
onClick: (L) => g(r.color)
|
|
57
|
+
}, [
|
|
58
|
+
l.activeColor === r.color && !o.value ? (t(), h(m(p), {
|
|
59
|
+
key: 0,
|
|
60
|
+
class: s(["text-c-btn", e.selector && "p-0.5"]),
|
|
61
|
+
icon: "Checkmark",
|
|
62
|
+
size: "xs"
|
|
63
|
+
}, null, 8, ["class"])) : c("", !0)
|
|
64
|
+
], 14, R)), 64)),
|
|
65
|
+
i[2] || (i[2] = n("hr", { class: "w-0.5 h-5 border-ghost border-l" }, null, -1)),
|
|
66
|
+
n("label", {
|
|
67
|
+
class: s(["cursor-pointer flex flex-row justify-center gap-2 items-center rounded-full z-10", e.selector ? "h-4 w-4" : "h-5 w-5"]),
|
|
68
|
+
style: f(b.value),
|
|
69
|
+
onClick: y
|
|
70
|
+
}, [
|
|
71
|
+
!a.value && (l.activeColor === o.value || l.activeColor && !k.some((r) => r.color === l.activeColor)) ? (t(), h(m(p), {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: "text-c-btn",
|
|
74
|
+
icon: "Checkmark",
|
|
75
|
+
size: "xs"
|
|
76
|
+
})) : c("", !0)
|
|
77
|
+
], 6)
|
|
78
|
+
], 2)) : c("", !0)
|
|
59
79
|
], 64)),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
s("
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
80
|
+
a.value ? (t(), d("div", {
|
|
81
|
+
key: 1,
|
|
82
|
+
class: s(["color-selector flex flex-1 gap-2 items-center rounded", e.selector ? "h-4" : "min-h-10"])
|
|
83
|
+
}, [
|
|
84
|
+
n("span", {
|
|
85
|
+
class: s(["absolute border border-dashed rounded-full", e.selector ? "h-4 w-4" : "h-5 w-5"])
|
|
86
|
+
}, null, 2),
|
|
87
|
+
n("span", {
|
|
88
|
+
class: s(["rounded-full z-[1]", e.selector ? "h-4 w-4" : "h-5 w-5"]),
|
|
89
|
+
style: f(b.value)
|
|
90
|
+
}, null, 6),
|
|
91
|
+
D(n("input", {
|
|
67
92
|
ref_key: "customColorInputRef",
|
|
68
|
-
ref:
|
|
69
|
-
"onUpdate:modelValue":
|
|
93
|
+
ref: C,
|
|
94
|
+
"onUpdate:modelValue": i[0] || (i[0] = (r) => o.value = r),
|
|
70
95
|
class: "border-transparent flex-1 outline-none w-full text-sm",
|
|
71
|
-
placeholder:
|
|
96
|
+
placeholder: l.activeColor || "#000000",
|
|
72
97
|
type: "text",
|
|
73
|
-
onInput:
|
|
74
|
-
}, null, 40,
|
|
75
|
-
[
|
|
98
|
+
onInput: i[1] || (i[1] = (r) => g(o.value))
|
|
99
|
+
}, null, 40, T), [
|
|
100
|
+
[V, o.value]
|
|
76
101
|
]),
|
|
77
|
-
|
|
102
|
+
n("button", {
|
|
78
103
|
class: "text-c-3 hover:bg-b-2 p-1.5 rounded-lg",
|
|
79
104
|
type: "button",
|
|
80
|
-
onClick:
|
|
105
|
+
onClick: y
|
|
81
106
|
}, [
|
|
82
|
-
|
|
107
|
+
$(m(p), {
|
|
83
108
|
icon: "Checkmark",
|
|
84
109
|
size: "xs"
|
|
85
110
|
})
|
|
86
111
|
])
|
|
87
|
-
])) :
|
|
88
|
-
]
|
|
112
|
+
], 2)) : c("", !0)
|
|
113
|
+
]));
|
|
89
114
|
}
|
|
90
115
|
});
|
|
91
116
|
export {
|
|
92
|
-
|
|
117
|
+
U as default
|
|
93
118
|
};
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { type ModalState } from '@scalar/components';
|
|
2
|
+
import type { Collection } from '@scalar/oas-utils/entities/spec';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
state: ModalState;
|
|
5
|
+
activeWorkspaceCollections: Collection[];
|
|
6
|
+
collectionId?: string;
|
|
4
7
|
};
|
|
5
8
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
6
9
|
submit: (environment: {
|
|
7
10
|
name: string;
|
|
8
11
|
color: string;
|
|
12
|
+
type: string;
|
|
13
|
+
collectionId?: string;
|
|
9
14
|
}) => any;
|
|
10
15
|
cancel: () => any;
|
|
11
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
17
|
onSubmit?: ((environment: {
|
|
13
18
|
name: string;
|
|
14
19
|
color: string;
|
|
20
|
+
type: string;
|
|
21
|
+
collectionId?: string;
|
|
15
22
|
}) => any) | undefined;
|
|
16
23
|
onCancel?: (() => any) | undefined;
|
|
17
24
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"AA8JA,OAAO,EACL,KAAK,UAAU,EAMhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,0BAA0B,EAAE,UAAU,EAAE,CAAA;IACxC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;;cAQU,MAAM;eACL,MAAM;cACP,MAAM;uBACG,MAAM;;;;;cAHf,MAAM;eACL,MAAM;cACP,MAAM;uBACG,MAAM;;;;AAmS3B,wBAQG"}
|
|
@@ -1,52 +1,134 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as _, ref as u, computed as h, watch as w, openBlock as m, createBlock as v, unref as i, withCtx as a, createVNode as s, createElementVNode as p, normalizeClass as I, toDisplayString as N, createTextVNode as T } from "vue";
|
|
2
|
+
import $ from "../../components/CommandPalette/CommandActionForm.vue.js";
|
|
3
|
+
import z from "../../components/CommandPalette/CommandActionInput.vue.js";
|
|
4
|
+
import { ScalarModal as B, ScalarListbox as D, ScalarButton as C, ScalarIcon as U } from "@scalar/components";
|
|
5
|
+
import { useToasts as W } from "@scalar/use-toasts";
|
|
6
|
+
import j from "./EnvironmentColors.vue.js";
|
|
7
|
+
import { useWorkspace as M } from "../../store/store.js";
|
|
8
|
+
const P = { class: "flex gap-2 items-start" }, K = /* @__PURE__ */ _({
|
|
6
9
|
__name: "EnvironmentModal",
|
|
7
10
|
props: {
|
|
8
|
-
state: {}
|
|
11
|
+
state: {},
|
|
12
|
+
activeWorkspaceCollections: {},
|
|
13
|
+
collectionId: {}
|
|
9
14
|
},
|
|
10
15
|
emits: ["cancel", "submit"],
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
16
|
+
setup(x, { emit: g }) {
|
|
17
|
+
const n = x, f = g, { events: E } = M(), r = u(""), c = u("#8E8E8E"), d = h(() => [
|
|
18
|
+
...n.activeWorkspaceCollections.filter((t) => {
|
|
19
|
+
var e;
|
|
20
|
+
return ((e = t.info) == null ? void 0 : e.title) !== "Drafts";
|
|
21
|
+
}).map((t) => {
|
|
22
|
+
var e;
|
|
23
|
+
return {
|
|
24
|
+
id: t.uid,
|
|
25
|
+
label: ((e = t.info) == null ? void 0 : e.title) ?? "Untitled Collection"
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
]), l = u(
|
|
29
|
+
d.value.find((t) => t.id === n.collectionId)
|
|
30
|
+
), { toast: S } = W(), V = (t) => {
|
|
31
|
+
c.value = t;
|
|
14
32
|
};
|
|
15
|
-
|
|
16
|
-
() =>
|
|
33
|
+
w(
|
|
34
|
+
() => n.state.open,
|
|
17
35
|
(t) => {
|
|
18
|
-
t && (
|
|
36
|
+
t && (r.value = "", c.value = "#8E8E8E", n.collectionId ? l.value = d.value.find(
|
|
37
|
+
(e) => e.id === n.collectionId
|
|
38
|
+
) : l.value = void 0);
|
|
19
39
|
}
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
40
|
+
);
|
|
41
|
+
const k = () => {
|
|
42
|
+
var t, e, o, b;
|
|
43
|
+
if (!((t = l.value) != null && t.id)) {
|
|
44
|
+
S("Please select a collection before adding an environment.", "error");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
f("submit", {
|
|
48
|
+
name: r.value,
|
|
49
|
+
color: c.value,
|
|
50
|
+
type: ((e = l.value) == null ? void 0 : e.id) === "global" ? "global" : "collection",
|
|
51
|
+
collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (b = l.value) == null ? void 0 : b.id : void 0
|
|
52
|
+
});
|
|
53
|
+
}, y = () => {
|
|
54
|
+
n.state.hide(), E.commandPalette.emit({ commandName: "Create Collection" });
|
|
55
|
+
};
|
|
56
|
+
return (t, e) => (m(), v(i(B), {
|
|
57
|
+
bodyClass: "!border-t-0 !rounded-t-lg",
|
|
58
|
+
size: "xs",
|
|
59
|
+
state: t.state
|
|
24
60
|
}, {
|
|
25
|
-
default:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
61
|
+
default: a(() => [
|
|
62
|
+
s($, {
|
|
63
|
+
disabled: !l.value,
|
|
64
|
+
onCancel: e[2] || (e[2] = (o) => f("cancel")),
|
|
65
|
+
onSubmit: k
|
|
66
|
+
}, {
|
|
67
|
+
options: a(() => [
|
|
68
|
+
s(i(D), {
|
|
69
|
+
modelValue: l.value,
|
|
70
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => l.value = o),
|
|
71
|
+
options: d.value,
|
|
72
|
+
placeholder: "Select Type"
|
|
73
|
+
}, {
|
|
74
|
+
default: a(() => [
|
|
75
|
+
d.value.length > 0 ? (m(), v(i(C), {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2 w-fit",
|
|
78
|
+
variant: "outlined"
|
|
79
|
+
}, {
|
|
80
|
+
default: a(() => [
|
|
81
|
+
p("span", {
|
|
82
|
+
class: I(l.value ? "text-c-1" : "text-c-3")
|
|
83
|
+
}, N(l.value ? l.value.label : "Select Collection"), 3),
|
|
84
|
+
s(i(U), {
|
|
85
|
+
class: "text-c-3",
|
|
86
|
+
icon: "ChevronDown",
|
|
87
|
+
size: "xs"
|
|
88
|
+
})
|
|
89
|
+
]),
|
|
90
|
+
_: 1
|
|
91
|
+
})) : (m(), v(i(C), {
|
|
92
|
+
key: 1,
|
|
93
|
+
class: "justify-between p-2 max-h-8 gap-1 text-xs hover:bg-b-2",
|
|
94
|
+
variant: "outlined",
|
|
95
|
+
onClick: y
|
|
96
|
+
}, {
|
|
97
|
+
default: a(() => e[3] || (e[3] = [
|
|
98
|
+
p("span", { class: "text-c-1" }, "Create Collection", -1)
|
|
99
|
+
])),
|
|
100
|
+
_: 1
|
|
101
|
+
}))
|
|
102
|
+
]),
|
|
103
|
+
_: 1
|
|
104
|
+
}, 8, ["modelValue", "options"])
|
|
105
|
+
]),
|
|
106
|
+
submit: a(() => e[4] || (e[4] = [
|
|
107
|
+
T("Add Environment")
|
|
108
|
+
])),
|
|
109
|
+
default: a(() => [
|
|
110
|
+
p("div", P, [
|
|
111
|
+
s(j, {
|
|
112
|
+
activeColor: c.value,
|
|
113
|
+
class: "peer",
|
|
114
|
+
selector: "",
|
|
115
|
+
onSelect: V
|
|
116
|
+
}, null, 8, ["activeColor"]),
|
|
117
|
+
s(z, {
|
|
118
|
+
modelValue: r.value,
|
|
119
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => r.value = o),
|
|
120
|
+
class: "!p-0 peer-has-[.color-selector]:hidden -mt-[.5px]",
|
|
121
|
+
placeholder: "Environment name"
|
|
122
|
+
}, null, 8, ["modelValue"])
|
|
123
|
+
])
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}, 8, ["disabled"])
|
|
45
127
|
]),
|
|
46
128
|
_: 1
|
|
47
129
|
}, 8, ["state"]));
|
|
48
130
|
}
|
|
49
131
|
});
|
|
50
132
|
export {
|
|
51
|
-
|
|
133
|
+
K as default
|
|
52
134
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
1
|
+
import { type EnvVariables } from '../../libs/env-helpers.js';
|
|
2
|
+
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
query: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
router: Router;
|
|
5
|
+
environment: Environment;
|
|
6
|
+
envVariables: EnvVariables;
|
|
8
7
|
dropdownPosition?: {
|
|
9
8
|
left: number;
|
|
10
9
|
top: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariableDropdown.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentVariableDropdown.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentVariableDropdown.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentVariableDropdown.vue"],"names":[],"mappings":"AA6KA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAQzE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;IAE1B,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACjD,CAAC;;gCAwDiC,IAAI,GAAG,MAAM;;;;;;;AAqPhD,wBAQG"}
|
|
@@ -1,116 +1,126 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as R, ref as m, computed as h, onMounted as I, openBlock as r, createBlock as v, unref as l, withCtx as x, createElementVNode as c, normalizeStyle as y, createElementBlock as u, Fragment as P, renderList as T, normalizeClass as j, createTextVNode as b, toDisplayString as k, createVNode as q, createCommentVNode as g } from "vue";
|
|
2
|
+
import { getEnvColor as D } from "../../libs/env-helpers.js";
|
|
3
|
+
import { ScalarTeleport as F, ScalarIcon as V, ScalarButton as K } from "@scalar/components";
|
|
4
|
+
import { onClickOutside as O } from "@vueuse/core";
|
|
5
|
+
import G from "fuse.js";
|
|
6
|
+
import { useRouter as L } from "vue-router";
|
|
7
|
+
import { parseEnvVariables as _ } from "../../libs/environment-parser.js";
|
|
8
|
+
const M = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "flex flex-col gap-px"
|
|
11
|
+
}, Q = ["onClick"], $ = { class: "flex items-center gap-1.5 whitespace-nowrap" }, H = { class: "w-20 overflow-hidden text-ellipsis text-right whitespace-nowrap" }, ne = /* @__PURE__ */ R({
|
|
7
12
|
__name: "EnvironmentVariableDropdown",
|
|
8
13
|
props: {
|
|
9
14
|
query: {},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
router: {},
|
|
15
|
+
environment: {},
|
|
16
|
+
envVariables: {},
|
|
13
17
|
dropdownPosition: {}
|
|
14
18
|
},
|
|
15
19
|
emits: ["select"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
setup(C, { expose: S, emit: E }) {
|
|
21
|
+
const s = C, z = E, d = m(!0), p = m(null), n = m(0), f = L(), A = () => {
|
|
22
|
+
if (!f) return;
|
|
23
|
+
const { currentRoute: t, push: o } = f, e = t.value.params.workspace;
|
|
24
|
+
o({
|
|
20
25
|
name: "environment.default",
|
|
21
26
|
params: {
|
|
22
27
|
workspace: e
|
|
23
28
|
}
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
29
|
+
}), d.value = !1;
|
|
30
|
+
}, B = new G(_(s.envVariables), {
|
|
26
31
|
keys: ["key", "value"]
|
|
27
|
-
}), i =
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
30
|
-
return
|
|
31
|
-
const o =
|
|
32
|
-
return o.length > 0 ? o.map((
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
handleArrowKey: (
|
|
38
|
-
const o =
|
|
39
|
-
|
|
32
|
+
}), i = h(() => {
|
|
33
|
+
const t = s.query;
|
|
34
|
+
if (!t)
|
|
35
|
+
return _(s.envVariables).slice(-4).filter(({ key: e, value: a }) => e !== "" || a !== "");
|
|
36
|
+
const o = B.search(t, { limit: 10 });
|
|
37
|
+
return o.length > 0 ? o.map((e) => e.item).filter(({ key: e, value: a }) => e !== "" || a !== "") : [];
|
|
38
|
+
}), w = (t) => {
|
|
39
|
+
z("select", t);
|
|
40
|
+
};
|
|
41
|
+
S({
|
|
42
|
+
handleArrowKey: (t) => {
|
|
43
|
+
const o = t === "up" ? -1 : 1, e = i.value.length;
|
|
44
|
+
e !== 0 && (n.value = (n.value + o + e) % e);
|
|
40
45
|
},
|
|
41
46
|
handleSelect: () => {
|
|
42
47
|
if (n.value >= 0) {
|
|
43
|
-
const
|
|
44
|
-
|
|
48
|
+
const t = i.value[n.value];
|
|
49
|
+
t && w(t.key);
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
|
-
}),
|
|
52
|
+
}), I(() => {
|
|
48
53
|
n.value = 0;
|
|
49
54
|
});
|
|
50
|
-
const N =
|
|
51
|
-
var
|
|
55
|
+
const N = h(() => {
|
|
56
|
+
var t, o;
|
|
52
57
|
return {
|
|
53
|
-
left: (((
|
|
58
|
+
left: (((t = s.dropdownPosition) == null ? void 0 : t.left) ?? 0) + "px",
|
|
54
59
|
// Add a 5px offset from the editor
|
|
55
|
-
top: (((o =
|
|
60
|
+
top: (((o = s.dropdownPosition) == null ? void 0 : o.top) ?? 0) + 5 + "px"
|
|
56
61
|
};
|
|
57
62
|
});
|
|
58
|
-
return
|
|
59
|
-
|
|
63
|
+
return O(
|
|
64
|
+
p,
|
|
60
65
|
() => {
|
|
61
|
-
|
|
66
|
+
d.value = !1;
|
|
62
67
|
},
|
|
63
|
-
{ ignore: [
|
|
64
|
-
), (
|
|
68
|
+
{ ignore: [p] }
|
|
69
|
+
), (t, o) => d.value ? (r(), v(l(F), {
|
|
65
70
|
key: 0,
|
|
66
71
|
class: "scalar-client"
|
|
67
72
|
}, {
|
|
68
|
-
default:
|
|
69
|
-
|
|
73
|
+
default: x(() => [
|
|
74
|
+
c("div", {
|
|
70
75
|
ref_key: "dropdownRef",
|
|
71
|
-
ref:
|
|
76
|
+
ref: p,
|
|
72
77
|
class: "fixed left-0 top-0 flex flex-col p-0.75 max-h-[60svh] w-56 rounded border custom-scroll",
|
|
73
78
|
style: y(N.value)
|
|
74
79
|
}, [
|
|
75
|
-
i.value.length ? (
|
|
76
|
-
(
|
|
77
|
-
key:
|
|
78
|
-
class: j(["h-8 font-code text-xxs hover:bg-b-2 flex cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2":
|
|
79
|
-
onClick: (W) =>
|
|
80
|
+
i.value.length ? (r(), u("ul", M, [
|
|
81
|
+
(r(!0), u(P, null, T(i.value, (e, a) => (r(), u("li", {
|
|
82
|
+
key: e.key,
|
|
83
|
+
class: j(["h-8 font-code text-xxs hover:bg-b-2 flex cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": a === n.value }]),
|
|
84
|
+
onClick: (W) => w(e.key)
|
|
80
85
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
c("div", $, [
|
|
87
|
+
e.source === "collection" ? (r(), u("span", {
|
|
88
|
+
key: 0,
|
|
83
89
|
class: "h-2.5 w-2.5 min-w-2.5 rounded-full",
|
|
84
90
|
style: y({
|
|
85
|
-
backgroundColor:
|
|
91
|
+
backgroundColor: l(D)(t.environment)
|
|
86
92
|
})
|
|
87
|
-
}, null, 4),
|
|
88
|
-
|
|
93
|
+
}, null, 4)) : (r(), v(l(V), {
|
|
94
|
+
key: 1,
|
|
95
|
+
class: "w-2.5",
|
|
96
|
+
icon: "Globe"
|
|
97
|
+
})),
|
|
98
|
+
b(" " + k(e.key), 1)
|
|
89
99
|
]),
|
|
90
|
-
|
|
91
|
-
], 10,
|
|
92
|
-
])) : (
|
|
100
|
+
c("span", H, k(e.value), 1)
|
|
101
|
+
], 10, Q))), 128))
|
|
102
|
+
])) : l(f) ? (r(), v(l(K), {
|
|
93
103
|
key: 1,
|
|
94
104
|
class: "font-code text-xxs hover:bg-b-2 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150",
|
|
95
105
|
variant: "secondary",
|
|
96
|
-
onClick:
|
|
106
|
+
onClick: A
|
|
97
107
|
}, {
|
|
98
|
-
default:
|
|
99
|
-
q(
|
|
108
|
+
default: x(() => [
|
|
109
|
+
q(l(V), {
|
|
100
110
|
icon: "Add",
|
|
101
111
|
size: "sm"
|
|
102
112
|
}),
|
|
103
113
|
o[0] || (o[0] = b(" Add Variable "))
|
|
104
114
|
]),
|
|
105
115
|
_: 1
|
|
106
|
-
})),
|
|
107
|
-
o[1] || (o[1] =
|
|
116
|
+
})) : g("", !0),
|
|
117
|
+
o[1] || (o[1] = c("div", { class: "absolute inset-0 -z-1 rounded bg-b-1 shadow-lg brightness-lifted" }, null, -1))
|
|
108
118
|
], 4)
|
|
109
119
|
]),
|
|
110
120
|
_: 1
|
|
111
|
-
})) :
|
|
121
|
+
})) : g("", !0);
|
|
112
122
|
}
|
|
113
123
|
});
|
|
114
124
|
export {
|
|
115
|
-
|
|
125
|
+
ne as default
|
|
116
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAuQ8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA8XjD,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Request.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c563efae"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|