@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
@@ -1,14 +1,15 @@
1
- import type { Environment } from '@scalar/oas-utils/entities/environment';
2
- import type { EnvVariable } from '../../../../store/index.js';
3
- type __VLS_Props = {
4
- description: string;
5
- environment: Environment;
6
- envVariables: EnvVariable[];
7
- };
8
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
- "overview:update:description": (value: string) => any;
10
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- "onOverview:update:description"?: ((value: string) => any) | undefined;
12
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
1
+ declare const _default: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
2
+ collectionType: "document";
3
+ document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
4
+ }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
5
+ collectionType: "workspace";
6
+ document: null;
7
+ }), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
8
+ collectionType: "document";
9
+ document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
10
+ }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
11
+ collectionType: "workspace";
12
+ document: null;
13
+ })> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
14
  export default _default;
14
15
  //# sourceMappingURL=Overview.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Overview.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Overview.vue"],"names":[],"mappings":"AA0GA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAIzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAA;IAGnB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;;;;;;AAwSF,wBAOG"}
1
+ {"version":3,"file":"Overview.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Overview.vue"],"names":[],"mappings":";;;;;;;;;;;;;AA6ZA,wBAMG"}
@@ -1,4 +1,7 @@
1
- import f from "./Overview.vue2.js";
1
+ import o from "./Overview.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7c1a2f6c"]]);
2
5
  export {
3
- f as default
6
+ e as default
4
7
  };
@@ -1,28 +1,30 @@
1
- import { defineComponent as x, ref as h, useTemplateRef as w, createElementBlock as d, openBlock as n, createElementVNode as i, createBlock as u, createCommentVNode as a, unref as o, withCtx as f, createVNode as p, Fragment as m, nextTick as y } from "vue";
2
- import { ScalarButton as c, ScalarMarkdown as V } from "@scalar/components";
1
+ import { defineComponent as g, computed as y, ref as x, useTemplateRef as w, createElementBlock as i, openBlock as t, createElementVNode as o, createBlock as c, createCommentVNode as B, unref as n, withCtx as m, createVNode as d, Fragment as v, nextTick as C } from "vue";
2
+ import { ScalarButton as f, ScalarMarkdown as I } from "@scalar/components";
3
3
  import { ScalarIconPencil as b } from "@scalar/icons";
