@scalar/api-client 2.9.0 → 2.9.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 +12 -0
- package/dist/components/CommandPalette/CommandActionForm.vue.js +9 -9
- package/dist/style.css +1 -1
- package/dist/v2/components/code-input/CodeInput.test.d.ts +2 -0
- package/dist/v2/components/code-input/CodeInput.test.d.ts.map +1 -0
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +140 -0
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -0
- package/dist/v2/components/code-input/CodeInput.vue.js +8 -0
- package/dist/v2/components/code-input/CodeInput.vue2.js +202 -0
- package/dist/v2/components/code-input/code-variable-widget.d.ts +21 -0
- package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -0
- package/dist/v2/components/code-input/code-variable-widget.js +106 -0
- package/dist/v2/components/code-input/code-variable-widget.test.d.ts +2 -0
- package/dist/v2/components/code-input/code-variable-widget.test.d.ts.map +1 -0
- package/dist/v2/components/code-input/index.d.ts +2 -0
- package/dist/v2/components/code-input/index.d.ts.map +1 -0
- package/dist/v2/components/code-input/index.js +4 -0
- package/dist/v2/components/data-table/DataTable.vue.d.ts +22 -0
- package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTable.vue.js +38 -0
- package/dist/v2/components/data-table/DataTable.vue2.js +4 -0
- package/dist/v2/components/data-table/DataTableCell.vue.d.ts +19 -0
- package/dist/v2/components/data-table/DataTableCell.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTableCell.vue.js +26 -0
- package/dist/v2/components/data-table/DataTableCell.vue2.js +4 -0
- package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +14 -0
- package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js +53 -0
- package/dist/v2/components/data-table/DataTableCheckbox.vue2.js +4 -0
- package/dist/v2/components/data-table/DataTableHeader.vue.d.ts +13 -0
- package/dist/v2/components/data-table/DataTableHeader.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTableHeader.vue.js +18 -0
- package/dist/v2/components/data-table/DataTableHeader.vue2.js +4 -0
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +53 -0
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTableInput.vue.js +7 -0
- package/dist/v2/components/data-table/DataTableInput.vue2.js +117 -0
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +16 -0
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +146 -0
- package/dist/v2/components/data-table/DataTableInputSelect.vue2.js +4 -0
- package/dist/v2/components/data-table/DataTableRow.vue.d.ts +13 -0
- package/dist/v2/components/data-table/DataTableRow.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTableRow.vue.js +12 -0
- package/dist/v2/components/data-table/DataTableText.vue.d.ts +16 -0
- package/dist/v2/components/data-table/DataTableText.vue.d.ts.map +1 -0
- package/dist/v2/components/data-table/DataTableText.vue.js +23 -0
- package/dist/v2/components/data-table/DataTableText.vue2.js +4 -0
- package/dist/v2/components/data-table/index.d.ts +9 -0
- package/dist/v2/components/data-table/index.d.ts.map +1 -0
- package/dist/v2/components/data-table/index.js +18 -0
- package/dist/v2/features/app/App.test.d.ts +2 -0
- package/dist/v2/features/app/App.test.d.ts.map +1 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +56 -41
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +3 -0
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +8 -7
- package/dist/v2/features/app/components/DesktopTabs.vue2.js +6 -0
- package/dist/v2/features/app/helpers/routes.d.ts +12 -9
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +0 -6
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue2.js +58 -45
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue2.js +12 -10
- package/dist/v2/features/collection/components/Environment.vue.d.ts +13 -87
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue2.js +20 -25
- package/dist/v2/features/collection/components/Overview.vue.d.ts +13 -12
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +5 -2
- package/dist/v2/features/collection/components/Overview.vue2.js +64 -66
- package/dist/v2/features/collection/components/Tabs.vue.js +8 -8
- package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +6 -95
- package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.js +50 -98
- package/dist/v2/features/environments/components/Environment.vue.d.ts +9 -63
- package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.js +41 -92
- package/dist/v2/features/environments/components/EnvironmentColors.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentColors.vue.js +105 -81
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts +7 -14
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +61 -39
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +3 -3
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts +21 -0
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -0
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +109 -0
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue2.js +4 -0
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts +7 -20
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +3 -3
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue2.js +85 -71
- package/dist/v2/features/environments/index.d.ts +0 -3
- package/dist/v2/features/environments/index.d.ts.map +1 -1
- package/dist/v2/features/environments/index.js +2 -4
- package/dist/v2/helpers/test-utils.d.ts +4 -0
- package/dist/v2/helpers/test-utils.d.ts.map +1 -0
- package/dist/v2/hooks/use-workspace-client-events.d.ts +2 -1
- package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
- package/dist/v2/hooks/use-workspace-client-events.js +23 -9
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +13 -13
- package/dist/v2/features/collection/WorkspaceCollection.test.d.ts +0 -2
- package/dist/v2/features/collection/WorkspaceCollection.test.d.ts.map +0 -1
- package/dist/v2/features/environments/Environments.test.d.ts +0 -2
- package/dist/v2/features/environments/Environments.test.d.ts.map +0 -1
- package/dist/v2/features/environments/Environments.vue.d.ts +0 -31
- package/dist/v2/features/environments/Environments.vue.d.ts.map +0 -1
- package/dist/v2/features/environments/Environments.vue.js +0 -65
- package/dist/v2/features/environments/Environments.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.d.ts +0 -20
- package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.d.ts.map +0 -1
- package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.js +0 -48
- package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.d.ts +0 -18
- package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.d.ts.map +0 -1
- package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.js +0 -35
- package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue2.js +0 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { defineComponent as E, ref as u, computed as d, onMounted as N, createBlock as x, createCommentVNode as P, openBlock as r, unref as f, withCtx as y, createElementVNode as s, normalizeStyle as b, createElementBlock as p, Fragment as _, renderList as q, normalizeClass as A, createTextVNode as w, toDisplayString as g, createVNode as T } from "vue";
|
|
2
|
+
import { ScalarTeleport as j, ScalarButton as D } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as F } from "@scalar/icons";
|
|
4
|
+
import { onClickOutside as I } from "@vueuse/core";
|
|
5
|
+
import K from "fuse.js";
|
|
6
|
+
const O = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "gap-1/2 flex flex-col"
|
|
9
|
+
}, R = ["onClick"], L = { class: "flex items-center gap-2 whitespace-nowrap" }, M = { class: "w-20 overflow-hidden text-right text-ellipsis whitespace-nowrap" }, Y = /* @__PURE__ */ E({
|
|
10
|
+
__name: "EnvironmentVariablesDropdown",
|
|
11
|
+
props: {
|
|
12
|
+
query: {},
|
|
13
|
+
environment: {},
|
|
14
|
+
dropdownPosition: {}
|
|
15
|
+
},
|
|
16
|
+
emits: ["select", "redirect"],
|
|
17
|
+
setup(n, { expose: k, emit: V }) {
|
|
18
|
+
const m = V, i = u(!0), c = u(null), o = u(0), C = () => {
|
|
19
|
+
m("redirect"), i.value = !1;
|
|
20
|
+
}, v = d(
|
|
21
|
+
() => n.environment.variables.map((e) => ({
|
|
22
|
+
key: e.name,
|
|
23
|
+
value: typeof e.value == "string" ? e.value : e.value.default
|
|
24
|
+
}))
|
|
25
|
+
), S = new K(v.value, {
|
|
26
|
+
keys: ["key", "value"]
|
|
27
|
+
}), a = d(() => {
|
|
28
|
+
if (!n.query)
|
|
29
|
+
return v.value.slice(-4).filter(({ key: t, value: l }) => t !== "" || l !== "");
|
|
30
|
+
const e = S.search(n.query, { limit: 10 });
|
|
31
|
+
return e.length > 0 ? e.map((t) => t.item).filter(({ key: t, value: l }) => t !== "" || l !== "") : [];
|
|
32
|
+
}), h = (e) => {
|
|
33
|
+
m("select", e);
|
|
34
|
+
};
|
|
35
|
+
k({
|
|
36
|
+
handleArrowKey: (e) => {
|
|
37
|
+
const t = e === "up" ? -1 : 1, l = a.value.length;
|
|
38
|
+
l !== 0 && (o.value = (o.value + t + l) % l);
|
|
39
|
+
},
|
|
40
|
+
handleSelect: () => {
|
|
41
|
+
if (o.value >= 0) {
|
|
42
|
+
const e = a.value[o.value];
|
|
43
|
+
e && h(e.key);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}), N(() => {
|
|
47
|
+
o.value = 0;
|
|
48
|
+
});
|
|
49
|
+
const z = d(() => ({
|
|
50
|
+
left: (n.dropdownPosition?.left ?? 0) + "px",
|
|
51
|
+
// Add a 5px offset from the editor
|
|
52
|
+
top: (n.dropdownPosition?.top ?? 0) + 5 + "px"
|
|
53
|
+
}));
|
|
54
|
+
return I(
|
|
55
|
+
c,
|
|
56
|
+
() => {
|
|
57
|
+
i.value = !1;
|
|
58
|
+
},
|
|
59
|
+
{ ignore: [c] }
|
|
60
|
+
), (e, t) => i.value ? (r(), x(f(j), {
|
|
61
|
+
key: 0,
|
|
62
|
+
class: "scalar-client"
|
|
63
|
+
}, {
|
|
64
|
+
default: y(() => [
|
|
65
|
+
s("div", {
|
|
66
|
+
ref_key: "dropdownRef",
|
|
67
|
+
ref: c,
|
|
68
|
+
class: "custom-scroll fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75",
|
|
69
|
+
style: b(z.value)
|
|
70
|
+
}, [
|
|
71
|
+
a.value.length ? (r(), p("ul", O, [
|
|
72
|
+
(r(!0), p(_, null, q(a.value, (l, B) => (r(), p("li", {
|
|
73
|
+
key: l.key,
|
|
74
|
+
class: A(["font-code text-xxs hover:bg-b-2 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": B === o.value }]),
|
|
75
|
+
onClick: (H) => h(l.key)
|
|
76
|
+
}, [
|
|
77
|
+
s("div", L, [
|
|
78
|
+
s("span", {
|
|
79
|
+
class: "h-2.25 w-2.25 min-w-2.25 rounded-full",
|
|
80
|
+
style: b({
|
|
81
|
+
backgroundColor: e.environment.color
|
|
82
|
+
})
|
|
83
|
+
}, null, 4),
|
|
84
|
+
w(" " + g(l.key), 1)
|
|
85
|
+
]),
|
|
86
|
+
s("span", M, g(l.value), 1)
|
|
87
|
+
], 10, R))), 128))
|
|
88
|
+
])) : (r(), x(f(D), {
|
|
89
|
+
key: 1,
|
|
90
|
+
class: "font-code text-xxs bg-b-inherit hover:bg-b-2 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150",
|
|
91
|
+
variant: "outlined",
|
|
92
|
+
onClick: C
|
|
93
|
+
}, {
|
|
94
|
+
default: y(() => [
|
|
95
|
+
T(f(F), { class: "size-3" }),
|
|
96
|
+
t[0] || (t[0] = w(" Add Variable ", -1))
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
})),
|
|
100
|
+
t[1] || (t[1] = s("div", { class: "bg-b-1 brightness-lifted absolute inset-0 -z-1 rounded shadow-lg" }, null, -1))
|
|
101
|
+
], 4)
|
|
102
|
+
]),
|
|
103
|
+
_: 1
|
|
104
|
+
})) : P("", !0);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
export {
|
|
108
|
+
Y as default
|
|
109
|
+
};
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
type TableRow = {
|
|
4
|
-
name: string;
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
1
|
+
import type { CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
|
+
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
7
3
|
type __VLS_Props = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
|
-
updateRow: (index: number, payload: Partial<TableRow>) => any;
|
|
15
|
-
addRow: (payload: Partial<TableRow>) => any;
|
|
16
|
-
deleteRow: (index: number) => any;
|
|
17
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
-
onUpdateRow?: ((index: number, payload: Partial<TableRow>) => any) | undefined;
|
|
19
|
-
onAddRow?: ((payload: Partial<TableRow>) => any) | undefined;
|
|
20
|
-
onDeleteRow?: ((index: number) => any) | undefined;
|
|
21
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
environment: XScalarEnvironment;
|
|
5
|
+
environmentName: string;
|
|
6
|
+
eventBus: WorkspaceEventBus;
|
|
7
|
+
} & CollectionType;
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
9
|
export default _default;
|
|
23
10
|
//# sourceMappingURL=EnvironmentVariablesTable.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesTable.vue"],"names":[],"mappings":"AAgMA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAWnH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;;AAkVrB,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./EnvironmentVariablesTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ o(a, [["__scopeId", "data-v-572665aa"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,122 +1,136 @@
|
|
|
1
|
-
import { defineComponent as h, computed as
|
|
2
|
-
import { ScalarButton as
|
|
3
|
-
import { ScalarIconTrash as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as h, computed as y, createBlock as s, openBlock as u, unref as a, withCtx as r, createVNode as i, createElementBlock as T, createTextVNode as v, Fragment as C, renderList as k, createCommentVNode as B } from "vue";
|
|
2
|
+
import { ScalarButton as w } from "@scalar/components";
|
|
3
|
+
import { ScalarIconTrash as I } from "@scalar/icons";
|
|
4
|
+
import R from "../../../components/data-table/DataTable.vue.js";
|
|
5
|
+
import b from "../../../components/data-table/DataTableRow.vue.js";
|
|
6
|
+
import c from "../../../components/data-table/DataTableHeader.vue.js";
|
|
7
|
+
import d from "../../../components/data-table/DataTableCell.vue.js";
|
|
8
|
+
import p from "../../../components/code-input/CodeInput.vue.js";
|
|
9
|
+
const W = /* @__PURE__ */ h({
|
|
10
10
|
__name: "EnvironmentVariablesTable",
|
|
11
11
|
props: {
|
|
12
|
-
data: {},
|
|
13
12
|
environment: {},
|
|
14
|
-
|
|
13
|
+
environmentName: {},
|
|
14
|
+
eventBus: {},
|
|
15
|
+
collectionType: {}
|
|
15
16
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
setup(n) {
|
|
18
|
+
const V = ["1fr", "1fr", "36px"], N = y(() => {
|
|
19
|
+
const t = n.environment.variables.map((l) => ({
|
|
20
|
+
name: l.name,
|
|
21
|
+
value: typeof l.value == "string" ? l.value : l.value.default
|
|
22
|
+
})), e = n.environment.variables.at(-1), o = e && (e.name !== "" || e.value !== "");
|
|
23
|
+
return !e || o ? [...t, { name: "", value: "" }] : t;
|
|
24
|
+
}), f = (t, e, o) => {
|
|
25
|
+
const l = o >= n.environment.variables.length;
|
|
26
|
+
if (!(!t && l)) {
|
|
27
|
+
if (o >= n.environment.variables.length) {
|
|
28
|
+
n.eventBus.emit("environment:upsert:environment-variable", {
|
|
29
|
+
environmentName: n.environmentName,
|
|
30
|
+
variable: { name: t, value: e },
|
|
31
|
+
collectionType: n.collectionType
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
n.eventBus.emit("environment:upsert:environment-variable", {
|
|
36
|
+
environmentName: n.environmentName,
|
|
37
|
+
variable: { name: t, value: e },
|
|
38
|
+
index: o,
|
|
39
|
+
collectionType: n.collectionType
|
|
40
|
+
});
|
|
28
41
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
}, g = (t) => n.eventBus.emit("environment:delete:environment-variable", {
|
|
43
|
+
environmentName: n.environmentName,
|
|
44
|
+
index: t,
|
|
45
|
+
collectionType: n.collectionType
|
|
46
|
+
});
|
|
47
|
+
return (t, e) => (u(), s(a(R), {
|
|
48
|
+
class: "group/table data-table h-min flex-1 rounded",
|
|
49
|
+
columns: V
|
|
34
50
|
}, {
|
|
35
|
-
default:
|
|
36
|
-
|
|
37
|
-
default:
|
|
38
|
-
|
|
39
|
-
default:
|
|
40
|
-
|
|
51
|
+
default: r(() => [
|
|
52
|
+
i(a(b), { class: "sr-only !block" }, {
|
|
53
|
+
default: r(() => [
|
|
54
|
+
i(a(c), null, {
|
|
55
|
+
default: r(() => [...e[0] || (e[0] = [
|
|
56
|
+
v("Name", -1)
|
|
41
57
|
])]),
|
|
42
58
|
_: 1
|
|
43
59
|
}),
|
|
44
|
-
|
|
45
|
-
default:
|
|
46
|
-
|
|
60
|
+
i(a(c), null, {
|
|
61
|
+
default: r(() => [...e[1] || (e[1] = [
|
|
62
|
+
v("Value", -1)
|
|
47
63
|
])]),
|
|
48
64
|
_: 1
|
|
49
65
|
}),
|
|
50
|
-
|
|
51
|
-
default:
|
|
52
|
-
|
|
66
|
+
i(a(c), null, {
|
|
67
|
+
default: r(() => [...e[2] || (e[2] = [
|
|
68
|
+
v("Actions", -1)
|
|
53
69
|
])]),
|
|
54
70
|
_: 1
|
|
55
71
|
})
|
|
56
72
|
]),
|
|
57
73
|
_: 1
|
|
58
74
|
}),
|
|
59
|
-
(u(!0), C
|
|
60
|
-
|
|
61
|
-
key: o,
|
|
75
|
+
(u(!0), T(C, null, k(N.value, (o, l) => (u(), s(a(b), {
|
|
76
|
+
key: l,
|
|
62
77
|
class: "group/row"
|
|
63
78
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
|
|
66
|
-
default:
|
|
67
|
-
|
|
68
|
-
"aria-label": "
|
|
79
|
+
default: r(() => [
|
|
80
|
+
i(a(d), null, {
|
|
81
|
+
default: r(() => [
|
|
82
|
+
i(a(p), {
|
|
83
|
+
"aria-label": "Environment Variable Name",
|
|
69
84
|
disableCloseBrackets: "",
|
|
70
85
|
disableTabIndent: "",
|
|
71
|
-
|
|
72
|
-
environment: a.environment,
|
|
86
|
+
environment: void 0,
|
|
73
87
|
lineWrapping: "",
|
|
74
|
-
modelValue:
|
|
88
|
+
modelValue: o.name,
|
|
75
89
|
placeholder: "Name",
|
|
76
|
-
"onUpdate:modelValue": (
|
|
77
|
-
}, null, 8, ["
|
|
90
|
+
"onUpdate:modelValue": (m) => f(m, o.value, l)
|
|
91
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
78
92
|
]),
|
|
79
93
|
_: 2
|
|
80
94
|
}, 1024),
|
|
81
|
-
|
|
82
|
-
default:
|
|
83
|
-
|
|
84
|
-
"aria-label": "
|
|
95
|
+
i(a(d), null, {
|
|
96
|
+
default: r(() => [
|
|
97
|
+
i(a(p), {
|
|
98
|
+
"aria-label": "Environment Variable Value",
|
|
85
99
|
disableTabIndent: "",
|
|
86
|
-
|
|
87
|
-
environment: a.environment,
|
|
100
|
+
environment: void 0,
|
|
88
101
|
lineWrapping: "",
|
|
89
|
-
modelValue:
|
|
102
|
+
modelValue: o.value,
|
|
90
103
|
placeholder: "Value",
|
|
91
|
-
"onUpdate:modelValue": (
|
|
92
|
-
}, null, 8, ["
|
|
104
|
+
"onUpdate:modelValue": (m) => f(o.name, m, l)
|
|
105
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
93
106
|
]),
|
|
94
107
|
_: 2
|
|
95
108
|
}, 1024),
|
|
96
|
-
|
|
97
|
-
default:
|
|
98
|
-
l(
|
|
109
|
+
i(a(d), { class: "flex items-center justify-center" }, {
|
|
110
|
+
default: r(() => [
|
|
111
|
+
l < t.environment.variables.length ? (u(), s(a(w), {
|
|
112
|
+
key: 0,
|
|
99
113
|
class: "text-c-2 hover:text-c-1 hover:bg-b-2 hidden h-fit rounded p-1 group-focus-within:flex group-hover/row:flex",
|
|
100
114
|
size: "sm",
|
|
101
115
|
variant: "ghost",
|
|
102
|
-
onClick: (
|
|
116
|
+
onClick: (m) => g(l)
|
|
103
117
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
|
|
118
|
+
default: r(() => [
|
|
119
|
+
i(a(I), { class: "size-3.5" })
|
|
106
120
|
]),
|
|
107
121
|
_: 1
|
|
108
|
-
}, 8, ["onClick"])
|
|
122
|
+
}, 8, ["onClick"])) : B("", !0)
|
|
109
123
|
]),
|
|
110
124
|
_: 2
|
|
111
125
|
}, 1024)
|
|
112
126
|
]),
|
|
113
127
|
_: 2
|
|
114
|
-
},
|
|
128
|
+
}, 1024))), 128))
|
|
115
129
|
]),
|
|
116
130
|
_: 1
|
|
117
131
|
}));
|
|
118
132
|
}
|
|
119
133
|
});
|
|
120
134
|
export {
|
|
121
|
-
|
|
135
|
+
W as default
|
|
122
136
|
};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
/** biome-ignore-all lint/performance/noBarrelFile: It's an entry point for this feature */
|
|
2
|
-
export type { Environment, EnvironmentVariable } from './components/Environment.vue.js';
|
|
3
|
-
export { default as Environments } from './Environments.vue.js';
|
|
4
1
|
export { default as EnvironmentsList } from './EnvironmentsList.vue.js';
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/test-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,gDAAgD;AAChD,eAAO,MAAM,YAAY,EAIT,iBAAiB,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
1
2
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
3
|
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
|
|
3
4
|
import type { ComputedRef } from 'vue';
|
|
4
5
|
/**
|
|
5
6
|
* Top level state mutation handling for the workspace store in the client
|
|
6
7
|
*/
|
|
7
|
-
export declare const useWorkspaceClientEvents: (eventBus: WorkspaceEventBus, document: ComputedRef<WorkspaceDocument | null
|
|
8
|
+
export declare const useWorkspaceClientEvents: (eventBus: WorkspaceEventBus, document: ComputedRef<WorkspaceDocument | null>, workspaceStore: WorkspaceStore) => void;
|
|
8
9
|
//# sourceMappingURL=use-workspace-client-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-workspace-client-events.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-workspace-client-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"use-workspace-client-events.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-workspace-client-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,EAC3B,UAAU,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,EAC/C,gBAAgB,cAAc,SA6C/B,CAAA"}
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import { mergeObjects as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
1
|
+
import { mergeObjects as t } from "@scalar/workspace-store/helpers/merge-object";
|
|
2
|
+
import { upsertEnvironment as v, upsertEnvironmentVariable as s } from "@scalar/workspace-store/mutators";
|
|
3
|
+
const c = (o, n, a) => {
|
|
4
|
+
const i = (e, r) => r === "document" ? e.value : a.workspace;
|
|
5
|
+
o.on(
|
|
6
|
+
"document:update:icon",
|
|
7
|
+
(e) => n.value && (n.value["x-scalar-client-config-icon"] = e)
|
|
8
|
+
), o.on(
|
|
9
|
+
"document:update:info",
|
|
10
|
+
(e) => n.value && (n.value.info = t(n.value.info, e))
|
|
11
|
+
), o.on(
|
|
12
|
+
"environment:upsert:environment",
|
|
13
|
+
(e) => v(n.value, a.workspace, e)
|
|
14
|
+
), o.on(
|
|
15
|
+
"environment:delete:environment",
|
|
16
|
+
({ environmentName: e, collectionType: r }) => delete i(n, r)?.["x-scalar-environments"]?.[e]
|
|
17
|
+
), o.on(
|
|
18
|
+
"environment:upsert:environment-variable",
|
|
19
|
+
(e) => s(i(n, e.collectionType), e)
|
|
20
|
+
), o.on(
|
|
21
|
+
"environment:delete:environment-variable",
|
|
22
|
+
({ environmentName: e, index: r, collectionType: l }) => i(n, l)?.["x-scalar-environments"]?.[e]?.variables?.splice(r, 1)
|
|
9
23
|
);
|
|
10
24
|
};
|
|
11
25
|
export {
|
|
12
|
-
|
|
26
|
+
c as useWorkspaceClientEvents
|
|
13
27
|
};
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (o) => {
|
|
35
35
|
o?.createNew && g.name === "request" && d();
|
|
36
|
-
}, v = "2.9.
|
|
36
|
+
}, v = "2.9.1";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (o, e) => (i(), l("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.9.
|
|
21
|
+
"version": "2.9.1",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -233,24 +233,24 @@
|
|
|
233
233
|
"zod": "4.1.11",
|
|
234
234
|
"@scalar/analytics-client": "1.0.0",
|
|
235
235
|
"@scalar/draggable": "0.3.0",
|
|
236
|
-
"@scalar/components": "0.16.
|
|
237
|
-
"@scalar/helpers": "0.0.13",
|
|
236
|
+
"@scalar/components": "0.16.1",
|
|
238
237
|
"@scalar/import": "0.4.32",
|
|
239
|
-
"@scalar/json-magic": "0.7.0",
|
|
240
238
|
"@scalar/icons": "0.5.0",
|
|
241
|
-
"@scalar/
|
|
239
|
+
"@scalar/helpers": "0.0.13",
|
|
240
|
+
"@scalar/oas-utils": "0.6.1",
|
|
241
|
+
"@scalar/json-magic": "0.7.0",
|
|
242
242
|
"@scalar/object-utils": "1.2.9",
|
|
243
|
-
"@scalar/openapi-types": "0.5.1",
|
|
244
243
|
"@scalar/openapi-parser": "0.23.0",
|
|
245
|
-
"@scalar/postman-to-openapi": "0.3.
|
|
246
|
-
"@scalar/sidebar": "0.2.
|
|
244
|
+
"@scalar/postman-to-openapi": "0.3.42",
|
|
245
|
+
"@scalar/sidebar": "0.2.1",
|
|
246
|
+
"@scalar/snippetz": "0.5.2",
|
|
247
|
+
"@scalar/openapi-types": "0.5.1",
|
|
247
248
|
"@scalar/themes": "0.13.23",
|
|
249
|
+
"@scalar/use-codemirror": "0.12.45",
|
|
248
250
|
"@scalar/types": "0.4.0",
|
|
249
|
-
"@scalar/use-codemirror": "0.12.44",
|
|
250
251
|
"@scalar/use-hooks": "0.3.0",
|
|
251
252
|
"@scalar/use-toasts": "0.9.0",
|
|
252
|
-
"@scalar/
|
|
253
|
-
"@scalar/workspace-store": "0.18.0"
|
|
253
|
+
"@scalar/workspace-store": "0.18.1"
|
|
254
254
|
},
|
|
255
255
|
"devDependencies": {
|
|
256
256
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -264,8 +264,8 @@
|
|
|
264
264
|
"vite": "7.1.11",
|
|
265
265
|
"vite-svg-loader": "5.1.0",
|
|
266
266
|
"vitest": "3.2.4",
|
|
267
|
-
"@scalar/
|
|
268
|
-
"@scalar/
|
|
267
|
+
"@scalar/galaxy": "0.5.9",
|
|
268
|
+
"@scalar/build-tooling": "0.2.8"
|
|
269
269
|
},
|
|
270
270
|
"scripts": {
|
|
271
271
|
"build": "scalar-build-vite",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceCollection.test.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/WorkspaceCollection.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Environments.test.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/Environments.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Environment as EntitiesEnvironment } from '@scalar/oas-utils/entities/environment';
|
|
2
|
-
import type { EnvVariable } from '../../../store/index.js';
|
|
3
|
-
import { type Environment } from './components/Environment.vue.js';
|
|
4
|
-
type __VLS_Props = {
|
|
5
|
-
/** Current selected document name or when null it means workspace level cookies */
|
|
6
|
-
documentName: string | null;
|
|
7
|
-
/** List of all available environments for the selected document */
|
|
8
|
-
environments: Environment[];
|
|
9
|
-
/** TODO: remove when we migrate to the new store */
|
|
10
|
-
environment: EntitiesEnvironment;
|
|
11
|
-
envVariables: EnvVariable[];
|
|
12
|
-
};
|
|
13
|
-
declare var __VLS_11: {};
|
|
14
|
-
type __VLS_Slots = {} & {
|
|
15
|
-
icon?: (props: typeof __VLS_11) => any;
|
|
16
|
-
};
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
} & {
|
|
20
|
-
[x: string]: any;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
-
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
25
|
-
export default _default;
|
|
26
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
-
new (): {
|
|
28
|
-
$slots: S;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=Environments.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Environments.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/Environments.vue"],"names":[],"mappings":"AAqIA,OAAO,KAAK,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAKhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EACL,KAAK,WAAW,EAEjB,MAAM,8BAA8B,CAAA;AAGrC,KAAK,WAAW,GAAG;IACjB,mFAAmF;IACnF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,YAAY,EAAE,WAAW,EAAE,CAAA;IAE3B,oDAAoD;IACpD,WAAW,EAAE,mBAAmB,CAAA;IAChC,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;AAoMF,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA0B7C,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|