@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.
Files changed (122) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/CommandPalette/CommandActionForm.vue.js +9 -9
  3. package/dist/style.css +1 -1
  4. package/dist/v2/components/code-input/CodeInput.test.d.ts +2 -0
  5. package/dist/v2/components/code-input/CodeInput.test.d.ts.map +1 -0
  6. package/dist/v2/components/code-input/CodeInput.vue.d.ts +140 -0
  7. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -0
  8. package/dist/v2/components/code-input/CodeInput.vue.js +8 -0
  9. package/dist/v2/components/code-input/CodeInput.vue2.js +202 -0
  10. package/dist/v2/components/code-input/code-variable-widget.d.ts +21 -0
  11. package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -0
  12. package/dist/v2/components/code-input/code-variable-widget.js +106 -0
  13. package/dist/v2/components/code-input/code-variable-widget.test.d.ts +2 -0
  14. package/dist/v2/components/code-input/code-variable-widget.test.d.ts.map +1 -0
  15. package/dist/v2/components/code-input/index.d.ts +2 -0
  16. package/dist/v2/components/code-input/index.d.ts.map +1 -0
  17. package/dist/v2/components/code-input/index.js +4 -0
  18. package/dist/v2/components/data-table/DataTable.vue.d.ts +22 -0
  19. package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -0
  20. package/dist/v2/components/data-table/DataTable.vue.js +38 -0
  21. package/dist/v2/components/data-table/DataTable.vue2.js +4 -0
  22. package/dist/v2/components/data-table/DataTableCell.vue.d.ts +19 -0
  23. package/dist/v2/components/data-table/DataTableCell.vue.d.ts.map +1 -0
  24. package/dist/v2/components/data-table/DataTableCell.vue.js +26 -0
  25. package/dist/v2/components/data-table/DataTableCell.vue2.js +4 -0
  26. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +14 -0
  27. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -0
  28. package/dist/v2/components/data-table/DataTableCheckbox.vue.js +53 -0
  29. package/dist/v2/components/data-table/DataTableCheckbox.vue2.js +4 -0
  30. package/dist/v2/components/data-table/DataTableHeader.vue.d.ts +13 -0
  31. package/dist/v2/components/data-table/DataTableHeader.vue.d.ts.map +1 -0
  32. package/dist/v2/components/data-table/DataTableHeader.vue.js +18 -0
  33. package/dist/v2/components/data-table/DataTableHeader.vue2.js +4 -0
  34. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +53 -0
  35. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -0
  36. package/dist/v2/components/data-table/DataTableInput.vue.js +7 -0
  37. package/dist/v2/components/data-table/DataTableInput.vue2.js +117 -0
  38. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +16 -0
  39. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -0
  40. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +146 -0
  41. package/dist/v2/components/data-table/DataTableInputSelect.vue2.js +4 -0
  42. package/dist/v2/components/data-table/DataTableRow.vue.d.ts +13 -0
  43. package/dist/v2/components/data-table/DataTableRow.vue.d.ts.map +1 -0
  44. package/dist/v2/components/data-table/DataTableRow.vue.js +12 -0
  45. package/dist/v2/components/data-table/DataTableText.vue.d.ts +16 -0
  46. package/dist/v2/components/data-table/DataTableText.vue.d.ts.map +1 -0
  47. package/dist/v2/components/data-table/DataTableText.vue.js +23 -0
  48. package/dist/v2/components/data-table/DataTableText.vue2.js +4 -0
  49. package/dist/v2/components/data-table/index.d.ts +9 -0
  50. package/dist/v2/components/data-table/index.d.ts.map +1 -0
  51. package/dist/v2/components/data-table/index.js +18 -0
  52. package/dist/v2/features/app/App.test.d.ts +2 -0
  53. package/dist/v2/features/app/App.test.d.ts.map +1 -0
  54. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  55. package/dist/v2/features/app/App.vue.js +56 -41
  56. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +3 -0
  57. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  58. package/dist/v2/features/app/components/DesktopTabs.vue.js +8 -7
  59. package/dist/v2/features/app/components/DesktopTabs.vue2.js +6 -0
  60. package/dist/v2/features/app/helpers/routes.d.ts +12 -9
  61. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  62. package/dist/v2/features/app/helpers/routes.js +0 -6
  63. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  64. package/dist/v2/features/collection/DocumentCollection.vue2.js +58 -45
  65. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  66. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +12 -10
  67. package/dist/v2/features/collection/components/Environment.vue.d.ts +13 -87
  68. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  69. package/dist/v2/features/collection/components/Environment.vue2.js +20 -25
  70. package/dist/v2/features/collection/components/Overview.vue.d.ts +13 -12
  71. package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
  72. package/dist/v2/features/collection/components/Overview.vue.js +5 -2
  73. package/dist/v2/features/collection/components/Overview.vue2.js +64 -66
  74. package/dist/v2/features/collection/components/Tabs.vue.js +8 -8
  75. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +6 -95
  76. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  77. package/dist/v2/features/environments/EnvironmentsList.vue.js +50 -98
  78. package/dist/v2/features/environments/components/Environment.vue.d.ts +9 -63
  79. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  80. package/dist/v2/features/environments/components/Environment.vue.js +41 -92
  81. package/dist/v2/features/environments/components/EnvironmentColors.vue.d.ts.map +1 -1
  82. package/dist/v2/features/environments/components/EnvironmentColors.vue.js +105 -81
  83. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts +7 -14
  84. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
  85. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +61 -39
  86. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts +1 -1
  87. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
  88. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +3 -3
  89. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts +21 -0
  90. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -0
  91. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +109 -0
  92. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue2.js +4 -0
  93. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts +7 -20
  94. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  95. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +3 -3
  96. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue2.js +85 -71
  97. package/dist/v2/features/environments/index.d.ts +0 -3
  98. package/dist/v2/features/environments/index.d.ts.map +1 -1
  99. package/dist/v2/features/environments/index.js +2 -4
  100. package/dist/v2/helpers/test-utils.d.ts +4 -0
  101. package/dist/v2/helpers/test-utils.d.ts.map +1 -0
  102. package/dist/v2/hooks/use-workspace-client-events.d.ts +2 -1
  103. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  104. package/dist/v2/hooks/use-workspace-client-events.js +23 -9
  105. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  106. package/package.json +13 -13
  107. package/dist/v2/features/collection/WorkspaceCollection.test.d.ts +0 -2
  108. package/dist/v2/features/collection/WorkspaceCollection.test.d.ts.map +0 -1
  109. package/dist/v2/features/environments/Environments.test.d.ts +0 -2
  110. package/dist/v2/features/environments/Environments.test.d.ts.map +0 -1
  111. package/dist/v2/features/environments/Environments.vue.d.ts +0 -31
  112. package/dist/v2/features/environments/Environments.vue.d.ts.map +0 -1
  113. package/dist/v2/features/environments/Environments.vue.js +0 -65
  114. package/dist/v2/features/environments/Environments.vue2.js +0 -4
  115. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.d.ts +0 -20
  116. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.d.ts.map +0 -1
  117. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.js +0 -48
  118. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue2.js +0 -4
  119. package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.d.ts +0 -18
  120. package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.d.ts.map +0 -1
  121. package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.js +0 -35
  122. 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
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EnvironmentVariablesDropdown.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,23 +1,10 @@
1
- import type { Environment } from '@scalar/oas-utils/entities/environment';
2
- import type { EnvVariable } from '../../../../store/index.js';
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
- data: TableRow[];
9
- /** TODO: remove once we migrate */
10
- environment: Environment;
11
- envVariables: EnvVariable[];
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":"AAyJA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAUzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAEhB,mCAAmC;IACnC,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;;;;;;;;;;AAqTF,wBAOG"}
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 o from "./EnvironmentVariablesTable.vue2.js";
1
+ import a from "./EnvironmentVariablesTable.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-265cc80b"]]);
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 x, createBlock as b, openBlock as u, unref as e, withCtx as n, createVNode as l, createElementBlock as C, createTextVNode as m, Fragment as R, renderList as T } from "vue";
2
- import { ScalarButton as _ } from "@scalar/components";
3
- import { ScalarIconTrash as y } from "@scalar/icons";
4
- import B from "../../../../components/DataTable/DataTable.vue.js";
5
- import v from "../../../../components/DataTable/DataTableRow.vue.js";
6
- import s from "../../../../components/DataTable/DataTableHeader.vue.js";
7
- import f from "../../../../components/DataTable/DataTableCell.vue.js";
8
- import V from "../../../../components/CodeInput/CodeInput.vue.js";
9
- const S = /* @__PURE__ */ h({
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
- envVariables: {}
13
+ environmentName: {},
14
+ eventBus: {},
15
+ collectionType: {}
15
16
  },
16
- emits: ["addRow", "updateRow", "deleteRow"],
17
- setup(r, { emit: g }) {
18
- const i = g, k = x(() => {
19
- const a = r.data.at(-1);
20
- return !a || a.name !== "" || a.value !== "" ? [...r.data, { name: "", value: "", domain: "", isDisabled: !0 }] : r.data;
21
- }), p = ({
22
- index: a,
23
- payload: t
24
- }) => {
25
- if (a >= r.data.length) {
26
- i("addRow", t);
27
- return;
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
- i("updateRow", a, t);
30
- }, w = ["1fr", "1fr", "36px"];
31
- return (a, t) => (u(), b(e(B), {
32
- class: "group/table data-table h-min flex-1 rounded border",
33
- columns: w
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: n(() => [
36
- l(e(v), { class: "sr-only !block" }, {
37
- default: n(() => [
38
- l(e(s), null, {
39
- default: n(() => [...t[0] || (t[0] = [
40
- m("Name", -1)
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
- l(e(s), null, {
45
- default: n(() => [...t[1] || (t[1] = [
46
- m("Value", -1)
60
+ i(a(c), null, {
61
+ default: r(() => [...e[1] || (e[1] = [
62
+ v("Value", -1)
47
63
  ])]),
48
64
  _: 1
49
65
  }),
50
- l(e(s), null, {
51
- default: n(() => [...t[2] || (t[2] = [
52
- m("Actions", -1)
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(R, null, T(k.value, (c, o) => (u(), b(e(v), {
60
- id: o,
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: n(() => [
65
- l(e(f), null, {
66
- default: n(() => [
67
- l(e(V), {
68
- "aria-label": "Cookie Name",
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
- envVariables: a.envVariables,
72
- environment: a.environment,
86
+ environment: void 0,
73
87
  lineWrapping: "",
74
- modelValue: c.name,
88
+ modelValue: o.name,
75
89
  placeholder: "Name",
76
- "onUpdate:modelValue": (d) => p({ index: o, payload: { name: d } })
77
- }, null, 8, ["envVariables", "environment", "modelValue", "onUpdate:modelValue"])
90
+ "onUpdate:modelValue": (m) => f(m, o.value, l)
91
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
78
92
  ]),
79
93
  _: 2
80
94
  }, 1024),
81
- l(e(f), null, {
82
- default: n(() => [
83
- l(e(V), {
84
- "aria-label": "Cookie Value",
95
+ i(a(d), null, {
96
+ default: r(() => [
97
+ i(a(p), {
98
+ "aria-label": "Environment Variable Value",
85
99
  disableTabIndent: "",
86
- envVariables: a.envVariables,
87
- environment: a.environment,
100
+ environment: void 0,
88
101
  lineWrapping: "",
89
- modelValue: c.value,
102
+ modelValue: o.value,
90
103
  placeholder: "Value",
91
- "onUpdate:modelValue": (d) => p({ index: o, payload: { value: d } })
92
- }, null, 8, ["envVariables", "environment", "modelValue", "onUpdate:modelValue"])
104
+ "onUpdate:modelValue": (m) => f(o.name, m, l)
105
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
93
106
  ]),
94
107
  _: 2
95
108
  }, 1024),
96
- l(e(f), { class: "flex items-center justify-center" }, {
97
- default: n(() => [
98
- l(e(_), {
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: (d) => i("deleteRow", o)
116
+ onClick: (m) => g(l)
103
117
  }, {
104
- default: n(() => [
105
- l(e(y), { class: "size-3.5" })
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
- }, 1032, ["id"]))), 128))
128
+ }, 1024))), 128))
115
129
  ]),
116
130
  _: 1
117
131
  }));
118
132
  }
119
133
  });
120
134
  export {
121
- S as default
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,2FAA2F;AAE3F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACpF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
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"}
@@ -1,6 +1,4 @@
1
- import { default as n } from "./Environments.vue.js";
2
- import { default as r } from "./EnvironmentsList.vue.js";
1
+ import { default as n } from "./EnvironmentsList.vue.js";
3
2
  export {
4
- n as Environments,
5
- r as EnvironmentsList
3
+ n as EnvironmentsList
6
4
  };
@@ -0,0 +1,4 @@
1
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
+ /** Mock event bus for all your testing needs */
3
+ export declare const mockEventBus: WorkspaceEventBus;
4
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -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>) => void;
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;AAGvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAElF,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,SAehD,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 i } from "@scalar/workspace-store/helpers/merge-object";
2
- const l = (a, e) => {
3
- a.on(
4
- "update:document-icon",
5
- (o) => e.value && (e.value["x-scalar-client-config-icon"] = o)
6
- ), a.on(
7
- "update:document-info",
8
- (o) => e.value && (e.value.info = i(e.value.info, o))
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
- l as useWorkspaceClientEvents
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.0";
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.0",
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.0",
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/oas-utils": "0.6.0",
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.41",
246
- "@scalar/sidebar": "0.2.0",
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/snippetz": "0.5.2",
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/build-tooling": "0.2.8",
268
- "@scalar/galaxy": "0.5.9"
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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=WorkspaceCollection.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkspaceCollection.test.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/WorkspaceCollection.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Environments.test.d.ts.map
@@ -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"}