4
- import z from "../../../../components/CodeInput/CodeInput.vue.js";
5
- const C = { class: "flex flex-col gap-2" }, I = { class: "flex min-h-8 items-center justify-between gap-2 pl-1.5" }, B = { class: "has-[:focus-visible]:bg-b-1 group relative z-1 flex flex-col rounded-lg" }, R = { class: "flex h-full min-h-[calc(1rem*4)] flex-col" }, $ = {
4
+ import V from "../../../components/code-input/CodeInput.vue.js";
5
+ const h = { class: "flex flex-col gap-2" }, z = { class: "flex items-center justify-between gap-2 pl-1.5" }, R = { class: "has-[:focus-visible]:bg-b-1 group rounded-lg" }, S = {
6
6
  key: 1,
7
- class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4"
8
- }, T = /* @__PURE__ */ x({
7
+ class: "text-c-3 flex items-center justify-center rounded-lg border p-4"
8
+ }, j = /* @__PURE__ */ g({
9
9
  __name: "Overview",
10
10
  props: {
11
- description: {},
11
+ document: {},
12
+ eventBus: {},
13
+ layout: {},
12
14
  environment: {},
13
- envVariables: {}
15
+ workspaceStore: {},
16
+ collectionType: {}
14
17
  },
15
- emits: ["overview:update:description"],
16
- setup(E, { emit: k }) {
17
- const g = k, s = h("preview"), l = async (t) => {
18
- s.value = t, t === "edit" && await y(() => {
19
- v.value?.focus();
20
- });
21
- }, v = w("codeInputRef");
22
- return (t, e) => (n(), d("div", C, [
23
- i("div", I, [
24
- e[6] || (e[6] = i("h3", { class: "font-bold" }, "Description", -1)),
25
- s.value === "preview" ? (n(), u(o(c), {
18
+ setup(k) {
19
+ const u = y(
20
+ () => k.document?.info?.description ?? ""
21
+ ), a = x("preview"), p = w("codeInputRef"), l = async (s) => {
22
+ a.value = s, s === "edit" && (await C(), p.value?.focus());
23
+ };
24
+ return (s, e) => (t(), i("div", h, [
25
+ o("div", z, [
26
+ e[6] || (e[6] = o("h3", { class: "font-bold" }, "Description", -1)),
27
+ a.value === "preview" ? (t(), c(n(f), {
26
28
  key: 0,
27
29
  class: "text-c-2 hover:text-c-1 flex items-center gap-2",
28
30
  size: "sm",
@@ -30,62 +32,58 @@ const C = { class: "flex flex-col gap-2" }, I = { class: "flex min-h-8 items-cen
30
32
  variant: "outlined",
31
33
  onClick: e[0] || (e[0] = (r) => l("edit"))
32
34
  }, {
33
- default: f(() => [
34
- p(o(b), {
35
+ default: m(() => [
36
+ d(n(b), {
35
37
  size: "sm",
36
38
  thickness: "1.5"
37
39
  }),
38
- e[5] || (e[5] = i("span", null, "Edit", -1))
40
+ e[5] || (e[5] = o("span", null, "Edit", -1))
39
41
  ]),
40
42
  _: 1
41
- })) : a("", !0)
43
+ })) : B("", !0)
42
44
  ]),
43
- i("div", B, [
44
- i("div", R, [
45
- s.value === "preview" ? (n(), d(m, { key: 0 }, [
46
- t.description && t.description.trim().length ? (n(), d(m, { key: 0 }, [
47
- t.description ? (n(), u(o(V), {
48
- key: 0,
49
- class: "h-full flex-1 rounded border border-transparent p-1.5 hover:border-(--scalar-background-3)",
50
- value: t.description,
51
- withImages: "",
52
- onDblclick: e[1] || (e[1] = (r) => l("edit"))
53
- }, null, 8, ["value"])) : a("", !0),
54
- e[7] || (e[7] = i("div", { class: "brightness-lifted bg-b-1 absolute inset-0 -z-1 hidden rounded group-hover:block group-has-[:focus-visible]:hidden" }, null, -1))
55
- ], 64)) : (n(), d("div", $, [
56
- p(o(c), {
57
- class: "hover:bg-b-2 hover:text-c-1 text-c-2 flex items-center gap-2",
58
- size: "sm",
59
- variant: "ghost",
60
- onClick: e[2] || (e[2] = (r) => l("edit"))
61
- }, {
62
- default: f(() => [
63
- p(o(b), {
64
- size: "sm",
65
- thickness: "1.5"
66
- }),
67
- e[8] || (e[8] = i("span", null, "Write a description", -1))
68
- ]),
69
- _: 1
70
- })
71
- ]))
72
- ], 64)) : a("", !0),
73
- s.value === "edit" ? (n(), u(o(z), {
74
- key: 1,
75
- ref_key: "codeInputRef",
76
- ref: v,
77
- class: "h-full flex-1 border px-0.5 py-0",
78
- envVariables: t.envVariables,
79
- environment: t.environment,
80
- modelValue: t.description,
81
- onBlur: e[3] || (e[3] = (r) => l("preview")),
82
- "onUpdate:modelValue": e[4] || (e[4] = (r) => g("overview:update:description", r))
83
- }, null, 8, ["envVariables", "environment", "modelValue"])) : a("", !0)
84
- ])
45
+ o("div", R, [
46
+ a.value === "preview" ? (t(), i(v, { key: 0 }, [
47
+ u.value.trim().length ? (t(), i(v, { key: 0 }, [
48
+ d(n(I), {
49
+ class: "flex-1 rounded border border-transparent p-1.5 hover:border-(--scalar-background-3)",
50
+ value: u.value,
51
+ withImages: "",
52
+ onDblclick: e[1] || (e[1] = (r) => l("edit"))
53
+ }, null, 8, ["value"]),
54
+ e[7] || (e[7] = o("div", { class: "brightness-lifted bg-b-1 absolute inset-0 -z-1 hidden rounded group-hover:block group-has-[:focus-visible]:hidden" }, null, -1))
55
+ ], 64)) : (t(), i("div", S, [
56
+ d(n(f), {
57
+ class: "hover:bg-b-2 hover:text-c-1 text-c-2 flex items-center gap-2",
58
+ size: "sm",
59
+ variant: "ghost",
60
+ onClick: e[2] || (e[2] = (r) => l("edit"))
61
+ }, {
62
+ default: m(() => [
63
+ d(n(b), {
64
+ size: "sm",
65
+ thickness: "1.5"
66
+ }),
67
+ e[8] || (e[8] = o("span", null, "Write a description", -1))
68
+ ]),
69
+ _: 1
70
+ })
71
+ ]))
72
+ ], 64)) : (t(), c(n(V), {
73
+ key: 1,
74
+ ref_key: "codeInputRef",
75
+ ref: p,
76
+ class: "border px-0.5 py-0",
77
+ environment: void 0,
78
+ layout: s.layout,
79
+ modelValue: u.value,
80
+ onBlur: e[3] || (e[3] = (r) => l("preview")),
81
+ "onUpdate:modelValue": e[4] || (e[4] = (r) => s.eventBus.emit("document:update:info", { description: r }))
82
+ }, null, 8, ["layout", "modelValue"]))
85
83
  ])
86
84
  ]));
87
85
  }
88
86
  });
89
87
  export {
90
- T as default
88
+ j as default
91
89
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as m, computed as p, createElementBlock as o, openBlock as t, Fragment as u, renderList as d, createBlock as f, unref as h, withCtx as v, createElementVNode as r, normalizeClass as x, toDisplayString as k, capitalize as _ } from "vue";
1
+ import { defineComponent as m, computed as p, createElementBlock as o, openBlock as t, Fragment as u, renderList as d, createBlock as f, unref as h, withCtx as x, createElementVNode as n, normalizeClass as k, toDisplayString as v, capitalize as _ } from "vue";
2
2
  import { RouterLink as b } from "vue-router";
3
3
  const w = { class: "flex w-full gap-2 border-b pl-1.5 md:ml-1.5 md:pl-0" }, g = ["href", "onClick"], z = /* @__PURE__ */ m({
4
4
  __name: "Tabs",
5
5
  props: {
6
6
  type: {}
7
7
  },
8
- setup(n) {
8
+ setup(r) {
9
9
  const s = p(
10
- () => n.type === "workspace" ? ["overview", "environment", "cookies", "settings"] : [
10
+ () => r.type === "workspace" ? ["environment", "cookies", "settings"] : [
11
11
  "overview",
12
12
  "servers",
13
13
  "authentication",
@@ -22,18 +22,18 @@ const w = { class: "flex w-full gap-2 border-b pl-1.5 md:ml-1.5 md:pl-0" }, g =
22
22
  custom: "",
23
23
  to: { name: `${c.type}.${e}` }
24
24
  }, {
25
- default: v(({ isActive: i, href: l, navigate: a }) => [
26
- r("a", {
25
+ default: x(({ isActive: i, href: l, navigate: a }) => [
26
+ n("a", {
27
27
  class: "-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline",
28
28
  href: l,
29
29
  onClick: a
30
30
  }, [
31
- r("span", {
32
- class: x([
31
+ n("span", {
32
+ class: k([
33
33
  "flex-center hover:text-c-1 h-full border-b",
34
34
  i ? "text-c-1 border-c-1" : "text-c-2 hover:text-c-1 border-transparent"
35
35
  ])
36
- }, k(_(e)), 3)
36
+ }, v(_(e)), 3)
37
37
  ], 8, g)
38
38
  ]),
39
39
  _: 2
@@ -1,98 +1,9 @@
1
- import type { Environment as EntitiesEnvironment } from '@scalar/oas-utils/entities/environment';
2
- import type { EnvVariable } from '../../../store/index.js';
3
- import { type Environment, type EnvironmentVariable } from './components/Environment.vue.js';
1
+ import type { CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events';
2
+ import type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
4
3
  type __VLS_Props = {
5
- /** Current selected document name or when null it means workspace level environments */
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
- type __VLS_Slots = {
14
- icon: () => unknown;
15
- };
16
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
- "environment:reorder": (payload: {
18
- draggingItem: {
19
- id: string;
20
- };
21
- hoveredItem: {
22
- id: string;
23
- };
24
- }) => any;
25
- "environment:add": (payload: {
26
- environment: Environment;
27
- }) => any;
28
- "environment:update": (payload: {
29
- environmentName: string;
30
- environment: Partial<Environment>;
31
- }) => any;
32
- "environment:delete": (payload: {
33
- environmentName: string;
34
- }) => any;
35
- "environment:add:variable": (payload: {
36
- environmentName: string;
37
- environmentVariable: Partial<EnvironmentVariable>;
38
- }) => any;
39
- "environment:update:variable": (payload: {
40
- /** Row number */
41
- id: number;
42
- /** Environment name */
43
- environmentName: string;
44
- /** Payload */
45
- environmentVariable: Partial<EnvironmentVariable>;
46
- }) => any;
47
- "environment:delete:variable": (payload: {
48
- /** Environment name */
49
- environmentName: string;
50
- /** Row number */
51
- id: number;
52
- }) => any;
53
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
54
- "onEnvironment:reorder"?: ((payload: {
55
- draggingItem: {
56
- id: string;
57
- };
58
- hoveredItem: {
59
- id: string;
60
- };
61
- }) => any) | undefined;
62
- "onEnvironment:add"?: ((payload: {
63
- environment: Environment;
64
- }) => any) | undefined;
65
- "onEnvironment:update"?: ((payload: {
66
- environmentName: string;
67
- environment: Partial<Environment>;
68
- }) => any) | undefined;
69
- "onEnvironment:delete"?: ((payload: {
70
- environmentName: string;
71
- }) => any) | undefined;
72
- "onEnvironment:add:variable"?: ((payload: {
73
- environmentName: string;
74
- environmentVariable: Partial<EnvironmentVariable>;
75
- }) => any) | undefined;
76
- "onEnvironment:update:variable"?: ((payload: {
77
- /** Row number */
78
- id: number;
79
- /** Environment name */
80
- environmentName: string;
81
- /** Payload */
82
- environmentVariable: Partial<EnvironmentVariable>;
83
- }) => any) | undefined;
84
- "onEnvironment:delete:variable"?: ((payload: {
85
- /** Environment name */
86
- environmentName: string;
87
- /** Row number */
88
- id: number;
89
- }) => any) | undefined;
90
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
91
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
4
+ environments: NonNullable<XScalarEnvironments['x-scalar-environments']>;
5
+ eventBus: WorkspaceEventBus;
6
+ } & CollectionType;
7
+ 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>;
92
8
  export default _default;
93
- type __VLS_WithSlots<T, S> = T & {
94
- new (): {
95
- $slots: S;
96
- };
97
- };
98
9
  //# sourceMappingURL=EnvironmentsList.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"names":[],"mappings":"AA+MA,OAAO,KAAK,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAGhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAM1C,OAA6B,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAA;AAErC,KAAK,WAAW,GAAG;IACjB,wFAAwF;IACxF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAE3B,mEAAmE;IACnE,YAAY,EAAE,WAAW,EAAE,CAAA;IAE3B,oDAAoD;IACpD,WAAW,EAAE,mBAAmB,CAAA;IAChC,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;AAkDF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,OAAO,CAAA;CACpB,CAAC;AAwSF,QAAA,MAAM,eAAe;;sBApVD;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;qBACf;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;;;qBAGgB,WAAW;;;yBAG5B,MAAM;qBAAe,OAAO,CAAC,WAAW,CAAC;;;yBAEjB,MAAM;;;yBAMvC,MAAM;6BACF,OAAO,CAAC,mBAAmB,CAAC;;;QAMjD,iBAAiB;YACb,MAAM;QACV,uBAAuB;yBACN,MAAM;QACvB,cAAc;6BACO,OAAO,CAAC,mBAAmB,CAAC;;;QAMjD,uBAAuB;yBACN,MAAM;QACvB,iBAAiB;YACb,MAAM;;;;sBApCI;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;qBACf;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;;;qBAGgB,WAAW;;;yBAG5B,MAAM;qBAAe,OAAO,CAAC,WAAW,CAAC;;;yBAEjB,MAAM;;;yBAMvC,MAAM;6BACF,OAAO,CAAC,mBAAmB,CAAC;;;QAMjD,iBAAiB;YACb,MAAM;QACV,uBAAuB;yBACN,MAAM;QACvB,cAAc;6BACO,OAAO,CAAC,mBAAmB,CAAC;;;QAMjD,uBAAuB;yBACN,MAAM;QACvB,iBAAiB;YACb,MAAM;;kFAuTd,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"}
1
+ {"version":3,"file":"EnvironmentsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"names":[],"mappings":"AA8FA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAQpH,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;;AAoLrB,wBAMG"}
@@ -1,114 +1,66 @@
1
- import { defineComponent as V, ref as E, createElementBlock as u, openBlock as m, Fragment as S, createCommentVNode as i, createVNode as p, createBlock as v, renderList as y, unref as o, withCtx as F, createTextVNode as U } from "vue";
2
- import { useModal as s, ScalarButton as $ } from "@scalar/components";
3
- import { ScalarIconPlus as g } from "@scalar/icons";
4
- import w from "./components/EnvironmentColorUpdateModal.vue.js";
5
- import C from "./components/EnvironmentCreateModal.vue.js";
6
- import M from "./components/EnvironmentDeleteModal.vue.js";
7
- import B from "./components/EnvironmentNameUpdateModal.vue.js";
8
- import D from "./components/Environment.vue.js";
9
- const x = {
10
- key: 0,
11
- class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4"
12
- }, q = /* @__PURE__ */ V({
1
+ import { defineComponent as E, ref as y, createElementBlock as u, openBlock as s, Fragment as v, createElementVNode as T, createVNode as l, renderList as b, createBlock as g, unref as r, withCtx as h, createTextVNode as k } from "vue";
2
+ import { useModal as d, ScalarButton as M } from "@scalar/components";
3
+ import { ScalarIconPlus as N } from "@scalar/icons";
4
+ import S from "./components/EnvironmentCreateModal.vue.js";
5
+ import w from "./components/EnvironmentDeleteModal.vue.js";
6
+ import C from "./components/Environment.vue.js";
7
+ const D = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, z = /* @__PURE__ */ E({
13
8
  __name: "EnvironmentsList",
14
9
  props: {
15
- documentName: {},
16
10
  environments: {},
17
- environment: {},
18
- envVariables: {}
11
+ eventBus: {},
12
+ collectionType: {}
19
13
  },
20
- emits: ["environment:reorder", "environment:add", "environment:update", "environment:delete", "environment:add:variable", "environment:update:variable", "environment:delete:variable"],
21
- setup(A, { emit: k }) {
22
- const a = k, b = s(), f = s(), c = s(), N = s(), t = E(null);
23
- return (l, n) => (m(), u(S, null, [
24
- (m(!0), u(S, null, y(l.environments, (e) => (m(), v(D, {
25
- key: e.name,
26
- color: e.color,
27
- envVariables: l.envVariables,
28
- environment: l.environment,
29
- isReadonly: !l.documentName,
30
- name: e.name,
31
- variables: e.variables,
32
- "onAdd:variable": (r) => a("environment:add:variable", {
33
- environmentName: e.name,
34
- environmentVariable: r
35
- }),
36
- onDelete: () => {
37
- t.value = e, o(f).show();
38
- },
39
- "onDelete:variable": ({ id: r }) => a("environment:delete:variable", {
40
- environmentName: e.name,
41
- id: r
42
- }),
43
- onReorder: n[0] || (n[0] = (r, d) => a("environment:reorder", {
44
- draggingItem: r,
45
- hoveredItem: d
46
- })),
47
- "onUpdate:color": () => {
48
- t.value = e, o(N).show();
49
- },
50
- "onUpdate:name": () => {
51
- t.value = e, o(c).show();
52
- },
53
- "onUpdate:variable": ({ id: r, value: d }) => a("environment:update:variable", {
54
- environmentName: e.name,
55
- id: r,
56
- environmentVariable: d
57
- })
58
- }, null, 8, ["color", "envVariables", "environment", "isReadonly", "name", "variables", "onAdd:variable", "onDelete", "onDelete:variable", "onUpdate:color", "onUpdate:name", "onUpdate:variable"]))), 128)),
59
- l.documentName !== null ? (m(), u("div", x, [
60
- p(o($), {
14
+ setup(i) {
15
+ const m = d(), c = d(), n = y(null), p = (e) => {
16
+ n.value = e, c.show();
17
+ }, f = () => {
18
+ n.value && i.eventBus.emit("environment:delete:environment", {
19
+ environmentName: n.value,
20
+ collectionType: i.collectionType
21
+ });
22
+ }, a = (e) => {
23
+ n.value = e ?? null, m.show();
24
+ };
25
+ return (e, t) => (s(), u(v, null, [
26
+ (s(!0), u(v, null, b(Object.entries(e.environments), ([o, B]) => (s(), g(C, {
27
+ key: o,
28
+ collectionType: e.collectionType,
29
+ environment: B,
30
+ environmentName: o,
31
+ eventBus: e.eventBus,
32
+ onDelete: () => p(o),
33
+ onEdit: () => a(o)
34
+ }, null, 8, ["collectionType", "environment", "environmentName", "eventBus", "onDelete", "onEdit"]))), 128)),
35
+ T("div", D, [
36
+ l(r(M), {
61
37
  class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
62
38
  size: "sm",
63
39
  variant: "ghost",
64
- onClick: n[1] || (n[1] = (e) => o(b).show())
40
+ onClick: t[0] || (t[0] = () => a())
65
41
  }, {
66
- default: F(() => [
67
- p(o(g)),
68
- n[6] || (n[6] = U(" Add Environment ", -1))
42
+ default: h(() => [
43
+ l(r(N)),
44
+ t[1] || (t[1] = k(" Add Environment ", -1))
69
45
  ]),
70
46
  _: 1
71
47
  })
72
- ])) : i("", !0),
73
- p(C, {
74
- state: o(b),
75
- onSubmit: n[2] || (n[2] = (e) => a("environment:add", {
76
- environment: {
77
- name: e.name,
78
- color: e.color,
79
- variables: []
80
- }
81
- }))
82
- }, null, 8, ["state"]),
83
- t.value ? (m(), v(M, {
84
- key: 1,
85
- name: t.value.name,
86
- state: o(f),
87
- onSubmit: n[3] || (n[3] = () => a("environment:delete", {
88
- environmentName: t.value.name
89
- }))
90
- }, null, 8, ["name", "state"])) : i("", !0),
91
- t.value ? (m(), v(B, {
92
- key: 2,
93
- name: t.value.name,
94
- state: o(c),
95
- onSubmit: n[4] || (n[4] = (e) => a("environment:update", {
96
- environmentName: t.value.name,
97
- environment: { name: e.name }
98
- }))
99
- }, null, 8, ["name", "state"])) : i("", !0),
100
- t.value ? (m(), v(w, {
101
- key: 3,
102
- color: t.value.color || "#FFFFFF",
103
- state: o(N),
104
- onSubmit: n[5] || (n[5] = (e) => a("environment:update", {
105
- environmentName: t.value.name,
106
- environment: { color: e.color }
107
- }))
108
- }, null, 8, ["color", "state"])) : i("", !0)
48
+ ]),
49
+ l(S, {
50
+ collectionType: e.collectionType,
51
+ environments: e.environments,
52
+ eventBus: e.eventBus,
53
+ selectedEnvironmentName: n.value,
54
+ state: r(m)
55
+ }, null, 8, ["collectionType", "environments", "eventBus", "selectedEnvironmentName", "state"]),
56
+ l(w, {
57
+ name: n.value,
58
+ state: r(c),
59
+ onSubmit: f
60
+ }, null, 8, ["name", "state"])
109
61
  ], 64));
110
62
  }
111
63
  });
112
64
  export {
113
- q as default
65
+ z as default
114
66
  };
@@ -1,70 +1,16 @@
1
- import type { Environment as EntitiesEnvironment } from '@scalar/oas-utils/entities/environment';
2
- import type { EnvVariable } from '../../../../store/index.js';
3
- export type EnvironmentVariable = {
4
- name: string;
5
- value: string;
6
- };
7
- export type Environment = {
8
- name: string;
9
- color?: string;
10
- variables: EnvironmentVariable[];
11
- };
1
+ import type { CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events';
2
+ import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
12
3
  type __VLS_Props = {
13
- /** Environment name */
14
- name: string;
15
- /** Environment color */
16
- color?: string;
17
- /** List of all environment variables */
18
- variables: EnvironmentVariable[];
19
- /** Marks the environment as readonly */
20
- isReadonly?: boolean;
21
- /** TODO: remove when we migrate to the new store */
22
- environment: EntitiesEnvironment;
23
- envVariables: EnvVariable[];
24
- };
25
- type __VLS_Slots = {
26
- default?(): unknown;
27
- };
28
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
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, {} & {
29
9
  delete: () => any;
30
- "update:variable": (payload: {
31
- id: number;
32
- value: Partial<EnvironmentVariable>;
33
- }) => any;
34
- reorder: (draggingItem: {
35
- id: string;
36
- }, hoveredItem: {
37
- id: string;
38
- }) => any;
39
- "add:variable": (payload: Partial<EnvironmentVariable>) => any;
40
- "update:name": () => any;
41
- "update:color": () => any;
42
- "delete:variable": (payload: {
43
- id: number;
44
- }) => any;
10
+ edit: () => any;
45
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
46
12
  onDelete?: (() => any) | undefined;
47
- "onUpdate:variable"?: ((payload: {
48
- id: number;
49
- value: Partial<EnvironmentVariable>;
50
- }) => any) | undefined;
51
- onReorder?: ((draggingItem: {
52
- id: string;
53
- }, hoveredItem: {
54
- id: string;
55
- }) => any) | undefined;
56
- "onAdd:variable"?: ((payload: Partial<EnvironmentVariable>) => any) | undefined;
57
- "onUpdate:name"?: (() => any) | undefined;
58
- "onUpdate:color"?: (() => any) | undefined;
59
- "onDelete:variable"?: ((payload: {
60
- id: number;
61
- }) => any) | undefined;
13
+ onEdit?: (() => any) | undefined;
62
14
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
63
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
64
15
  export default _default;
65
- type __VLS_WithSlots<T, S> = T & {
66
- new (): {
67
- $slots: S;
68
- };
69
- };
70
16
  //# sourceMappingURL=Environment.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/Environment.vue"],"names":[],"mappings":"AA6IA,OAAO,KAAK,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAEhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,mBAAmB,EAAE,CAAA;CACjC,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB,oDAAoD;IACpD,WAAW,EAAE,mBAAmB,CAAA;IAChC,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;AAwBF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,IAAI,OAAO,CAAA;CACpB,CAAC;AA6QF,QAAA,MAAM,eAAe;;;YAvRX,MAAM;eACH,OAAO,CAAC,mBAAmB,CAAC;;;YAVjB,MAAM;;YACP,MAAM;;;;;;YAYW,MAAM;;;;;YAJpC,MAAM;eACH,OAAO,CAAC,mBAAmB,CAAC;;;YAVjB,MAAM;;YACP,MAAM;;;;;;YAYW,MAAM;;kFA0R5C,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"}
1
+ {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/Environment.vue"],"names":[],"mappings":"AAmEA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAInH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;;;;;;;;AA6JrB,wBAOG"}